AliPhysics  ec7afe5 (ec7afe5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskEMCALTimeCalibration.C
Go to the documentation of this file.
1 
31  TString geometryName = "",//EMCAL_COMPLETE12SMV1_DCAL_8SM
32  Double_t minClusterEne = 1.0,
33  Double_t maxClusterEne = 500,
34  Int_t minNcells = 2,
35  Int_t maxNcells = 200,
36  Double_t minLambda0LG = 0.1,
37  Double_t maxLambda0LG = 4.0,
38  Double_t minLambda0 = 0.1,
39  Double_t maxLambda0 = 0.4,
40  Double_t maxRtrack = 0.025,
41  Double_t minCellEne = 0.4,
42  Double_t minTime = -20.,
43  Double_t maxTime = 20.,
44  Bool_t pileupFromSPDFlag = kFALSE,
45  TString referenceFileName = "",//Reference.root
46  TString referenceSMFileName = "",//ReferenceSM.root
47  Bool_t badReconstruction = kFALSE,
48  Bool_t fillHeavyHistos = kFALSE,
49  Int_t badMapType = 0,
50  TString badMapFileName = "")
51 {
52  // Get the pointer to the existing analysis manager via the static access method.
53  //==============================================================================
54  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
55  if (!mgr)
56  {
57  ::Error("AddTaskEMCALTimeCalibration", "No analysis manager to connect to.");
58  return NULL;
59  }
60 
61  // Check the analysis type using the event handlers connected to the analysis manager.
62  //==============================================================================
63  if (!mgr->GetInputEventHandler())
64  {
65  ::Error("AddTaskEMCALTimeCalibration", "This task requires an input event handler");
66  return NULL;
67  }
68 
69  AliAnalysisTaskEMCALTimeCalib *taskmbemcal = new AliAnalysisTaskEMCALTimeCalib("TimeCalibTask");
70  taskmbemcal->SelectCollisionCandidates(AliVEvent::kEMC1|AliVEvent::kEMC7|AliVEvent::kEMC8|AliVEvent::kEMCEJE|AliVEvent::kEMCEGA);
71  taskmbemcal->SetGeometryName(geometryName);
72  taskmbemcal->SetMinClusterEnergy (minClusterEne);
73  taskmbemcal->SetMaxClusterEnergy (maxClusterEne);
74  taskmbemcal->SetMinNcells (minNcells);
75  taskmbemcal->SetMaxNcells (maxNcells);
76  taskmbemcal->SetMinLambda0 (minLambda0);
77  taskmbemcal->SetMaxLambda0 (maxLambda0);
78  taskmbemcal->SetMinLambda0LG (minLambda0LG);
79  taskmbemcal->SetMaxLambda0LG (maxLambda0LG);
80  taskmbemcal->SetMaxRtrack (maxRtrack);
81  taskmbemcal->SetMinCellEnergy (minCellEne);
82  taskmbemcal->SetMinTime (minTime);
83  taskmbemcal->SetMaxTime (maxTime);
84 
85  if(fillHeavyHistos) taskmbemcal->SwithOnFillHeavyHisto();
86  else taskmbemcal->SwithOffFillHeavyHisto();
87 
88  // pass1
89  taskmbemcal->SetRawTimeHisto(200,400.,800.);
90  taskmbemcal->SetPassTimeHisto (200,400.,800.);
91  // pass2
92  if(referenceSMFileName.Length()!=0){
93  taskmbemcal->SetReferenceRunByRunFileName(referenceSMFileName);
94  taskmbemcal->LoadReferenceRunByRunHistos();
95  taskmbemcal->SetPassTimeHisto(800,400.,800.);
96  if(badReconstruction) { //add for runs before LHC15n muon_calo_pass1 in run2
97  taskmbemcal->SwitchOnBadReco();
98  taskmbemcal->SetPassTimeHisto(500,-100.,150.);
99  }
100  }
101 
102  //pass3
103  if(referenceFileName.Length()!=0){
104  taskmbemcal->SetReferenceFileName(referenceFileName);
105  taskmbemcal->LoadReferenceHistos();
106  taskmbemcal->SetPassTimeHisto(1000,-250.,250.);
107  }
108  if(pileupFromSPDFlag==kTRUE) taskmbemcal->SwitchOnPileupFromSPD();
109  else taskmbemcal->SwitchOffPileupFromSPD();
110 
111  //bad channel map
112  taskmbemcal->SetBadChannelMapSource(badMapType);
113  if(badMapType==2) taskmbemcal->SetBadChannelFileName(badMapFileName);
114 
115 
116  //taskmbemcal->PrintInfo();
117 
118  if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName();
119 
120  // Create containers for input/output
121  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
122  AliAnalysisDataContainer *coutput = mgr->CreateContainer("chistolist", TList::Class(),
123  AliAnalysisManager::kOutputContainer,
124  outputFile.Data());
125 
126  mgr->AddTask(taskmbemcal);
127  mgr->ConnectInput (taskmbemcal, 0, cinput1);
128  mgr->ConnectOutput (taskmbemcal, 1, coutput);
129 
130  return taskmbemcal;
131 }
void SetRawTimeHisto(Int_t nbins, Double_t lower, Double_t upper)
double Double_t
Definition: External.C:58
AliAnalysisTaskEMCALTimeCalib * AddTaskEMCALTimeCalibration(TString outputFile="", TString geometryName="", Double_t minClusterEne=1.0, Double_t maxClusterEne=500, Int_t minNcells=2, Int_t maxNcells=200, Double_t minLambda0LG=0.1, Double_t maxLambda0LG=4.0, Double_t minLambda0=0.1, Double_t maxLambda0=0.4, Double_t maxRtrack=0.025, Double_t minCellEne=0.4, Double_t minTime=-20., Double_t maxTime=20., Bool_t pileupFromSPDFlag=kFALSE, TString referenceFileName="", TString referenceSMFileName="", Bool_t badReconstruction=kFALSE, Bool_t fillHeavyHistos=kFALSE, Int_t badMapType=0, TString badMapFileName="")
int Int_t
Definition: External.C:63
void SetPassTimeHisto(Int_t nbins, Double_t lower, Double_t upper)
Task to work on Time Calibration for EMCal/DCal.
void LoadReferenceHistos()
Load reference Histograms (for one period) from file.
bool Bool_t
Definition: External.C:53