AliPhysics  f57202d (f57202d)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnaCaloTrackCorrBaseClass.cxx
Go to the documentation of this file.
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 // --- ROOT system ---
17 #include <TClonesArray.h>
18 //#include <Riostream.h>
19 
20 //---- AliRoot system ----
22 #include "AliCaloTrackReader.h"
23 #include "AliCalorimeterUtils.h"
24 #include "AliCaloPID.h"
25 #include "AliFiducialCut.h"
26 #include "AliIsolationCut.h"
27 #include "AliMCAnalysisUtils.h"
29 #include "AliVCaloCells.h"
30 #include "AliAODEvent.h"
31 #include "AliAODHandler.h"
32 #include "AliAODPWG4Particle.h"
33 #include "AliMCEvent.h"
34 
38 
39 //__________________________________________________________
42 //__________________________________________________________
44 TObject(),
45 fDataMC(0), fDebug(0),
46 fCalorimeter(-1), fCalorimeterString(""),
47 fCheckFidCut(0), fCheckRealCaloAcc(0),
48 fCheckCaloPID(0), fRecalculateCaloPID(0),
49 fMinPt(0), fMaxPt(0),
50 fPairTimeCut(200), fTRDSMCovered(-1),
51 fNZvertBin(0), fNrpBin(0),
52 fNCentrBin(0), fNmaxMixEv(0),
53 fDoOwnMix(0), fUseTrackMultBins(0),
54 fFillPileUpHistograms(0), fFillHighMultHistograms(0),
55 fMakePlots(kFALSE),
56 fInputAODBranch(0x0), fInputAODName(""),
57 fOutputAODBranch(0x0), fNewAOD(kFALSE),
58 fOutputAODName(""), fOutputAODClassName(""),
59 fAODObjArrayName(""), fAddToHistogramsName(""),
60 fCaloPID(0x0), fCaloUtils(0x0),
61 fFidCut(0x0), fHisto(0x0),
62 fIC(0x0), fMCUtils(0x0),
63 fNMS(0x0), fReader(0x0),
64 fStudyClusterOverlapsPerGenerator(0),
65 fNCocktailGenNames(0)
66 {
68 }
69 
70 //___________________________________________________________
72 //___________________________________________________________
74 {
75  //delete fCaloUtils ; //Already deleted in maker
76  //delete fReader ; //Already deleted in maker
77 
78  delete fCaloPID ;
79  delete fFidCut ;
80  delete fIC ;
81  delete fMCUtils ;
82  delete fNMS ;
83  delete fHisto ;
84 }
85 
86 //______________________________________________________________________
89 //______________________________________________________________________
91 {
92  if(!fOutputAODBranch)
93  {
94  AliFatal("No AOD branch available!!!\n");
95  return; // coverity
96  }
97 
98  Int_t i = fOutputAODBranch->GetEntriesFast();
99  //new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc);
100  if (strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4Particle")==0)
101  {
102  new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc);
103  }
104  else if(strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4ParticleCorrelation")==0)
105  {
106  new((*fOutputAODBranch)[i]) AliAODPWG4ParticleCorrelation(pc);
107  }
108  else
109  {
110  AliFatal(Form("Cannot add an object of type < %s >, to the AOD TClonesArray \n", fOutputAODBranch->GetClass()->GetName()));
111  }
112 }
113 
114 //__________________________________________________________________________________________
119 //__________________________________________________________________________________________
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 //________________________________________________________________
148 //________________________________________________________________
150 {
151  AliDebug(3,Form("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 
161  {
164  }
165  else if (aodHandler->GetExtensions())
166  {
167  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(GetReader()->GetDeltaAODFileName());
168  if(ext)
169  {
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
177  { // If no Delta AODs, kept in standard branch, to revise.
178  if(fNewAOD && fReader->GetOutputEvent())
179  {
180  fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName);
181  fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);
182  }
183  else
184  {
185  fInputAODBranch = (TClonesArray *) fReader->GetInputEvent()->FindListObject(fInputAODName);
187  fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);//Try the output event.
188  }
189  }
190  }
191  else
192  { // If no Delta AODs, kept in standard branch
193  if(fNewAOD && fReader->GetOutputEvent())
194  {
195  fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName);
196  fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);
197  }
198  else
199  {
200  fInputAODBranch = (TClonesArray *) fReader->GetInputEvent()->FindListObject(fInputAODName);
202  fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);//Try the output event.
203  }
204  }
205 
206 // if(GetDebug() > 1)
207 // {
208 // if(fNewAOD && !fOutputAODBranch)
209 // AliInfo(Form("Output Branch <%s>, not found!\n",fOutputAODName.Data()));
210 // if(!fNewAOD && !fInputAODBranch)
211 // AliInfo(Form("Input Branch <%s>, not found!\n",fInputAODName.Data()));
212 // }
213 }
214 
215 //_____________________________________________________________________________________
223 //_____________________________________________________________________________________
225  Int_t & iclus, Int_t first)
226 {
227  if ( !clusters ) return 0x0;
228 
229  for(iclus = first; iclus < clusters->GetEntriesFast(); iclus++)
230  {
231  AliVCluster *cluster= dynamic_cast<AliVCluster*> (clusters->At(iclus));
232  if ( cluster )
233  {
234  if ( cluster->GetID() == clId )
235  {
236  return cluster;
237  }
238  }
239  }// calorimeter clusters loop
240 
241  return 0x0;
242 }
243 
244 //______________________________________________________________________________________
246 //______________________________________________________________________________________
247 TClonesArray * AliAnaCaloTrackCorrBaseClass::GetAODBranch(const TString & aodName) const
248 {
249  AliDebug(3,Form("AliAnaCaloTrackCorrBaseClass::GetAODBranch() - Get Input Branch with name: <%s>; \n",aodName.Data()));
250 
251  //Get the AOD handler, if output AOD is created use it, if not get the branches from the input which should be deltaAODs
252  AliAODHandler* aodHandler = 0x0;
253  Bool_t outAOD = kFALSE;
254  if((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()) outAOD = kTRUE;
255  if(outAOD) aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
256  else aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
257 
259  {
260  return (TClonesArray *) (fReader->GetAODBranchList())->FindObject(aodName);
261  }
262  else if (aodHandler->GetExtensions())
263  {
264  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(GetReader()->GetDeltaAODFileName());
265  if(ext){
266  AliAODEvent *aodEvent = ext->GetAOD();
267  TClonesArray * aodbranch = (TClonesArray*) aodEvent->FindListObject(aodName);
268  if(aodbranch) return aodbranch;
269  else {
270  if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName);
271  else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName);
272  }
273  }
274  else{//If no Delta AODs, kept in standard branch, to revise.
275  if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName);
276  else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName);
277  }
278  }
279  else{ //If no Delta AODs, kept in standard branch, to revise.
280  if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName);
281  else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName);
282  }
283 }
284 
285 //_____________________________________________________________
287 //_____________________________________________________________
289 {
290  return fReader->GetCTSTracks();
291 }
292 
293 //________________________________________________________________
295 //________________________________________________________________
297 {
298  return fReader->GetPHOSClusters();
299 }
300 
301 //_________________________________________________________________
303 //_________________________________________________________________
305 {
306  return fReader->GetEMCALClusters();
307 }
308 
309 //______________________________________________________________________
311 //______________________________________________________________________
313 {
314  return fReader->GetOutputEvent()->GetCaloClusters();
315 }
316 
317 //________________________________________________________________
319 //________________________________________________________________
321 {
322  return fReader->GetOutputEvent()->GetTracks();
323 }
324 
325 //____________________________________________________________
328 //____________________________________________________________
330 {
331  TString parList ; //this will be list of parameters used for this analysis.
332  const Int_t buffersize = 255;
333  char onePar[buffersize] ;
334  snprintf(onePar,buffersize,"--- AliAnaCaloTrackCorrBaseClass ---\n") ;
335  parList+=onePar ;
336  snprintf(onePar,buffersize,"Minimal P_t: %2.2f ; Max\n", fMinPt) ;
337  parList+=onePar ;
338  snprintf(onePar,buffersize,"Minimal P_t: %2.2f ; Max\n", fMaxPt) ;
339  parList+=onePar ;
340  snprintf(onePar,buffersize,"|t_{1}-t_{2}| < %2.2f ; Max\n", fPairTimeCut) ;
341  parList+=onePar ;
342  snprintf(onePar,buffersize,"fDataMC =%d (Check MC information, on/off) \n",fDataMC) ;
343  parList+=onePar ;
344  snprintf(onePar,buffersize,"fCheckFidCut=%d (Check Fiducial cut selection on/off) \n",fCheckFidCut) ;
345  parList+=onePar ;
346  snprintf(onePar,buffersize,"fCheckRealCaloAcc=%d (Check Real Calo Acceptance on/off) \n",fCheckRealCaloAcc) ;
347  parList+=onePar ;
348  snprintf(onePar,buffersize,"fCheckCaloPID =%d (Use Bayesian PID in calorimetes, on/off) \n",fCheckCaloPID) ;
349  parList+=onePar ;
350  snprintf(onePar,buffersize,"fRecalculateCaloPID =%d (Calculate PID from shower/tof/tracking parameters, on/off) \n",fRecalculateCaloPID) ;
351  parList+=onePar ;
352  snprintf(onePar,buffersize,"fInputAODName =%s Input AOD name \n",fInputAODName.Data()) ;
353  parList+=onePar ;
354  if(fNewAOD)
355  {
356  snprintf(onePar,buffersize,"fOutputAODName =%s Output AOD name \n",fOutputAODName.Data()) ;
357  parList+=onePar ;
358  snprintf(onePar,buffersize,"fOutputAODClassName =%s Output AOD class name \n",fOutputAODClassName.Data()) ;
359  parList+=onePar ;
360  }
361  snprintf(onePar,buffersize,"fAODObjArrayName =%s Reference arrays in AOD name \n",fAODObjArrayName.Data()) ;
362  parList+=onePar ;
363  snprintf(onePar,buffersize,"fAddToHistogramsName =%s String added to beginning of histograms name \n",fAddToHistogramsName.Data()) ;
364  parList+=onePar ;
365 
366  return parList;
367 }
368 
369 //_____________________________________________________________________
377 //_____________________________________________________________________
379  TString & genName, TString & genNameBkg)
380 {
381  if(cluster->GetNLabels() == 0 || cluster->GetLabel() < 0 ) return -1;
382 
383  (GetReader()->GetMC())->GetCocktailGenerator(cluster->GetLabel(), genName);
384 
385  //printf("Generator?: %s\n",genName.Data());
386 
387  Bool_t overlapGener = kFALSE;
388  Bool_t overlapGenerHIJING = kFALSE;
389  Bool_t overlapGenerOther = kFALSE;
390 
391  genNameBkg = "";
392 
393  const UInt_t nlabels = cluster->GetNLabels();
394  //Int_t noverlapsGen = 0;
395  //TString genName2Prev = genName;
396  for(UInt_t ilabel = 1; ilabel < nlabels; ilabel++)
397  {
398  Int_t label2 = cluster->GetLabels()[ilabel];
399  TString genName2;
400  (GetReader()->GetMC())->GetCocktailGenerator(label2,genName2);
401 
402  //if(genName2 != genName2Prev) noverlapsGen++;
403 
404  if(genName2 != genName)
405  {
406  //genName2Prev = genName2;
407 
408  if(!genNameBkg.Contains(genName2))
409  genNameBkg = Form("%s_%s",genNameBkg.Data(), genName2.Data());
410 
411  overlapGener = kTRUE;
412 
413  if( genName2.Contains("ijing") && !genName.Contains("ijing"))
414  overlapGenerHIJING = kTRUE;
415 
416  if(!genName2.Contains("ijing"))
417  overlapGenerOther = kTRUE;
418  }
419  }
420 
421  Int_t genBkgTag = -1;
422 
423  if ( !overlapGener ) genBkgTag = 0; // Pure
424  else if ( overlapGenerHIJING && !overlapGenerOther) genBkgTag = 1; // Gen+Hij
425  else if ( !overlapGenerHIJING && overlapGenerOther) genBkgTag = 2; // GenX+GenY
426  else if ( overlapGenerHIJING && overlapGenerOther) genBkgTag = 3; // GenX+GenY+Hij
427  else genBkgTag = 4;
428 
429  // check overlap with same generator, but not hijing
430  Int_t overpdg[nlabels];
431  Int_t overlab[nlabels];
432  Int_t noverlaps = GetMCAnalysisUtils()->GetNOverlaps(cluster->GetLabels(), nlabels,mctag,-1,GetReader(),overpdg,overlab);
433  Bool_t sameGenOverlap = kFALSE;
434  Bool_t sameGenOverlapHI = kFALSE;
435  for(Int_t iover = 0; iover < noverlaps; iover++)
436  {
437  TString genName2;
438  (GetReader()->GetMC())->GetCocktailGenerator(overlab[iover],genName2);
439  if ( genName2==genName )
440  {
441  if ( !genName.Contains("ijing") ) sameGenOverlap = kTRUE;
442  else sameGenOverlapHI = kTRUE;
443  }
444  }
445 
446  //printf("bkg tag %d, noverlaps %d; same gen overlap %d\n",genBkgTag,noverlaps,sameGenOverlap);
447  if(sameGenOverlap)
448  {
449  if(genBkgTag == 0) genBkgTag = 2; // GenX+GenX
450  if(genBkgTag == 1) genBkgTag = 3; // GenX+GenX+Hij
451  }
452 
453  // Logic a bit different for hijing main particles
454  if(genName.Contains("ijing"))
455  {
456 
457  if(sameGenOverlapHI)
458  {
459  if(!overlapGener) genBkgTag = 1; // Hij+Hij
460  else genBkgTag = 3; // Hij+Gen+Hij
461  }
462  else
463  {
464  if(!overlapGener) genBkgTag = 0; // Pure
465  else genBkgTag = 2; // Hij+Gen
466  }
467  }
468 
469  return genBkgTag;
470 }
471 
472 //_____________________________________________________________________
474 //_____________________________________________________________________
476 {
477  AliInfo(Form("Create AOD branch of %s objects and with name < %s >\n",
478  fOutputAODClassName.Data(),fOutputAODName.Data())) ;
479 
480  TClonesArray * aodBranch = new TClonesArray(fOutputAODClassName, 0);
481 
482  aodBranch->SetName(fOutputAODName);
483 
484  return aodBranch ;
485 }
486 
487 //________________________________________________________
489 //________________________________________________________
491 {
492  return fReader->GetEventNumber() ;
493 }
494 
495 //__________________________________________________________
497 //__________________________________________________________
499 {
500  return fReader->GetStack();
501 }
502 
503 //____________________________________________________________
505 //____________________________________________________________
507 {
508  return fReader->GetHeader();
509 }
510 
511 //____________________________________________________________________________
513 //____________________________________________________________________________
515 {
516  return fReader->GetGenEventHeader();
517 }
518 
519 //_________________________________________________________________
524 //_________________________________________________________________
526 {
527  //curCentrBin = (GetTrackMultiplicity()-1)/5;
528  //if(curCentrBin > GetNCentrBin()-1) curCentrBin=GetNCentrBin()-1;
529  Int_t trackMult = GetReader()->GetTrackMultiplicity();
530 
531  for(Int_t ibin = 0; ibin < GetNTrackMultBin()-1; ibin++)
532  {
533  if(trackMult >= fTrackMultBins[ibin] && trackMult < fTrackMultBins[ibin+1]) return ibin;
534  }
535 
536  AliWarning(Form("Bin not found for track multiplicity %d",trackMult));
537 
538  return -1;
539 }
540 
541 //________________________________________________________________
545 //________________________________________________________________
547 {
548  Int_t curCentrBin = 0;
549 
550  if(fUseTrackMultBins) // pp collisions
551  {
552  return GetTrackMultiplicityBin();
553  }
554  else // Set centrality based on centrality task, PbPb collisions
555  {
556  Float_t minCent = GetReader()->GetCentralityBin(0);
557  Float_t maxCent = GetReader()->GetCentralityBin(1);
558 
559  if((minCent< 0 && maxCent< 0) || minCent>=maxCent)
560  {
561  curCentrBin = GetEventCentrality() * GetNCentrBin() / GetReader()->GetCentralityOpt();
562  if(curCentrBin==GetNCentrBin())
563  {
564  curCentrBin = GetNCentrBin()-1;
565  AliDebug(1,Form("Centrality = %d, put it in last bin \n",GetEventCentrality()));
566  }
567  }
568  else
569  {
570  curCentrBin = (Int_t)((GetEventCentrality()-minCent) * GetNCentrBin() / (maxCent-minCent));
571  if(curCentrBin==GetNCentrBin()) curCentrBin = GetNCentrBin()-1;
572  }
573 
574  AliDebug(1,Form("Current CentrBin %d, centrality %d, n bins %d, max bin from centrality %d",
575  curCentrBin, GetEventCentrality(), GetNCentrBin(), GetReader()->GetCentralityOpt()));
576  }
577 
578  return curCentrBin;
579 }
580 
581 //_______________________________________________________
583 //_______________________________________________________
585 {
586  Int_t curRPBin = 0 ;
587 
588  if(GetNRPBin() > 1 && GetEventPlane())
589  {
590  Float_t epAngle = GetEventPlaneAngle();//->GetEventplane(GetEventPlaneMethod(),fReader->GetInputEvent());
591 
592  if(epAngle < 0 || epAngle >TMath::Pi())
593  {
594  AliWarning(Form("Wrong event plane angle : %f \n",epAngle));
595  return -1;
596  }
597 
598  curRPBin = TMath::Nint(epAngle*(GetNRPBin()-1)/TMath::Pi());
599  if(curRPBin >= GetNRPBin()) printf("RP Bin %d out of range %d",curRPBin,GetNRPBin());
600 
601  AliDebug(1,Form("Current RP bin %d, bin float %f, angle %f, n bins %d",
602  curRPBin,epAngle*(GetNRPBin()-1)/TMath::Pi(),epAngle,GetNRPBin()));
603  }
604 
605  return curRPBin ;
606 }
607 
608 //_______________________________________________________
611 //_______________________________________________________
613 {
614  Double_t v[3] = {0,0,0}; //vertex
615  GetReader()->GetVertex(v);
616 
617  Int_t curZvertBin = (Int_t)(0.5*GetNZvertBin()*(v[2]+GetZvertexCut())/GetZvertexCut());
618 
619  AliDebug(1,Form("AliAnaCaloTrackCorrBaseClass::GetEventVzBin() - %d, vz %2.2f, n bins %d",
620  curZvertBin, v[2], GetNZvertBin()));
621 
622  return curZvertBin;
623 }
624 
625 //________________________________________________________________________________________
627 //________________________________________________________________________________________
629 {
630  if(iCen<0 || iVz < 0 || iRP < 0)
631  return -1;
632  else
633  return iCen*GetNZvertBin()*GetNRPBin()+iVz*GetNRPBin()+iRP;
634 }
635 
636 //________________________________________________________
638 //________________________________________________________
640 {
641  //Get vertex z bin
642  Int_t iVz = GetEventVzBin();
643 
644  // centrality (PbPb) or tracks multiplicity (pp) bin
645  Int_t iCen = GetEventCentralityBin();
646 
647  // reaction plane bin (PbPb)
648  Int_t iRP = GetEventRPBin();
649 
650  Int_t eventBin = GetEventMixBin(iCen, iVz, iRP);
651 
652  AliDebug(1,Form("Bins : cent %d, vz %d, RP %d, event %d/%d",
653  iCen,iVz, iRP, eventBin, GetNZvertBin()*GetNRPBin()*GetNCentrBin()));
654 
655  return eventBin;
656 }
657 
658 //____________________________________________
661 //____________________________________________
663 {
664  if( fDebug >= 0 )
665  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(this->ClassName(),fDebug);
666 
667  if( GetMCAnalysisUtils()->GetDebug() >= 0 )
668  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(GetMCAnalysisUtils()->ClassName(),GetMCAnalysisUtils()->GetDebug());
669 
670  if( GetIsolationCut()->GetDebug() >= 0 )
671  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(GetIsolationCut()->ClassName(),GetIsolationCut()->GetDebug());
672 
673  if( GetNeutralMesonSelection()->GetDebug() >= 0 )
674  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(GetNeutralMesonSelection()->ClassName(),GetNeutralMesonSelection()->GetDebug());
675 
676  //printf("Debug levels: Ana %d, MC %d, Iso %d\n",fDebug,GetMCAnalysisUtils()->GetDebug(),GetIsolationCut()->GetDebug());
677 }
678 
679 //_________________________________________________
681 //_________________________________________________
683 {
684  fDataMC = kFALSE;
685  fDebug = 0;
686  fCheckCaloPID = kTRUE ;
687  fCheckFidCut = kFALSE ;
688  fCheckRealCaloAcc = kFALSE ;
689  fRecalculateCaloPID = kFALSE ;
690  fMinPt = 0.2 ; //Min pt in particle analysis
691  fMaxPt = 300. ; //Max pt in particle analysis
692  fNZvertBin = 1;
693  fNrpBin = 1;
694 
695  fCalorimeterString = "EMCAL";
696  fCalorimeter = kEMCAL ;
697 
698  fTrackMultBins[0] = 0; fTrackMultBins[1] = 5; fTrackMultBins[2] = 10;
699  fTrackMultBins[3] = 15; fTrackMultBins[4] = 20; fTrackMultBins[5] = 30;
700  fTrackMultBins[6] = 40; fTrackMultBins[7] = 55; fTrackMultBins[8] = 70;
701  for(Int_t ibin=9; ibin < 20; ibin++) fTrackMultBins[ibin] = 10000;
702 
703  //fReader = new AliCaloTrackReader(); //Initialized in maker
704  //fCaloUtils = new AliCalorimeterUtils();//Initialized in maker
705 
706  fNewAOD = kFALSE ;
707  fOutputAODName = "CaloTrackCorr";
708  fOutputAODClassName = "AliAODPWG4Particle";
709  fInputAODName = "CaloTrackCorr";
711  fAODObjArrayName = "Ref";
712 
713  fNCocktailGenNames = 7;
714  // Order matters, here cocktail of MC LHC14a1a
715  fCocktailGenNames[0] = ""; // First must be always empty
716  fCocktailGenNames[1] = "pi0EMC";
717  fCocktailGenNames[2] = "pi0";
718  fCocktailGenNames[3] = "etaEMC";
719  fCocktailGenNames[4] = "eta";
720  fCocktailGenNames[5] = "hijing";
721  fCocktailGenNames[6] = "other";
722 
723  for(Int_t igen = 7; igen < 10; igen++)
724  fCocktailGenNames[igen] = "";
725 }
726 
727 //__________________________________________________________________
729 //__________________________________________________________________
731 {
732  if(! opt)
733  return;
734 
735  printf("New AOD: = %d\n", fNewAOD);
736  printf("Input AOD name: = %s\n", fInputAODName.Data());
737  printf("Output AOD name: = %s\n", fOutputAODName.Data());
738  printf("Output AOD Class name: = %s\n", fOutputAODClassName.Data());
739  printf("Name of reference array : %s\n", fAODObjArrayName.Data());
740  printf("String added histograms name : %s\n", fAddToHistogramsName.Data());
741 
742  printf("Min Photon pT = %2.2f\n", fMinPt) ;
743  printf("Max Photon pT = %3.2f\n", fMaxPt) ;
744  printf("Check PID = %d\n", fCheckCaloPID) ;
745  printf("Recalculate PID = %d\n", fRecalculateCaloPID) ;
746  printf("Check Fiducial cut = %d\n", fCheckFidCut) ;
747  printf("Check Real Calo Acc = %d\n", fCheckRealCaloAcc) ;
748  printf("Check MC labels = %d\n", fDataMC);
749  printf("Make plots? = %d\n", fMakePlots);
750  printf("Debug Level = %d\n", fDebug);
751 
752  printf(" \n") ;
753 }
754 
755 //_______________________________________________________________
757 //_______________________________________________________________
759 {
760  fCalorimeterString = calo;
761 
762  if (calo=="EMCAL") fCalorimeter = kEMCAL;
763  else if(calo=="PHOS" ) fCalorimeter = kPHOS;
764  else if(calo=="CTS") fCalorimeter = kCTS;
765  else if(calo=="DCAL") fCalorimeter = kDCAL;
766  else if(calo.Contains("DCAL") && calo.Contains("PHOS")) fCalorimeter = kDCALPHOS;
767  else AliFatal(Form("Detector < %s > not known!", calo.Data()));
768 
769 }
770 
771 //_______________________________________________________________
773 //_______________________________________________________________
775 {
776  fCalorimeter = calo;
777 
778  if (calo==kEMCAL) fCalorimeterString = "EMCAL";
779  else if(calo==kPHOS ) fCalorimeterString = "PHOS";
780  else if(calo==kCTS) fCalorimeterString = "CTS";
781  else if(calo==kDCAL) fCalorimeterString = "DCAL";
782  else if(calo==kDCALPHOS) fCalorimeterString = "DCAL_PHOS";
783  else AliFatal(Form("Detector < %d > not known!", calo));
784 }
785 
786 
AliFiducialCut * fFidCut
Acceptance cuts detector dependent.
TString fOutputAODName
Name of output AOD branch.
virtual AliHeader * GetMCHeader() const
virtual AliMCEvent * GetMC() const
virtual ~AliAnaCaloTrackCorrBaseClass()
Destructor.
Int_t GetDebug() const
virtual TObjArray * GetCTSTracks() const
virtual void InitParameters()
Initialize the parameters of the analysis.
double Double_t
Definition: External.C:58
virtual AliHeader * GetHeader() const
Int_t fTrackMultBins[20]
Multiplicity bins limits. Number of bins set with SetNTrackMult() that calls SetNCentrBin().
Bool_t fCheckFidCut
Do analysis for clusters in defined region.
virtual void GetVertex(Double_t vertex[3]) const
virtual TObjArray * GetEMCALClusters() const
Bool_t WriteDeltaAODToFile() const
virtual AliVEvent * GetInputEvent() const
virtual void SetCalorimeter(TString &calo)
Set the calorimeter for the analysis. A string.
virtual Int_t GetNTrackMultBin() const
Number of bins in centrality.
virtual AliIsolationCut * GetIsolationCut()
virtual Float_t GetZvertexCut() const
Maximal number of events for mixin.
virtual Double_t GetEventPlaneAngle() const
Bool_t fRecalculateCaloPID
Recalculate PID or use PID weights in calorimeters.
Float_t fPairTimeCut
Maximum difference between time of cluster pairs (ns).
AliHistogramRanges * fHisto
Histogram ranges container.
virtual AliNeutralMesonSelection * GetNeutralMesonSelection()
virtual AliGenEventHeader * GetGenEventHeader() const
virtual AliGenEventHeader * GetMCGenEventHeader() const
TString fInputAODName
Name of input AOD branch.
virtual void GetVertex(Double_t v[3]) const
TString fCocktailGenNames[10]
Array with name of generators to study, first must be always empty.
AliCaloTrackReader * fReader
Access to ESD/AOD/MC data and other utilities.
TString fCalorimeterString
Calorimeter selection.
virtual Float_t GetCentralityBin(Int_t i) const
virtual Int_t GetEventNumber() const
Base class for CaloTrackCorr analysis algorithms.
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
virtual TList * GetAODBranchList() const
float Float_t
Definition: External.C:68
TClonesArray * fInputAODBranch
! Selected input particles branch.
Float_t fMinPt
Maximum pt of (trigger) particles in the analysis.
Bool_t fUseTrackMultBins
Use track multiplicity and not centrality bins in mixing.
virtual TClonesArray * GetAODBranch(const TString &aodBranchName) const
Recover ouput and input AOD pointers for each event in AliCaloTrackMaker.
virtual Int_t GetCentralityOpt() const
virtual AliAODEvent * GetOutputEvent() const
AliIsolationCut * fIC
Isolation cut utils.
Float_t fMaxPt
Minimum pt of (trigger) particles in the analysis.
Int_t GetDebug() const
virtual AliEventplane * GetEventPlane() const
Bool_t fCheckRealCaloAcc
When analysis of MC particle kinematics, check their hit in Calorimeter in Real Geometry or use AliFi...
Bool_t outAOD
Definition: ana.C:66
TString fOutputAODClassName
Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelati...
virtual Int_t GetNCentrBin() const
Number of bins in reaction plain.
Int_t GetCocktailGeneratorBackgroundTag(AliVCluster *clus, Int_t mctag, TString &genName, TString &genNameBkg)
virtual TObjArray * GetPHOSClusters() const
virtual TObjArray * GetPHOSClusters() const
TObject * FindObject(int bin, const char *nameH, const TList *lst, Bool_t normPerEvent=kTRUE)
virtual TClonesArray * GetAODCaloClusters() const
virtual void AddAODParticle(AliAODPWG4Particle part)
Int_t GetNOverlaps(const Int_t *label, UInt_t nlabels, Int_t mctag, Int_t mesonLabel, AliCaloTrackReader *reader, Int_t *overpdg, Int_t *overlabel)
virtual AliStack * GetStack() const
Bool_t fNewAOD
Flag, new aod branch added to the analysis or not.
AliMCAnalysisUtils * fMCUtils
MonteCarlo Analysis utils.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
virtual Int_t GetNRPBin() const
Number of bins in vertex.
virtual TClonesArray * GetCreateOutputAODBranch()
Create AOD branch filled in the analysis.
virtual AliMCAnalysisUtils * GetMCAnalysisUtils()
AliCaloPID * fCaloPID
PID calculation utils.
Int_t fNCocktailGenNames
Number of generators to study.
virtual Int_t GetTrackMultiplicityBin() const
Cut on vertex position.
Int_t fNrpBin
Number of bins in event container for reaction plain.
AliNeutralMesonSelection * fNMS
Neutral Meson Selection utities.
virtual void Print(const Option_t *) const
Print some relevant parameters set for the analysis.
Bool_t fDataMC
Flag to access MC data when using ESD or AOD.
TClonesArray * fOutputAODBranch
! Selected output particles branch.
const char Option_t
Definition: External.C:48
virtual TClonesArray * GetAODTracks() const
virtual AliVCluster * FindCluster(TObjArray *clusters, Int_t clId, Int_t &iclus, Int_t first=0)
virtual AliCaloTrackReader * GetReader() const
bool Bool_t
Definition: External.C:53
Int_t fNZvertBin
Number of bins in event container for vertex position.
Bool_t fCheckCaloPID
Do analysis for calorimeters.
Int_t fCalorimeter
Calorimeter selection.
TString fAddToHistogramsName
Add this string to histograms name.
Int_t GetTrackMultiplicity() const
virtual TObjArray * GetEMCALClusters() const
DCal, not used so far, just in case.
virtual Int_t CheckMixedEventVertex(Int_t caloLabel, Int_t trackLabel)
TString fAODObjArrayName
Name of ref array kept in a TList in AliAODParticleCorrelation with clusters or track. references.
virtual AliMixedEvent * GetMixedEvent() const
virtual TObjArray * GetCTSTracks() const