AliPhysics  b11e70a (b11e70a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskPi0.C
Go to the documentation of this file.
1 
9 TString kAnaPi0 = "";
10 
35 (
36  TString calorimeter = "EMCAL",
37  Bool_t simulation = kFALSE,
38  Int_t year = 2015,
39  TString col = "pp",
40  TString trigger = "EMC7",
41  Bool_t rejectEMCTrig = kFALSE,
42  Bool_t muonCaloPass = kFALSE,
43  TString clustersArray = "",
44  Bool_t tender = kFALSE,
45  Bool_t nonLinOn = kFALSE,
46  Float_t shshMax = 0.5,
47  Bool_t tm = kTRUE,
48  Int_t minCen = -1,
49  Int_t maxCen = -1,
50  Bool_t mixOn = kTRUE,
51  TString outputfile = "",
52  Bool_t printSettings = kFALSE,
53  Int_t debug = 0 // Debug level
54  )
55 
56 {
57  // Get the pointer to the existing analysis manager via the static access method.
58 
59  printf("Passed settings:\n calorimeter <%s>, simulation <%d>, year <%d>,\n col <%s>, trigger <%s>, reject EMC <%d> clustersArray <%s>, tender <%d>, non linearity <%d>\n shshMax <%2.2f>, tm %d, minCen %d, maxCen %d, mixOn <%d>,\n outputfile <%s>, printSettings <%d>, debug <%d>\n",
60  calorimeter.Data(),simulation,year,col.Data(),trigger.Data(), rejectEMCTrig, clustersArray.Data(),tender, nonLinOn, shshMax,tm,
61  minCen,maxCen,mixOn,outputfile.Data(),printSettings,debug);
62 
63  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
64  if (!mgr)
65  {
66  ::Error("AddTask", "No analysis manager to connect to.");
67  return NULL;
68  }
69 
70  // Check the analysis type using the event handlers connected to the analysis manager.
71 
72  if (!mgr->GetInputEventHandler())
73  {
74  ::Error("AddTask", "This task requires an input event handler");
75  return NULL;
76  }
77 
78  // Make sure the B field is enabled for track selection, some cuts need it
79  ((AliInputEventHandler*)mgr->GetInputEventHandler())->SetNeedField(kTRUE);
80 
81  // Name for containers
82 
83  kAnaPi0 = Form("Pi0_%s_Trig%s_Col_%s_Year%d_Cl%s_Ten%d_TM%d_M02_%1.2f_Mix%d",
84  calorimeter.Data(),trigger.Data(),col.Data(),year,clustersArray.Data(),tender,
85  tm, shshMax,mixOn);
86 
87  if(col=="PbPb" && maxCen>=0) kAnaPi0+=Form("Cen%d_%d",minCen,maxCen);
88 
89  printf("<<<< NAME: %s >>>>>\n",kAnaPi0.Data());
90 
91  // #### Configure analysis ####
92 
94 
95  // General frame setting and configuration
96  maker->SetReader ( ConfigureReader (col,simulation,clustersArray,tender,calorimeter,nonLinOn,trigger,rejectEMCTrig,minCen,maxCen,printSettings,debug) );
97  maker->SetCaloUtils( ConfigureCaloUtils(col,simulation,clustersArray,tender,nonLinOn,year, printSettings,debug) );
98 
99  if(muonCaloPass)
100  {
101  maker->GetReader()->SwitchOffPrimaryVertexSelection();
102  maker->GetReader()->SwitchOffRejectNoTrackEvents();
103  }
104 
105  // Remove as soon calibrations are available
106  if(year > 2014)
107  {
108  maker->GetReader()->SwitchOffUseEMCALTimeCut();
109  maker->GetReader()->SetEMCALTimeCut(-1000,1000);
110  maker->GetCaloUtils()->SwitchOffRunDepCorrection();
111  }
112 
113  // Analysis tasks setting and configuration
114  Int_t n = 0;//Analysis number, order is important
115 
116  if(calorimeter.Contains("EMCAL"))
117  {
118  // Photon analysis
119  //
120  maker->AddAnalysis(ConfigurePhotonAnalysis(col, simulation, "EMCAL", year, tm, shshMax, printSettings, debug), n++);
121 
122  // Pi0 analysis
123  //
124  printf("AliAnaPi0: EMCal-EMCal invariant mass\n");
125  maker->AddAnalysis(ConfigurePi0Analysis (col, simulation, "EMCAL", kFALSE, year, tm, mixOn , printSettings, debug), n++);
126  }
127 
128  if(calorimeter.Contains("PHOS"))
129  {
130  // Photon analysis
131  //
132  maker->AddAnalysis(ConfigurePhotonAnalysis(col, simulation, "PHOS", year, tm, shshMax, printSettings, debug), n++);
133 
134  // Pi0 analysis
135  //
136  printf("AliAnaPi0: PHOS-PHOS invariant mass\n");
137  maker->AddAnalysis(ConfigurePi0Analysis (col, simulation, "PHOS", kFALSE, year, tm, mixOn , printSettings, debug), n++);
138  }
139 
140  if(calorimeter.Contains("BothCalo"))
141  {
142  // Pi0 analysis
143  //
144  //Do it with PHOS or EMCal in the main loop and EMCal or PHOS in the mixed event, should be equivalent?
145  printf("AliAnaPi0: DCal-PHOS invariant mass\n");
146  maker->AddAnalysis(ConfigurePi0Analysis (col, simulation, "EMCAL", kTRUE, year, tm, mixOn, printSettings, debug), n++);
147  printf("AliAnaPi0: PHOS-DCal invariant mass\n");
148  maker->AddAnalysis(ConfigurePi0Analysis (col, simulation, "PHOS" , kTRUE, year, tm, mixOn, printSettings, debug), n++);
149  }
150 
151  // Maker
152 
153  maker->SetAnaDebug(debug) ;
154 
155  maker->SwitchOnHistogramsMaker() ;
156  maker->SwitchOnAODsMaker() ;
157 
158  maker->SwitchOffDataControlHistograms();
159  if(rejectEMCTrig) maker->SwitchOnDataControlHistograms();
160 
161  if(printSettings) maker->Print("");
162 
163  printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, calorimeter.Data());
164 
165  // Create task
166 
168 
169  task->SetDebugLevel(debug);
170 
171  //task->SetBranches("ESD:AliESDRun.,AliESDHeader");
172  //task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
173 
174  task->SetAnalysisMaker(maker);
175 
176  mgr->AddTask(task);
177 
178  //Create containers
179 
180  if(outputfile.Length()==0) outputfile = AliAnalysisManager::GetCommonFileName();
181 
182  AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(kAnaPi0, TList::Class(),
183  AliAnalysisManager::kOutputContainer,
184  Form("%s",outputfile.Data()));
185 
186  AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Param_%s",kAnaPi0.Data()), TList::Class(),
187  AliAnalysisManager::kParamContainer,
188  "AnalysisParameters.root");
189 
190  // Create ONLY the output containers for the data produced by the task.
191  // Get and connect other common input/output containers via the manager as below
192  //==============================================================================
193  mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
194  //if(!kData.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
195  mgr->ConnectOutput (task, 1, cout_pc);
196  mgr->ConnectOutput (task, 2, cout_cuts);
197 
198 // if(!mixOn)
199 // {
200  UInt_t mask = SetTriggerMaskFromName(trigger);
201  task->SelectCollisionCandidates(mask);
202 // }
203 
204  return task;
205 }
206 
210 AliCaloTrackReader * ConfigureReader(TString col, Bool_t simulation,
211  TString clustersArray, Bool_t tender,
212  TString calorimeter, Bool_t nonLinOn,
213  TString trigger, Bool_t rejectEMCTrig,
214  Int_t minCen, Int_t maxCen,
215  Bool_t printSettings, Int_t debug )
216 {
217  // Get the data type ESD or AOD
218  AliAnalysisManager * mgr = AliAnalysisManager::GetAnalysisManager();
219  TString inputDataType = mgr->GetInputEventHandler()->GetDataType();
220 
221  AliCaloTrackReader * reader = 0;
222  if (inputDataType == "AOD") reader = new AliCaloTrackAODReader();
223  else if(inputDataType == "ESD") reader = new AliCaloTrackESDReader();
224  else printf("AliCaloTrackReader::ConfigureReader() - Data not known InputData=%s\n",inputDataType.Data());
225 
226  reader->SetDebug(debug);//10 for lots of messages
227 
228  //
229  // MC settings
230  //
231  // Check if kine stack is available, independent of request of simulation
232  Bool_t useKinematics = kFALSE;
233  useKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
234 
235  if(simulation)
236  {
237  if (!useKinematics && inputDataType=="AOD") useKinematics = kTRUE; //AOD primary should be available ...
238  }
239 
240  if(useKinematics)
241  {
242  if(inputDataType == "ESD")
243  {
244  reader->SwitchOnStack();
245  reader->SwitchOffAODMCParticles();
246  }
247  else if(inputDataType == "AOD")
248  {
249  reader->SwitchOffStack();
250  reader->SwitchOnAODMCParticles();
251  }
252  }
253 
254  // In case of Pythia pt Hard bin simulations (jet-jet, gamma-jet)
255  // reject some special events that bother the cross section
256  if(simulation)
257  {
258  // Event rejection cuts for jet-jet simulations, do not use in other
259  reader->SetPtHardAndJetPtComparison(kTRUE);
260  reader->SetPtHardAndJetPtFactor(4);
261 
262  // Gamma-jet
263  //reader->SetPtHardAndClusterPtComparison(kTRUE);
264  //reader->SetPtHardAndClusterPtFactor(1.5);
265  }
266 
267  //------------------------
268  // Detector input filling
269  //------------------------
270 
271  //Min cluster/track E
272  reader->SetEMCALEMin(0.3);
273  reader->SetEMCALEMax(1000);
274  reader->SetPHOSEMin(0.3);
275  reader->SetPHOSEMax(1000);
276  reader->SetCTSPtMin(0.2);
277  reader->SetCTSPtMax(1000);
278 
281 
282  // Shower shape smearing
283  // Set it in the train configuration page not here for the moment
284 // if(simulation)
285 // {
286 // reader->SwitchOffShowerShapeSmearing(); // Active only on MC, off by default
287 // reader->SetShowerShapeSmearWidth(0.005);
288 // }
289 
290  //
291  // Tracks
292  //
293  reader->SwitchOnCTS();
294 
295  reader->SwitchOffUseTrackTimeCut();
296  reader->SetTrackTimeCut(0,50);
297 
298  reader->SwitchOffFiducialCut();
299  reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
300 
301  reader->SwitchOffUseTrackDCACut();
302  //reader->SetTrackDCACut(0,0.0105);
303  //reader->SetTrackDCACut(1,0.035);
304  //reader->SetTrackDCACut(2,1.1);
305 
306  if(inputDataType=="ESD")
307  {
308  gROOT->LoadMacro("$ALICE_PHYSICS/PWGJE/macros/CreateTrackCutsPWGJE.C");
309 
310  //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
311  //reader->SetTrackCuts(esdTrackCuts);
312 
313  AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
314  reader->SetTrackCuts(esdTrackCuts);
315  AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
316  reader->SetTrackComplementaryCuts(esdTrackCuts2);
317 
319  }
320  else if(inputDataType=="AOD")
321  {
322  reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
324  reader->SetTrackStatus(AliVTrack::kITSrefit);
325 
326  //reader->SwitchOnAODPrimaryTrackSelection(); // Used in preliminary results of QM from Nicolas and Xiangrong?
327  //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
328  //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid, TPC only
329  }
330 
331  //
332  // Calorimeter
333  //
334  if(clustersArray == "" && !tender)
335  {
336  printf("**************** Standard EMCAL clusters branch analysis **************** \n");
338  // Check in ConfigureCaloUtils that the recalibration and bad map are ON
339  }
340  else
341  {
342  printf("**************** Input for analysis is Clusterizer %s **************** \n", clustersArray.Data());
343  reader->SetEMCALClusterListName(clustersArray);
345  }
346 
347  // Time cuts
349  if(simulation)
350  {
351  reader->SwitchOffUseEMCALTimeCut();
352  reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
353  }
354  else
355  {
356  reader->SwitchOnUseEMCALTimeCut();
357  reader->SetEMCALTimeCut(-25,20);
358  }
359 
360  // CAREFUL
361  if(nonLinOn) reader->SwitchOnClusterELinearityCorrection();
363 
364  if(calorimeter.Contains("EMCAL"))
365  {
366  reader->SwitchOnEMCALCells();
367  reader->SwitchOnEMCAL();
368  }
369 
370  if(calorimeter.Contains("PHOS"))
371  { // Should be on if QA is activated with correlation on
372  reader->SwitchOnPHOSCells();
373  reader->SwitchOnPHOS();
374  }
375 
376  //-----------------
377  // Event selection
378  //-----------------
379 
380  //if(!simulation) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
381 
382  // Event triggered by EMCal selection settings
385 
386 
387  if( rejectEMCTrig && !simulation )
388  {
389  printf("=== Remove bad triggers === \n");
392 
393 // reader->SetTriggerPatchTimeWindow(8,9); // default values
394 // if (kRunNumber < 146861) reader->SetEventTriggerL0Threshold(3.);
395 // else if(kRunNumber < 154000) reader->SetEventTriggerL0Threshold(4.);
396 // else if(kRunNumber < 165000) reader->SetEventTriggerL0Threshold(5.5);
397 // //redefine for other periods, triggers
398 //
399 // if(kRunNumber < 172000)
400 // {
401 // reader->SetEventTriggerL1Bit(4,5); // current LHC11 data
402 // printf("\t Old L1 Trigger data format!\n");
403 // }
404 // else
405 // {
406 // reader->SetEventTriggerL1Bit(6,8); // LHC12-13 data
407 // printf("\t Current L1 Trigger data format!\n");
408 // }
409 
410  if(clustersArray != "" || tender)
411  {
412  printf("Trigger cluster calibration OFF\n");
414  }
415  }
416 
417  //reader->RejectFastClusterEvents() ;
418 
419  reader->SetZvertexCut(10.); // Open cut
420  reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
421  reader->SwitchOnRejectNoTrackEvents();
422 
423  reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
424  reader->SwitchOffPileUpEventRejection(); // remove pileup by default off, apply it only for MB not for trigger
425 
426  if(col=="PbPb")
427  {
428  // Centrality
429  reader->SetCentralityClass("V0M");
430  reader->SetCentralityOpt(100); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
431  reader->SetCentralityBin(minCen,maxCen); // Accept all events, if not select range
432 
433  // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
434  reader->SetEventPlaneMethod("V0");
435  }
436 
437  if(printSettings) reader->Print("");
438 
439  return reader;
440 }
441 
445 AliCalorimeterUtils* ConfigureCaloUtils(TString col, Bool_t simulation,
446  TString clustersArray, Bool_t tender,
447  Bool_t nonLinOn, Int_t year,
448  Bool_t printSettings, Int_t debug)
449 {
451 
452  cu->SetDebug(debug);
453 
454  // Remove clusters close to borders, at least max energy cell is 1 cell away
457 
459 
460  if (year == 2010) cu->SetNumberOfSuperModulesUsed(4);
461  else if(year <= 2013) cu->SetNumberOfSuperModulesUsed(10);
462  else if(year > 2013) cu->SetNumberOfSuperModulesUsed(20);
463  else cu->SetNumberOfSuperModulesUsed(10);
464 
465  if(kAnaPi0.Contains("_PHOS_") && !kAnaPi0.Contains("EMCAL") && !kAnaPi0.Contains("Both"))
466  {
467  if(year <= 2013) cu->SetNumberOfSuperModulesUsed(3);
468  else cu->SetNumberOfSuperModulesUsed(4);
469  }
470 
471  printf("xxx Number of SM set to <%d> xxx\n",cu->GetNumberOfSuperModulesUsed());
472 
473  // Search of local maxima in cluster
474  if(col=="pp")
475  {
476  cu->SetLocalMaximaCutE(0.1);
477  cu->SetLocalMaximaCutEDiff(0.03);
478  }
479  else
480  {
481  cu->SetLocalMaximaCutE(0.2);
482  cu->SetLocalMaximaCutEDiff(0.03);
483  }
484 
486 
488 
489  // EMCAL settings
490 
491  if(!simulation)
493 
494  AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
495 
496  // calibrations
497  Bool_t calibEner = kFALSE;
498  Bool_t calibTime = kFALSE;
499  cu->SwitchOffRecalibration();
501 
502  if( !tender )
503  {
504  cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering
506 
507  calibEner = kTRUE;
508  calibTime = kTRUE;
509  if (year > 2014) calibTime = kFALSE; // Remove as soon as calib available
510  }
511 
512  if( simulation )
513  {
514  calibEner = kFALSE;
515  calibTime = kFALSE;
516 
517  cu->SwitchOffRecalibration(); // Check the reader if it is taken into account during filtering
519  }
520 
521  gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/EMCAL/macros/ConfigureEMCALRecoUtils.C");
523  simulation,
524  kTRUE, // exotic
525  nonLinOn, // Non linearity
526  calibEner, // E calib
527  kTRUE, // bad map
528  calibTime); // time calib
529 
530  if( calibTime ) recou->SetExoticCellDiffTimeCut(200);
531 
532  if( nonLinOn ) cu->SwitchOnCorrectClusterLinearity();
533 
534  printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
535  printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
536 
537  // PHOS
539 
540  if(printSettings) cu->Print("");
541 
542  return cu;
543 }
544 
549 AliAnaPhoton* ConfigurePhotonAnalysis(TString col, Bool_t simulation,
550  TString calorimeter, Int_t year,
551  Int_t tm, Float_t shshMax,
552  Bool_t printSettings, Int_t debug)
553 {
554  AliAnaPhoton *ana = new AliAnaPhoton();
555 
556  // cluster selection cuts
557 
559 
560  ana->SwitchOffFiducialCut();
561 
562  ana->SetCalorimeter(calorimeter);
563 
564  ana->SwitchOnFillShowerShapeHistograms(); // Filled before photon shower shape selection
565 
566  //if(!simulation) ana->SwitchOnFillPileUpHistograms();
567 //
568  if(tm) ana->SwitchOnTrackMatchRejection() ;
569  else ana->SwitchOffTrackMatchRejection() ;
570 
571  ana->SwitchOnTMHistoFill() ;
572 
573  if(calorimeter == "PHOS")
574  {
575  ana->SetNCellCut(2);// At least 3 cells
576  ana->SetMinPt(0.5);
577  ana->SetMinDistanceToBadChannel(2, 4, 5);
578  ana->SetTimeCut(-1e10,1e10); // open cut
579  }
580  else
581  {//EMCAL
582  ana->SetNCellCut(1);// At least 2 cells
583  ana->SetMinEnergy(0.5); // avoid mip peak at E = 260 MeV
584  ana->SetMaxEnergy(100);
585  ana->SetTimeCut(-1e10,1e10); // open cut, usual time window of [425-825] ns if time recalibration is off
586  // restrict to less than 100 ns when time calibration is on
587  ana->SetMinDistanceToBadChannel(2, 4, 6);
588 
589  // NLM cut, used in all, exclude clusters with more than 2 maxima
590  // Not needed if M02 cut is already strong or clusterizer V2
591  ana->SetNLMCut(1, 2) ;
592  }
593 
594  //PID cuts (shower shape)
595  ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
596  AliCaloPID* caloPID = ana->GetCaloPID();
597  //Not used in bayesian
598 
599  // EMCAL
600 
601  //caloPID->SetEMCALLambda0CutMax(0.27);
602  if(calorimeter=="EMCAL")
603  {
604  caloPID->SetEMCALLambda0CutMax(shshMax);
605  caloPID->SetEMCALLambda0CutMin(0.10);
606  }
607 
608  // Track matching
609  caloPID->SetEMCALDEtaCut(0.025);
610  caloPID->SetEMCALDPhiCut(0.030);
611 
612  // PHOS
613  caloPID->SetPHOSDispersionCut(2.5);
614  caloPID->SetPHOSRCut(2.);
615  //if(kInputData=="AOD") caloPID->SetPHOSRCut(2000.); // Open cut since dX, dZ not stored
616 
617  // Branch AOD settings
618  ana->SetOutputAODName(Form("Photon_%s_%s",calorimeter.Data(), kAnaPi0.Data()));
619  ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
620 
621  //Set Histograms name tag, bins and ranges
622  ana->AddToHistogramsName(Form("AnaPhoton_%s_TM%d_",calorimeter.Data(),tm));
623 
624  SetAnalysisCommonParameters(ana,calorimeter,year,col,simulation,printSettings,debug) ; // see method below
625 
626  if(ana->GetFirstSMCoveredByTRD() > 0)
627  printf(">>> Set first SM covered by TRD, SM=%d <<< year %d \n", ana->GetFirstSMCoveredByTRD(),year);
628 
629  // Number of particle type MC histograms
630  ana->FillNOriginHistograms (14); // 14 max
631  ana->FillNPrimaryHistograms(6); // 6 max
632 
633  return ana;
634 }
635 
639 AliAnaPi0* ConfigurePi0Analysis(TString col, Bool_t simulation,
640  TString calorimeter, Bool_t bothCalo, Int_t year,
641  Int_t tm, Bool_t mixOn,
642  Bool_t printSettings, Int_t debug)
643 {
644  AliAnaPi0 *ana = new AliAnaPi0();
645 
646  ana->SetDebug(debug);
647 
648  // Input delta AOD settings
649  ana->SetInputAODName(Form("Photon_%s_%s",calorimeter.Data(),kAnaPi0.Data()));
650 
651  if(bothCalo)
652  {
654  if ( calorimeter == "EMCAL" ) ana->SetOtherDetectorInputName(Form("Photon_PHOS_%s" ,kAnaPi0.Data()));
655  else ana->SetOtherDetectorInputName(Form("Photon_EMCAL_%s",kAnaPi0.Data()));
656  }
657 
658  // Calorimeter settings
659  ana->SetCalorimeter(calorimeter);
660 
661  // settings for pp collision mixing
662  if(mixOn) ana->SwitchOnOwnMix();
663  else ana->SwitchOffOwnMix();
664 
665  // Cuts
666  if (calorimeter == "EMCAL" )
667  {
668  if(year < 2014) ana->SetPairTimeCut(50);
669  else ana->SetPairTimeCut(200); // REMEMBER to remove this when time calib is on
670  }
671 
672  ana->SetNPIDBits(1);
673  ana->SetNAsymCuts(1); // no asymmetry cut, previous studies showed small effect.
674  // In EMCAL assymetry cut prevents combination of assymetric decays which is the main source of pi0 at high E.
675 
676  if (col == "pp" )
677  {
678  ana->SetNCentrBin(1);
679  ana->SwitchOffTrackMultBins();
680  ana->SetNZvertBin(10);
681  ana->SetNRPBin(1);
682  ana->SetNMaxEvMix(100);
683  ana->SetMinPt(0.5); // 0.5
684  }
685  else if(col == "PbPb")
686  {
687  ana->SetNCentrBin(10);
688  ana->SetNZvertBin(10);
689  ana->SetNRPBin(4);
690  ana->SetNMaxEvMix(10);
691  ana->SetMinPt(1.5);
692  }
693  else if(col =="pPb")
694  {
695  ana->SetNCentrBin(1);
696  ana->SetNZvertBin(10);
697  ana->SetNRPBin(4);
698  ana->SetNMaxEvMix(100);
699  ana->SetMinPt(0.5);
700  }
701 
702  // Angle cut, avoid pairs with too large angle
703  ana->SwitchOnAngleSelection();
704  ana->SetAngleMaxCut(TMath::DegToRad()*80.); // EMCal: 4 SM in phi, 2 full SMs in eta
705  ana->SetAngleCut(0.014); // Minimum angle open, cell size
706 
707  //if(!bothCalo) ana->SwitchOnSMCombinations();
708  ana->SwitchOnSMCombinations();
710  ana->SwitchOnFillAngleHisto();
711  ana->SwitchOnFillOriginHisto(); // MC
712 
713  // Set Histograms name tag, bins and ranges
714 
715  if(!bothCalo) ana->AddToHistogramsName(Form("AnaPi0_%s_TM%d_",calorimeter.Data(),tm));
716  else ana->AddToHistogramsName(Form("AnaPi0_%sPlusOther_TM%d_",calorimeter.Data(),tm));
717 
718  SetAnalysisCommonParameters(ana,calorimeter,year,col,simulation,printSettings,debug) ; // see method below
719 
720  if(printSettings) ana->Print("");
721 
722  return ana;
723 }
724 
732  TString calorimeter, Int_t year,
733  TString col, Bool_t simulation,
734  Bool_t printSettings, Int_t debug)
735 {
736  //
737  // Histograms ranges
738  //
739  AliHistogramRanges* histoRanges = ana->GetHistogramRanges();
740 
741  histoRanges->SetHistoPtRangeAndNBins(0, 100, 200) ; // Energy and pt histograms
742 
743  if(calorimeter=="EMCAL")
744  {
745  if(year==2010)
746  {
747  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
748  histoRanges->SetHistoXRangeAndNBins(-230,90,120); // QA
749  histoRanges->SetHistoYRangeAndNBins(370,450,40); // QA
750  }
751  else if ( year < 2014 )
752  {
753  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
754  histoRanges->SetHistoXRangeAndNBins(-460,90,200); // QA
755  histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
756  }
757  else // Run2
758  {
759  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 329*TMath::DegToRad(), 250) ;
760  histoRanges->SetHistoXRangeAndNBins(-460,460,230); // QA
761  histoRanges->SetHistoYRangeAndNBins(-450,450,225); // QA
762  }
763 
764  histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
765  }
766  else if(calorimeter=="PHOS")
767  {
768  histoRanges->SetHistoPhiRangeAndNBins(250*TMath::DegToRad(), 320*TMath::DegToRad(), 70) ;
769  histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
770  }
771  else if(calorimeter=="CTS")
772  {
773  ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
774  ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
775  }
776 
777  histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
778 
779  // Invariant mass histo
780  histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
781  histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
782 
783  // check if time calibration is on
784  histoRanges->SetHistoTimeRangeAndNBins(0.,1000,1000);
785  //histoRanges->SetHistoTimeRangeAndNBins(-400.,400,400);
786  histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
787 
788  // track-cluster residuals
789  histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
790  histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
791  histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
792 
793  // QA, electron, charged
794  histoRanges->SetHistoPOverERangeAndNBins(0,2.,200);
795  histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200);
796 
797  // QA
798  histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
799  histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
800  histoRanges->SetHistoZRangeAndNBins(-350,350,175);
801  histoRanges->SetHistoRRangeAndNBins(430,460,30);
802  histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
803  histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
804 
805  // QA, correlation
806  if(col=="PbPb")
807  {
808  histoRanges->SetHistoNClusterCellRangeAndNBins(0,100,100);
809  histoRanges->SetHistoNClustersRangeAndNBins(0,500,50);
810  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,2000,200);
811  }
812  else
813  {
814  histoRanges->SetHistoNClusterCellRangeAndNBins(0,50,50);
815  histoRanges->SetHistoNClustersRangeAndNBins(0,50,50);
816  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,200,200);
817  }
818 
819  // xE, zT
820  histoRanges->SetHistoRatioRangeAndNBins(0.,2.,200);
821  histoRanges->SetHistoHBPRangeAndNBins (0.,10.,200);
822 
823  // Isolation
824  histoRanges->SetHistoPtInConeRangeAndNBins(0, 50 , 250);
825  histoRanges->SetHistoPtSumRangeAndNBins (0, 100, 250);
826 
827  //
828  // TRD SM
829  //
830  if (year == 2011) ana->SetFirstSMCoveredByTRD( 6);
831  else if(year == 2012 ||
832  year == 2013) ana->SetFirstSMCoveredByTRD( 4);
833  else ana->SetFirstSMCoveredByTRD(-1);
834 
835  //
836  // MC histograms?
837  //
838  if(simulation) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
839  else ana->SwitchOffDataMC() ;
840 
841  if(col.Contains("PbPb")) ana->SwitchOnFillHighMultiplicityHistograms();
843 
844  //Set here generator name, default pythia
845  //ana->GetMCAnalysisUtils()->SetMCGenerator("");
846 
847  //
848  // Debug
849  //
850  if(printSettings) ana->Print("");
851 
852  ana->SetDebug(debug); // 10 for lots of messages
853 }
854 
859 UInt_t SetTriggerMaskFromName(TString trigger)
860 {
861  if(trigger=="EMC7")
862  {
863  printf("CaloTrackCorr trigger EMC7\n");
864  return AliVEvent::kEMC7;
865  }
866  else if (trigger=="INT7")
867  {
868  printf("CaloTrackCorr trigger INT7\n");
869  return AliVEvent::kINT7;
870  }
871  else if(trigger=="EMC1")
872  {
873  printf("CaloTrackCorr trigger EMC1\n");
874  return AliVEvent::kEMC1;
875  }
876  else if(trigger=="MB")
877  {
878  printf("CaloTrackCorr trigger MB\n");
879  return AliVEvent::kMB;
880  }
881  else if(trigger=="PHOS")
882  {
883  printf("CaloTrackCorr trigger PHOS\n");
884  return AliVEvent::kPHI7;
885  }
886  else if(trigger=="PHOSPb")
887  {
888  printf("CaloTrackCorr trigger PHOSPb\n");
889  return AliVEvent::kPHOSPb;
890  }
891  else if(trigger=="AnyINT")
892  {
893  printf("CaloTrackCorr trigger AnyINT\n");
894  return AliVEvent::kAnyINT;
895  }
896  else if(trigger=="INT")
897  {
898  printf("CaloTrackCorr trigger AnyINT\n");
899  return AliVEvent::kAny;
900  }
901  else if(trigger=="EMCEGA")
902  {
903  printf("CaloTrackCorr trigger EMC Gamma\n");
904  return AliVEvent::kEMCEGA;
905  }
906  else if(trigger=="EMCEJE")
907  {
908  printf("CaloTrackCorr trigger EMC Jet\n");
909  return AliVEvent::kEMCEJE;
910  }
911  else if(trigger=="Central")
912  {
913  printf("CaloTrackCorr trigger Central\n");
914  return AliVEvent::kCentral;
915  }
916  else if(trigger=="CentralEGA")
917  {
918  printf("CaloTrackCorr trigger Central+EMCEGA\n");
919  return (AliVEvent::kCentral | AliVEvent::kEMCEGA);
920  }
921  else if(trigger=="SemiCentral")
922  {
923  printf("CaloTrackCorr trigger SemiCentral\n");
924  return AliVEvent::kSemiCentral;
925  }
926  else if(trigger=="SemiOrCentral")
927  {
928  printf("CaloTrackCorr trigger SemiCentral Or Central\n");
929  return (AliVEvent::kSemiCentral | AliVEvent::kCentral);
930  }
931  else return AliVEvent::kAny;
932 }
933 
virtual void SwitchOnAODTrackSharedClusterSelection()
void SetHistoTrackMultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n)
virtual void SetDebug(Int_t d)
AliAnalysisTaskCaloTrackCorrelation * AddTaskPi0(TString calorimeter="EMCAL", Bool_t simulation=kFALSE, Int_t year=2015, TString col="pp", TString trigger="EMC7", Bool_t rejectEMCTrig=kFALSE, Bool_t muonCaloPass=kFALSE, TString clustersArray="", Bool_t tender=kFALSE, Bool_t nonLinOn=kFALSE, Float_t shshMax=0.5, Bool_t tm=kTRUE, Int_t minCen=-1, Int_t maxCen=-1, Bool_t mixOn=kTRUE, TString outputfile="", Bool_t printSettings=kFALSE, Int_t debug=0)
Definition: AddTaskPi0.C:35
void SetAngleCut(Float_t a)
Definition: AliAnaPi0.h:76
void SetNumberOfCellsFromPHOSBorder(Int_t n)
void SwitchOnPairWithOtherDetector()
Definition: AliAnaPi0.h:141
void SwitchOnFillOriginHisto()
Definition: AliAnaPi0.h:128
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 SetHistoXRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SwitchOnTrackMatchRejection()
Definition: AliAnaPhoton.h:108
void SwitchOnLoadOwnEMCALGeometryMatrices()
void SwitchOnTMHistoFill()
Definition: AliAnaPhoton.h:80
AliAnaPi0 * ConfigurePi0Analysis(TString col, Bool_t simulation, TString calorimeter, Bool_t bothCalo, Int_t year, Int_t tm, Bool_t mixOn, Bool_t printSettings, Int_t debug)
Definition: AddTaskPi0.C:639
void SetNPIDBits(Int_t s)
Definition: AliAnaPi0.h:115
virtual void SwitchOnAODHybridTrackSelection()
virtual void SetCentralityBin(Int_t min, Int_t max)
AliEMCALRecoUtils * GetEMCALRecoUtils() const
void FillNPrimaryHistograms(Int_t n)
Definition: AliAnaPhoton.h:113
void SwitchOffClusterELinearityCorrection()
void SetCTSPtMax(Float_t pt)
void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n)
Selected photon clusters invariant mass analysis.
Definition: AliAnaPi0.h:38
virtual void SetCalorimeter(TString &calo)
Set the calorimeter for the analysis. A string.
virtual void SetInputAODName(TString name)
virtual void SetTrackComplementaryCuts(AliESDtrackCuts *)
void SwitchOnSMCombinations()
Definition: AliAnaPi0.h:89
void SetMinDistanceToBadChannel(Float_t m1, Float_t m2, Float_t m3)
Definition: AliAnaPhoton.h:91
void SwitchOnAngleSelection()
Definition: AliAnaPi0.h:70
virtual void SetOutputAODClassName(TString name)
void SwitchOffMultipleCutAnalysis()
Definition: AliAnaPi0.h:110
void SetHistodRRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetLocalMaximaCutEDiff(Float_t c)
void SetPHOSEMax(Float_t e)
void SetNumberOfCellsFromEMCALBorder(Int_t n)
void SetEMCALEMin(Float_t e)
void SetNCellCut(Int_t n)
Definition: AliAnaPhoton.h:99
void SetAngleMaxCut(Float_t a)
Definition: AliAnaPi0.h:77
const TString calorimeter
Definition: anaM.C:35
virtual void SetPtHardAndJetPtComparison(Bool_t compare)
Bool_t IsRecalibrationOn() const
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 SetPHOSRCut(Float_t rcut)
Definition: AliCaloPID.h:207
void SetEMCALDPhiCut(Float_t dcut)
Definition: AliCaloPID.h:201
virtual void SetOutputAODName(TString name)
void SwitchOffRecalculateClusterTrackMatching()
void SwitchOnFillAngleHisto()
Definition: AliAnaPi0.h:79
void SwitchOffVertexBCEventSelection()
Base class for CaloTrackCorr analysis algorithms.
void SwitchOffTrackMatchRejection()
Definition: AliAnaPhoton.h:109
void SetHistoPtInConeRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual void SetDebug(Int_t d)
void SetHistoPOverERangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual AliFiducialCut * GetFiducialCut()
virtual void SetCentralityOpt(Int_t opt)
void SetHistoPhiRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual AliHistogramRanges * GetHistogramRanges()
void SetHistoPtSumRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetTrackStatus(ULong_t bit)
TString kAnaPi0
Global name to be composed of the settings, used to set the AOD branch name.
Definition: AddTaskPi0.C:9
Bool_t IsBadChannelsRemovalSwitchedOn() const
Filter EMCal/PHOS clusters for photon analysis.
Definition: AliAnaPhoton.h:32
void SetHistoTrackResidualPhiRangeAndNBins(Float_t min, Float_t max, Int_t n)
AliCaloTrackReader * ConfigureReader(TString col, Bool_t simulation, TString clustersArray, Bool_t tender, TString calorimeter, Bool_t nonLinOn, TString trigger, Bool_t rejectEMCTrig, Int_t minCen, Int_t maxCen, Bool_t printSettings, Int_t debug)
Definition: AddTaskPi0.C:210
void SwitchOffTriggerClusterTimeRecal()
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.
Definition: AliAnaPi0.cxx:1384
Int_t GetNumberOfSuperModulesUsed() const
void SetHistoYRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetTimeCut(Double_t min, Double_t max)
Definition: AliAnaPhoton.h:94
void SetAnalysisCommonParameters(AliAnaCaloTrackCorrBaseClass *ana, TString calorimeter, Int_t year, TString col, Bool_t simulation, Bool_t printSettings, Int_t debug)
Definition: AddTaskPi0.C:731
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
virtual void SetNCentrBin(Int_t n=1)
Number of bins in reaction plain.
virtual void SetPtHardAndJetPtFactor(Float_t factor)
Class for event, clusters and tracks filtering and preparation for the ESD analysis.
AliAnaPhoton * ConfigurePhotonAnalysis(TString col, Bool_t simulation, TString calorimeter, Int_t year, Int_t tm, Float_t shshMax, Bool_t printSettings, Int_t debug)
Definition: AddTaskPi0.C:549
virtual void SetEventPlaneMethod(TString m)
void SetNAsymCuts(Int_t s)
Definition: AliAnaPi0.h:113
virtual void SetNRPBin(Int_t n=1)
Number of bins for vertex position.
void SetHistoNClustersRangeAndNBins(Int_t min, Int_t max, Int_t n)
void SetPHOSDispersionCut(Float_t dcut)
Definition: AliCaloPID.h:210
UInt_t SetTriggerMaskFromName(TString trigger)
Definition: AddTaskPi0.C:859
virtual void SetTrackCuts(AliESDtrackCuts *)
virtual void SwitchOffFiducialCut()
virtual void SetCentralityClass(TString name)
void SwitchOnFillShowerShapeHistograms()
Definition: AliAnaPhoton.h:69
void SwitchOnBadTriggerEventsRemoval()
void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SwitchOnClusterELinearityCorrection()
void SetTrackTimeCut(Double_t a, Double_t b)
void SetEMCALTimeCut(Double_t a, Double_t b)
void SetHistoAsymmetryRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoV0MultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n)
Main class conecting the CaloTrackCorrelations package and Analysis Frame.
void SwitchOffLoadOwnPHOSGeometryMatrices()
void SetHistoZRangeAndNBins(Float_t min, Float_t max, Int_t n)
AliCalorimeterUtils * ConfigureCaloUtils(TString col, Bool_t simulation, TString clustersArray, Bool_t tender, Bool_t nonLinOn, Int_t year, Bool_t printSettings, Int_t debug)
Definition: AddTaskPi0.C:445
void SetHistoV0SignalRangeAndNBins(Int_t min, Int_t max, Int_t n)
virtual void Print(const Option_t *) const
Print some relevant parameters set for the analysis.
void SetHistoTimeRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoFinePtRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetOtherDetectorInputName(TString name)
Definition: AliAnaPi0.h:143
Class for PID selection with calorimeters.
Definition: AliCaloPID.h:51
void FillNOriginHistograms(Int_t n)
Definition: AliAnaPhoton.h:111
virtual void SetNMaxEvMix(Int_t n=20)
Number of bins in track multiplicity.
void SetPHOSEMin(Float_t e)
void SetHistoShowerShapeRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistodEdxRangeAndNBins(Float_t min, Float_t max, Int_t n)
Class with utils specific to calorimeter clusters/cells.
virtual void SwitchOnConstrainTrackToVertex()
void SetHistoHBPRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetEMCALLambda0CutMin(Float_t lcut)
Definition: AliCaloPID.h:195
void SetHistoRRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoVertexDistRangeAndNBins(Float_t min, Float_t max, Int_t n)
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 SetLocalMaximaCutE(Float_t cut)
void SetHistoRatioRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetNLMCut(Int_t min, Int_t max)
Definition: AliAnaPhoton.h:102
void ConfigureEMCALRecoUtils(AliEMCALRecoUtils *reco, Bool_t bMC=kFALSE, Bool_t bExotic=kTRUE, Bool_t bNonLin=kFALSE, Bool_t bRecalE=kTRUE, Bool_t bBad=kTRUE, Bool_t bRecalT=kTRUE)
Int_t GetFirstSMCoveredByTRD() const
Time cut in ns.
Steering class of package CaloTrackCorrelartions.