AliPhysics  0e0bd91 (0e0bd91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AddTaskIsoPhoton.C
Go to the documentation of this file.
1 
11 TString kAnaIsoPhotonName = "";
12 
13 Int_t kDebug = -1;
14 
15 TString kCalorimeter = "EMCAL";
16 TString kData = "" ;
17 Bool_t kPrint = 0 ;
18 
52  const Float_t pth = 2.,
53  const Bool_t leading = kFALSE,
54  const Bool_t timecut = kFALSE,
55  const TString calorimeter = "EMCAL",
56  const Bool_t simu = kFALSE,
57  const Bool_t exotic = kTRUE,
58  const Bool_t nonlin = kFALSE,
59  const TString trigger = "EMC7",
60  const Bool_t tm = kTRUE,
61  const Int_t minCen = -1,
62  const Int_t maxCen = -1,
63  const Float_t deltaphicut = 0.03,
64  const Float_t deltaetacut = 0.02,
65  const Float_t tmin = -30.,
66  const Float_t tmax = 30.,
67  const Bool_t trackTcut = kFALSE,
68  const Int_t disttobad = 2,
69  const Int_t nlmMax = 20,
70  const Bool_t qaan = kFALSE,
71  const Bool_t primvtx = kTRUE,
72  const Bool_t notrackcut = kTRUE,
73  const Bool_t rdmtrigger = kFALSE,
74  const TString tag = "",
75  const Int_t debug = -1,
76  const Bool_t print = kFALSE,
77  const Bool_t tmInCone = kTRUE
78  )
79 {
80 kDebug = debug;
82 kPrint = print ;
83 
84  printf("AddTaskIsoPhoton() - Settings: cone %2.2f, pth %2.2f, timeCut On %d, NLM max cut %d, calorimeter %s, simu %d, exotic %d, non lin %d, trigger %s, TM %d, qa %d, debug %d, centrality %d-%d\n",
85  cone, pth, timecut , nlmMax, calorimeter.Data(),simu, exotic, nonlin, trigger.Data(), tm, qaan, debug, minCen, maxCen );
86 
87  // Get the pointer to the existing analysis manager via the static access method.
88 
89  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
90  if (!mgr)
91  {
92  ::Error("AddTask", "No analysis manager to connect to.");
93  return NULL;
94  }
95 
96  // Check the analysis type using the event handlers connected to the analysis manager.
97 
98  if (!mgr->GetInputEventHandler())
99  {
100  ::Error("AddTask", "This task requires an input event handler");
101  return NULL;
102  }
103 
104  // Make sure the B field is enabled for track selection, some cuts need it
105  ((AliInputEventHandler*)mgr->GetInputEventHandler())->SetNeedField(kTRUE);
106 
107  Bool_t useKinematics = kFALSE;
108  useKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
109 
110  // Name for containers
111 
112  if(tag!="")
113  kAnaIsoPhotonName = Form("%s_Trig%s_TM%d_%1.3f_dB%d_R%1.1f_Pt%1.1f_%s",calorimeter.Data(), trigger.Data(),tm,deltaphicut,disttobad,cone,pth,tag.Data());
114  else
115  kAnaIsoPhotonName = Form("%s_Trig%s_TM%d_%1.3f_dB%d_R%1.1f_Pt%1.1f",calorimeter.Data(), trigger.Data(),tm,deltaphicut,disttobad,cone,pth);
116 
117  if(maxCen>=0) kAnaIsoPhotonName+=Form("Cen%d_%d",minCen,maxCen);
118 
119  printf("<<<< NAME: %s >>>>>\n",kAnaIsoPhotonName.Data());
120 
121  // #### Configure analysis ####
122 
124 
125  //maker->SetScaleFactor(scaleFactor); // for MC, negative (not scaled) by default
126 
127  // General frame setting and configuration
128  maker->SetReader (ConfigureReader (mgr->GetInputEventHandler()->GetDataType(),useKinematics,simu,
129  calorimeter,nonlin, timecut, primvtx, notrackcut,tmin,tmax,trackTcut,minCen, maxCen, debug,print));
130  maker->SetCaloUtils(ConfigureCaloUtils(nonlin,exotic,simu,timecut,debug,print));
131 
132  // Analysis tasks setting and configuration
133  Int_t n = 0;//Analysis number, order is important
134 
135  // Isolation settings
136  Int_t partInCone = AliIsolationCut::kNeutralAndCharged; // kOnlyCharged;
137  // Int_t thresType = AliIsolationCut::kPtThresIC;// AliIsolationCut::kSumPtFracIC ;
138  Int_t thresType = AliIsolationCut::kSumPtIC ;
139 
140  if(!rdmtrigger)
141 {
142  // Photon analysis
143  maker->AddAnalysis(ConfigurePhotonAnalysis(calorimeter,tm,deltaphicut,deltaetacut,disttobad,nlmMax,simu,debug,print), n++); // Photon cluster selection
144 
145  // Isolation analysis
146  maker->AddAnalysis(ConfigureIsolationAnalysis(calorimeter,"Photon", partInCone,thresType,cone, pth,tm,leading,kFALSE,simu,debug,print,tmInCone), n++); // Photon isolation
147 }
148 else
149 {
150  maker->AddAnalysis(ConfigureRandomTriggerAnalysis(), n++);
151  maker->AddAnalysis(ConfigureIsolationAnalysis(calorimeter,Form("RandomTrigger%s",kCalorimeter.Data()), partInCone,thresType,cone, pth,tm,leading,kFALSE,simu,debug,print,tmInCone), n++);// Ghost trigger isolation
152 }
153 
154 
155  // QA histograms on clusters or tracks
156  if(qaan)
157  {
158  maker->AddAnalysis(ConfigureQAAnalysis(calorimeter,simu,debug,print),n++);
159  maker->AddAnalysis(ConfigureChargedAnalysis(simu,debug), n++); // charged tracks plots
160  }
161 
162  maker->SetAnaDebug(debug) ;
163  maker->SwitchOnHistogramsMaker() ;
164  maker->SwitchOnAODsMaker() ;
165 
166  if(print) maker->Print("");
167 
168  maker->SwitchOffDataControlHistograms();
169 
170  printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, calorimeter.Data());
171 
172  // Create task
173 
174  AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("CaloTrackCorr%s",kAnaIsoPhotonName.Data()));
175  task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
176  task->SetDebugLevel(debug);
177  task->SetBranches("ESD:AliESDRun.,AliESDHeader");
178  task->SetAnalysisMaker(maker);
179  mgr->AddTask(task);
180 
181  //Create containers
182 
183  TString outputfile = AliAnalysisManager::GetCommonFileName();
184 
185  AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(kAnaIsoPhotonName, TList::Class(),
186  AliAnalysisManager::kOutputContainer,
187  Form("%s",outputfile.Data()));
188 
189  AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Param_%s",kAnaIsoPhotonName.Data()), TList::Class(),
190  AliAnalysisManager::kParamContainer,
191  "AnalysisParameters.root");
192 
193  // Create ONLY the output containers for the data produced by the task.
194  // Get and connect other common input/output containers via the manager as below
195  //==============================================================================
196  mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
197  // AOD output slot will be used in a different way in future
198  mgr->ConnectOutput (task, 1, cout_pc);
199  mgr->ConnectOutput (task, 2, cout_cuts);
200 
201  // Set the trigger selection
202  UInt_t mask = SetTriggerMaskFromName(trigger);
203  task->SelectCollisionCandidates(mask);
204 
205  return task;
206 }
207 
211 AliCaloTrackReader * ConfigureReader(TString inputDataType = "AOD", Bool_t useKinematics = kFALSE, Bool_t simu = kFALSE,
212  TString calorimeter = "EMCAL", Bool_t nonlin = kTRUE, Bool_t timecut = kFALSE,
213  Bool_t primvtx = kFALSE, Bool_t notrackcut = kFALSE, Float_t tmin, Float_t tmax,
214  Bool_t trackTcut = kFALSE, Float_t minCen = -1, Float_t maxCen = -1,
215  Int_t debug = -1, Bool_t print = kFALSE)
216 {
217  if(simu)
218  {
219  if (!useKinematics && inputDataType=="AOD") useKinematics = kTRUE; //AOD primary should be available ...
220  }
221 
222  cout<<"********* ACCESS KINE? "<<useKinematics<< endl;
223 
224  AliCaloTrackReader * reader = 0;
225  if (inputDataType=="AOD") reader = new AliCaloTrackAODReader();
226  else if(inputDataType=="ESD") reader = new AliCaloTrackESDReader();
227  else printf("AliCaloTrackReader::ConfigureReader() - Data not known inputData=%s\n",inputDataType.Data());
228 
229  reader->SetDebug(debug);//10 for lots of messages
230 
233 
234  reader->SwitchOffWriteDeltaAOD() ;
235 
236  // MC settings
237  if(useKinematics)
238  {
239  if(inputDataType == "ESD")
240  {
241  reader->SwitchOnStack();
242  reader->SwitchOffAODMCParticles();
243  }
244  else if(inputDataType == "AOD")
245  {
246  reader->SwitchOffStack();
247  reader->SwitchOnAODMCParticles();
248  }
249  }
250 
251  //------------------------
252  // Detector input filling
253  //------------------------
254 
255  //Min cluster/track E
256  reader->SetEMCALEMin(0.3);
257  reader->SetEMCALEMax(1000);
258  reader->SetPHOSEMin(0.3);
259  reader->SetPHOSEMax(1000);
260  reader->SetCTSPtMin(0.2);
261  reader->SetCTSPtMax(1000);
262 
263  // Time cuts
264  if(simu)
265  {
266  reader->SwitchOffUseTrackTimeCut();
268  reader->SwitchOffUseEMCALTimeCut();
269  reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
270  }
271  else
272  {
274 
275  if(timecut)
276  {
277  printf("Set time cut \n");
278  reader->SwitchOnUseEMCALTimeCut();
279  //Absolute window
280  reader->SetEMCALTimeCut(tmin,tmax); // default is -25ns-20ns
281  }
282  else
283  {
284  printf("Off time cuts time cut \n");
285  reader->SwitchOffUseEMCALTimeCut();
286  //Absolute window
287  reader->SetEMCALTimeCut(-1.e6,1.e6);
288  }
289  }
290 
291  reader->SwitchOffFiducialCut();
292  reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
293 
294  // Tracks
295  reader->SwitchOnCTS();
296 
297 
300 
301 if(trackTcut)
302  reader->SwitchOnUseTrackTimeCut();
303 else
304  reader->SwitchOffUseTrackTimeCut();
305 
306  reader->SetTrackTimeCut(0,50);
307 
308  reader->SwitchOffUseTrackDCACut();
309  //reader->SetTrackDCACut(0,0.0105);
310  //reader->SetTrackDCACut(1,0.035);
311  //reader->SetTrackDCACut(2,1.1);
312 
313  if(inputDataType=="ESD")
314  {
315  gROOT->LoadMacro("$ALICE_PHYSICS/PWGJE/macros/CreateTrackCutsPWGJE.C");
316  //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
317  //reader->SetTrackCuts(esdTrackCuts);
318  //reader->SwitchOnConstrainTrackToVertex();
319 
320 // if(kYears>2010)
321 // {
322  //Hybrids 2011
323  AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
324  reader->SetTrackCuts(esdTrackCuts);
325  AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
326  reader->SetTrackComplementaryCuts(esdTrackCuts2);
327 // }
328 // else
329 // {
330 // //Hybrids 2010
331 // AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001006);
332 // reader->SetTrackCuts(esdTrackCuts);
333 // AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10041006);
334 // reader->SetTrackComplementaryCuts(esdTrackCuts2);
335 // }
336  }
337  else if(inputDataType=="AOD")
338  {
339  //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid
340  reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
341  reader->SetTrackStatus(AliVTrack::kITSrefit);
342  //reader->SwitchOnTrackHitSPDSelection(); // Check that the track has at least a hit on the SPD, not much sense to use for hybrid or TPC only tracks
343  }
344 
345  // Calorimeter
346 
348 
349 
350  // CAREFUL
351  if(!nonlin) reader->SwitchOffClusterELinearityCorrection();
353 
354  if(calorimeter == "EMCAL") {
355  reader->SwitchOnEMCALCells();
356  reader->SwitchOnEMCAL();
357  }
358  if(calorimeter == "PHOS") { // Should be on if QA is activated with correlation on
359  reader->SwitchOffPHOSCells();
360  reader->SwitchOffPHOS();
361  }
362 
363  //-----------------
364  // Event selection
365  //-----------------
366 
367  //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
368 
369  // reader->RejectFastClusterEvents() ;
370 
371  reader->SwitchOnEventTriggerAtSE();
372 
373  reader->SetZvertexCut(10.); // Open cut
374  if(primvtx)
375  reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
376  else
378  if(notrackcut)
379  reader->SwitchOnRejectNoTrackEvents();
380  else
382 
383  reader->SwitchOffPileUpEventRejection(); // remove pileup
384  reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
385 
386  if(maxCen > 0 )
387  {
388  // Centrality
389  reader->SetCentralityClass("V0M");
390  reader->SetCentralityOpt(100); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
391  reader->SetCentralityBin(minCen,maxCen); // Accept all events, if not select range
392 
393  // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
394  reader->SetEventPlaneMethod("V0");
395  }
396 
397  if(print) reader->Print("");
398 
399  return reader;
400 }
401 
405 AliCalorimeterUtils* ConfigureCaloUtils(Bool_t nonlin = kTRUE, Bool_t exotic = kTRUE ,Bool_t simu = kFALSE, Bool_t timecut = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
406 {
408  cu->SetDebug(debug);
409 
410  // Remove clusters close to borders, at least max energy cell is 1 cell away
411  cu->SetNumberOfCellsFromEMCALBorder(0);//this was originally set to one
413 
415 
417 
418  //EMCAL settings
419 
420  if(simu)
422 
423  /* AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
424 
425  cu->SwitchOffRecalibration();
426  cu->SwitchOffRunDepCorrection();
427 
428  gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/EMCAL/macros/ConfigureEMCALRecoUtils.C");
429  ConfigureEMCALRecoUtils(recou,
430  simu,
431  exotic,
432  nonlin,
433  kFALSE, // e calib
434  kFALSE, // bad map
435  kFALSE); // time calib
436  if(timecut) recou->SetExoticCellDiffTimeCut(50.);
437  */
438  if( nonlin)
439  {
440  printf("ConfigureCaloUtils() - Apply non linearity to EMCAL\n");
442  }
443  /*
444  printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
445  printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
446  */
448 
449  if(print) cu->Print("");
450 
451  return cu;
452 }
453 
458 AliAnaPhoton* ConfigurePhotonAnalysis(TString calorimeter = "EMCAL", Bool_t tm = kFALSE, Float_t deltaphicut = 0.02, Float_t deltaetacut = 0.03,Int_t disttobad=0,Int_t nlmMax = 2, Bool_t simu = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
459 {
460  AliAnaPhoton *ana = new AliAnaPhoton();
461  ana->SetDebug(debug); //10 for lots of messages
462 
463  // cluster selection cuts
464 
465  ana->SwitchOffFiducialCut();
466 
468 
469  if(calorimeter == "PHOS")
470  {
471  ana->SetNCellCut(2);// At least 3 cells
472  ana->SetMinPt(0.3);
473  ana->SetMinDistanceToBadChannel(2, 4, 5);
474  ana->SetTimeCut(-1e10,1e10); // open cut
475  }
476  else
477  {//EMCAL
478  ana->SetNCellCut(1);// At least 2 cells
479  ana->SetMinEnergy(0.3); // avoid mip peak at E = 260 MeV
480  ana->SetMaxEnergy(1000);
481  // ana->SetTimeCut(-1e10,1e10); // open cut, usual time window of [425-825] ns if time recalibration is off
482  // restrict to less than 100 ns when time calibration is on
483  ana->SetMinDistanceToBadChannel(disttobad, 4, 6);
484 
485  // NLM cut, used in all, exclude clusters with more than 2 maxima
486  // Not needed if M02 cut is already strong or clusterizer V2
487  ana->SetNLMCut(1, nlmMax) ;
488  }
489 
490  if(tm)
491  {
493  ana->SwitchOffTMHistoFill() ;
494  }
495  else
496  {
498  ana->SwitchOnTMHistoFill() ;
499  }
500 
501  //PID cuts (shower shape)
502  ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
503  AliCaloPID* caloPID = ana->GetCaloPID();
504  //Not used in bayesian
505 
506  //EMCAL
507  caloPID->SetEMCALLambda0CutMax(1000.);
508  caloPID->SetEMCALLambda0CutMin(0.);
509 
510  // caloPID->SetEMCALDEtaCut(0.025);
511  // caloPID->SetEMCALDPhiCut(0.030);
512  caloPID->SetEMCALDEtaCut(deltaetacut);
513  caloPID->SetEMCALDPhiCut(deltaphicut);
514 
515  ana->SwitchOnFillShowerShapeHistograms(); // Filled before photon shower shape selection
516  if(!simu) ana->SwitchOnFillPileUpHistograms();
517 
518  // Input / output delta AOD settings
519 
520  ana->SetOutputAODName(Form("Photon%s",kAnaIsoPhotonName.Data()));
521  ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
522 
523  //Set Histograms name tag, bins and ranges
524 
525  ana->AddToHistogramsName(Form("AnaPhoton_TM%d_",tm));
526  SetHistoRangeAndNBins(ana->GetHistogramRanges(), calorimeter); // see method below
527 
528  // Number of particle type MC histograms
529  ana->FillNOriginHistograms(20);
530  ana->FillNPrimaryHistograms(20);
531 
532  ConfigureMC(ana,simu);
533 
534  if(print) ana->Print("");
535 
536  return ana;
537 }
538 
543  TString particle="Photon",
544  Int_t partInCone = AliIsolationCut::kOnlyCharged,
545  Int_t thresType = AliIsolationCut::kSumPtFracIC,
546  Float_t cone = 0.3,
547  Float_t pth = 0.3,
548  Bool_t tm = kFALSE,
549  Bool_t leading = kTRUE,
550  Bool_t multi = kFALSE, Bool_t simu = kFALSE,
551  Int_t debug = -1, Bool_t print = kFALSE,
552  Bool_t tmInCone = kTRUE )
553 {
555  ana->SetDebug(debug);
556 
557  ana->SwitchOnFiducialCut();
558  //Avoid borders of EMCal
559  if(calorimeter=="EMCAL")
560  {
561  //ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
562  ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.27, 103, 157) ;
563  }
564 
565  ana->SetMinPt(5);
566 
567  // Input / output delta AOD settings
568 
569  ana->SetInputAODName(Form("%s%s",particle.Data(),kAnaIsoPhotonName.Data()));
570  ana->SetAODObjArrayName(Form("IC%s_%s",particle.Data(),kAnaIsoPhotonName.Data()));
571 
573 
574  if(!tm) ana->SwitchOnTMHistoFill();
575  else ana->SwitchOffTMHistoFill();
576  // ana->SwitchOnTMHistoFill();
577 
578  // ana->SwitchOffSSHistoFill();
579  // if(!kSimulation) ana->SwitchOnFillPileUpHistograms();
580  ana->SwitchOnSSHistoFill();
581  if(leading) ana->SwitchOnLeadingOnly();
582  else ana->SwitchOffLeadingOnly();
583  if(!simu) ana->SwitchOnFillPileUpHistograms();
584 
585  //Do settings for main isolation cut class
586  AliIsolationCut * ic = ana->GetIsolationCut();
587  ic->SetDebug(debug);
588 
589  printf("\t *** Set: R = %2.2f, Threshold %2.2f, Method %d, Neutral/Charged option %d ***\n",cone,pth,thresType,partInCone);
590 
591  //Main parameters
592  //****
593  ic->SetConeSize(cone);
594 
595  ic->SetPtFraction (0.1);
596  ic->SetPtThreshold (pth);
597  ic->SetSumPtThreshold(pth);
598 
599  ic->SetParticleTypeInCone(partInCone);
600 
601  ic->SetICMethod(thresType);
602 
604  //****
605 
606  //Do or not do isolation with previously produced AODs.
607  //No effect if use of SwitchOnSeveralIsolation()
608  ana->SwitchOffReIsolation();
609 
610  //Multiple IC
611  if(multi)
612  {
613  ic->SetConeSize(1.); // Take all for first iteration
614  ic->SetPtThreshold(100);// Take all for first iteration
615  ana->SwitchOnSeveralIsolation() ;
616  ana->SetAODObjArrayName(Form("MultiIC%sTM%d",particle.Data(),tm));
617 
618  ana->SetNCones(4);
619  ana->SetNPtThresFrac(4);
620  ana->SetConeSizes(0,0.3); ana->SetConeSizes(1,0.4);
621  ana->SetConeSizes(2,0.5); ana->SetConeSizes(3,0.6);
622  ana->SetPtThresholds(0, 0.5); ana->SetPtThresholds(1, 1); ana->SetPtThresholds(2, 2);
623  ana->SetPtFractions (0, 0.05) ; ana->SetPtFractions (1, 0.1); ana->SetPtFractions (2, 0.2) ; ana->SetPtFractions (3, 0.3) ;
624  ana->SetSumPtThresholds(0, 1) ; ana->SetSumPtThresholds(1, 3) ; ana->SetSumPtThresholds(2, 5); ana->SetSumPtThresholds(3, 7) ;
625 
626  ana->SwitchOffTMHistoFill();
627  ana->SwitchOffSSHistoFill();
628  }
629  else
631 
632  AliCaloPID* caloPID = ana->GetCaloPID();
633  caloPID->SetEMCALDEtaCut(0.02);
634  caloPID->SetEMCALDPhiCut(0.030);
635 
636  //Set Histograms name tag, bins and ranges
637 
638  if(!multi)ana->AddToHistogramsName(Form("AnaIsol%s_TM%d_",particle.Data(),tm));
639  else ana->AddToHistogramsName(Form("AnaMultiIsol%s_TM%d_",particle.Data(),tm));
640 
641  SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
642 
643  if(particle=="Hadron" || particle.Contains("CTS"))
644  {
645  ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
646  ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
647  }
648 
649  ConfigureMC(ana,simu);
650 
651  if(print) ic ->Print("");
652  if(print) ana->Print("");
653 
654  return ana;
655 }
656 
660 AliAnaCalorimeterQA* ConfigureQAAnalysis(TString calorimeter = "EMCAL", Bool_t simu = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
661 {
663  ana->SetDebug(debug); //10 for lots of messages
665 
666  ana->SetTimeCut(-1e10,1e10); // Open time cut
667  ana->SwitchOffCorrelation();
668 
669  // Study exotic clusters PHOS and EMCAL
671 
672 
673  ana->SwitchOffFiducialCut();
679  ana->SwitchOffStudyWeight();
682 
683 
684  ana->AddToHistogramsName("QA_"); //Begining of histograms name
685  SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
686 
687  ConfigureMC(ana,simu);
688 
689  if(print) ana->Print("");
690 
691  return ana;
692 }
693 
697 AliAnaChargedParticles* ConfigureChargedAnalysis(Bool_t simulation, Int_t debugLevel)
698 {
700  ana->SetDebug(debugLevel); //10 for lots of messages
701 
702  // selection cuts
703 
704  ana->SetMinPt(0.5);
705  ana->SwitchOnFiducialCut();
706  ana->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ; //more restrictive cut in reader and after in isolation
707 
709  //if(!simulation) ana->SwitchOnFillPileUpHistograms();
710 
711  // Input / output delta AOD settings
712 
713  ana->SetOutputAODName(Form("Hadron%s",kAnaIsoPhotonName.Data()));
714  ana->SetOutputAODClassName("AliAODPWG4Particle");
715  ana->SetInputAODName(Form("Hadron%s",kAnaIsoPhotonName.Data()));
716 
717  //Set Histograms name tag, bins and ranges
718 
719  ana->AddToHistogramsName("AnaHadrons_");
720  SetHistoRangeAndNBins(ana->GetHistogramRanges(),""); // see method below
721 
722  ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
723  ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
724 
725  if(debugLevel > 0) ana->Print("");
726 
727  return ana;
728 }
729 
734 {
736  ana->SetDebug(kDebug); //10 for lots of messages
737 
738  if(detector=="") detector = kCalorimeter;
739  ana->SetDetector(detector);
740 
741  // selection cuts
742  ana->SetMinPt(4.);
743  ana->SetMaxPt(61.);
744 
745  if (detector=="EMCAL")
746  {
747  ana->SetEtaCut(-0.27,0.27);
748  //ana->SetPhiCut(103*TMath::DegToRad(), 157*TMath::DegToRad());
749  ana->SetPhiCut(1.8, 2.75);
750  }
751  else if(detector=="PHOS")
752  {
753  ana->SetEtaCut(-0.13,0.13);
754  ana->SetPhiCut(260*TMath::DegToRad(), 320*TMath::DegToRad());
755  }
756  else if(detector=="CTS")
757  {
758  ana->SetEtaCut(-0.9,0.9);
759  ana->SetPhiCut(0, TMath::TwoPi());
760  }
761 
762  // AOD branch
763  if(!kData.Contains("delta"))
764  {
765  ana->SetOutputAODName(Form("RandomTrigger%s%s",detector.Data(),kAnaIsoPhotonName.Data()));
766  ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
767  }
768  else
769  ana->SetInputAODName(Form("RandomTrigger%s%s",detector.Data(),kAnaIsoPhotonName.Data()));
770 
771  printf("Set RandomTrigger%s%s\n",detector.Data(),kAnaIsoPhotonName.Data());
772 
773  //Set Histograms name tag, bins and ranges
774 
775  ana->AddToHistogramsName(Form("AnaRandomTrigger%s_",detector.Data()));
776 
777  SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
778 
779  if(detector=="CTS")
780  {
781  ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
782  ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
783  }
784 
785  if(kPrint) ana->Print("");
786 
787  return ana;
788 }
789 
793 void ConfigureMC(AliAnaCaloTrackCorrBaseClass* ana, Bool_t simu = kFALSE)
794 {
795  if(simu) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
796  else ana->SwitchOffDataMC() ;
797 
798  //Set here generator name, default pythia
799  //ana->GetMCAnalysisUtils()->SetMCGenerator("");
800 }
801 
805 void SetHistoRangeAndNBins (AliHistogramRanges* histoRanges, TString calorimeter = "EMCAL")
806 {
807  histoRanges->SetHistoPtRangeAndNBins(0., 100., 200) ; // Energy and pt histograms
808 
809  if(calorimeter=="EMCAL")
810  {
811  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
812  histoRanges->SetHistoXRangeAndNBins(-600,90,200); // QA
813  histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
814 
815  histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
816  }
817  else
818  {
819  histoRanges->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ;
820  histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
821  }
822 
823  histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
824 
825  // Invariant mass histoRangeslysis
826  histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
827  histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
828 
829  // check if time calibration is on
830  histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
831  histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
832 
833  // track-cluster residuals
834  histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
835  histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
836  histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
837 
838  // QA, electron, charged
839  histoRanges->SetHistoPOverERangeAndNBins(0, 2.5 ,500);
840  histoRanges->SetHistodEdxRangeAndNBins (0.,250.0,500);
841 
842  // QA
843  histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
844  histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
845  histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
846  histoRanges->SetHistoNClusterCellRangeAndNBins(0,50,50);
847  histoRanges->SetHistoZRangeAndNBins(-400,400,200);
848  histoRanges->SetHistoRRangeAndNBins(400,450,25);
849  histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
850  histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
851  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
852 
853  // Isolation
854  histoRanges->SetHistoPtInConeRangeAndNBins(0, 50 , 250);
855  histoRanges->SetHistoPtSumRangeAndNBins (0, 100, 250);
856 }
857 
861 UInt_t SetTriggerMaskFromName(TString trigger)
862 {
863  if(trigger=="EMC7")
864  {
865  printf("CaloTrackCorr trigger EMC7\n");
866  return AliVEvent::kEMC7;
867  }
868  else if (trigger=="INT7")
869  {
870  printf("CaloTrackCorr trigger INT7\n");
871  return AliVEvent::kINT7;
872  }
873  else if(trigger=="EMC1")
874  {
875  printf("CaloTrackCorr trigger EMC1\n");
876  return AliVEvent::kEMC1;
877  }
878  else if(trigger=="MB")
879  {
880  printf("CaloTrackCorr trigger MB\n");
881  return AliVEvent::kMB;
882  }
883  else if(trigger=="PHOS")
884  {
885  printf("CaloTrackCorr trigger PHOS\n");
886  return AliVEvent::kPHI7;
887  }
888  else if(trigger=="PHOSPb")
889  {
890  printf("CaloTrackCorr trigger PHOSPb\n");
891  return AliVEvent::kPHOSPb;
892  }
893  else if(trigger=="AnyINT")
894  {
895  printf("CaloTrackCorr trigger AnyINT\n");
896  return AliVEvent::kAnyINT;
897  }
898  else if(trigger=="INT")
899  {
900  printf("CaloTrackCorr trigger AnyINT\n");
901  return AliVEvent::kAny;
902  }
903  else if(trigger=="EMCEGA")
904  {
905  printf("CaloTrackCorr trigger EMC Gamma\n");
906  return AliVEvent::kEMCEGA;
907  }
908  else if(trigger=="EMCEJE")
909  {
910  printf("CaloTrackCorr trigger EMC Jet\n");
911  return AliVEvent::kEMCEJE;
912  }
913  else if(trigger=="Central")
914  {
915  printf("CaloTrackCorr trigger Central\n");
916  return (AliVEvent::kCentral | AliVEvent::kMB);
917  }
918  else if(trigger=="CentralEGA")
919  {
920  printf("CaloTrackCorr trigger Central+EMCEGA\n");
921  return (AliVEvent::kCentral | AliVEvent::kEMCEGA);
922  }
923  else if(trigger=="SemiCentral")
924  {
925  printf("CaloTrackCorr trigger SemiCentral\n");
926  return (AliVEvent::kSemiCentral | AliVEvent::kMB);
927  }
928  else if(trigger=="SemiOrCentral")
929  {
930  printf("CaloTrackCorr trigger SemiCentral Or Central\n");
931  return (AliVEvent::kSemiCentral | AliVEvent::kCentral | AliVEvent::kMB);
932  }
933 }
934 
935 
void SetSumPtThresholds(Int_t i, Float_t pt)
void SetPtThreshold(Float_t pt)
void SetHistoTrackMultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n)
virtual void SetDebug(Int_t d)
void SetNumberOfCellsFromPHOSBorder(Int_t n)
void SetPhiCut(Float_t min, Float_t max)
void SetTimeCut(Double_t min, Double_t max)
AliAnaPhoton * ConfigurePhotonAnalysis(TString calorimeter="EMCAL", Bool_t tm=kFALSE, Float_t deltaphicut=0.02, Float_t deltaetacut=0.03, Int_t disttobad=0, Int_t nlmMax=2, Bool_t simu=kFALSE, Int_t debug=-1, Bool_t print=kFALSE)
void ana(Int_t mode=mGRID)
Definition: ana.C:86
void SetSimpleCTSFiducialCut(Float_t abseta, Float_t phimin, Float_t phimax)
void SetHistoMassRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual void AddToHistogramsName(TString add)
void SwitchOnFillAllTrackMatchingHistogram()
void SetHistoXRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SwitchOnTrackMatchRejection()
Definition: AliAnaPhoton.h:105
void SwitchOnLoadOwnEMCALGeometryMatrices()
void SwitchOnTMHistoFill()
Definition: AliAnaPhoton.h:79
Class with utils to perform Isolation Cuts.
virtual void SwitchOnAODHybridTrackSelection()
virtual void SetCentralityBin(Int_t min, Int_t max)
void SetConeSize(Float_t r)
void SetPtFraction(Float_t pt)
void FillNPrimaryHistograms(Int_t n)
Definition: AliAnaPhoton.h:110
void SwitchOffClusterELinearityCorrection()
void SetCTSPtMax(Float_t pt)
AliCaloTrackReader * ConfigureReader(TString inputDataType="AOD", Bool_t useKinematics=kFALSE, Bool_t simu=kFALSE, TString calorimeter="EMCAL", Bool_t nonlin=kTRUE, Bool_t timecut=kFALSE, Bool_t primvtx=kFALSE, Bool_t notrackcut=kFALSE, Float_t tmin, Float_t tmax, Bool_t trackTcut=kFALSE, Float_t minCen=-1, Float_t maxCen=-1, Int_t debug=-1, Bool_t print=kFALSE)
void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetDebug(Int_t d)
virtual void SetCalorimeter(TString &calo)
Set the calorimeter for the analysis. A string.
virtual void SetInputAODName(TString name)
AliAnaChargedParticles * ConfigureChargedAnalysis(Bool_t simulation, Int_t debugLevel)
virtual void SetTrackComplementaryCuts(AliESDtrackCuts *)
virtual AliIsolationCut * GetIsolationCut()
void SetHistoRangeAndNBins(AliHistogramRanges *histoRanges, TString calorimeter="EMCAL")
void SetMinDistanceToBadChannel(Float_t m1, Float_t m2, Float_t m3)
Definition: AliAnaPhoton.h:88
TString kCalorimeter
Global debug level.
void SwitchOffTMHistoFill()
Definition: AliAnaPhoton.h:80
void SetSimpleEMCALFiducialCut(Float_t abseta, Float_t phimin, Float_t phimax)
virtual void SetOutputAODClassName(TString name)
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
void SetSumPtThreshold(Float_t s)
Class for the Calorimeter QA analysis.
void SetHistodRRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetPHOSEMax(Float_t e)
void SetNumberOfCellsFromEMCALBorder(Int_t n)
void SetEMCALEMin(Float_t e)
void SetNCellCut(Int_t n)
Definition: AliAnaPhoton.h:96
void SetPtFractions(Int_t i, Float_t pt)
const TString calorimeter
Definition: anaM.C:35
AliAnalysisTaskCaloTrackCorrelation * AddTaskIsoPhoton(const Float_t cone=0.4, const Float_t pth=2., const Bool_t leading=kFALSE, const Bool_t timecut=kFALSE, const TString calorimeter="EMCAL", const Bool_t simu=kFALSE, const Bool_t exotic=kTRUE, const Bool_t nonlin=kFALSE, const TString trigger="EMC7", const Bool_t tm=kTRUE, const Int_t minCen=-1, const Int_t maxCen=-1, const Float_t deltaphicut=0.03, const Float_t deltaetacut=0.02, const Float_t tmin=-30., const Float_t tmax=30., const Bool_t trackTcut=kFALSE, const Int_t disttobad=2, const Int_t nlmMax=20, const Bool_t qaan=kFALSE, const Bool_t primvtx=kTRUE, const Bool_t notrackcut=kTRUE, const Bool_t rdmtrigger=kFALSE, const TString tag="", const Int_t debug=-1, const Bool_t print=kFALSE, const Bool_t tmInCone=kTRUE)
Global bool for print option.
void SetHistoTrackResidualEtaRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
Class for event, clusters and tracks filtering and preparation for the AOD analysis.
void SetCTSPtMin(Float_t pt)
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
void SetEMCALDPhiCut(Float_t dcut)
Definition: AliCaloPID.h:201
virtual void SetOutputAODName(TString name)
void SwitchOffRecalculateClusterTrackMatching()
AliCalorimeterUtils * ConfigureCaloUtils(Bool_t nonlin=kTRUE, Bool_t exotic=kTRUE, Bool_t simu=kFALSE, Bool_t timecut=kFALSE, Int_t debug=-1, Bool_t print=kFALSE)
void SetICMethod(Int_t i)
void SwitchOffVertexBCEventSelection()
Base class for CaloTrackCorr analysis algorithms.
void SwitchOffTrackMatchRejection()
Definition: AliAnaPhoton.h:106
void SetHistoPtInConeRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual void SetDebug(Int_t d)
void SetHistoPOverERangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual AliFiducialCut * GetFiducialCut()
virtual AliFiducialCut * GetFiducialCut()
virtual void SetCentralityOpt(Int_t opt)
void SetHistoPhiRangeAndNBins(Float_t min, Float_t max, Int_t n)
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
virtual AliHistogramRanges * GetHistogramRanges()
TString kData
Global setting of calorimeter of photon.
void SetHistoPtSumRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetTrackStatus(ULong_t bit)
UInt_t SetTriggerMaskFromName(TString trigger)
Filter EMCal/PHOS clusters for photon analysis.
Definition: AliAnaPhoton.h:32
void SetHistoTrackResidualPhiRangeAndNBins(Float_t min, Float_t max, Int_t n)
AliAnaParticleIsolation * ConfigureIsolationAnalysis(TString calorimeter="EMCAL", TString particle="Photon", Int_t partInCone=AliIsolationCut::kOnlyCharged, Int_t thresType=AliIsolationCut::kSumPtFracIC, Float_t cone=0.3, Float_t pth=0.3, Bool_t tm=kFALSE, Bool_t leading=kTRUE, Bool_t multi=kFALSE, Bool_t simu=kFALSE, Int_t debug=-1, Bool_t print=kFALSE, Bool_t tmInCone=kTRUE)
void SetConeSizes(Int_t i, Float_t r)
void SetEtaCut(Float_t min, Float_t max)
AliAnaRandomTrigger * ConfigureRandomTriggerAnalysis(TString detector="")
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
Base class for event, clusters and tracks filtering and preparation for the analysis.
void SetHistoNClusterCellRangeAndNBins(Int_t min, Int_t max, Int_t n)
void SwitchOffBadTriggerEventsRemoval()
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
void SetHistoYRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetTimeCut(Double_t min, Double_t max)
Definition: AliAnaPhoton.h:91
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
virtual void SetZvertexCut(Float_t zcut=10.)
void SetNumberOfSuperModulesUsed(Int_t nSM)
Class containing more common histogram axis types.
void SetEMCALLambda0CutMax(Float_t lcut)
Definition: AliCaloPID.h:192
Class for event, clusters and tracks filtering and preparation for the ESD analysis.
virtual void SetEventPlaneMethod(TString m)
virtual void SetTrackCuts(AliESDtrackCuts *)
Track selection for correlation analysis.
void SetTrackMatchedClusterRejectionInCone(Bool_t tm)
virtual void SwitchOffFiducialCut()
virtual void SetCentralityClass(TString name)
void SwitchOnFillShowerShapeHistograms()
Definition: AliAnaPhoton.h:68
Select clusters/tracks with low particle environment in their vecinity, isolated within a cone...
void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SwitchOnClusterELinearityCorrection()
void SetTrackTimeCut(Double_t a, Double_t b)
void SetEMCALTimeCut(Double_t a, Double_t b)
Gerenate a random trigger.
void SetHistoAsymmetryRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoV0MultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n)
virtual void SetAODObjArrayName(TString name)
Main class conecting the CaloTrackCorrelations package and Analysis Frame.
Int_t kDebug
Global name to be composed of the settings, used to set the AOD branch name.
void SetHistoZRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoV0SignalRangeAndNBins(Int_t min, Int_t max, Int_t n)
void SetHistoTimeRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoFinePtRangeAndNBins(Float_t min, Float_t max, Int_t n)
Class for PID selection with calorimeters.
Definition: AliCaloPID.h:51
void FillNOriginHistograms(Int_t n)
Definition: AliAnaPhoton.h:108
void SetPHOSEMin(Float_t e)
void SetHistoShowerShapeRangeAndNBins(Float_t min, Float_t max, Int_t n)
Bool_t kPrint
Global string for data type.
void SetHistodEdxRangeAndNBins(Float_t min, Float_t max, Int_t n)
Class with utils specific to calorimeter clusters/cells.
AliAnaCalorimeterQA * ConfigureQAAnalysis(TString calorimeter="EMCAL", Bool_t simu=kFALSE, Int_t debug=-1, Bool_t print=kFALSE)
void SwitchOffPrimaryVertexSelection()
void SetEMCALLambda0CutMin(Float_t lcut)
Definition: AliCaloPID.h:195
void SetHistoRRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetParticleTypeInCone(Int_t i)
void SetHistoVertexDistRangeAndNBins(Float_t min, Float_t max, Int_t n)
void ConfigureMC(AliAnaCaloTrackCorrBaseClass *ana, Bool_t simu=kFALSE)
void SetEMCALEMax(Float_t e)
void SetHistoDiffTimeRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetEMCALDEtaCut(Float_t dcut)
Definition: AliCaloPID.h:198
void SwitchOffUseParametrizedTimeCut()
void SetPtThresholds(Int_t i, Float_t pt)
void SetHistoRatioRangeAndNBins(Float_t min, Float_t max, Int_t n)
TString kAnaIsoPhotonName
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
void SetNLMCut(Int_t min, Int_t max)
Definition: AliAnaPhoton.h:99
Steering class of package CaloTrackCorrelartions.