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