1 /**************************************************************************
2 * Copyright(c) 1998-2002, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //===============================================================
17 // To be modified for hadron correction using particle ID and track merging
18 // Author : magali.estienne@subatech.in2p3.fr
19 //===============================================================
20 // Author : Mark Horner (LBL/UCT)
22 // --- Standard library ---
23 #include "Riostream.h"
26 // --- AliRoot header files ---
27 #include "AliAODTrack.h"
28 #include "AliJetDummyGeo.h"
29 #include "AliJetHadronCorrectionv1.h"
31 static Double_t etaGrid[HCPARAMETERS]={ 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.67};
33 ClassImp(AliJetHadronCorrectionv1)
35 Double_t AliJetHadronCorrectionv1::fgParLookup[HCPARAMETERS][HCPARAMETERSETS] =
38 {7.52624e-2 , 9.80119e-2 , 1.29086e-2},
39 {-2.07449e-2 , 2.22951e-2 , 8.31971e-2},
40 {-3.64861e-4 , -3.65680e-03 , -3.07148e-02},
41 {5.35252e-3 , 5.12234e-03 , 2.25559e-02},
42 {1.27106e-1 , 1.25248e-01 , 1.06352e-01},
43 {-6.72909e-2 , 9.78677e-01 , -1.35909e-01},
44 {-3.80660e-5 , -2.77522e-05 , -2.05218e-05},
45 {1.54855e-7 , 1.00604e-07 , 1.02481e-07}
48 AliJetHadronCorrectionv1* AliJetHadronCorrectionv1::fgHadrCorr = 0;
50 AliJetHadronCorrectionv1::AliJetHadronCorrectionv1(const char *name,const char *title)
51 :AliJetHadronCorrection(name, title),
57 AliJetHadronCorrectionv1*
58 AliJetHadronCorrectionv1::Instance()
60 // return pointer to global instance. Instantiate if needed
61 if (! fgHadrCorr) fgHadrCorr = new AliJetHadronCorrectionv1();
65 void AliJetHadronCorrectionv1::SetGeometry2(AliJetDummyGeo *geometry)
67 // Initialise EMCAL geometry
71 fSamplingFraction = geometry->GetSampling();
74 SetParameters(geometry->GetName());
75 fSamplingFraction = geometry->GetSampling();
81 ###########################################################################
82 ###########################################################################
84 This will have to be modified with the inclusion of the new EMCAL geometry
85 That means I guess a new study of the hadron correction...
89 ###########################################################################
90 ###########################################################################
93 void AliJetHadronCorrectionv1::SetGeometry(TString /*name*/,Double_t fs)
95 // Initialise EMCAL geometry
96 fSamplingFraction = fs;
100 name == "EMCAL_5655_21" ||
101 name == "EMCALArch1a" ||
102 name == "EMCALArch1aN" ||
103 name == "G56_2_55_19" ||
104 name == "G56_2_55_19_104_14" )
105 { // set parameters to this hadron correction
106 cout<<"HC parameters!"<<endl;
107 for (Int_t i=0;i<6;i++)
109 fPar[i] = fgParLookup[i][0];
110 cout <<fPar[i]<<endl;
112 }else if( name == "EMCAL_6564_21" ||
113 name == "G65_2_64_19" )
115 cout<<"HC parameters!"<<endl;
116 for (Int_t i=0;i<6;i++)
118 fPar[i] = fgParLookup[i][1];
119 cout <<fPar[i]<<endl;
123 printf("Geometry not defined in hadron correction\n");
129 // Double_t AliJetHadronCorrectionv1::GetEnergy(Double_t pmom, Double_t eta, Int_t /*gid*/)
130 Double_t AliJetHadronCorrectionv1::GetEnergy(Double_t pmom, Double_t eta, Int_t /*gid*/)
132 // Return parametrised energy response
133 Double_t etai = TMath::Abs(eta);
135 if(etai < etaGrid[1]) {
136 for (Int_t i=0;i<8;i++)
138 fPar[i] = fgParLookup[i][1];
139 // cout << "fPar[" << i << "]: " << fPar[i] << endl;
141 } else if(etai >= etaGrid[1] && etai <= etaGrid[HCPARAMETERS-2]) {
142 for (Int_t i=0;i<8;i++)
144 fPar[i] = fgParLookup[i][0];
145 // cout << "fPar[" << i << "]: " << fPar[i] << endl;
148 for (Int_t i=0;i<8;i++)
150 fPar[i] = fgParLookup[i][2];
151 // cout << "fPar[" << i << "]: " << fPar[i] << endl;
156 Double_t value = fPar[5]*pow(etai,3) +
157 fPar[0]*pow(etai,2) +
162 fPar[6]*pow(pmom,2) +
165 return fSamplingFraction*value;
169 void AliJetHadronCorrectionv1::TrackPositionEMCal(AliAODTrack* track,Double_t &eta, Double_t &phi)
171 AliAODPid* pid = (AliAODPid*) track->GetDetPid();
175 pid->GetEMCALPosition(emcpos);
176 TVector3 tpos(emcpos[0],emcpos[1],emcpos[2]);