]>
Commit | Line | Data |
---|---|---|
0c442e33 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
be884acb | 16 | #include "TObjArray.h" |
17 | #include "TF1.h" | |
18 | #include "TH1F.h" | |
19 | #include "TH2F.h" | |
20 | #include "TH2I.h" | |
21 | #include "TH3F.h" | |
22 | #include "TParticle.h" | |
0c442e33 | 23 | #include "TList.h" |
24 | #include "THashList.h" | |
be884acb | 25 | |
26 | #include "AliAnalysisTaskSE.h" | |
27 | #include "AliAnalysisTaskEpRatio.h" | |
28 | #include "AliAnalysisManager.h" | |
29 | #include "AliInputEventHandler.h" | |
30 | #include "AliCaloPhoton.h" | |
31 | #include "AliPHOSGeometry.h" | |
32 | #include "AliVEvent.h" | |
33 | #include "AliAODEvent.h" | |
34 | #include "AliVCaloCells.h" | |
35 | #include "AliVCluster.h" | |
36 | #include "AliVTrack.h" | |
37 | #include "AliLog.h" | |
38 | #include "AliPID.h" | |
39 | #include "AliPIDResponse.h" | |
40 | ||
41 | // *********************** New | |
42 | #include "AliVertex.h" | |
43 | #include "AliVVertex.h" | |
44 | #include "AliVertexerTracks.h" | |
45 | #include "AliExternalTrackParam.h" | |
46 | #include "AliTrackReference.h" | |
47 | ||
48 | #include <AliCDBManager.h> | |
49 | #include "AliMagF.h" | |
50 | #include "TGeoGlobalMagField.h" | |
51 | #include "AliPHOSCalibData.h" | |
52 | #include "AliOADBContainer.h" | |
53 | ||
0c442e33 | 54 | // Analysis task to fill histograms with E/p ratios for electrons, positrons, muons |
55 | // and hadrons (pions, kaons..), where E is an energy of PHOS cluster | |
56 | // and p is the momentum of it's matched track. | |
57 | ||
be884acb | 58 | // Authors: Boris Polishchuk,Tsubasa Okubo |
0c442e33 | 59 | // Date : 04.07.2013 |
be884acb | 60 | |
61 | ClassImp(AliAnalysisTaskEpRatio) | |
62 | //________________________________________________________________________ | |
63 | AliAnalysisTaskEpRatio::AliAnalysisTaskEpRatio(const char *name) : AliAnalysisTaskSE(name), | |
64 | fRunNumber(-999), | |
65 | fOutputContainer(0), | |
66 | fPHOSGeo(0), | |
67 | fPIDResponse(0) // Yuri | |
68 | // Output slots #0 write into a TH1 container | |
69 | { | |
70 | DefineOutput(1,TList::Class()); | |
71 | ||
72 | } | |
73 | //________________________________________________________________________ | |
74 | void AliAnalysisTaskEpRatio::UserCreateOutputObjects() | |
75 | { | |
76 | // Create histograms | |
77 | // Called once | |
78 | ||
79 | if(fOutputContainer != NULL){ | |
80 | delete fOutputContainer; | |
81 | } | |
0c442e33 | 82 | fOutputContainer = new THashList(); |
be884acb | 83 | fOutputContainer->SetOwner(); |
84 | ||
85 | fOutputContainer->Add( new TH1F("h_CellMultEvent","PHOS Cell Multiplicity per Event",200,0,200) ); | |
86 | ||
87 | fOutputContainer->Add( new TH2F("hEp","E/p All charged particles (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
88 | fOutputContainer->Add( new TH2F("hEp_ele","E/p electron & positron (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
89 | fOutputContainer->Add( new TH2F("hEp_ele2","E/p electron & positron (E/p VS. 1/p)",1000,0,2.,500,0,5) ); | |
90 | fOutputContainer->Add( new TH2F("hEp_other","E/p other (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
91 | ||
92 | fOutputContainer->Add( new TH2F("hEp_electron","E/p Electron only (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
93 | fOutputContainer->Add( new TH2F("hEp_positron","E/p Positron only (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
94 | ||
95 | fOutputContainer->Add( new TH2F("hEp_mod1","E/p All charged particles in Module1 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
96 | fOutputContainer->Add( new TH2F("hEp_mod2","E/p All charged particles in Module2 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
97 | fOutputContainer->Add( new TH2F("hEp_mod3","E/p All charged particles in Module3 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
98 | ||
99 | fOutputContainer->Add( new TH2F("hEp_ele_mod1","E/p electron & positron in Module1 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
100 | fOutputContainer->Add( new TH2F("hEp_ele_mod2","E/p electron & positron in Module2 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
101 | fOutputContainer->Add( new TH2F("hEp_ele_mod3","E/p electron & positron in Module3 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
102 | ||
103 | fOutputContainer->Add( new TH2F("hEp_other_mod1","E/p other in Module1 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
104 | fOutputContainer->Add( new TH2F("hEp_other_mod2","E/p other in Module2 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
105 | fOutputContainer->Add( new TH2F("hEp_other_mod3","E/p other in Module3 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
106 | ||
107 | fOutputContainer->Add( new TH2F("h_dedx_PHOS","dE/dx in PHOS via TPC",1000,0,10,2200,0,220.) ); | |
108 | fOutputContainer->Add( new TH2F("h_dedx_ele_PHOS","dE/dx electron in PHOS via TPC",1000,0,10,2200,0,220.) ); | |
109 | fOutputContainer->Add( new TH2F("h_dedx_other_PHOS","dE/dx other in PHOS via TPC",1000,0,10,2200,0,220.) ); | |
110 | fOutputContainer->Add( new TH2F("h_dedx_pion_PHOS" ,"dE/dx pion in PHOS via TPC",1000,0,10,2200,0,220.) ); | |
111 | fOutputContainer->Add( new TH2F("h_dedx_proton_PHOS","dE/dx proton in PHOS via TPC",1000,0,10,2200,0,220.) ); | |
112 | fOutputContainer->Add( new TH2F("h_dedx_kaon_PHOS" ,"dE/dx kaon in PHOS via TPC",1000,0,10,2200,0,220.) ); | |
113 | fOutputContainer->Add( new TH2F("h_dedx_muon_PHOS" ,"dE/dx muon in PHOS via TPC",1000,0,10,2200,0,220.) ); | |
114 | ||
115 | fOutputContainer->Add( new TH2F("h_ClusNXZM1","Cluster (X,Z) Module1", 64,0.5,64.5, 56,0.5,56.5) ); | |
116 | fOutputContainer->Add( new TH2F("h_ClusNXZM2","Cluster (X,Z) Module2", 64,0.5,64.5, 56,0.5,56.5) ); | |
117 | fOutputContainer->Add( new TH2F("h_ClusNXZM3","Cluster (X,Z) Module3", 64,0.5,64.5, 56,0.5,56.5) ); | |
118 | fOutputContainer->Add( new TH2F("h_ClusNXZM1_ele","Electron Cluster (X,Z) Module1", 64,0.5,64.5, 56,0.5,56.5) ); | |
119 | fOutputContainer->Add( new TH2F("h_ClusNXZM2_ele","Electron Cluster (X,Z) Module2", 64,0.5,64.5, 56,0.5,56.5) ); | |
120 | fOutputContainer->Add( new TH2F("h_ClusNXZM3_ele","Electron Cluster (X,Z) Module3", 64,0.5,64.5, 56,0.5,56.5) ); | |
121 | ||
122 | fOutputContainer->Add( new TH2F("h_EClus_NCell","Energy VS. NCell in PHOS",1000,0,10,30,0,30.) ); | |
123 | fOutputContainer->Add( new TH1F("h_ECluster","Energy of Cluster in PHOS",1000,0,10.) ); | |
124 | fOutputContainer->Add( new TH1F("h_NCells","Number of Cells per Cluster in PHOS",30,0,30.) ); | |
125 | ||
126 | // ===================================================================================================== | |
127 | fOutputContainer->Add( new TH2F("hEp_had","E/p Hadrons (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
128 | fOutputContainer->Add( new TH2F("hEp_had2","E/p Hadrons (E/p VS. 1/p)",1000,0,2.,500,0,5) ); | |
129 | fOutputContainer->Add( new TH2F("h_dedx_had_PHOS","dE/dx Hadron in PHOS via TPC",1000,0,10,2200,0,220.) ); | |
130 | fOutputContainer->Add( new TH2F("h_ClusNXZM1_had","Hadron Cluster (X,Z) Module1", 64,0.5,64.5, 56,0.5,56.5) ); | |
131 | fOutputContainer->Add( new TH2F("h_ClusNXZM2_had","Hadron Cluster (X,Z) Module2", 64,0.5,64.5, 56,0.5,56.5) ); | |
132 | fOutputContainer->Add( new TH2F("h_ClusNXZM3_had","Hadron Cluster (X,Z) Module3", 64,0.5,64.5, 56,0.5,56.5) ); | |
133 | fOutputContainer->Add( new TH2F("hEp_had_mod1","E/p Hadron in Module1 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
134 | fOutputContainer->Add( new TH2F("hEp_had_mod2","E/p Hadron in Module2 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
135 | fOutputContainer->Add( new TH2F("hEp_had_mod3","E/p Hadron in Module3 (E/p VS. p_{T})",1000,0,2,1000,0,10.) ); | |
136 | ||
137 | // ===================================================================================================== | |
138 | fOutputContainer->Add( new TH1F("h_NClusEvent","Number PHOS Clusters per Event in All Modules",31,-0.5,30.5) ); | |
139 | fOutputContainer->Add( new TH1F("h_NClusEventmod1","Number PHOS Clusters per Event in Module1",21,-0.5,20.5) ); | |
140 | fOutputContainer->Add( new TH1F("h_NClusEventmod2","Number PHOS Clusters per Event in Module2",21,-0.5,20.5) ); | |
141 | fOutputContainer->Add( new TH1F("h_NClusEventmod3","Number PHOS Clusters per Event in Module3",21,-0.5,20.5) ); | |
142 | ||
143 | fOutputContainer->Add( new TH1F("h_EClusEvent","PHOS Cluster Energy per Event in All Modules",2010,-0.5,20.5) ); | |
144 | fOutputContainer->Add( new TH1F("h_EClusEventmod1","PHOS Cluster Energy per Event in Module1",2010,-0.5,20.5) ); | |
145 | fOutputContainer->Add( new TH1F("h_EClusEventmod2","PHOS Cluster Energy per Event in Module2",2010,-0.5,20.5) ); | |
146 | fOutputContainer->Add( new TH1F("h_EClusEventmod3","PHOS Cluster Energy per Event in Module3",2010,-0.5,20.5) ); | |
147 | ||
148 | fOutputContainer->Add( new TH1F("h_NTrackEvent","Number of TPC Tracks per Event",1001,-0.5,1000.5) ); | |
149 | fOutputContainer->Add( new TH1F("h_PTrackEvent","TPC Momentum per Event",2010,-0.5,20.5) ); | |
150 | fOutputContainer->Add( new TH1F("h_NClusTPCEvent","Number of TPC Clusters per Event",301,-0.5,300.5) ); | |
151 | ||
152 | // ====================================================================================================== | |
153 | ||
154 | ||
155 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); | |
156 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); | |
157 | ||
158 | fPIDResponse = inputHandler->GetPIDResponse(); | |
159 | if(!fPIDResponse) AliFatal(" !!! FATAL!! No PIDResponse!!"); | |
160 | ||
161 | PostData(1, fOutputContainer); | |
162 | ||
163 | } | |
164 | ||
165 | //________________________________________________________________________ | |
166 | void AliAnalysisTaskEpRatio::UserExec(Option_t *) | |
167 | { | |
168 | //Main function that does all the job. | |
169 | ||
170 | AliVEvent* event = InputEvent(); | |
171 | fRunNumber = event->GetRunNumber(); | |
172 | ||
173 | SetGeometry(); | |
174 | ||
175 | Double_t v[3]={0,0,0}; //vertex; | |
176 | const AliVVertex *primvertex = event->GetPrimaryVertex(); | |
177 | ||
178 | primvertex->GetXYZ(v); | |
179 | TVector3 vtx(v); | |
180 | ||
181 | if(fabs(v[2])>10.) return; | |
182 | ||
183 | const Int_t kNumberOfTracks = event->GetNumberOfTracks(); | |
184 | const Int_t kNumberOfCaloClusters = event->GetNumberOfCaloClusters(); | |
185 | ||
186 | AliVCaloCells *cells = event->GetPHOSCells(); | |
187 | Int_t multCells = cells->GetNumberOfCells(); | |
188 | FillHistogram("h_CellMultEvent",multCells); | |
189 | ||
190 | TLorentzVector pc1; //4-momentum of PHOS cluster 1 | |
191 | Int_t inPHOS=0; | |
192 | ||
193 | // ================ | |
194 | // === TPC dedx === | |
195 | // ================ | |
196 | FillHistogram("h_NTrackEvent",kNumberOfTracks); | |
197 | ||
198 | for(Int_t iTrack=0; iTrack<kNumberOfTracks; iTrack++){ | |
685f202a | 199 | |
be884acb | 200 | AliVTrack* esdTrack = dynamic_cast<AliVTrack*> (event->GetTrack(iTrack)); |
685f202a | 201 | if(!esdTrack) AliFatal(Form("iTrack %d is Not a AliVTrack!!",iTrack)); |
202 | ||
be884acb | 203 | FillHistogram("h_PTrackEvent",esdTrack->P() ); |
204 | FillHistogram("h_NClusTPCEvent",esdTrack->GetTPCNcls() ); | |
205 | } | |
206 | ||
207 | // ================ | |
208 | // === E/p ======== | |
209 | // ================ | |
210 | Float_t position[3]; | |
211 | Int_t mod1, relId[4], cellAbsId, cellX, cellZ; | |
212 | Int_t nPHOSCluster = 0, inMod1 = 0, inMod2 = 0, inMod3 = 0; | |
213 | ||
214 | for(Int_t iClu=0; iClu<kNumberOfCaloClusters; iClu++){ | |
215 | ||
216 | AliVCluster *c1 = event->GetCaloCluster(iClu); | |
217 | ||
218 | if( !c1->IsPHOS() ) continue; | |
219 | //if( c1->E()<0.3 ) continue; | |
220 | FillHistogram("h_EClus_NCell",c1->E(),c1->GetNCells()); | |
221 | FillHistogram("h_ECluster",c1->E()); | |
222 | FillHistogram("h_NCells",c1->GetNCells()); | |
223 | if( c1->GetNCells()<3 ) continue; | |
224 | ||
225 | c1->GetPosition(position); | |
226 | TVector3 global1(position); | |
227 | fPHOSGeo->GlobalPos2RelId(global1,relId); | |
228 | mod1 = relId[0]; | |
229 | cellX = relId[2]; | |
230 | cellZ = relId[3]; | |
231 | ||
232 | cellAbsId = c1->GetCellAbsId(0); | |
233 | fPHOSGeo->AbsToRelNumbering(cellAbsId,relId); | |
234 | mod1 = relId[0]; | |
235 | ||
236 | FillHistogram("h_EClusEvent",c1->E()); | |
237 | ||
238 | if( mod1 == 1 ){ | |
239 | inMod1++; nPHOSCluster++; | |
240 | FillHistogram("h_EClusEventmod1",c1->E()); | |
241 | } | |
242 | else if( mod1 == 2 ){ | |
243 | inMod2++; nPHOSCluster++; | |
244 | FillHistogram("h_EClusEventmod2",c1->E()); | |
245 | } | |
246 | else if( mod1 == 3 ){ | |
247 | inMod3++; nPHOSCluster++; | |
248 | FillHistogram("h_EClusEventmod3",c1->E()); | |
249 | } | |
250 | ||
251 | Int_t nMatched = c1->GetNTracksMatched(); | |
252 | ||
253 | Double_t Dx = c1->GetTrackDx(); | |
254 | Double_t Dz = c1->GetTrackDz(); | |
255 | Double_t r = sqrt(Dx*Dx+Dz*Dz); // unit is [cm] | |
256 | ||
257 | if(r > 5.) continue; | |
258 | if(nMatched<=0) continue; | |
259 | ||
260 | AliVTrack* esdTrack = dynamic_cast<AliVTrack*> (c1->GetTrackMatched(0)); | |
261 | if( !(TMath::Abs(esdTrack->Eta())< 0.8) ) continue; | |
262 | ||
263 | Short_t charge = esdTrack->Charge(); | |
264 | if(fPIDResponse) { | |
265 | ||
266 | //if(c1->E()<0.3) continue; // MIP & noise cut | |
267 | ||
268 | // ============================================================================= | |
269 | FillHistogram("hEp",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
270 | FillHistogram("h_dedx_PHOS",esdTrack->P(),esdTrack->GetTPCsignal()); | |
271 | ||
272 | if( mod1 == 1 ){ | |
273 | FillHistogram("hEp_mod1",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
274 | FillHistogram("h_ClusNXZM1",cellX,cellZ,1.); | |
275 | } | |
276 | else if( mod1 == 2 ){ | |
277 | FillHistogram("hEp_mod2",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
278 | FillHistogram("h_ClusNXZM2",cellX,cellZ,1.); | |
279 | } | |
280 | else if( mod1 == 3 ){ | |
281 | FillHistogram("hEp_mod3",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
282 | FillHistogram("h_ClusNXZM3",cellX,cellZ,1.); | |
283 | } | |
284 | ||
285 | ||
286 | Bool_t pidPion=kFALSE, pidKaon=kFALSE, pidProton=kFALSE, pidElectron=kFALSE, pidMuon=kFALSE, pidHadron=kFALSE; | |
287 | Double_t nsigmaProton = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(esdTrack, AliPID::kProton)); // esdTrack << inEvHMain | |
288 | Double_t nsigmaKaon = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(esdTrack, AliPID::kKaon)); | |
289 | Double_t nsigmaPion = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(esdTrack, AliPID::kPion)); | |
290 | //Double_t nsigmaElectron = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(esdTrack, AliPID::kElectron)); | |
291 | Double_t nsigmaElectron = fPIDResponse->NumberOfSigmasTPC(esdTrack, AliPID::kElectron); | |
292 | Double_t nsigmaMuon = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(esdTrack, AliPID::kMuon)); | |
293 | ||
294 | if((nsigmaKaon <nsigmaPion) && (nsigmaKaon <nsigmaProton) && (nsigmaKaon <nsigmaElectron) | |
295 | && (nsigmaKaon <nsigmaMuon ) && (nsigmaKaon <3)) pidKaon = kTRUE; | |
296 | if((nsigmaPion <nsigmaKaon) && (nsigmaPion <nsigmaProton) && (nsigmaPion <nsigmaElectron) | |
297 | && (nsigmaPion <nsigmaMuon ) && (nsigmaPion <3)) pidPion = kTRUE; | |
298 | if((nsigmaProton <nsigmaKaon) && (nsigmaProton <nsigmaPion ) && (nsigmaProton <nsigmaElectron) | |
299 | && (nsigmaProton <nsigmaMuon ) && (nsigmaProton <3)) pidProton = kTRUE; | |
300 | if((nsigmaMuon <nsigmaKaon) && (nsigmaMuon <nsigmaPion ) && (nsigmaMuon <nsigmaProton ) | |
301 | && (nsigmaMuon <nsigmaElectron) && (nsigmaMuon <3)) pidMuon = kTRUE; | |
302 | if((nsigmaElectron<nsigmaKaon) && (nsigmaElectron<nsigmaPion ) && (nsigmaElectron<nsigmaProton ) | |
303 | && (nsigmaElectron <nsigmaMuon ) && (nsigmaElectron<3) && (nsigmaElectron>-2)) pidElectron = kTRUE; | |
304 | if( (nsigmaElectron<-3) ) pidHadron = kTRUE; | |
305 | ||
306 | if (pidPion){ | |
307 | FillHistogram("h_dedx_pion_PHOS",esdTrack->P(),esdTrack->GetTPCsignal()); | |
308 | } | |
309 | if (pidKaon){ | |
310 | FillHistogram("h_dedx_kaon_PHOS",esdTrack->P(),esdTrack->GetTPCsignal()); | |
311 | } | |
312 | if (pidProton){ | |
313 | FillHistogram("h_dedx_proton_PHOS",esdTrack->P(),esdTrack->GetTPCsignal()); | |
314 | } | |
315 | if (pidMuon){ | |
316 | FillHistogram("h_dedx_muon_PHOS",esdTrack->P(),esdTrack->GetTPCsignal()); | |
317 | } | |
318 | ||
319 | if (pidElectron){ | |
320 | FillHistogram("hEp_ele",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
321 | FillHistogram("hEp_ele2",c1->E()/esdTrack->P(),1/esdTrack->P()); | |
322 | FillHistogram("h_dedx_ele_PHOS",esdTrack->P(),esdTrack->GetTPCsignal()); | |
323 | ||
324 | // ============================================================================= | |
325 | ||
326 | if (charge>0) FillHistogram("hEp_positron",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
327 | if (charge<0) FillHistogram("hEp_electron",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
328 | ||
329 | if( mod1 == 1 ){ | |
330 | FillHistogram("h_ClusNXZM1_ele",cellX,cellZ,1.); | |
331 | FillHistogram("hEp_ele_mod1",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
332 | } | |
333 | else if( mod1 == 2 ){ | |
334 | FillHistogram("h_ClusNXZM2_ele",cellX,cellZ,1.); | |
335 | FillHistogram("hEp_ele_mod2",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
336 | } | |
337 | else if( mod1 == 3 ){ | |
338 | FillHistogram("h_ClusNXZM3_ele",cellX,cellZ,1.); | |
339 | FillHistogram("hEp_ele_mod3",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
340 | } | |
341 | } | |
342 | else{ | |
343 | FillHistogram("hEp_other",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
344 | FillHistogram("h_dedx_other_PHOS",esdTrack->P(),esdTrack->GetTPCsignal()); | |
345 | ||
346 | if( mod1 == 1 ){ | |
347 | FillHistogram("hEp_other_mod1",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
348 | } | |
349 | else if( mod1 == 2 ){ | |
350 | FillHistogram("hEp_other_mod2",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
351 | } | |
352 | else if( mod1 == 3 ){ | |
353 | FillHistogram("hEp_other_mod3",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
354 | } | |
355 | ||
356 | } | |
357 | ||
358 | if (pidHadron){ | |
359 | FillHistogram("hEp_had",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
360 | FillHistogram("hEp_had2",c1->E()/esdTrack->P(),1/esdTrack->P()); | |
361 | FillHistogram("h_dedx_had_PHOS",esdTrack->P(),esdTrack->GetTPCsignal()); | |
362 | ||
363 | // ============================================================================= | |
364 | ||
365 | if( mod1 == 1 ){ | |
366 | FillHistogram("h_ClusNXZM1_had",cellX,cellZ,1.); | |
367 | FillHistogram("hEp_had_mod1",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
368 | } | |
369 | else if( mod1 == 2 ){ | |
370 | FillHistogram("h_ClusNXZM2_had",cellX,cellZ,1.); | |
371 | FillHistogram("hEp_had_mod2",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
372 | } | |
373 | else if( mod1 == 3 ){ | |
374 | FillHistogram("h_ClusNXZM3_had",cellX,cellZ,1.); | |
375 | FillHistogram("hEp_had_mod3",c1->E()/esdTrack->P(),esdTrack->Pt()); | |
376 | } | |
377 | } | |
378 | ||
379 | } | |
380 | ||
381 | // ============================================================================================================================= | |
382 | inPHOS++; | |
383 | } | |
384 | ||
385 | FillHistogram("h_NClusEvent",nPHOSCluster); | |
386 | FillHistogram("h_NClusEventmod1",inMod1); | |
387 | FillHistogram("h_NClusEventmod2",inMod2); | |
388 | FillHistogram("h_NClusEventmod3",inMod3); | |
389 | ||
390 | nPHOSCluster = 0; | |
391 | inMod1 = 0; | |
392 | inMod2 = 0; | |
393 | inMod3 = 0; | |
394 | ||
395 | //delete caloClustersArr; | |
396 | PostData(1,fOutputContainer); | |
397 | return ; | |
398 | } | |
399 | ||
400 | //_____________________________________________________________________________ | |
401 | void AliAnalysisTaskEpRatio::FillHistogram(const char * key,Double_t x)const{ | |
402 | //FillHistogram | |
403 | TH1I * tmpI = dynamic_cast<TH1I*>(fOutputContainer->FindObject(key)) ; | |
404 | if(tmpI){ | |
405 | tmpI->Fill(x) ; | |
406 | return ; | |
407 | } | |
408 | TH1F * tmpF = dynamic_cast<TH1F*>(fOutputContainer->FindObject(key)) ; | |
409 | if(tmpF){ | |
410 | tmpF->Fill(x) ; | |
411 | return ; | |
412 | } | |
413 | TH1D * tmpD = dynamic_cast<TH1D*>(fOutputContainer->FindObject(key)) ; | |
414 | if(tmpD){ | |
415 | tmpD->Fill(x) ; | |
416 | return ; | |
417 | } | |
418 | AliInfo(Form("can not find histogram <%s> ",key)) ; | |
419 | } | |
420 | //_____________________________________________________________________________ | |
421 | void AliAnalysisTaskEpRatio::FillHistogram(const char * key,Double_t x,Double_t y)const{ | |
422 | //FillHistogram | |
423 | TObject * tmp = fOutputContainer->FindObject(key) ; | |
424 | if(!tmp){ | |
425 | AliInfo(Form("can not find histogram <%s> ",key)) ; | |
426 | return ; | |
427 | } | |
428 | if(tmp->IsA() == TClass::GetClass("TH1F")){ | |
429 | ((TH1F*)tmp)->Fill(x,y) ; | |
430 | return ; | |
431 | } | |
432 | if(tmp->IsA() == TClass::GetClass("TH2F")){ | |
433 | ((TH2F*)tmp)->Fill(x,y) ; | |
434 | return ; | |
435 | } | |
436 | AliError(Form("Calling FillHistogram with 2 parameters for histo <%s> of type %s",key,tmp->IsA()->GetName())) ; | |
437 | } | |
438 | ||
be884acb | 439 | //_____________________________________________________________________________ |
440 | void AliAnalysisTaskEpRatio::SetGeometry() | |
441 | { | |
0c442e33 | 442 | //Init geometry. |
be884acb | 443 | |
444 | if(!fPHOSGeo){ | |
445 | ||
446 | AliOADBContainer geomContainer("phosGeo"); | |
447 | geomContainer.InitFromFile("$ALICE_ROOT/OADB/PHOS/PHOSGeometry.root","PHOSRotationMatrixes"); | |
448 | TObjArray *matrixes = (TObjArray*)geomContainer.GetObject(fRunNumber,"PHOSRotationMatrixes"); | |
449 | fPHOSGeo = AliPHOSGeometry::GetInstance("IHEP") ; | |
450 | for(Int_t mod=0; mod<5; mod++) { | |
451 | if(!matrixes->At(mod)) { | |
452 | if( fDebug ) | |
453 | AliInfo(Form("No PHOS Matrix for mod:%d, geo=%p\n", mod, fPHOSGeo)); | |
454 | continue; | |
455 | } | |
456 | else { | |
457 | fPHOSGeo->SetMisalMatrix(((TGeoHMatrix*)matrixes->At(mod)),mod) ; | |
458 | if( fDebug >1 ) | |
459 | AliInfo(Form("Adding PHOS Matrix for mod:%d, geo=%p\n", mod, fPHOSGeo)); | |
460 | } | |
461 | } | |
462 | } | |
463 | ||
464 | } | |
efa654f0 | 465 | |
466 | //_____________________________________________________________________________ | |
467 | void AliAnalysisTaskEpRatio::FillHistogram(const char * key,Double_t x,Double_t y, Double_t z) const{ | |
468 | //Fills 1D histograms with key | |
469 | TObject * tmp = fOutputContainer->FindObject(key) ; | |
470 | if(!tmp){ | |
471 | AliInfo(Form("can not find histogram <%s> ",key)) ; | |
472 | return ; | |
473 | } | |
474 | if(tmp->IsA() == TClass::GetClass("TH2F")){ | |
475 | ((TH2F*)tmp)->Fill(x,y,z) ; | |
476 | return ; | |
477 | } | |
478 | if(tmp->IsA() == TClass::GetClass("TH3F")){ | |
479 | ((TH3F*)tmp)->Fill(x,y,z) ; | |
480 | return ; | |
481 | } | |
482 | } |