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