AliPhysics  ec7afe5 (ec7afe5)
 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 
37 
38 //__________________________________________________________
41 //__________________________________________________________
43 TObject(),
44 fDataMC(0), fDebug(0),
45 fCalorimeter(-1), fCalorimeterString(""),
46 fCheckFidCut(0), fCheckRealCaloAcc(0),
47 fCheckCaloPID(0), fRecalculateCaloPID(0),
48 fMinPt(0), fMaxPt(0),
49 fPairTimeCut(200), fTRDSMCovered(-1),
50 fNZvertBin(0), fNrpBin(0),
51 fNCentrBin(0), fNmaxMixEv(0),
52 fDoOwnMix(0), fUseTrackMultBins(0),
53 fFillPileUpHistograms(0), fFillHighMultHistograms(0),
54 fMakePlots(kFALSE),
55 fInputAODBranch(0x0), fInputAODName(""),
56 fOutputAODBranch(0x0), fNewAOD(kFALSE),
57 fOutputAODName(""), fOutputAODClassName(""),
58 fAODObjArrayName(""), fAddToHistogramsName(""),
59 fCaloPID(0x0), fCaloUtils(0x0),
60 fFidCut(0x0), fHisto(0x0),
61 fIC(0x0), fMCUtils(0x0),
62 fNMS(0x0), fReader(0x0),
63 fStudyClusterOverlapsPerGenerator(0),
64 fNCocktailGenNames(0)
65 {
67 }
68 
69 //___________________________________________________________
71 //___________________________________________________________
73 {
74  //delete fCaloUtils ; //Already deleted in maker
75  //delete fReader ; //Already deleted in maker
76 
77  delete fCaloPID ;
78  delete fFidCut ;
79  delete fIC ;
80  delete fMCUtils ;
81  delete fNMS ;
82  delete fHisto ;
83 }
84 
85 //______________________________________________________________________
88 //______________________________________________________________________
90 {
91  if(!fOutputAODBranch)
92  {
93  AliFatal("No AOD branch available!!!\n");
94  return; // coverity
95  }
96 
97  Int_t i = fOutputAODBranch->GetEntriesFast();
98  //new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc);
99  if (strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4Particle")==0)
100  {
101  new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc);
102  }
103  else if(strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4ParticleCorrelation")==0)
104  {
105  new((*fOutputAODBranch)[i]) AliAODPWG4ParticleCorrelation(pc);
106  }
107  else
108  {
109  AliFatal(Form("Cannot add an object of type < %s >, to the AOD TClonesArray \n", fOutputAODBranch->GetClass()->GetName()));
110  }
111 }
112 
113 //__________________________________________________________________________________________
118 //__________________________________________________________________________________________
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 
144 //________________________________________________________________
147 //________________________________________________________________
149 {
150  AliDebug(3,Form("AliAnaCaloTrackCorrBaseClass::ConnectInputOutputAODBranches() - Connect Input with name: <%s>; Connect output with name <%s>\n",fInputAODName.Data(),fOutputAODName.Data()));
151 
152  //Get the AOD handler, if output AOD is created use it, if not get the branches from the input which should be deltaAODs
153  AliAODHandler* aodHandler = 0x0;
154  Bool_t outAOD = kFALSE;
155  if((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()) outAOD = kTRUE;
156  if(outAOD) aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
157  else aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
158 
160  {
163  }
164  else if (aodHandler->GetExtensions())
165  {
166  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(GetReader()->GetDeltaAODFileName());
167  if(ext)
168  {
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
176  { // If no Delta AODs, kept in standard branch, to revise.
177  if(fNewAOD && fReader->GetOutputEvent())
178  {
179  fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName);
180  fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);
181  }
182  else
183  {
184  fInputAODBranch = (TClonesArray *) fReader->GetInputEvent()->FindListObject(fInputAODName);
186  fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);//Try the output event.
187  }
188  }
189  }
190  else
191  { // If no Delta AODs, kept in standard branch
192  if(fNewAOD && fReader->GetOutputEvent())
193  {
194  fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName);
195  fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);
196  }
197  else
198  {
199  fInputAODBranch = (TClonesArray *) fReader->GetInputEvent()->FindListObject(fInputAODName);
201  fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);//Try the output event.
202  }
203  }
204 
205 // if(GetDebug() > 1)
206 // {
207 // if(fNewAOD && !fOutputAODBranch)
208 // AliInfo(Form("Output Branch <%s>, not found!\n",fOutputAODName.Data()));
209 // if(!fNewAOD && !fInputAODBranch)
210 // AliInfo(Form("Input Branch <%s>, not found!\n",fInputAODName.Data()));
211 // }
212 }
213 
214 //_____________________________________________________________________________________
222 //_____________________________________________________________________________________
224  Int_t & iclus, Int_t first)
225 {
226  if ( !clusters ) return 0x0;
227 
228  for(iclus = first; iclus < clusters->GetEntriesFast(); iclus++)
229  {
230  AliVCluster *cluster= dynamic_cast<AliVCluster*> (clusters->At(iclus));
231  if ( cluster )
232  {
233  if ( cluster->GetID() == clId )
234  {
235  return cluster;
236  }
237  }
238  }// calorimeter clusters loop
239 
240  return 0x0;
241 }
242 
243 //______________________________________________________________________________________
245 //______________________________________________________________________________________
246 TClonesArray * AliAnaCaloTrackCorrBaseClass::GetAODBranch(const TString & aodName) const
247 {
248  AliDebug(3,Form("AliAnaCaloTrackCorrBaseClass::GetAODBranch() - Get Input Branch with name: <%s>; \n",aodName.Data()));
249 
250  //Get the AOD handler, if output AOD is created use it, if not get the branches from the input which should be deltaAODs
251  AliAODHandler* aodHandler = 0x0;
252  Bool_t outAOD = kFALSE;
253  if((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()) outAOD = kTRUE;
254  if(outAOD) aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
255  else aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
256 
258  {
259  return (TClonesArray *) (fReader->GetAODBranchList())->FindObject(aodName);
260  }
261  else if (aodHandler->GetExtensions())
262  {
263  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(GetReader()->GetDeltaAODFileName());
264  if(ext){
265  AliAODEvent *aodEvent = ext->GetAOD();
266  TClonesArray * aodbranch = (TClonesArray*) aodEvent->FindListObject(aodName);
267  if(aodbranch) return aodbranch;
268  else {
269  if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName);
270  else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName);
271  }
272  }
273  else{//If no Delta AODs, kept in standard branch, to revise.
274  if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName);
275  else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName);
276  }
277  }
278  else{ //If no Delta AODs, kept in standard branch, to revise.
279  if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName);
280  else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName);
281  }
282 }
283 
284 //_____________________________________________________________
286 //_____________________________________________________________
288 {
289  return fReader->GetCTSTracks();
290 }
291 
292 //________________________________________________________________
294 //________________________________________________________________
296 {
297  return fReader->GetPHOSClusters();
298 }
299 
300 //_________________________________________________________________
302 //_________________________________________________________________
304 {
305  return fReader->GetEMCALClusters();
306 }
307 
308 //______________________________________________________________________
310 //______________________________________________________________________
312 {
313  return fReader->GetOutputEvent()->GetCaloClusters();
314 }
315 
316 //________________________________________________________________
318 //________________________________________________________________
320 {
321  return fReader->GetOutputEvent()->GetTracks();
322 }
323 
324 //____________________________________________________________
327 //____________________________________________________________
329 {
330  TString parList ; //this will be list of parameters used for this analysis.
331  const Int_t buffersize = 255;
332  char onePar[buffersize] ;
333  snprintf(onePar,buffersize,"--- AliAnaCaloTrackCorrBaseClass ---\n") ;
334  parList+=onePar ;
335  snprintf(onePar,buffersize,"Minimal P_t: %2.2f ; Max\n", fMinPt) ;
336  parList+=onePar ;
337  snprintf(onePar,buffersize,"Minimal P_t: %2.2f ; Max\n", fMaxPt) ;
338  parList+=onePar ;
339  snprintf(onePar,buffersize,"|t_{1}-t_{2}| < %2.2f ; Max\n", fPairTimeCut) ;
340  parList+=onePar ;
341  snprintf(onePar,buffersize,"fDataMC =%d (Check MC information, on/off) \n",fDataMC) ;
342  parList+=onePar ;
343  snprintf(onePar,buffersize,"fCheckFidCut=%d (Check Fiducial cut selection on/off) \n",fCheckFidCut) ;
344  parList+=onePar ;
345  snprintf(onePar,buffersize,"fCheckRealCaloAcc=%d (Check Real Calo Acceptance on/off) \n",fCheckRealCaloAcc) ;
346  parList+=onePar ;
347  snprintf(onePar,buffersize,"fCheckCaloPID =%d (Use Bayesian PID in calorimetes, on/off) \n",fCheckCaloPID) ;
348  parList+=onePar ;
349  snprintf(onePar,buffersize,"fRecalculateCaloPID =%d (Calculate PID from shower/tof/tracking parameters, on/off) \n",fRecalculateCaloPID) ;
350  parList+=onePar ;
351  snprintf(onePar,buffersize,"fInputAODName =%s Input AOD name \n",fInputAODName.Data()) ;
352  parList+=onePar ;
353  if(fNewAOD)
354  {
355  snprintf(onePar,buffersize,"fOutputAODName =%s Output AOD name \n",fOutputAODName.Data()) ;
356  parList+=onePar ;
357  snprintf(onePar,buffersize,"fOutputAODClassName =%s Output AOD class name \n",fOutputAODClassName.Data()) ;
358  parList+=onePar ;
359  }
360  snprintf(onePar,buffersize,"fAODObjArrayName =%s Reference arrays in AOD name \n",fAODObjArrayName.Data()) ;
361  parList+=onePar ;
362  snprintf(onePar,buffersize,"fAddToHistogramsName =%s String added to beginning of histograms name \n",fAddToHistogramsName.Data()) ;
363  parList+=onePar ;
364 
365  return parList;
366 }
367 
368 //_____________________________________________________________________
379 //_____________________________________________________________________
381  TString & genName , Int_t & index,
382  TString & genNameBkg, Int_t & indexBkg)
383 {
384  if(cluster->GetNLabels() == 0 || cluster->GetLabel() < 0 ) return -1;
385 
386  //(GetReader()->GetMC())->
387  index = GetReader()->GetCocktailGeneratorAndIndex(cluster->GetLabel(), genName);
388  //TString genNameOrg;
389  //(GetReader()->GetMC())->GetCocktailGenerator(cluster->GetLabel(), genNameOrg);
390 
391  //printf("Generator?: %s, index %d\n",genName.Data(), index);
392 
393  Bool_t overlapGener = kFALSE;
394  Bool_t overlapGenerHIJING = kFALSE;
395  Bool_t overlapGenerOther = kFALSE;
396 
397  genNameBkg = "";
398  indexBkg = -1;
399 
400  const UInt_t nlabels = cluster->GetNLabels();
401  //Int_t noverlapsGen = 0;
402  //TString genName2Prev = genName;
403  for(UInt_t ilabel = 1; ilabel < nlabels; ilabel++)
404  {
405  Int_t label2 = cluster->GetLabels()[ilabel];
406  TString genName2;
407  //(GetReader()->GetMC())->GetCocktailGenerator(label2,genName2);
408  Int_t index2 = GetReader()->GetCocktailGeneratorAndIndex(label2, genName2);
409 
410  //if(genName2 != genName2Prev) noverlapsGen++;
411 
412  if(genName2 != genName)
413  {
414  //genName2Prev = genName2;
415 
416  if(!genNameBkg.Contains(genName2) && indexBkg != index2)
417  {
418  genNameBkg = Form("%s_%s",genNameBkg.Data(), genName2.Data());
419  indexBkg = index2;
420  }
421 
422  overlapGener = kTRUE;
423 
424  if( genName2.Contains("ijing") && !genName.Contains("ijing"))
425  overlapGenerHIJING = kTRUE;
426 
427  if(!genName2.Contains("ijing"))
428  overlapGenerOther = kTRUE;
429  }
430  }
431 
432  Int_t genBkgTag = -1;
433 
434  if ( !overlapGener ) genBkgTag = 0; // Pure
435  else if ( overlapGenerHIJING && !overlapGenerOther) genBkgTag = 1; // Gen+Hij
436  else if ( !overlapGenerHIJING && overlapGenerOther) genBkgTag = 2; // GenX+GenY
437  else if ( overlapGenerHIJING && overlapGenerOther) genBkgTag = 3; // GenX+GenY+Hij
438  else genBkgTag = 4;
439 
440  // check overlap with same generator, but not hijing
441  Int_t overpdg[nlabels];
442  Int_t overlab[nlabels];
443  Int_t noverlaps = GetMCAnalysisUtils()->GetNOverlaps(cluster->GetLabels(), nlabels,mctag,-1,GetReader(),overpdg,overlab);
444  Bool_t sameGenOverlap = kFALSE;
445  Bool_t sameGenOverlapHI = kFALSE;
446  for(Int_t iover = 0; iover < noverlaps; iover++)
447  {
448  TString genName2;
449  //(GetReader()->GetMC())->GetCocktailGenerator(overlab[iover],genName2);
450  Int_t index2 = GetReader()->GetCocktailGeneratorAndIndex(overlab[iover], genName2);
451 
452  if ( genName2==genName && index==index2)
453  {
454  if ( !genName.Contains("ijing") ) sameGenOverlap = kTRUE;
455  else sameGenOverlapHI = kTRUE;
456  }
457  }
458 
459  //printf("bkg tag %d, noverlaps %d; same gen overlap %d\n",genBkgTag,noverlaps,sameGenOverlap);
460  if(sameGenOverlap)
461  {
462  if(genBkgTag == 0) genBkgTag = 2; // GenX+GenX
463  if(genBkgTag == 1) genBkgTag = 3; // GenX+GenX+Hij
464  }
465 
466  // Logic a bit different for hijing main particles
467  if(genName.Contains("ijing"))
468  {
469 
470  if(sameGenOverlapHI)
471  {
472  if(!overlapGener) genBkgTag = 1; // Hij+Hij
473  else genBkgTag = 3; // Hij+Gen+Hij
474  }
475  else
476  {
477  if(!overlapGener) genBkgTag = 0; // Pure
478  else genBkgTag = 2; // Hij+Gen
479  }
480  }
481 
482  return genBkgTag;
483 }
484 
485 //_____________________________________________________________________
487 //_____________________________________________________________________
489 {
490  AliInfo(Form("Create AOD branch of %s objects and with name < %s >\n",
491  fOutputAODClassName.Data(),fOutputAODName.Data())) ;
492 
493  TClonesArray * aodBranch = new TClonesArray(fOutputAODClassName, 0);
494 
495  aodBranch->SetName(fOutputAODName);
496 
497  return aodBranch ;
498 }
499 
500 //________________________________________________________
502 //________________________________________________________
504 {
505  return fReader->GetEventNumber() ;
506 }
507 
508 //__________________________________________________________
510 //__________________________________________________________
512 {
513  return fReader->GetStack();
514 }
515 
516 //____________________________________________________________
518 //____________________________________________________________
520 {
521  return fReader->GetHeader();
522 }
523 
524 //____________________________________________________________________________
526 //____________________________________________________________________________
528 {
529  return fReader->GetGenEventHeader();
530 }
531 
532 //_________________________________________________________________
537 //_________________________________________________________________
539 {
540  //curCentrBin = (GetTrackMultiplicity()-1)/5;
541  //if(curCentrBin > GetNCentrBin()-1) curCentrBin=GetNCentrBin()-1;
542  Int_t trackMult = GetReader()->GetTrackMultiplicity();
543 
544  for(Int_t ibin = 0; ibin < GetNTrackMultBin()-1; ibin++)
545  {
546  if(trackMult >= fTrackMultBins[ibin] && trackMult < fTrackMultBins[ibin+1]) return ibin;
547  }
548 
549  AliWarning(Form("Bin not found for track multiplicity %d",trackMult));
550 
551  return -1;
552 }
553 
554 //________________________________________________________________
558 //________________________________________________________________
560 {
561  Int_t curCentrBin = 0;
562 
563  if(fUseTrackMultBins) // pp collisions
564  {
565  return GetTrackMultiplicityBin();
566  }
567  else // Set centrality based on centrality task, PbPb collisions
568  {
569  Float_t minCent = GetReader()->GetCentralityBin(0);
570  Float_t maxCent = GetReader()->GetCentralityBin(1);
571 
572  if((minCent< 0 && maxCent< 0) || minCent>=maxCent)
573  {
574  curCentrBin = GetEventCentrality() * GetNCentrBin() / GetReader()->GetCentralityOpt();
575  if(curCentrBin==GetNCentrBin())
576  {
577  curCentrBin = GetNCentrBin()-1;
578  AliDebug(1,Form("Centrality = %d, put it in last bin \n",GetEventCentrality()));
579  }
580  }
581  else
582  {
583  curCentrBin = (Int_t)((GetEventCentrality()-minCent) * GetNCentrBin() / (maxCent-minCent));
584  if(curCentrBin==GetNCentrBin()) curCentrBin = GetNCentrBin()-1;
585  }
586 
587  AliDebug(1,Form("Current CentrBin %d, centrality %d, n bins %d, max bin from centrality %d",
588  curCentrBin, GetEventCentrality(), GetNCentrBin(), GetReader()->GetCentralityOpt()));
589  }
590 
591  return curCentrBin;
592 }
593 
594 //_______________________________________________________
596 //_______________________________________________________
598 {
599  Int_t curRPBin = 0 ;
600 
601  if(GetNRPBin() > 1 && GetEventPlane())
602  {
603  Float_t epAngle = GetEventPlaneAngle();//->GetEventplane(GetEventPlaneMethod(),fReader->GetInputEvent());
604 
605  if(epAngle < 0 || epAngle >TMath::Pi())
606  {
607  AliWarning(Form("Wrong event plane angle : %f \n",epAngle));
608  return -1;
609  }
610 
611  curRPBin = TMath::Nint(epAngle*(GetNRPBin()-1)/TMath::Pi());
612  if(curRPBin >= GetNRPBin()) printf("RP Bin %d out of range %d",curRPBin,GetNRPBin());
613 
614  AliDebug(1,Form("Current RP bin %d, bin float %f, angle %f, n bins %d",
615  curRPBin,epAngle*(GetNRPBin()-1)/TMath::Pi(),epAngle,GetNRPBin()));
616  }
617 
618  return curRPBin ;
619 }
620 
621 //_______________________________________________________
624 //_______________________________________________________
626 {
627  Double_t v[3] = {0,0,0}; //vertex
628  GetReader()->GetVertex(v);
629 
630  Int_t curZvertBin = (Int_t)(0.5*GetNZvertBin()*(v[2]+GetZvertexCut())/GetZvertexCut());
631 
632  AliDebug(1,Form("AliAnaCaloTrackCorrBaseClass::GetEventVzBin() - %d, vz %2.2f, n bins %d",
633  curZvertBin, v[2], GetNZvertBin()));
634 
635  return curZvertBin;
636 }
637 
638 //________________________________________________________________________________________
640 //________________________________________________________________________________________
642 {
643  if(iCen<0 || iVz < 0 || iRP < 0)
644  return -1;
645  else
646  return iCen*GetNZvertBin()*GetNRPBin()+iVz*GetNRPBin()+iRP;
647 }
648 
649 //________________________________________________________
651 //________________________________________________________
653 {
654  //Get vertex z bin
655  Int_t iVz = GetEventVzBin();
656 
657  // centrality (PbPb) or tracks multiplicity (pp) bin
658  Int_t iCen = GetEventCentralityBin();
659 
660  // reaction plane bin (PbPb)
661  Int_t iRP = GetEventRPBin();
662 
663  Int_t eventBin = GetEventMixBin(iCen, iVz, iRP);
664 
665  AliDebug(1,Form("Bins : cent %d, vz %d, RP %d, event %d/%d",
666  iCen,iVz, iRP, eventBin, GetNZvertBin()*GetNRPBin()*GetNCentrBin()));
667 
668  return eventBin;
669 }
670 
671 //____________________________________________
674 //____________________________________________
676 {
677  if( fDebug >= 0 )
678  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(this->ClassName(),fDebug);
679 
680  if( GetMCAnalysisUtils()->GetDebug() >= 0 )
681  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(GetMCAnalysisUtils()->ClassName(),GetMCAnalysisUtils()->GetDebug());
682 
683  if( GetIsolationCut()->GetDebug() >= 0 )
684  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(GetIsolationCut()->ClassName(),GetIsolationCut()->GetDebug());
685 
686  if( GetNeutralMesonSelection()->GetDebug() >= 0 )
687  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(GetNeutralMesonSelection()->ClassName(),GetNeutralMesonSelection()->GetDebug());
688 
689  //printf("Debug levels: Ana %d, MC %d, Iso %d\n",fDebug,GetMCAnalysisUtils()->GetDebug(),GetIsolationCut()->GetDebug());
690 }
691 
692 //_________________________________________________
694 //_________________________________________________
696 {
697  fDataMC = kFALSE;
698  fDebug = 0;
699  fCheckCaloPID = kTRUE ;
700  fCheckFidCut = kFALSE ;
701  fCheckRealCaloAcc = kFALSE ;
702  fRecalculateCaloPID = kFALSE ;
703  fMinPt = 0.2 ; //Min pt in particle analysis
704  fMaxPt = 300. ; //Max pt in particle analysis
705  fNZvertBin = 1;
706  fNrpBin = 1;
707 
708  fCalorimeterString = "EMCAL";
709  fCalorimeter = kEMCAL ;
710 
711  fTrackMultBins[0] = 0; fTrackMultBins[1] = 5; fTrackMultBins[2] = 10;
712  fTrackMultBins[3] = 15; fTrackMultBins[4] = 20; fTrackMultBins[5] = 30;
713  fTrackMultBins[6] = 40; fTrackMultBins[7] = 55; fTrackMultBins[8] = 70;
714  for(Int_t ibin=9; ibin < 20; ibin++) fTrackMultBins[ibin] = 10000;
715 
716  //fReader = new AliCaloTrackReader(); //Initialized in maker
717  //fCaloUtils = new AliCalorimeterUtils();//Initialized in maker
718 
719  fNewAOD = kFALSE ;
720  fOutputAODName = "CaloTrackCorr";
721  fOutputAODClassName = "AliAODPWG4Particle";
722  fInputAODName = "CaloTrackCorr";
724  fAODObjArrayName = "Ref";
725 
726  fNCocktailGenNames = 7;
727  // Order matters, here cocktail of MC LHC14a1a
728  fCocktailGenNames[0] = ""; // First must be always empty
729  fCocktailGenNames[1] = "pi0EMC";
730  fCocktailGenNames[2] = "pi0";
731  fCocktailGenNames[3] = "etaEMC";
732  fCocktailGenNames[4] = "eta";
733  fCocktailGenNames[5] = "hijing";
734  fCocktailGenNames[6] = "other";
735 
736  for(Int_t igen = 7; igen < 10; igen++)
737  fCocktailGenNames[igen] = "";
738 
739  for(Int_t igen = 0; igen < 10; igen++)
740  fCocktailGenIndeces[igen] = -1;
741 }
742 
743 //__________________________________________________________________
745 //__________________________________________________________________
747 {
748  if(! opt)
749  return;
750 
751  printf("New AOD: = %d\n", fNewAOD);
752  printf("Input AOD name: = %s\n", fInputAODName.Data());
753  printf("Output AOD name: = %s\n", fOutputAODName.Data());
754  printf("Output AOD Class name: = %s\n", fOutputAODClassName.Data());
755  printf("Name of reference array : %s\n", fAODObjArrayName.Data());
756  printf("String added histograms name : %s\n", fAddToHistogramsName.Data());
757 
758  printf("Min Photon pT = %2.2f\n", fMinPt) ;
759  printf("Max Photon pT = %3.2f\n", fMaxPt) ;
760  printf("Check PID = %d\n", fCheckCaloPID) ;
761  printf("Recalculate PID = %d\n", fRecalculateCaloPID) ;
762  printf("Check Fiducial cut = %d\n", fCheckFidCut) ;
763  printf("Check Real Calo Acc = %d\n", fCheckRealCaloAcc) ;
764  printf("Check MC labels = %d\n", fDataMC);
765  printf("Make plots? = %d\n", fMakePlots);
766  printf("Debug Level = %d\n", fDebug);
767 
768  printf(" \n") ;
769 }
770 
771 //_______________________________________________________________
773 //_______________________________________________________________
775 {
776  fCalorimeterString = calo;
777 
778  if (calo=="EMCAL") fCalorimeter = kEMCAL;
779  else if(calo=="PHOS" ) fCalorimeter = kPHOS;
780  else if(calo=="CTS") fCalorimeter = kCTS;
781  else if(calo=="DCAL") fCalorimeter = kDCAL;
782  else if(calo.Contains("DCAL") && calo.Contains("PHOS")) fCalorimeter = kDCALPHOS;
783  else AliFatal(Form("Detector < %s > not known!", calo.Data()));
784 
785 }
786 
787 //_______________________________________________________________
789 //_______________________________________________________________
791 {
792  fCalorimeter = calo;
793 
794  if (calo==kEMCAL) fCalorimeterString = "EMCAL";
795  else if(calo==kPHOS ) fCalorimeterString = "PHOS";
796  else if(calo==kCTS) fCalorimeterString = "CTS";
797  else if(calo==kDCAL) fCalorimeterString = "DCAL";
798  else if(calo==kDCALPHOS) fCalorimeterString = "DCAL_PHOS";
799  else AliFatal(Form("Detector < %d > not known!", calo));
800 }
801 
802 
AliFiducialCut * fFidCut
Acceptance cuts detector dependent.
TString fOutputAODName
Name of output AOD branch.
virtual AliHeader * GetMCHeader() const
Int_t GetCocktailGeneratorBackgroundTag(AliVCluster *clus, Int_t mctag, TString &genName, Int_t &index, TString &genNameBkg, Int_t &indexBkg)
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 fCocktailGenIndeces[10]
Array with indeces of generators to study.
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
Int_t GetCocktailGeneratorAndIndex(Int_t index, TString &nameGen) const
Base class for CaloTrackCorr analysis algorithms.
int Int_t
Definition: External.C:63
Int_t GetTrackMultiplicity(Int_t cut=0) const
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:67
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.
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.
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