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