]>
Commit | Line | Data |
---|---|---|
f15155ed | 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 | ||
16 | //_________________________________________________________________________ | |
17 | // Base class for CaloTrackCorr analysis algorithms | |
18 | //-- Author: Gustavo Conesa (LNF-INFN, LPSC-Grenoble) | |
19 | // | |
20 | // | |
21 | //_________________________________________________________________________ | |
22 | ||
23 | ||
24 | // --- ROOT system --- | |
25 | #include <TClonesArray.h> | |
26 | //#include <Riostream.h> | |
27 | ||
28 | //---- AliRoot system ---- | |
29 | #include "AliAnaCaloTrackCorrBaseClass.h" | |
30 | #include "AliCaloTrackReader.h" | |
31 | #include "AliCalorimeterUtils.h" | |
32 | #include "AliCaloPID.h" | |
33 | #include "AliFiducialCut.h" | |
34 | #include "AliIsolationCut.h" | |
35 | #include "AliMCAnalysisUtils.h" | |
36 | #include "AliNeutralMesonSelection.h" | |
37 | #include "AliVCaloCells.h" | |
38 | #include "AliAODEvent.h" | |
39 | #include "AliAODHandler.h" | |
40 | #include "AliAnalysisManager.h" | |
41 | #include "AliAODPWG4Particle.h" | |
42 | ||
43 | ClassImp(AliAnaCaloTrackCorrBaseClass) | |
44 | ||
45 | ||
46 | //__________________________________________________________ | |
47 | AliAnaCaloTrackCorrBaseClass::AliAnaCaloTrackCorrBaseClass() : | |
48 | TObject(), | |
49 | fDataMC(0), fDebug(0), fCheckFidCut(0), | |
50 | fCheckCaloPID(0), fRecalculateCaloPID(0), | |
51 | fMinPt(0), fMaxPt(0), fPairTimeCut(200), | |
52 | fMultiBin(0), fNZvertBin(0), | |
53 | fNrpBin(0), fNCentrBin(0), | |
11045377 | 54 | fNmaxMixEv(0), fDoOwnMix(0), |
55 | fUseTrackMultBins(0), | |
56 | fMaxMulti(0), fMinMulti(0), | |
f15155ed | 57 | fUseSelectEvent(kFALSE), fMakePlots(kFALSE), |
58 | fInputAODBranch(0x0), fInputAODName(""), | |
59 | fOutputAODBranch(0x0), fNewAOD(kFALSE), | |
60 | fOutputAODName(""), fOutputAODClassName(""), | |
61 | fAODObjArrayName(""), fAddToHistogramsName(""), | |
62 | fCaloPID(0x0), fCaloUtils(0x0), | |
63 | fFidCut(0x0), fHisto(0x0), | |
64 | fIC(0x0), fMCUtils(0x0), | |
65 | fNMS(0x0), fReader(0x0) | |
66 | { | |
67 | //Default Ctor | |
68 | ||
69 | //Initialize parameters | |
70 | InitParameters(); | |
71 | } | |
72 | ||
73 | //___________________________________________________________ | |
74 | AliAnaCaloTrackCorrBaseClass::~AliAnaCaloTrackCorrBaseClass() | |
75 | { | |
76 | // Remove all pointers except analysis output pointers. | |
77 | ||
78 | //delete fCaloUtils ; //Already deleted in maker | |
79 | //delete fReader ; //Already deleted in maker | |
80 | ||
0de1814a | 81 | delete fCaloPID ; |
82 | delete fFidCut ; | |
83 | delete fIC ; | |
84 | delete fMCUtils ; | |
85 | delete fNMS ; | |
86 | delete fHisto ; | |
f15155ed | 87 | } |
88 | ||
89 | //______________________________________________________________________ | |
90 | void AliAnaCaloTrackCorrBaseClass::AddAODParticle(AliAODPWG4Particle pc) | |
91 | { | |
92 | //Put AOD calo cluster in the AODParticleCorrelation array | |
93 | ||
94 | if(fOutputAODBranch){ | |
95 | ||
96 | Int_t i = fOutputAODBranch->GetEntriesFast(); | |
97 | //new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc); | |
98 | if(strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4Particle")==0) | |
99 | new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc); | |
100 | else if(strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4ParticleCorrelation")==0) | |
101 | new((*fOutputAODBranch)[i]) AliAODPWG4ParticleCorrelation(pc); | |
102 | else { | |
103 | printf("AliAnaCaloTrackCorrBaseClass::AddAODParticle() - Cannot add an object of type < %s >, to the AOD TClonesArray \n", | |
104 | fOutputAODBranch->GetClass()->GetName()); | |
105 | abort(); | |
106 | } | |
107 | } | |
108 | else { | |
109 | printf(" AliAnaCaloTrackCorrBaseClass::AddAODParticle() - No AOD branch available!!!\n"); | |
110 | abort(); | |
111 | } | |
112 | ||
113 | } | |
114 | ||
04f7a616 | 115 | //_______________________________________________________________________________ |
116 | Int_t AliAnaCaloTrackCorrBaseClass::CheckMixedEventVertex(const Int_t caloLabel, | |
117 | const Int_t trackLabel) | |
118 | { | |
119 | // Check vertex in mixed events | |
120 | ||
121 | if (!GetMixedEvent()) return 1; // Not mixed event continue normal processing | |
122 | ||
123 | Int_t evt = -1; | |
124 | ||
125 | if (caloLabel >= 0 ) | |
126 | { | |
127 | evt = GetMixedEvent()->EventIndexForCaloCluster(caloLabel) ; | |
128 | } | |
129 | else if(trackLabel >= 0 ) | |
130 | { | |
131 | evt = GetMixedEvent()->EventIndex(trackLabel) ; | |
132 | } | |
133 | else | |
134 | return 0; // go to next entry in the particle list | |
135 | ||
136 | if(evt == -1) | |
137 | return 0 ; // to content coverity | |
138 | ||
139 | if (TMath::Abs(GetVertex(evt)[2]) > GetZvertexCut()) return -1; // Vertex out of range process next event | |
140 | ||
141 | return 1 ; // continue processing normally | |
142 | ||
143 | } | |
f15155ed | 144 | |
145 | //________________________________________________________________ | |
146 | void AliAnaCaloTrackCorrBaseClass::ConnectInputOutputAODBranches() | |
147 | { | |
148 | //Recover ouput and input AOD pointers for each event in the maker | |
149 | ||
150 | //Delta AODs | |
151 | if(fDebug > 3) printf("AliAnaCaloTrackCorrBaseClass::ConnectInputOutputAODBranches() - Connect Input with name: <%s>; Connect output with name <%s>\n",fInputAODName.Data(),fOutputAODName.Data()); | |
152 | ||
153 | //Get the AOD handler, if output AOD is created use it, if not get the branches from the input which should be deltaAODs | |
154 | AliAODHandler* aodHandler = 0x0; | |
155 | Bool_t outAOD = kFALSE; | |
156 | if((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()) outAOD = kTRUE; | |
157 | if(outAOD) aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
158 | else aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()); | |
159 | ||
160 | if(!GetReader()->WriteDeltaAODToFile()) | |
161 | { | |
162 | fOutputAODBranch = (TClonesArray *) (fReader->GetAODBranchList())->FindObject(fOutputAODName); | |
163 | fInputAODBranch = (TClonesArray *) (fReader->GetAODBranchList())->FindObject(fInputAODName); | |
164 | } | |
165 | else if (aodHandler->GetExtensions()) { | |
166 | ||
167 | AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(GetReader()->GetDeltaAODFileName()); | |
168 | if(ext){ | |
169 | AliAODEvent *aodEvent = ext->GetAOD(); | |
170 | if(fNewAOD)fOutputAODBranch = (TClonesArray*) aodEvent->FindListObject(fOutputAODName); | |
171 | fInputAODBranch = (TClonesArray*) aodEvent->FindListObject(fInputAODName); | |
172 | if(!fOutputAODBranch && fNewAOD) fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName); | |
173 | if(!fInputAODBranch) fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName); | |
174 | } | |
175 | else{//If no Delta AODs, kept in standard branch, to revise. | |
176 | if(fNewAOD && fReader->GetOutputEvent()) { | |
177 | fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName); | |
178 | fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName); | |
179 | } | |
180 | else { | |
181 | fInputAODBranch = (TClonesArray *) fReader->GetInputEvent()->FindListObject(fInputAODName); | |
182 | if(!fInputAODBranch && fReader->GetOutputEvent() ) | |
183 | fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);//Try the output event. | |
184 | } | |
185 | } | |
186 | } | |
187 | else{ //If no Delta AODs, kept in standard branch | |
188 | if(fNewAOD && fReader->GetOutputEvent()) { | |
189 | fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName); | |
190 | fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName); | |
191 | } | |
192 | else{ | |
193 | fInputAODBranch = (TClonesArray *) fReader->GetInputEvent()->FindListObject(fInputAODName); | |
194 | if(!fInputAODBranch && fReader->GetOutputEvent()) | |
195 | fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);//Try the output event. | |
196 | } | |
197 | } | |
198 | ||
199 | if(GetDebug() > 1){ | |
200 | if(fNewAOD && !fOutputAODBranch) | |
201 | printf(" AliAnaCaloTrackCorrBaseClass::ConnectInputOutputAODBranches() - Output Branch <%s>, not found!\n",fOutputAODName.Data()); | |
202 | if(!fNewAOD && !fInputAODBranch) | |
203 | printf(" AliAnaCaloTrackCorrBaseClass::ConnectInputOutputAODBranches() - Input Branch <%s>, not found!\n",fInputAODName.Data()); | |
204 | } | |
205 | } | |
206 | ||
207 | //__________________________________________________________________________________________ | |
208 | AliVCluster * AliAnaCaloTrackCorrBaseClass::FindCluster(TObjArray* clusters, const Int_t id, | |
209 | Int_t & iclus, const Int_t first) | |
210 | { | |
211 | // Given the cluster ID stored in AliAODPWG4Particle, get the originator cluster and its index in the array | |
212 | ||
213 | if(!clusters) return 0x0; | |
214 | ||
215 | for(iclus = first; iclus < clusters->GetEntriesFast(); iclus++){ | |
216 | AliVCluster *cluster= dynamic_cast<AliVCluster*> (clusters->At(iclus)); | |
217 | if(cluster){ | |
218 | if (cluster->GetID()==id) { | |
219 | return cluster; | |
220 | } | |
221 | } | |
222 | }// calorimeter clusters loop | |
223 | ||
224 | return 0x0; | |
225 | ||
226 | } | |
227 | ||
228 | //______________________________________________________________________________ | |
229 | TClonesArray * AliAnaCaloTrackCorrBaseClass::GetAODBranch(TString aodName) const | |
230 | { | |
231 | //Recover ouput and input AOD pointers for each event in the maker | |
232 | ||
233 | //Delta AODs | |
234 | if(fDebug > 3) printf("AliAnaCaloTrackCorrBaseClass::GetAODBranch() - Get Input Branch with name: <%s>; \n",aodName.Data()); | |
235 | ||
236 | //Get the AOD handler, if output AOD is created use it, if not get the branches from the input which should be deltaAODs | |
237 | AliAODHandler* aodHandler = 0x0; | |
238 | Bool_t outAOD = kFALSE; | |
239 | if((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()) outAOD = kTRUE; | |
240 | if(outAOD) aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
241 | else aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()); | |
242 | ||
243 | if(!GetReader()->WriteDeltaAODToFile()) | |
244 | { | |
245 | return (TClonesArray *) (fReader->GetAODBranchList())->FindObject(aodName); | |
246 | } | |
247 | else if (aodHandler->GetExtensions()) | |
248 | { | |
249 | AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(GetReader()->GetDeltaAODFileName()); | |
250 | if(ext){ | |
251 | AliAODEvent *aodEvent = ext->GetAOD(); | |
252 | TClonesArray * aodbranch = (TClonesArray*) aodEvent->FindListObject(aodName); | |
253 | if(aodbranch) return aodbranch; | |
254 | else { | |
255 | if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName); | |
256 | else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName); | |
257 | } | |
258 | } | |
259 | else{//If no Delta AODs, kept in standard branch, to revise. | |
260 | if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName); | |
261 | else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName); | |
262 | } | |
263 | } | |
264 | else{ //If no Delta AODs, kept in standard branch, to revise. | |
265 | if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName); | |
266 | else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName); | |
267 | } | |
268 | ||
269 | } | |
270 | ||
271 | //_____________________________________________________________ | |
272 | TObjArray * AliAnaCaloTrackCorrBaseClass::GetCTSTracks() const | |
273 | { | |
274 | //Get list of referenced tracks from reader | |
275 | ||
276 | return fReader->GetCTSTracks(); | |
277 | ||
278 | } | |
279 | ||
280 | //________________________________________________________________ | |
281 | TObjArray * AliAnaCaloTrackCorrBaseClass::GetPHOSClusters() const | |
282 | { | |
283 | //Get list of PHOS reference caloclusters from reader | |
284 | ||
285 | return fReader->GetPHOSClusters(); | |
286 | ||
287 | } | |
288 | ||
289 | //_________________________________________________________________ | |
290 | TObjArray * AliAnaCaloTrackCorrBaseClass::GetEMCALClusters() const | |
291 | { | |
292 | //Get list of emcal referenced caloclusters from reader | |
293 | ||
294 | return fReader->GetEMCALClusters(); | |
295 | ||
296 | } | |
297 | ||
298 | //______________________________________________________________________ | |
299 | TClonesArray * AliAnaCaloTrackCorrBaseClass::GetAODCaloClusters() const | |
300 | { | |
301 | //Get list of all caloclusters in AOD output file | |
302 | ||
303 | return fReader->GetOutputEvent()->GetCaloClusters(); | |
304 | ||
305 | } | |
306 | ||
307 | //________________________________________________________________ | |
308 | TClonesArray * AliAnaCaloTrackCorrBaseClass::GetAODTracks() const | |
309 | { | |
310 | //Get list of all tracks in AOD output file | |
311 | ||
312 | return fReader->GetOutputEvent()->GetTracks(); | |
313 | ||
314 | } | |
315 | ||
316 | //____________________________________________________________ | |
317 | TString AliAnaCaloTrackCorrBaseClass::GetBaseParametersList() | |
318 | { | |
319 | //Put data member values in string to keep in output container | |
320 | ||
321 | TString parList ; //this will be list of parameters used for this analysis. | |
322 | const Int_t buffersize = 255; | |
323 | char onePar[buffersize] ; | |
324 | snprintf(onePar,buffersize,"--- AliAnaCaloTrackCorrBaseClass ---\n") ; | |
325 | parList+=onePar ; | |
326 | snprintf(onePar,buffersize,"Minimal P_t: %2.2f ; Max\n", fMinPt) ; | |
327 | parList+=onePar ; | |
328 | snprintf(onePar,buffersize,"Minimal P_t: %2.2f ; Max\n", fMaxPt) ; | |
329 | parList+=onePar ; | |
330 | snprintf(onePar,buffersize,"|t_{1}-t_{2}| < %2.2f ; Max\n", fPairTimeCut) ; | |
331 | parList+=onePar ; | |
332 | snprintf(onePar,buffersize,"fDataMC =%d (Check MC information, on/off) \n",fDataMC) ; | |
333 | parList+=onePar ; | |
334 | snprintf(onePar,buffersize,"fCheckFidCut=%d (Check Fiducial cut selection on/off) \n",fCheckFidCut) ; | |
335 | parList+=onePar ; | |
336 | snprintf(onePar,buffersize,"fCheckCaloPID =%d (Use Bayesian PID in calorimetes, on/off) \n",fCheckCaloPID) ; | |
337 | parList+=onePar ; | |
338 | snprintf(onePar,buffersize,"fRecalculateCaloPID =%d (Calculate PID from shower/tof/tracking parameters, on/off) \n",fRecalculateCaloPID) ; | |
339 | parList+=onePar ; | |
340 | snprintf(onePar,buffersize,"fInputAODName =%s Input AOD name \n",fInputAODName.Data()) ; | |
341 | parList+=onePar ; | |
342 | if(fNewAOD){ | |
343 | snprintf(onePar,buffersize,"fOutputAODName =%s Output AOD name \n",fOutputAODName.Data()) ; | |
344 | parList+=onePar ; | |
345 | snprintf(onePar,buffersize,"fOutputAODClassName =%s Output AOD class name \n",fOutputAODClassName.Data()) ; | |
346 | parList+=onePar ; | |
347 | } | |
348 | snprintf(onePar,buffersize,"fAODObjArrayName =%s Reference arrays in AOD name \n",fAODObjArrayName.Data()) ; | |
349 | parList+=onePar ; | |
350 | snprintf(onePar,buffersize,"fAddToHistogramsName =%s String added to beginning of histograms name \n",fAddToHistogramsName.Data()) ; | |
351 | parList+=onePar ; | |
352 | ||
353 | return parList; | |
354 | ||
355 | } | |
356 | ||
357 | //_____________________________________________________________________ | |
358 | TClonesArray * AliAnaCaloTrackCorrBaseClass::GetCreateOutputAODBranch() | |
359 | { | |
360 | //Create AOD branch filled in the analysis | |
361 | ||
362 | printf("Create AOD branch of %s objects and with name < %s >\n", | |
363 | fOutputAODClassName.Data(),fOutputAODName.Data()) ; | |
364 | ||
365 | TClonesArray * aodBranch = new TClonesArray(fOutputAODClassName, 0); | |
366 | aodBranch->SetName(fOutputAODName); | |
367 | return aodBranch ; | |
368 | ||
369 | } | |
370 | ||
371 | //________________________________________________________ | |
372 | Int_t AliAnaCaloTrackCorrBaseClass::GetEventNumber() const | |
373 | { | |
374 | //Get current event number | |
375 | ||
376 | return fReader->GetEventNumber() ; | |
377 | ||
378 | } | |
379 | ||
380 | ||
381 | //__________________________________________________________ | |
382 | AliStack * AliAnaCaloTrackCorrBaseClass::GetMCStack() const | |
383 | { | |
384 | //Get stack pointer from reader | |
385 | ||
386 | return fReader->GetStack(); | |
387 | ||
388 | } | |
389 | //____________________________________________________________ | |
390 | AliHeader * AliAnaCaloTrackCorrBaseClass::GetMCHeader() const | |
391 | { | |
392 | //Get header pointer from reader | |
393 | ||
394 | return fReader->GetHeader(); | |
395 | ||
396 | } | |
397 | ||
398 | //____________________________________________________________________________ | |
399 | AliGenEventHeader * AliAnaCaloTrackCorrBaseClass::GetMCGenEventHeader() const | |
400 | { | |
401 | //Get GenEventHeader pointer from reader | |
402 | ||
403 | return fReader->GetGenEventHeader(); | |
404 | ||
405 | } | |
406 | ||
11045377 | 407 | |
408 | //___________________________________________________________ | |
409 | Int_t AliAnaCaloTrackCorrBaseClass::GetEventCentralityBin() | |
410 | { | |
411 | // Define the centrality bin for mixing | |
412 | // In pp collisions analysis hardcoded track multiplicities | |
413 | ||
414 | Int_t curCentrBin = 0; | |
415 | ||
416 | if(fUseTrackMultBins) // pp collisions | |
417 | { // Track multiplicity bins | |
418 | //curCentrBin = (GetTrackMultiplicity()-1)/5; | |
419 | //if(curCentrBin > GetNCentrBin()-1) curCentrBin=GetNCentrBin()-1; | |
420 | Int_t trackMult = GetReader()->GetTrackMultiplicity(); | |
421 | if(trackMult<=5) | |
422 | curCentrBin=8; | |
423 | else if(trackMult<=10) | |
424 | curCentrBin=7; | |
425 | else if(trackMult<=15) | |
426 | curCentrBin=6; | |
427 | else if(trackMult<=20) | |
428 | curCentrBin=5; | |
429 | else if(trackMult<=30) | |
430 | curCentrBin=4; | |
431 | else if(trackMult<=40) | |
432 | curCentrBin=3; | |
433 | else if(trackMult<=55) | |
434 | curCentrBin=2; | |
435 | else if(trackMult<=70) | |
436 | curCentrBin=1 ; | |
437 | else curCentrBin=0 ; | |
438 | } | |
439 | else // Set centrality based on centrality task, PbPb collisions | |
440 | { | |
441 | Float_t minCent = GetReader()->GetCentralityBin(0); | |
442 | Float_t maxCent = GetReader()->GetCentralityBin(1); | |
443 | ||
444 | if((minCent< 0 && maxCent< 0) || minCent>=maxCent) | |
445 | { | |
446 | curCentrBin = GetEventCentrality() * GetNCentrBin() / GetReader()->GetCentralityOpt(); | |
447 | } | |
448 | else | |
449 | { | |
8fd30003 | 450 | curCentrBin = (Int_t)((GetEventCentrality()-minCent) * GetNCentrBin() / (maxCent-minCent)); |
11045377 | 451 | if(curCentrBin==GetNCentrBin()) curCentrBin = GetNCentrBin()-1; |
452 | } | |
453 | ||
454 | if(GetDebug() > 0 ) | |
455 | printf("AliAnaCaloTrackCorrBaseClass::GetEventCentralityBin() - %d, centrality %d, n bins %d, max bin from centrality %d\n", | |
456 | curCentrBin, GetEventCentrality(), GetNCentrBin(), GetReader()->GetCentralityOpt()); | |
457 | } | |
458 | ||
459 | return curCentrBin; | |
460 | ||
461 | } | |
462 | ||
463 | //_________________________________________________ | |
464 | Int_t AliAnaCaloTrackCorrBaseClass::GetEventRPBin() | |
465 | { | |
466 | //Reaction plane bin | |
467 | ||
468 | Int_t curRPBin = 0 ; | |
469 | ||
470 | if(GetNRPBin() > 1 && GetEventPlane()) | |
471 | { | |
472 | Float_t epAngle = GetEventPlaneAngle();//->GetEventplane(GetEventPlaneMethod(),fReader->GetInputEvent()); | |
473 | ||
474 | if(epAngle < 0 || epAngle >TMath::Pi()) | |
475 | { | |
476 | printf("AliAnaCaloTrackCorrBaseClass::GetEventRPBin() - Wrong event plane angle : %f \n",epAngle); | |
477 | return -1; | |
478 | } | |
479 | ||
480 | curRPBin = TMath::Nint(epAngle*(GetNRPBin()-1)/TMath::Pi()); | |
481 | if(curRPBin >= GetNRPBin()) printf("RP Bin %d out of range %d\n",curRPBin,GetNRPBin()); | |
482 | ||
483 | if(GetDebug() > 0 ) | |
484 | printf("AliAnaCaloTrackCorrBaseClass::GetEventRPBin() - %d, bin float %f, angle %f, n bins %d\n", | |
485 | curRPBin,epAngle*(GetNRPBin()-1)/TMath::Pi(),epAngle,GetNRPBin()); | |
486 | } | |
487 | ||
488 | return curRPBin ; | |
489 | ||
490 | } | |
491 | ||
492 | //_________________________________________________ | |
493 | Int_t AliAnaCaloTrackCorrBaseClass::GetEventVzBin() | |
494 | { | |
495 | // Return Vz bin, divide vertex in GetNZvertBin() bins, | |
496 | // depending on the vertex cut | |
497 | ||
498 | Double_t v[3] = {0,0,0}; //vertex | |
499 | GetReader()->GetVertex(v); | |
500 | ||
501 | Int_t curZvertBin = (Int_t)(0.5*GetNZvertBin()*(v[2]+GetZvertexCut())/GetZvertexCut()); | |
502 | ||
503 | if(GetDebug() > 0 ) | |
504 | printf("AliAnaCaloTrackCorrBaseClass::GetEventVzBin() - %d, vz %2.2f, n bins %d \n", | |
505 | curZvertBin, v[2], GetNZvertBin()); | |
506 | ||
507 | return curZvertBin; | |
508 | } | |
509 | ||
510 | //____________________________________________________________________________________________________ | |
511 | Int_t AliAnaCaloTrackCorrBaseClass::GetEventMixBin(const Int_t iCen, const Int_t iVz, const Int_t iRP) | |
512 | { | |
513 | // Event mixing bin, combination of vz, centrality and reaction plane bins | |
514 | ||
515 | if(iCen<0 || iVz < 0 || iRP < 0) | |
516 | return -1; | |
517 | else | |
518 | return iCen*GetNZvertBin()*GetNRPBin()+iVz*GetNRPBin()+iRP; | |
519 | } | |
520 | ||
521 | //__________________________________________________ | |
522 | Int_t AliAnaCaloTrackCorrBaseClass::GetEventMixBin() | |
523 | { | |
524 | // Event mixing bin, combination of vz, centrality and reaction plane bins | |
525 | ||
526 | //Get vertex z bin | |
527 | Int_t iVz = GetEventVzBin(); | |
528 | ||
529 | // centrality (PbPb) or tracks multiplicity (pp) bin | |
530 | Int_t iCen = GetEventCentralityBin(); | |
531 | ||
532 | // reaction plane bin (PbPb) | |
533 | Int_t iRP = GetEventRPBin(); | |
534 | ||
535 | Int_t eventBin = GetEventMixBin(iCen, iVz, iRP); | |
536 | ||
537 | if(GetDebug() > 0) | |
538 | printf("AliAnaCaloTrackCorrBaseClass::GetEventMixBin() - Bins : cent %d, vz %d, RP %d, event %d/%d\n", | |
539 | iCen,iVz, iRP, eventBin, GetNZvertBin()*GetNRPBin()*GetNCentrBin()); | |
540 | ||
541 | return eventBin; | |
542 | ||
543 | } | |
544 | ||
f15155ed | 545 | //_________________________________________________ |
546 | void AliAnaCaloTrackCorrBaseClass::InitParameters() | |
547 | { | |
548 | //Initialize the parameters of the analysis. | |
549 | fDataMC = kFALSE; | |
550 | fDebug = -1; | |
551 | fCheckCaloPID = kTRUE ; | |
552 | fCheckFidCut = kFALSE ; | |
553 | fRecalculateCaloPID = kFALSE ; | |
554 | fMinPt = 0.1 ; //Min pt in particle analysis | |
555 | fMaxPt = 300. ; //Max pt in particle analysis | |
556 | fMultiBin = 1; | |
557 | fNZvertBin = 1; | |
558 | fNrpBin = 1; | |
559 | fMaxMulti = 1000; | |
560 | fMinMulti = 0; | |
561 | fUseSelectEvent = kFALSE ; | |
562 | ||
563 | //fReader = new AliCaloTrackReader(); //Initialized in maker | |
564 | //fCaloUtils = new AliCalorimeterUtils();//Initialized in maker | |
565 | ||
566 | fNewAOD = kFALSE ; | |
567 | fOutputAODName = "CaloTrackCorr"; | |
568 | fOutputAODClassName = "AliAODPWG4Particle"; | |
569 | fInputAODName = "CaloTrackCorr"; | |
570 | fAddToHistogramsName = ""; | |
571 | fAODObjArrayName = "Ref"; | |
572 | ||
573 | } | |
574 | ||
575 | //__________________________________________________________________ | |
576 | void AliAnaCaloTrackCorrBaseClass::Print(const Option_t * opt) const | |
577 | { | |
578 | //Print some relevant parameters set for the analysis | |
579 | ||
580 | if(! opt) | |
581 | return; | |
582 | ||
583 | printf("New AOD: = %d\n",fNewAOD); | |
584 | printf("Input AOD name: = %s\n",fInputAODName.Data()); | |
585 | printf("Output AOD name: = %s\n",fOutputAODName.Data()); | |
586 | printf("Output AOD Class name: = %s\n",fOutputAODClassName.Data()); | |
587 | printf("Min Photon pT = %2.2f\n", fMinPt) ; | |
588 | printf("Max Photon pT = %3.2f\n", fMaxPt) ; | |
589 | printf("Check PID = %d\n", fCheckCaloPID) ; | |
590 | printf("Recalculate PID = %d\n", fRecalculateCaloPID) ; | |
591 | printf("Check Fiducial cut = %d\n", fCheckFidCut) ; | |
592 | printf("Check MC labels = %d\n", fDataMC); | |
593 | printf("Make plots? = %d \n", fMakePlots); | |
594 | printf("Debug Level = %d\n", fDebug); | |
595 | ||
596 | printf("Name of reference array : %s\n", fAODObjArrayName.Data()); | |
597 | printf("String added histograms name : %s\n", fAddToHistogramsName.Data()); | |
598 | ||
599 | printf(" \n") ; | |
600 | ||
601 | } | |
602 | ||
603 | ||
604 |