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