AliPhysics  v5-06-21-01 (1eac791)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AddTaskEMCALPi0Calibration.C
Go to the documentation of this file.
1 
35 AliAnalysisTaskEMCALPi0CalibSelection * AddTaskEMCALPi0Calibration(TString outputFile = "", // AnalysisResults.root
36  TString trigger ="CEMC7",
37  Bool_t recalE = kFALSE,
38  Bool_t recalT = kFALSE,
39  Bool_t rmBad = kFALSE,
40  Bool_t nonlin = kTRUE,
41  Bool_t simu = kFALSE)
42 {
43  // Get the pointer to the existing analysis manager via the static access method.
44  //==============================================================================
45  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
46  if (!mgr)
47  {
48  ::Error("AddTaskEMCALTriggerQA", "No analysis manager to connect to.");
49  return NULL;
50  }
51 
52  // Check the analysis type using the event handlers connected to the analysis manager.
53  //==============================================================================
54  if (!mgr->GetInputEventHandler())
55  {
56  ::Error("AddTaskEMCALPi0Calibration", "This task requires an input event handler");
57  return NULL;
58  }
59 
60 
61  // Create containers for input/output
62  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
63 
65  //pi0calib->SetDebugLevel(10);
66  //pi0calib->UseFilteredEventAsInput();
67  pi0calib->SetClusterMinEnergy(0.3);
68  pi0calib->SetClusterMaxEnergy(10.);
69  pi0calib->SetClusterLambda0Cuts(0.1,0.5);
70  pi0calib->SetAsymmetryCut(1.);
71  pi0calib->SetClusterMinNCells(1);
72  pi0calib->SetNCellsGroup(0);
73  pi0calib->SwitchOnSameSM();
74  pi0calib->SetPairDTimeCut(20);
75  pi0calib->SetClusterMinTime(560);
76  pi0calib->SetClusterMaxTime(610);
77 
78  pi0calib->SetTriggerName(trigger);
79 
80  // Cluster recalculation, Reco Utils configuration
81 
82 
83  AliEMCALRecoUtils * reco = pi0calib->GetEMCALRecoUtils();
84 
85  gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/EMCAL/macros/ConfigureEMCALRecoUtils.C");
86 
88  simu,
89  kTRUE, // exotic
90  nonlin,
91  recalE,
92  rmBad,
93  recalT);
94 
95  reco->SetNumberOfCellsFromEMCALBorder(0); // Do not remove clusters in borders!
96 
97  // recalibrate energy and do corrections because of Temperature corrections
98  pi0calib->SwitchOnClusterCorrection();
99  reco->SwitchOnRecalibration();
100  reco->SwitchOnRunDepCorrection();
101 
102  //reco->Print("");
103 
104  //---------------------
105  // Geometry alignment
106  //---------------------
107 
108  pi0calib->SetGeometryName("EMCAL_COMPLETE12SMV1_DCAL_8SM");
109 
111 
112 
113  //---------------------
114  // Recalibration
115  //---------------------
116 
117  if(recalE)
118  {
119  TFile * f = new TFile("RecalibrationFactors.root","read");
120  for(Int_t ism = 0; ism < 12; ism++)
121  {
122  TH2F * h = (TH2F*)f->Get("EMCALRecalFactors_SM0");
123  reco->SetEMCALChannelRecalibrationFactors(0,h);
124  }
125  }
126 
127  pi0calib->PrintInfo();
128 
129  mgr->AddTask(pi0calib);
130 
131  if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName();
132 
133  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
134  AliAnalysisDataContainer *coutput = mgr->CreateContainer(Form("Pi0Calibration_Trig%s",trigger.Data()),
135  TList::Class(), AliAnalysisManager::kOutputContainer,
136  outputFile.Data());
137 
138  AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("ParamsPi0Calibration_Trig%s",trigger.Data()),
139  TList::Class(), AliAnalysisManager::kOutputContainer,
140  "AnalysisParameters.root");
141 
142  mgr->AddTask(pi0calib);
143 
144  mgr->ConnectInput (pi0calib, 0, cinput1);
145  mgr->ConnectOutput (pi0calib, 1, coutput);
146  mgr->ConnectOutput (pi0calib, 2, cout_cuts);
147 
148  return pi0calib;
149 }
This task provides the input for the EMCal energy calibration with pi0 invariant mass analysis per ch...
AliAnalysisTaskEMCALPi0CalibSelection * AddTaskEMCALPi0Calibration(TString outputFile="", TString trigger="CEMC7", Bool_t recalE=kFALSE, Bool_t recalT=kFALSE, Bool_t rmBad=kFALSE, Bool_t nonlin=kTRUE, Bool_t simu=kFALSE)
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)