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