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