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