AliPhysics  d497547 (d497547)
 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 
257  //------------------------
258  // Detector input filling
259  //------------------------
260 
261  if(clustListName!="")
262  reader->SetEMCALClusterListName(clustListName);
263  //Min cluster/track E
264  reader->SetEMCALEMin(0.3);
265  reader->SetEMCALEMax(1000);
266  reader->SetPHOSEMin(0.3);
267  reader->SetPHOSEMax(1000);
268  reader->SetCTSPtMin(0.2);
269  reader->SetCTSPtMax(1000);
270 
271  // Time cuts
272  if(simu)
273  {
274  reader->SwitchOffUseTrackTimeCut();
276  reader->SwitchOffUseEMCALTimeCut();
277  reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
278  }
279  else
280  {
282 
283  if(timecut)
284  {
285  printf("Set time cut \n");
286  reader->SwitchOnUseEMCALTimeCut();
287  //Absolute window
288  reader->SetEMCALTimeCut(tmin,tmax); // default is -25ns-20ns
289  }
290  else
291  {
292  printf("Off time cuts time cut \n");
293  reader->SwitchOffUseEMCALTimeCut();
294  //Absolute window
295  reader->SetEMCALTimeCut(-1.e6,1.e6);
296  }
297  }
298 
299  reader->SwitchOffFiducialCut();
300  reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
301 
302  // Tracks
303  reader->SwitchOnCTS();
304 
305 
308 
309 if(trackTcut)
310  reader->SwitchOnUseTrackTimeCut();
311 else
312  reader->SwitchOffUseTrackTimeCut();
313 
314  reader->SetTrackTimeCut(0,50);
315 
316  reader->SwitchOffUseTrackDCACut();
317  //reader->SetTrackDCACut(0,0.0105);
318  //reader->SetTrackDCACut(1,0.035);
319  //reader->SetTrackDCACut(2,1.1);
320 
321  if(inputDataType=="ESD")
322  {
323  gROOT->LoadMacro("$ALICE_PHYSICS/PWGJE/macros/CreateTrackCutsPWGJE.C");
324  //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
325  //reader->SetTrackCuts(esdTrackCuts);
326  //reader->SwitchOnConstrainTrackToVertex();
327 
328 // if(kYears>2010)
329 // {
330  //Hybrids 2011
331  AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
332  reader->SetTrackCuts(esdTrackCuts);
333  AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
334  reader->SetTrackComplementaryCuts(esdTrackCuts2);
335 // }
336 // else
337 // {
338 // //Hybrids 2010
339 // AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001006);
340 // reader->SetTrackCuts(esdTrackCuts);
341 // AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10041006);
342 // reader->SetTrackComplementaryCuts(esdTrackCuts2);
343 // }
344  }
345  else if(inputDataType=="AOD")
346  {
347  //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid
348  reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
349  reader->SetTrackStatus(AliVTrack::kITSrefit);
350  //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
351  }
352 
353  // Calorimeter
354 
356 
357 
358  // CAREFUL
359  if(!nonlin) reader->SwitchOffClusterELinearityCorrection();
361 
362  if(calorimeter == "EMCAL") {
363  reader->SwitchOnEMCALCells();
364  reader->SwitchOnEMCAL();
365  }
366  if(calorimeter == "PHOS") { // Should be on if QA is activated with correlation on
367  reader->SwitchOffPHOSCells();
368  reader->SwitchOffPHOS();
369  }
370 
371  //-----------------
372  // Event selection
373  //-----------------
374 
375  //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
376 
377  // reader->RejectFastClusterEvents() ;
378 
379  reader->SwitchOnEventTriggerAtSE();
380 
381  reader->SetZvertexCut(10.); // Open cut
382  if(primvtx)
383  reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
384  else
386  if(notrackcut)
387  reader->SwitchOnRejectNoTrackEvents();
388  else
390 
391  reader->SwitchOffPileUpEventRejection(); // remove pileup
392  reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
393 
394  if(maxCen > 0 )
395  {
396  // Centrality
397  reader->SetCentralityClass("V0M");
398  reader->SetCentralityOpt(100); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
399  reader->SetCentralityBin(minCen,maxCen); // Accept all events, if not select range
400 
401  // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
402  reader->SetEventPlaneMethod("V0");
403  }
404 
405  if(print) reader->Print("");
406 
407  return reader;
408 }
409 
413 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)
414 {
416  cu->SetDebug(debug);
417 
418  // Remove clusters close to borders, at least max energy cell is 1 cell away
419  cu->SetNumberOfCellsFromEMCALBorder(0);//this was originally set to one
421 
423 
425 
426  //EMCAL settings
427 
428  if(simu)
430 
431  /* AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
432 
433  cu->SwitchOffRecalibration();
434  cu->SwitchOffRunDepCorrection();
435 
436  gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/EMCAL/macros/ConfigureEMCALRecoUtils.C");
437  ConfigureEMCALRecoUtils(recou,
438  simu,
439  exotic,
440  nonlin,
441  kFALSE, // e calib
442  kFALSE, // bad map
443  kFALSE); // time calib
444  if(timecut) recou->SetExoticCellDiffTimeCut(50.);
445  */
446  if( nonlin)
447  {
448  printf("ConfigureCaloUtils() - Apply non linearity to EMCAL\n");
450  }
451  /*
452  printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
453  printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
454  */
456 
457  if(print) cu->Print("");
458 
459  return cu;
460 }
461 
466 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)
467 {
468  AliAnaPhoton *ana = new AliAnaPhoton();
469  ana->SetDebug(debug); //10 for lots of messages
470 
471  // cluster selection cuts
472 
473  ana->SwitchOffFiducialCut();
474 
476 
477  if(calorimeter == "PHOS")
478  {
479  ana->SetNCellCut(2);// At least 3 cells
480  ana->SetMinPt(0.3);
481  ana->SetMinDistanceToBadChannel(2, 4, 5);
482  ana->SetTimeCut(-1e10,1e10); // open cut
483  }
484  else
485  {//EMCAL
486  ana->SetNCellCut(1);// At least 2 cells
487  ana->SetMinEnergy(0.3); // avoid mip peak at E = 260 MeV
488  ana->SetMaxEnergy(1000);
489  // ana->SetTimeCut(-1e10,1e10); // open cut, usual time window of [425-825] ns if time recalibration is off
490  // restrict to less than 100 ns when time calibration is on
491  ana->SetMinDistanceToBadChannel(disttobad, 4, 6);
492 
493  // NLM cut, used in all, exclude clusters with more than 2 maxima
494  // Not needed if M02 cut is already strong or clusterizer V2
495  ana->SetNLMCut(1, nlmMax) ;
496  }
497 
498  if(tm)
499  {
501  ana->SwitchOffTMHistoFill() ;
502  }
503  else
504  {
506  ana->SwitchOnTMHistoFill() ;
507  }
508 
509  //PID cuts (shower shape)
510  ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
511  AliCaloPID* caloPID = ana->GetCaloPID();
512  //Not used in bayesian
513 
514  //EMCAL
515  caloPID->SetEMCALLambda0CutMax(1000.);
516  caloPID->SetEMCALLambda0CutMin(0.);
517 
518  // caloPID->SetEMCALDEtaCut(0.025);
519  // caloPID->SetEMCALDPhiCut(0.030);
520  caloPID->SetEMCALDEtaCut(deltaetacut);
521  caloPID->SetEMCALDPhiCut(deltaphicut);
522 
523  ana->SwitchOnFillShowerShapeHistograms(); // Filled before photon shower shape selection
524  if(!simu) ana->SwitchOnFillPileUpHistograms();
525 
526  // Input / output delta AOD settings
527 
528  ana->SetOutputAODName(Form("Photon%s",kAnaIsoPhotonName.Data()));
529  ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
530 
531  //Set Histograms name tag, bins and ranges
532 
533  ana->AddToHistogramsName(Form("AnaPhoton_TM%d_",tm));
534  SetHistoRangeAndNBins(ana->GetHistogramRanges(), calorimeter); // see method below
535 
536  // Number of particle type MC histograms
537  ana->FillNOriginHistograms(20);
538  ana->FillNPrimaryHistograms(20);
539 
540  ConfigureMC(ana,simu);
541 
542  if(print) ana->Print("");
543 
544  return ana;
545 }
546 
551  TString particle="Photon",
554  Float_t cone = 0.3,
555  Float_t pth = 0.3,
556  Bool_t tm = kFALSE,
557  Bool_t leading = kTRUE,
558  Bool_t multi = kFALSE, Bool_t simu = kFALSE,
559  Int_t debug = -1, Bool_t print = kFALSE,
560  Bool_t tmInCone = kTRUE )
561 {
563  ana->SetDebug(debug);
564 
565  ana->SwitchOnFiducialCut();
566  //Avoid borders of EMCal
567  if(calorimeter=="EMCAL")
568  {
569  //ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
570  ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.27, 103, 157) ;
571  }
572 
573  ana->SetMinPt(5);
574 
575  // Input / output delta AOD settings
576 
577  ana->SetInputAODName(Form("%s%s",particle.Data(),kAnaIsoPhotonName.Data()));
578  ana->SetAODObjArrayName(Form("IC%s_%s",particle.Data(),kAnaIsoPhotonName.Data()));
579 
581 
582  if(!tm) ana->SwitchOnTMHistoFill();
583  else ana->SwitchOffTMHistoFill();
584  // ana->SwitchOnTMHistoFill();
585 
586  // ana->SwitchOffSSHistoFill();
587  // if(!kSimulation) ana->SwitchOnFillPileUpHistograms();
588  ana->SwitchOnSSHistoFill();
589  if(leading) ana->SwitchOnLeadingOnly();
590  else ana->SwitchOffLeadingOnly();
591  if(!simu) ana->SwitchOnFillPileUpHistograms();
592 
593  //Do settings for main isolation cut class
594  AliIsolationCut * ic = ana->GetIsolationCut();
595  ic->SetDebug(debug);
596 
597  printf("\t *** Set: R = %2.2f, Threshold %2.2f, Method %d, Neutral/Charged option %d ***\n",cone,pth,thresType,partInCone);
598 
599  //Main parameters
600  //****
601  ic->SetConeSize(cone);
602 
603  ic->SetPtFraction (0.1);
604  ic->SetPtThreshold (pth);
605  ic->SetSumPtThreshold(pth);
606 
607  ic->SetParticleTypeInCone(partInCone);
608 
609  ic->SetICMethod(thresType);
610 
612  //****
613 
614  //Do or not do isolation with previously produced AODs.
615  //No effect if use of SwitchOnSeveralIsolation()
616  ana->SwitchOffReIsolation();
617 
618  //Multiple IC
619  if(multi)
620  {
621  ic->SetConeSize(1.); // Take all for first iteration
622  ic->SetPtThreshold(100);// Take all for first iteration
623  ana->SwitchOnSeveralIsolation() ;
624  ana->SetAODObjArrayName(Form("MultiIC%sTM%d",particle.Data(),tm));
625 
626  ana->SetNCones(4);
627  ana->SetNPtThresFrac(4);
628  ana->SetConeSizes(0,0.3); ana->SetConeSizes(1,0.4);
629  ana->SetConeSizes(2,0.5); ana->SetConeSizes(3,0.6);
630  ana->SetPtThresholds(0, 0.5); ana->SetPtThresholds(1, 1); ana->SetPtThresholds(2, 2);
631  ana->SetPtFractions (0, 0.05) ; ana->SetPtFractions (1, 0.1); ana->SetPtFractions (2, 0.2) ; ana->SetPtFractions (3, 0.3) ;
632  ana->SetSumPtThresholds(0, 1) ; ana->SetSumPtThresholds(1, 3) ; ana->SetSumPtThresholds(2, 5); ana->SetSumPtThresholds(3, 7) ;
633 
634  ana->SwitchOffTMHistoFill();
635  ana->SwitchOffSSHistoFill();
636  }
637  else
639 
640  AliCaloPID* caloPID = ana->GetCaloPID();
641  caloPID->SetEMCALDEtaCut(0.02);
642  caloPID->SetEMCALDPhiCut(0.030);
643 
644  //Set Histograms name tag, bins and ranges
645 
646  if(!multi)ana->AddToHistogramsName(Form("AnaIsol%s_TM%d_",particle.Data(),tm));
647  else ana->AddToHistogramsName(Form("AnaMultiIsol%s_TM%d_",particle.Data(),tm));
648 
649  SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
650 
651  if(particle=="Hadron" || particle.Contains("CTS"))
652  {
653  ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
654  ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
655  }
656 
657  ConfigureMC(ana,simu);
658 
659  if(print) ic ->Print("");
660  if(print) ana->Print("");
661 
662  return ana;
663 }
664 
668 AliAnaCalorimeterQA* ConfigureQAAnalysis(TString calorimeter = "EMCAL", Bool_t simu = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
669 {
671  ana->SetDebug(debug); //10 for lots of messages
673 
674  ana->SetTimeCut(-1e10,1e10); // Open time cut
675  ana->SwitchOffCorrelation();
676 
677  // Study exotic clusters PHOS and EMCAL
679 
680  ana->SwitchOffFiducialCut();
686 
687  ana->AddToHistogramsName("QA_"); //Begining of histograms name
688  SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
689 
690  ConfigureMC(ana,simu);
691 
692  if(print) ana->Print("");
693 
694  return ana;
695 }
696 
701 {
703  ana->SetDebug(debugLevel); //10 for lots of messages
704 
705  // selection cuts
706 
707  ana->SetMinPt(0.5);
708  ana->SwitchOnFiducialCut();
709  ana->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ; //more restrictive cut in reader and after in isolation
710 
712  //if(!simulation) ana->SwitchOnFillPileUpHistograms();
713 
714  // Input / output delta AOD settings
715 
716  ana->SetOutputAODName(Form("Hadron%s",kAnaIsoPhotonName.Data()));
717  ana->SetOutputAODClassName("AliAODPWG4Particle");
718  ana->SetInputAODName(Form("Hadron%s",kAnaIsoPhotonName.Data()));
719 
720  //Set Histograms name tag, bins and ranges
721 
722  ana->AddToHistogramsName("AnaHadrons_");
723  SetHistoRangeAndNBins(ana->GetHistogramRanges(),""); // see method below
724 
725  ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
726  ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
727 
728  if(debugLevel > 0) ana->Print("");
729 
730  return ana;
731 }
732 
737 {
739  ana->SetDebug(kDebug); //10 for lots of messages
740 
741  if(detector=="") detector = kCalorimeter;
742  ana->SetDetector(detector);
743 
744  // selection cuts
745  ana->SetMinPt(4.);
746  ana->SetMaxPt(61.);
747 
748  if (detector=="EMCAL")
749  {
750  ana->SetEtaCut(-0.27,0.27);
751  //ana->SetPhiCut(103*TMath::DegToRad(), 157*TMath::DegToRad());
752  ana->SetPhiCut(1.8, 2.75);
753  }
754  else if(detector=="PHOS")
755  {
756  ana->SetEtaCut(-0.13,0.13);
757  ana->SetPhiCut(260*TMath::DegToRad(), 320*TMath::DegToRad());
758  }
759  else if(detector=="CTS")
760  {
761  ana->SetEtaCut(-0.9,0.9);
762  ana->SetPhiCut(0, TMath::TwoPi());
763  }
764 
765  // AOD branch
766  if(!kData.Contains("delta"))
767  {
768  ana->SetOutputAODName(Form("RandomTrigger%s%s",detector.Data(),kAnaIsoPhotonName.Data()));
769  ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
770  }
771  else
772  ana->SetInputAODName(Form("RandomTrigger%s%s",detector.Data(),kAnaIsoPhotonName.Data()));
773 
774  printf("Set RandomTrigger%s%s\n",detector.Data(),kAnaIsoPhotonName.Data());
775 
776  //Set Histograms name tag, bins and ranges
777 
778  ana->AddToHistogramsName(Form("AnaRandomTrigger%s_",detector.Data()));
779 
780  SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
781 
782  if(detector=="CTS")
783  {
784  ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
785  ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
786  }
787 
788  if(kPrint) ana->Print("");
789 
790  return ana;
791 }
792 
797 {
798  if(simu) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
799  else ana->SwitchOffDataMC() ;
800 
801  //Set here generator name, default pythia
802  //ana->GetMCAnalysisUtils()->SetMCGenerator("");
803 }
804 
809 {
810  histoRanges->SetHistoPtRangeAndNBins(0., 100., 200) ; // Energy and pt histograms
811 
812  if(calorimeter=="EMCAL")
813  {
814  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
815  histoRanges->SetHistoXRangeAndNBins(-600,90,200); // QA
816  histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
817 
818  histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
819  }
820  else
821  {
822  histoRanges->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ;
823  histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
824  }
825 
826  histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
827 
828  // Invariant mass histoRangeslysis
829  histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
830  histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
831 
832  // check if time calibration is on
833  histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
834  histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
835 
836  // track-cluster residuals
837  histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
838  histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
839  histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
840 
841  // QA, electron, charged
842  histoRanges->SetHistoPOverERangeAndNBins(0, 2.5 ,500);
843  histoRanges->SetHistodEdxRangeAndNBins (0.,250.0,500);
844 
845  // QA
846  histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
847  histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
848  histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
849  histoRanges->SetHistoNClusterCellRangeAndNBins(0,50,50);
850  histoRanges->SetHistoZRangeAndNBins(-400,400,200);
851  histoRanges->SetHistoRRangeAndNBins(400,450,25);
852  histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
853  histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
854  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
855 
856  // Isolation
857  histoRanges->SetHistoPtInConeRangeAndNBins(0, 50 , 250);
858  histoRanges->SetHistoPtSumRangeAndNBins (0, 100, 250);
859 }
860 
865 {
866  if(trigger=="EMC7")
867  {
868  printf("CaloTrackCorr trigger EMC7\n");
869  return AliVEvent::kEMC7;
870  }
871  else if (trigger=="INT7")
872  {
873  printf("CaloTrackCorr trigger INT7\n");
874  return AliVEvent::kINT7;
875  }
876  else if(trigger=="EMC1")
877  {
878  printf("CaloTrackCorr trigger EMC1\n");
879  return AliVEvent::kEMC1;
880  }
881  else if(trigger=="MB")
882  {
883  printf("CaloTrackCorr trigger MB\n");
884  return AliVEvent::kMB;
885  }
886  else if(trigger=="PHOS")
887  {
888  printf("CaloTrackCorr trigger PHOS\n");
889  return AliVEvent::kPHI7;
890  }
891  else if(trigger=="PHOSPb")
892  {
893  printf("CaloTrackCorr trigger PHOSPb\n");
894  return AliVEvent::kPHOSPb;
895  }
896  else if(trigger=="AnyINT")
897  {
898  printf("CaloTrackCorr trigger AnyINT\n");
899  return AliVEvent::kAnyINT;
900  }
901  else if(trigger=="INT")
902  {
903  printf("CaloTrackCorr trigger AnyINT\n");
904  return AliVEvent::kAny;
905  }
906  else if(trigger=="EMCEGA")
907  {
908  printf("CaloTrackCorr trigger EMC Gamma\n");
909  return AliVEvent::kEMCEGA;
910  }
911  else if(trigger=="EMCEJE")
912  {
913  printf("CaloTrackCorr trigger EMC Jet\n");
914  return AliVEvent::kEMCEJE;
915  }
916  else if(trigger=="Central")
917  {
918  printf("CaloTrackCorr trigger Central\n");
919  return (AliVEvent::kCentral | AliVEvent::kMB);
920  }
921  else if(trigger=="CentralEGA")
922  {
923  printf("CaloTrackCorr trigger Central+EMCEGA\n");
924  return (AliVEvent::kCentral | AliVEvent::kEMCEGA);
925  }
926  else if(trigger=="SemiCentral")
927  {
928  printf("CaloTrackCorr trigger SemiCentral\n");
929  return (AliVEvent::kSemiCentral | AliVEvent::kMB);
930  }
931  else if(trigger=="SemiOrCentral")
932  {
933  printf("CaloTrackCorr trigger SemiCentral Or Central\n");
934  return (AliVEvent::kSemiCentral | AliVEvent::kCentral | AliVEvent::kMB);
935  }
936 }
937 
938 
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()
const int debug
Definition: scanAll.C:15
void SetHistoXRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SwitchOnTrackMatchRejection()
Definition: AliAnaPhoton.h:131
void SwitchOnLoadOwnEMCALGeometryMatrices()
void SwitchOnTMHistoFill()
Definition: AliAnaPhoton.h:93
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:142
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:114
TString kCalorimeter
Global debug level.
void SwitchOffTMHistoFill()
Definition: AliAnaPhoton.h:94
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:122
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:132
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:117
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
virtual void SetZvertexCut(Float_t zcut=10.)
void SetNumberOfSuperModulesUsed(Int_t nSM)
Class containing more common histogram axis types.
void SetEMCALLambda0CutMax(Float_t lcut)
Definition: AliCaloPID.h:202
Class for event, clusters and tracks filtering and preparation for the ESD analysis.
virtual void SetEventPlaneMethod(TString m)
void SetPHOSEMin(Float_t en)
virtual void SetTrackCuts(AliESDtrackCuts *)
Track selection for correlation analysis.
void SetTrackMatchedClusterRejectionInCone(Bool_t tm)
virtual void SwitchOffFiducialCut()
virtual void SetCentralityClass(TString name)
void SwitchOnFillShowerShapeHistograms()
Definition: AliAnaPhoton.h:73
Select clusters/tracks with low particle environment in their vecinity, isolated within a cone...
void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SwitchOnClusterELinearityCorrection()
void SetTrackTimeCut(Double_t a, Double_t b)
void SetEMCALTimeCut(Double_t a, Double_t b)
Gerenate a random trigger.
void SetHistoAsymmetryRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoV0MultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n)
virtual void SetAODObjArrayName(TString name)
Main class conecting the CaloTrackCorrelations package and Analysis Frame.
Int_t kDebug
Global name to be composed of the settings, used to set the AOD branch name.
void SetHistoZRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoV0SignalRangeAndNBins(Int_t min, Int_t max, Int_t n)
void SetHistoTimeRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoFinePtRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetEMCALEMax(Float_t en)
Class for PID selection with calorimeters.
Definition: AliCaloPID.h:53
void FillNOriginHistograms(Int_t n)
Definition: AliAnaPhoton.h:140
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:125
Steering class of package CaloTrackCorrelartions.