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