AliPhysics  d497547 (d497547)
 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  // In case of Pythia pt Hard bin simulations (jet-jet, gamma-jet)
261  // reject some special events that bother the cross section
262  if(simulation)
263  {
264  // Event rejection cuts for jet-jet simulations, do not use in other
265  reader->SetPtHardAndJetPtComparison(kTRUE);
266  reader->SetPtHardAndJetPtFactor(4);
267 
268  // Gamma-jet
269  //reader->SetPtHardAndClusterPtComparison(kTRUE);
270  //reader->SetPtHardAndClusterPtFactor(1.5);
271  }
272 
273  //------------------------
274  // Detector input filling
275  //------------------------
276 
277  //Min cluster/track E
278  reader->SetEMCALEMin(0.3);
279  reader->SetEMCALEMax(1000);
280  reader->SetPHOSEMin(0.3);
281  reader->SetPHOSEMax(1000);
282  reader->SetCTSPtMin(0.2);
283  reader->SetCTSPtMax(1000);
284 
285 // reader->SetEMCALNCellsCut(1);
286 // reader->SetPHOSNCellsCut(2);
287 //
288 // reader->SetEMCALBadChannelMinDist(2);
289 // reader->SetPHOSBadChannelMinDist(2);
290 
293 
294  // Shower shape smearing
295  // Set it in the train configuration page not here for the moment
296 // if(simulation)
297 // {
298 // reader->SwitchOffShowerShapeSmearing(); // Active only on MC, off by default
299 // reader->SetShowerShapeSmearWidth(0.005);
300 // }
301 
302  //
303  // Tracks
304  //
305  reader->SwitchOnCTS();
306 
307  reader->SwitchOffUseTrackTimeCut();
308  reader->SetTrackTimeCut(0,50);
309 
310  reader->SwitchOffFiducialCut();
311  reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
312 
313  reader->SwitchOffUseTrackDCACut();
314  //reader->SetTrackDCACut(0,0.0105);
315  //reader->SetTrackDCACut(1,0.035);
316  //reader->SetTrackDCACut(2,1.1);
317 
318  if(inputDataType=="ESD")
319  {
320  gROOT->LoadMacro("$ALICE_PHYSICS/PWGJE/macros/CreateTrackCutsPWGJE.C");
321 
322  //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
323  //reader->SetTrackCuts(esdTrackCuts);
324 
325  AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
326  reader->SetTrackCuts(esdTrackCuts);
327  AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
328  reader->SetTrackComplementaryCuts(esdTrackCuts2);
329 
331  }
332  else if(inputDataType=="AOD")
333  {
334  reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
336  reader->SetTrackStatus(AliVTrack::kITSrefit);
337 
338  //reader->SwitchOnAODPrimaryTrackSelection(); // Used in preliminary results of QM from Nicolas and Xiangrong?
339  //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
340  //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid, TPC only
341  }
342 
343  //
344  // Calorimeter
345  //
346  if(clustersArray == "" && !tender)
347  {
348  printf("**************** Standard EMCAL clusters branch analysis **************** \n");
350  // Check in ConfigureCaloUtils that the recalibration and bad map are ON
351  }
352  else
353  {
354  printf("**************** Input for analysis is Clusterizer %s **************** \n", clustersArray.Data());
355  reader->SetEMCALClusterListName(clustersArray);
357  }
358 
359  // Time cuts
361  if(simulation)
362  {
363  reader->SwitchOffUseEMCALTimeCut();
364  reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
365  }
366  else
367  {
368  reader->SwitchOnUseEMCALTimeCut();
369  reader->SetEMCALTimeCut(-25,20);
370  }
371 
372  // CAREFUL
373  if(nonLinOn) reader->SwitchOnClusterELinearityCorrection();
375 
376  if(calorimeter.Contains("EMCAL"))
377  {
378  reader->SwitchOnEMCALCells();
379  reader->SwitchOnEMCAL();
380  }
381 
382  if(calorimeter.Contains("PHOS"))
383  { // Should be on if QA is activated with correlation on
384  reader->SwitchOnPHOSCells();
385  reader->SwitchOnPHOS();
386  }
387 
388  //-----------------
389  // Event selection
390  //-----------------
391 
392  //if(!simulation) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
393 
394  // Event triggered by EMCal selection settings
397 
398 
399  if( rejectEMCTrig && !simulation )
400  {
401  printf("=== Remove bad triggers === \n");
404 
405 // reader->SetTriggerPatchTimeWindow(8,9); // default values
406 // if (kRunNumber < 146861) reader->SetEventTriggerL0Threshold(3.);
407 // else if(kRunNumber < 154000) reader->SetEventTriggerL0Threshold(4.);
408 // else if(kRunNumber < 165000) reader->SetEventTriggerL0Threshold(5.5);
409 // //redefine for other periods, triggers
410 //
411 // if(kRunNumber < 172000)
412 // {
413 // reader->SetEventTriggerL1Bit(4,5); // current LHC11 data
414 // printf("\t Old L1 Trigger data format!\n");
415 // }
416 // else
417 // {
418 // reader->SetEventTriggerL1Bit(6,8); // LHC12-13 data
419 // printf("\t Current L1 Trigger data format!\n");
420 // }
421 
422  if(clustersArray != "" || tender)
423  {
424  printf("Trigger cluster calibration OFF\n");
426  }
427  }
428 
429  //reader->RejectFastClusterEvents() ;
430 
431  reader->SetZvertexCut(10.); // Open cut
432  reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
433  reader->SwitchOnRejectNoTrackEvents();
434 
435  reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
436  reader->SwitchOffPileUpEventRejection(); // remove pileup by default off, apply it only for MB not for trigger
437 
438  if(col=="PbPb")
439  {
440  // Centrality
441  reader->SetCentralityClass("V0M");
442  reader->SetCentralityOpt(100); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
443  reader->SetCentralityBin(minCen,maxCen); // Accept all events, if not select range
444 
445  // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
446  reader->SetEventPlaneMethod("V0");
447  }
448 
449  if(printSettings) reader->Print("");
450 
451  return reader;
452 }
453 
458  TString clustersArray, Bool_t tender,
459  Bool_t nonLinOn, Int_t year,
460  Bool_t printSettings, Int_t debug)
461 {
463 
464  cu->SetDebug(debug);
465 
466  // Remove clusters close to borders, at least max energy cell is 1 cell away
469 
471 
472  if (year == 2010) cu->SetNumberOfSuperModulesUsed(4);
473  else if(year <= 2013) cu->SetNumberOfSuperModulesUsed(10);
474  else if(year > 2013) cu->SetNumberOfSuperModulesUsed(20);
475  else cu->SetNumberOfSuperModulesUsed(10);
476 
477  if(kAnaPi0.Contains("_PHOS_") && !kAnaPi0.Contains("EMCAL") && !kAnaPi0.Contains("Both"))
478  {
479  if(year <= 2013) cu->SetNumberOfSuperModulesUsed(3);
480  else cu->SetNumberOfSuperModulesUsed(4);
481  }
482 
483  printf("xxx Number of SM set to <%d> xxx\n",cu->GetNumberOfSuperModulesUsed());
484 
485  // Search of local maxima in cluster
486  if(col=="pp")
487  {
488  cu->SetLocalMaximaCutE(0.1);
489  cu->SetLocalMaximaCutEDiff(0.03);
490  }
491  else
492  {
493  cu->SetLocalMaximaCutE(0.2);
494  cu->SetLocalMaximaCutEDiff(0.03);
495  }
496 
498 
500 
501  // EMCAL settings
502 
503  if(!simulation)
505 
506  AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
507 
508  // calibrations
509  Bool_t calibEner = kFALSE;
510  Bool_t calibTime = kFALSE;
511  cu->SwitchOffRecalibration();
513 
514  if( !tender )
515  {
516  cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering
518 
519  calibEner = kTRUE;
520  calibTime = kTRUE;
521  if (year > 2014) calibTime = kFALSE; // Remove as soon as calib available
522  }
523 
524  if( simulation )
525  {
526  calibEner = kFALSE;
527  calibTime = kFALSE;
528 
529  cu->SwitchOffRecalibration(); // Check the reader if it is taken into account during filtering
531  }
532 
533  gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/EMCAL/macros/ConfigureEMCALRecoUtils.C");
535  simulation,
536  kTRUE, // exotic
537  nonLinOn, // Non linearity
538  calibEner, // E calib
539  kTRUE, // bad map
540  calibTime); // time calib
541 
542  if( calibTime ) recou->SetExoticCellDiffTimeCut(200);
543 
544  if( nonLinOn ) cu->SwitchOnCorrectClusterLinearity();
545 
546  printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
547  printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
548 
549  // PHOS
551 
552  if(printSettings) cu->Print("");
553 
554  return cu;
555 }
556 
562  TString calorimeter, Int_t year,
563  Int_t tm, Float_t shshMax,
564  Bool_t printSettings, Int_t debug)
565 {
566  AliAnaPhoton *ana = new AliAnaPhoton();
567 
568  // cluster selection cuts
569 
571 
572  ana->SwitchOffFiducialCut();
573 
574  ana->SetCalorimeter(calorimeter);
575 
576  ana->SwitchOnFillShowerShapeHistograms(); // Filled before photon shower shape selection
577 
578  //if(!simulation) ana->SwitchOnFillPileUpHistograms();
579 //
580  if(tm) ana->SwitchOnTrackMatchRejection() ;
581  else ana->SwitchOffTrackMatchRejection() ;
582 
583  ana->SwitchOnTMHistoFill() ;
584 
585  if(calorimeter == "PHOS")
586  {
587  ana->SetNCellCut(2);// At least 3 cells
588  ana->SetMinPt(0.5);
589  ana->SetMinDistanceToBadChannel(2, 4, 5);
590  ana->SetTimeCut(-1e10,1e10); // open cut
591  }
592  else
593  {//EMCAL
594  ana->SetNCellCut(1);// At least 2 cells
595  ana->SetMinEnergy(0.5); // avoid mip peak at E = 260 MeV
596  ana->SetMaxEnergy(100);
597  ana->SetTimeCut(-1e10,1e10); // open cut, usual time window of [425-825] ns if time recalibration is off
598  // restrict to less than 100 ns when time calibration is on
599  ana->SetMinDistanceToBadChannel(2, 4, 6);
600 
601  // NLM cut, used in all, exclude clusters with more than 2 maxima
602  // Not needed if M02 cut is already strong or clusterizer V2
603  ana->SetNLMCut(1, 2) ;
604  }
605 
606  //PID cuts (shower shape)
607  ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
608  AliCaloPID* caloPID = ana->GetCaloPID();
609  //Not used in bayesian
610 
611  // EMCAL
612 
613  //caloPID->SetEMCALLambda0CutMax(0.27);
614  if(calorimeter=="EMCAL")
615  {
616  caloPID->SetEMCALLambda0CutMax(shshMax);
617  caloPID->SetEMCALLambda0CutMin(0.10);
618  }
619 
620  // Track matching
621  caloPID->SetEMCALDEtaCut(0.025);
622  caloPID->SetEMCALDPhiCut(0.030);
623 
624  // PHOS
625  caloPID->SetPHOSDispersionCut(2.5);
626  caloPID->SetPHOSRCut(2.);
627  //if(kInputData=="AOD") caloPID->SetPHOSRCut(2000.); // Open cut since dX, dZ not stored
628 
629  // Branch AOD settings
630  ana->SetOutputAODName(Form("Photon_%s_%s",calorimeter.Data(), kAnaPi0.Data()));
631  ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
632 
633  //Set Histograms name tag, bins and ranges
634  ana->AddToHistogramsName(Form("AnaPhoton_%s_TM%d_",calorimeter.Data(),tm));
635 
636  SetAnalysisCommonParameters(ana,calorimeter,year,col,simulation,printSettings,debug) ; // see method below
637 
638  if(ana->GetFirstSMCoveredByTRD() > 0)
639  printf(">>> Set first SM covered by TRD, SM=%d <<< year %d \n", ana->GetFirstSMCoveredByTRD(),year);
640 
641  // Number of particle type MC histograms
642  ana->FillNOriginHistograms (14); // 18 max
643  ana->FillNPrimaryHistograms(4); // 7 max
644 
645  return ana;
646 }
647 
652  TString calorimeter, Bool_t bothCalo, Int_t year,
653  Int_t tm, Bool_t mixOn,
654  Bool_t printSettings, Int_t debug)
655 {
656  AliAnaPi0 *ana = new AliAnaPi0();
657 
658  ana->SetDebug(debug);
659 
660  // Input delta AOD settings
661  ana->SetInputAODName(Form("Photon_%s_%s",calorimeter.Data(),kAnaPi0.Data()));
662 
663  if(bothCalo)
664  {
666  if ( calorimeter == "EMCAL" ) ana->SetOtherDetectorInputName(Form("Photon_PHOS_%s" ,kAnaPi0.Data()));
667  else ana->SetOtherDetectorInputName(Form("Photon_EMCAL_%s",kAnaPi0.Data()));
668  }
669 
670  // Calorimeter settings
671  ana->SetCalorimeter(calorimeter);
672 
673  // Acceptance plots
674  // ana->SwitchOnFiducialCut(); // Needed to fill acceptance plots with predefined calorimeter acceptances
675  // ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.7, 100, 180) ;
676  // ana->GetFiducialCut()->DoEMCALFiducialCut(kTRUE);
677 
678  ana->SwitchOffFiducialCut();
680 
681  // settings for pp collision mixing
682  if(mixOn) ana->SwitchOnOwnMix();
683  else ana->SwitchOffOwnMix();
684 
685  // Cuts
686  if (calorimeter == "EMCAL" )
687  {
688  if(year < 2014) ana->SetPairTimeCut(50);
689  else ana->SetPairTimeCut(200); // REMEMBER to remove this when time calib is on
690  }
691 
692  ana->SetNPIDBits(1);
693  ana->SetNAsymCuts(1); // no asymmetry cut, previous studies showed small effect.
694  // In EMCAL assymetry cut prevents combination of assymetric decays which is the main source of pi0 at high E.
695 
696  if (col == "pp" )
697  {
698  ana->SetNCentrBin(1);
699  ana->SwitchOffTrackMultBins();
700  ana->SetNZvertBin(10);
701  ana->SetNRPBin(1);
702  ana->SetNMaxEvMix(100);
703  ana->SetMinPt(0.5); // 0.5
704  }
705  else if(col == "PbPb")
706  {
707  ana->SetNCentrBin(10);
708  ana->SetNZvertBin(10);
709  ana->SetNRPBin(4);
710  ana->SetNMaxEvMix(10);
711  ana->SetMinPt(1.5);
712  }
713  else if(col =="pPb")
714  {
715  ana->SetNCentrBin(1);
716  ana->SetNZvertBin(10);
717  ana->SetNRPBin(4);
718  ana->SetNMaxEvMix(100);
719  ana->SetMinPt(0.5);
720  }
721 
722  // Angle cut, avoid pairs with too large angle
723  ana->SwitchOnAngleSelection();
724  ana->SetAngleMaxCut(TMath::DegToRad()*80.); // EMCal: 4 SM in phi, 2 full SMs in eta
725  ana->SetAngleCut(0.016); // Minimum angle open, cell size
726 
727  //if(!bothCalo) ana->SwitchOnSMCombinations();
728  ana->SwitchOnSMCombinations();
730  ana->SwitchOnFillAngleHisto();
731  ana->SwitchOnFillOriginHisto(); // MC
732 
733  // Set Histograms name tag, bins and ranges
734 
735  if(!bothCalo) ana->AddToHistogramsName(Form("AnaPi0_%s_TM%d_",calorimeter.Data(),tm));
736  else ana->AddToHistogramsName(Form("AnaPi0_%sPlusOther_TM%d_",calorimeter.Data(),tm));
737 
738  SetAnalysisCommonParameters(ana,calorimeter,year,col,simulation,printSettings,debug) ; // see method below
739 
740  if(printSettings) ana->Print("");
741 
742  return ana;
743 }
744 
752  TString calorimeter, Int_t year,
753  TString col, Bool_t simulation,
754  Bool_t printSettings, Int_t debug)
755 {
756  //
757  // Histograms ranges
758  //
759  AliHistogramRanges* histoRanges = ana->GetHistogramRanges();
760 
761  histoRanges->SetHistoPtRangeAndNBins(0, 40, 80) ; // Energy and pt histograms
762 
763  if(calorimeter=="EMCAL")
764  {
765  if(year==2010)
766  {
767  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
768  histoRanges->SetHistoXRangeAndNBins(-230,90,120); // QA
769  histoRanges->SetHistoYRangeAndNBins(370,450,40); // QA
770  }
771  else if ( year < 2014 )
772  {
773  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 104) ;
774  histoRanges->SetHistoXRangeAndNBins(-460,90,200); // QA
775  histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
776  }
777  else // Run2
778  {
779  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 329*TMath::DegToRad(), 250) ;
780  histoRanges->SetHistoXRangeAndNBins(-460,460,230); // QA
781  histoRanges->SetHistoYRangeAndNBins(-450,450,225); // QA
782  }
783 
784  histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
785  }
786  else if(calorimeter=="PHOS")
787  {
788  histoRanges->SetHistoPhiRangeAndNBins(250*TMath::DegToRad(), 320*TMath::DegToRad(), 70) ;
789  histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
790  }
791  else if(calorimeter=="CTS")
792  {
793  ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
794  ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
795  }
796 
797  histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
798 
799  // Invariant mass histo
800  histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
801  histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
802 
803  // check if time calibration is on
804  histoRanges->SetHistoTimeRangeAndNBins(-1000,1000,1000);
805  //histoRanges->SetHistoTimeRangeAndNBins(-400.,400,400);
806  histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
807 
808  // track-cluster residuals
809  histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.05,0.05,100);
810  histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.05,0.05,100);
811  histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
812 
813  // QA, electron, charged
814  histoRanges->SetHistoPOverERangeAndNBins(0,2.,200);
815  histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200);
816 
817  // QA
818  histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
819  histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
820  histoRanges->SetHistoZRangeAndNBins(-350,350,175);
821  histoRanges->SetHistoRRangeAndNBins(430,460,30);
822  histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
823  histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
824 
825  // QA, correlation
826  if(col=="PbPb")
827  {
828  histoRanges->SetHistoNClusterCellRangeAndNBins(0,100,100);
829  histoRanges->SetHistoNClustersRangeAndNBins(0,500,50);
830  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,2000,200);
831  }
832  else
833  {
834  histoRanges->SetHistoNClusterCellRangeAndNBins(0,50,50);
835  histoRanges->SetHistoNClustersRangeAndNBins(0,50,50);
836  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,200,200);
837  }
838 
839  // xE, zT
840  histoRanges->SetHistoRatioRangeAndNBins(0.,2.,200);
841  histoRanges->SetHistoHBPRangeAndNBins (0.,10.,200);
842 
843  // Isolation
844  histoRanges->SetHistoPtInConeRangeAndNBins(0, 50 , 250);
845  histoRanges->SetHistoPtSumRangeAndNBins (0, 100, 250);
846 
847  //
848  // TRD SM
849  //
850  if (year == 2011) ana->SetFirstSMCoveredByTRD( 6);
851  else if(year == 2012 ||
852  year == 2013) ana->SetFirstSMCoveredByTRD( 4);
853  else ana->SetFirstSMCoveredByTRD(-1);
854 
855  //
856  // MC histograms?
857  //
858  if(simulation) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
859  else ana->SwitchOffDataMC() ;
860 
861  if(col.Contains("PbPb")) ana->SwitchOnFillHighMultiplicityHistograms();
863 
864  //Set here generator name, default pythia
865  //ana->GetMCAnalysisUtils()->SetMCGenerator("");
866 
867  //
868  // Debug
869  //
870  if(printSettings) ana->Print("");
871 
872  ana->SetDebug(debug); // 10 for lots of messages
873 }
874 
880 {
881  if(trigger=="EMC7")
882  {
883  printf("CaloTrackCorr trigger EMC7\n");
884  return AliVEvent::kEMC7;
885  }
886  else if (trigger=="INT7")
887  {
888  printf("CaloTrackCorr trigger INT7\n");
889  return AliVEvent::kINT7;
890  }
891  else if(trigger=="EMC1")
892  {
893  printf("CaloTrackCorr trigger EMC1\n");
894  return AliVEvent::kEMC1;
895  }
896  else if(trigger=="MB")
897  {
898  printf("CaloTrackCorr trigger MB\n");
899  return AliVEvent::kMB;
900  }
901  else if(trigger=="PHOS")
902  {
903  printf("CaloTrackCorr trigger PHOS\n");
904  return AliVEvent::kPHI7;
905  }
906  else if(trigger=="PHOSPb")
907  {
908  printf("CaloTrackCorr trigger PHOSPb\n");
909  return AliVEvent::kPHOSPb;
910  }
911  else if(trigger=="AnyINT")
912  {
913  printf("CaloTrackCorr trigger AnyINT\n");
914  return AliVEvent::kAnyINT;
915  }
916  else if(trigger=="INT")
917  {
918  printf("CaloTrackCorr trigger AnyINT\n");
919  return AliVEvent::kAny;
920  }
921  else if(trigger=="EMCEGA")
922  {
923  printf("CaloTrackCorr trigger EMC Gamma\n");
924  return AliVEvent::kEMCEGA;
925  }
926  else if(trigger=="EMCEJE")
927  {
928  printf("CaloTrackCorr trigger EMC Jet\n");
929  return AliVEvent::kEMCEJE;
930  }
931  else if(trigger=="Central")
932  {
933  printf("CaloTrackCorr trigger Central\n");
934  return AliVEvent::kCentral;
935  }
936  else if(trigger=="CentralEGA")
937  {
938  printf("CaloTrackCorr trigger Central+EMCEGA\n");
939  return (AliVEvent::kCentral | AliVEvent::kEMCEGA);
940  }
941  else if(trigger=="SemiCentral")
942  {
943  printf("CaloTrackCorr trigger SemiCentral\n");
944  return AliVEvent::kSemiCentral;
945  }
946  else if(trigger=="SemiOrCentral")
947  {
948  printf("CaloTrackCorr trigger SemiCentral Or Central\n");
949  return (AliVEvent::kSemiCentral | AliVEvent::kCentral);
950  }
951  else return AliVEvent::kAny;
952 }
953 
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)
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
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:651
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:142
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:114
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:122
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: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 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:2560
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:117
void SetAnalysisCommonParameters(AliAnaCaloTrackCorrBaseClass *ana, TString calorimeter, Int_t year, TString col, Bool_t simulation, Bool_t printSettings, Int_t debug)
Definition: AddTaskPi0.C:751
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:561
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:879
virtual void SetTrackCuts(AliESDtrackCuts *)
virtual void SwitchOffFiducialCut()
virtual void SetCentralityClass(TString name)
void SwitchOnFillShowerShapeHistograms()
Definition: AliAnaPhoton.h:73
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:457
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:140
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:125
Int_t GetFirstSMCoveredByTRD() const
Time cut in ns.
Steering class of package CaloTrackCorrelartions.