AliPhysics  97344c9 (97344c9)
 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 //_____________________________________________________________________
376 //_____________________________________________________________________
378  TString & genName , Int_t & index,
379  TString & genNameBkg, Int_t & indexBkg)
380 {
381  if(cluster->GetNLabels() == 0 || cluster->GetLabel() < 0 ) return -1;
382 
383  //(GetReader()->GetMC())->
384  index = GetReader()->GetCocktailGeneratorAndIndex(cluster->GetLabel(), genName);
385  //TString genNameOrg;
386  //(GetReader()->GetMC())->GetCocktailGenerator(cluster->GetLabel(), genNameOrg);
387 
388  //printf("Generator?: %s, index %d\n",genName.Data(), index);
389 
390  Bool_t overlapGener = kFALSE;
391  Bool_t overlapGenerHIJING = kFALSE;
392  Bool_t overlapGenerOther = kFALSE;
393 
394  genNameBkg = "";
395  indexBkg = -1;
396 
397  const UInt_t nlabels = cluster->GetNLabels();
398  //Int_t noverlapsGen = 0;
399  //TString genName2Prev = genName;
400  for(UInt_t ilabel = 1; ilabel < nlabels; ilabel++)
401  {
402  Int_t label2 = cluster->GetLabels()[ilabel];
403  TString genName2;
404  //(GetReader()->GetMC())->GetCocktailGenerator(label2,genName2);
405  Int_t index2 = GetReader()->GetCocktailGeneratorAndIndex(label2, genName2);
406 
407  //if(genName2 != genName2Prev) noverlapsGen++;
408 
409  if(genName2 != genName)
410  {
411  //genName2Prev = genName2;
412 
413  if(!genNameBkg.Contains(genName2) && indexBkg != index2)
414  {
415  genNameBkg = Form("%s_%s",genNameBkg.Data(), genName2.Data());
416  indexBkg = index2;
417  }
418 
419  overlapGener = kTRUE;
420 
421  if( genName2.Contains("ijing") && !genName.Contains("ijing"))
422  overlapGenerHIJING = kTRUE;
423 
424  if(!genName2.Contains("ijing"))
425  overlapGenerOther = kTRUE;
426  }
427  }
428 
429  Int_t genBkgTag = -1;
430 
431  if ( !overlapGener ) genBkgTag = 0; // Pure
432  else if ( overlapGenerHIJING && !overlapGenerOther) genBkgTag = 1; // Gen+Hij
433  else if ( !overlapGenerHIJING && overlapGenerOther) genBkgTag = 2; // GenX+GenY
434  else if ( overlapGenerHIJING && overlapGenerOther) genBkgTag = 3; // GenX+GenY+Hij
435  else genBkgTag = 4;
436 
437  // check overlap with same generator, but not hijing
438  Int_t overpdg[nlabels];
439  Int_t overlab[nlabels];
440  Int_t noverlaps = GetMCAnalysisUtils()->GetNOverlaps(cluster->GetLabels(), nlabels,mctag,-1,GetReader(),overpdg,overlab);
441  Bool_t sameGenOverlap = kFALSE;
442  Bool_t sameGenOverlapHI = kFALSE;
443  for(Int_t iover = 0; iover < noverlaps; iover++)
444  {
445  TString genName2;
446  //(GetReader()->GetMC())->GetCocktailGenerator(overlab[iover],genName2);
447  Int_t index2 = GetReader()->GetCocktailGeneratorAndIndex(overlab[iover], genName2);
448 
449  if ( genName2==genName && index==index2)
450  {
451  if ( !genName.Contains("ijing") ) sameGenOverlap = kTRUE;
452  else sameGenOverlapHI = kTRUE;
453  }
454  }
455 
456  //printf("bkg tag %d, noverlaps %d; same gen overlap %d\n",genBkgTag,noverlaps,sameGenOverlap);
457  if(sameGenOverlap)
458  {
459  if(genBkgTag == 0) genBkgTag = 2; // GenX+GenX
460  if(genBkgTag == 1) genBkgTag = 3; // GenX+GenX+Hij
461  }
462 
463  // Logic a bit different for hijing main particles
464  if(genName.Contains("ijing"))
465  {
466 
467  if(sameGenOverlapHI)
468  {
469  if(!overlapGener) genBkgTag = 1; // Hij+Hij
470  else genBkgTag = 3; // Hij+Gen+Hij
471  }
472  else
473  {
474  if(!overlapGener) genBkgTag = 0; // Pure
475  else genBkgTag = 2; // Hij+Gen
476  }
477  }
478 
479  return genBkgTag;
480 }
481 
482 //_____________________________________________________________________
484 //_____________________________________________________________________
486 {
487  AliInfo(Form("Create AOD branch of %s objects and with name < %s >\n",
488  fOutputAODClassName.Data(),fOutputAODName.Data())) ;
489 
490  TClonesArray * aodBranch = new TClonesArray(fOutputAODClassName, 0);
491 
492  aodBranch->SetName(fOutputAODName);
493 
494  return aodBranch ;
495 }
496 
497 //________________________________________________________
499 //________________________________________________________
501 {
502  return fReader->GetEventNumber() ;
503 }
504 
505 //__________________________________________________________
507 //__________________________________________________________
509 {
510  return fReader->GetStack();
511 }
512 
513 //____________________________________________________________
515 //____________________________________________________________
517 {
518  return fReader->GetHeader();
519 }
520 
521 //____________________________________________________________________________
523 //____________________________________________________________________________
525 {
526  return fReader->GetGenEventHeader();
527 }
528 
529 //_________________________________________________________________
534 //_________________________________________________________________
536 {
537  //curCentrBin = (GetTrackMultiplicity()-1)/5;
538  //if(curCentrBin > GetNCentrBin()-1) curCentrBin=GetNCentrBin()-1;
539  Int_t trackMult = GetReader()->GetTrackMultiplicity();
540 
541  for(Int_t ibin = 0; ibin < GetNTrackMultBin()-1; ibin++)
542  {
543  if(trackMult >= fTrackMultBins[ibin] && trackMult < fTrackMultBins[ibin+1]) return ibin;
544  }
545 
546  AliWarning(Form("Bin not found for track multiplicity %d",trackMult));
547 
548  return -1;
549 }
550 
551 //________________________________________________________________
555 //________________________________________________________________
557 {
558  Int_t curCentrBin = 0;
559 
560  if(fUseTrackMultBins) // pp collisions
561  {
562  return GetTrackMultiplicityBin();
563  }
564  else // Set centrality based on centrality task, PbPb collisions
565  {
566  Float_t minCent = GetReader()->GetCentralityBin(0);
567  Float_t maxCent = GetReader()->GetCentralityBin(1);
568 
569  if((minCent< 0 && maxCent< 0) || minCent>=maxCent)
570  {
571  curCentrBin = GetEventCentrality() * GetNCentrBin() / GetReader()->GetCentralityOpt();
572  if(curCentrBin==GetNCentrBin())
573  {
574  curCentrBin = GetNCentrBin()-1;
575  AliDebug(1,Form("Centrality = %d, put it in last bin \n",GetEventCentrality()));
576  }
577  }
578  else
579  {
580  curCentrBin = (Int_t)((GetEventCentrality()-minCent) * GetNCentrBin() / (maxCent-minCent));
581  if(curCentrBin==GetNCentrBin()) curCentrBin = GetNCentrBin()-1;
582  }
583 
584  AliDebug(1,Form("Current CentrBin %d, centrality %d, n bins %d, max bin from centrality %d",
585  curCentrBin, GetEventCentrality(), GetNCentrBin(), GetReader()->GetCentralityOpt()));
586  }
587 
588  return curCentrBin;
589 }
590 
591 //_______________________________________________________
593 //_______________________________________________________
595 {
596  Int_t curRPBin = 0 ;
597 
598  if(GetNRPBin() > 1 && GetEventPlane())
599  {
600  Float_t epAngle = GetEventPlaneAngle();//->GetEventplane(GetEventPlaneMethod(),fReader->GetInputEvent());
601 
602  if(epAngle < 0 || epAngle >TMath::Pi())
603  {
604  AliWarning(Form("Wrong event plane angle : %f \n",epAngle));
605  return -1;
606  }
607 
608  curRPBin = TMath::Nint(epAngle*(GetNRPBin()-1)/TMath::Pi());
609  if(curRPBin >= GetNRPBin()) printf("RP Bin %d out of range %d",curRPBin,GetNRPBin());
610 
611  AliDebug(1,Form("Current RP bin %d, bin float %f, angle %f, n bins %d",
612  curRPBin,epAngle*(GetNRPBin()-1)/TMath::Pi(),epAngle,GetNRPBin()));
613  }
614 
615  return curRPBin ;
616 }
617 
618 //_______________________________________________________
621 //_______________________________________________________
623 {
624  Double_t v[3] = {0,0,0}; //vertex
625  GetReader()->GetVertex(v);
626 
627  Int_t curZvertBin = (Int_t)(0.5*GetNZvertBin()*(v[2]+GetZvertexCut())/GetZvertexCut());
628 
629  AliDebug(1,Form("AliAnaCaloTrackCorrBaseClass::GetEventVzBin() - %d, vz %2.2f, n bins %d",
630  curZvertBin, v[2], GetNZvertBin()));
631 
632  return curZvertBin;
633 }
634 
635 //________________________________________________________________________________________
637 //________________________________________________________________________________________
639 {
640  if(iCen<0 || iVz < 0 || iRP < 0)
641  return -1;
642  else
643  return iCen*GetNZvertBin()*GetNRPBin()+iVz*GetNRPBin()+iRP;
644 }
645 
646 //________________________________________________________
648 //________________________________________________________
650 {
651  //Get vertex z bin
652  Int_t iVz = GetEventVzBin();
653 
654  // centrality (PbPb) or tracks multiplicity (pp) bin
655  Int_t iCen = GetEventCentralityBin();
656 
657  // reaction plane bin (PbPb)
658  Int_t iRP = GetEventRPBin();
659 
660  Int_t eventBin = GetEventMixBin(iCen, iVz, iRP);
661 
662  AliDebug(1,Form("Bins : cent %d, vz %d, RP %d, event %d/%d",
663  iCen,iVz, iRP, eventBin, GetNZvertBin()*GetNRPBin()*GetNCentrBin()));
664 
665  return eventBin;
666 }
667 
668 //____________________________________________
671 //____________________________________________
673 {
674  if( fDebug >= 0 )
675  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(this->ClassName(),fDebug);
676 
677  if( GetMCAnalysisUtils()->GetDebug() >= 0 )
678  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(GetMCAnalysisUtils()->ClassName(),GetMCAnalysisUtils()->GetDebug());
679 
680  if( GetIsolationCut()->GetDebug() >= 0 )
681  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(GetIsolationCut()->ClassName(),GetIsolationCut()->GetDebug());
682 
683  if( GetNeutralMesonSelection()->GetDebug() >= 0 )
684  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(GetNeutralMesonSelection()->ClassName(),GetNeutralMesonSelection()->GetDebug());
685 
686  //printf("Debug levels: Ana %d, MC %d, Iso %d\n",fDebug,GetMCAnalysisUtils()->GetDebug(),GetIsolationCut()->GetDebug());
687 }
688 
689 //_________________________________________________
691 //_________________________________________________
693 {
694  fDataMC = kFALSE;
695  fDebug = 0;
696  fCheckCaloPID = kTRUE ;
697  fCheckFidCut = kFALSE ;
698  fCheckRealCaloAcc = kFALSE ;
699  fRecalculateCaloPID = kFALSE ;
700  fMinPt = 0.2 ; //Min pt in particle analysis
701  fMaxPt = 300. ; //Max pt in particle analysis
702  fNZvertBin = 1;
703  fNrpBin = 1;
704 
705  fCalorimeterString = "EMCAL";
706  fCalorimeter = kEMCAL ;
707 
708  fTrackMultBins[0] = 0; fTrackMultBins[1] = 5; fTrackMultBins[2] = 10;
709  fTrackMultBins[3] = 15; fTrackMultBins[4] = 20; fTrackMultBins[5] = 30;
710  fTrackMultBins[6] = 40; fTrackMultBins[7] = 55; fTrackMultBins[8] = 70;
711  for(Int_t ibin=9; ibin < 20; ibin++) fTrackMultBins[ibin] = 10000;
712 
713  //fReader = new AliCaloTrackReader(); //Initialized in maker
714  //fCaloUtils = new AliCalorimeterUtils();//Initialized in maker
715 
716  fNewAOD = kFALSE ;
717  fOutputAODName = "CaloTrackCorr";
718  fOutputAODClassName = "AliAODPWG4Particle";
719  fInputAODName = "CaloTrackCorr";
721  fAODObjArrayName = "Ref";
722 
723  fNCocktailGenNames = 7;
724  // Order matters, here cocktail of MC LHC14a1a
725  fCocktailGenNames[0] = ""; // First must be always empty
726  fCocktailGenNames[1] = "pi0EMC";
727  fCocktailGenNames[2] = "pi0";
728  fCocktailGenNames[3] = "etaEMC";
729  fCocktailGenNames[4] = "eta";
730  fCocktailGenNames[5] = "hijing";
731  fCocktailGenNames[6] = "other";
732 
733  for(Int_t igen = 7; igen < 10; igen++)
734  fCocktailGenNames[igen] = "";
735 
736  for(Int_t igen = 0; igen < 10; igen++)
737  fCocktailGenIndeces[igen] = -1;
738 }
739 
740 //__________________________________________________________________
742 //__________________________________________________________________
744 {
745  if(! opt)
746  return;
747 
748  printf("New AOD: = %d\n", fNewAOD);
749  printf("Input AOD name: = %s\n", fInputAODName.Data());
750  printf("Output AOD name: = %s\n", fOutputAODName.Data());
751  printf("Output AOD Class name: = %s\n", fOutputAODClassName.Data());
752  printf("Name of reference array : %s\n", fAODObjArrayName.Data());
753  printf("String added histograms name : %s\n", fAddToHistogramsName.Data());
754 
755  printf("Min Photon pT = %2.2f\n", fMinPt) ;
756  printf("Max Photon pT = %3.2f\n", fMaxPt) ;
757  printf("Check PID = %d\n", fCheckCaloPID) ;
758  printf("Recalculate PID = %d\n", fRecalculateCaloPID) ;
759  printf("Check Fiducial cut = %d\n", fCheckFidCut) ;
760  printf("Check Real Calo Acc = %d\n", fCheckRealCaloAcc) ;
761  printf("Check MC labels = %d\n", fDataMC);
762  printf("Make plots? = %d\n", fMakePlots);
763  printf("Debug Level = %d\n", fDebug);
764 
765  printf(" \n") ;
766 }
767 
768 //_______________________________________________________________
770 //_______________________________________________________________
772 {
773  fCalorimeterString = calo;
774 
775  if (calo=="EMCAL") fCalorimeter = kEMCAL;
776  else if(calo=="PHOS" ) fCalorimeter = kPHOS;
777  else if(calo=="CTS") fCalorimeter = kCTS;
778  else if(calo=="DCAL") fCalorimeter = kDCAL;
779  else if(calo.Contains("DCAL") && calo.Contains("PHOS")) fCalorimeter = kDCALPHOS;
780  else AliFatal(Form("Detector < %s > not known!", calo.Data()));
781 
782 }
783 
784 //_______________________________________________________________
786 //_______________________________________________________________
788 {
789  fCalorimeter = calo;
790 
791  if (calo==kEMCAL) fCalorimeterString = "EMCAL";
792  else if(calo==kPHOS ) fCalorimeterString = "PHOS";
793  else if(calo==kCTS) fCalorimeterString = "CTS";
794  else if(calo==kDCAL) fCalorimeterString = "DCAL";
795  else if(calo==kDCALPHOS) fCalorimeterString = "DCAL_PHOS";
796  else AliFatal(Form("Detector < %d > not known!", calo));
797 }
798 
799 
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
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.
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