AliPhysics  608b256 (608b256)
AddTaskEMCALTimeCalibration.C
Go to the documentation of this file.
1 
33  TString geometryName = "",//EMCAL_COMPLETE12SMV1_DCAL_8SM
34  Double_t minClusterEne = 0.9,
35  Double_t maxClusterEne = 500,
36  Int_t minNcells = 2,
37  Int_t maxNcells = 200,
38  Double_t minLambda0LG = 0.1,
39  Double_t maxLambda0LG = 4.0,
40  Double_t minLambda0 = 0.1,
41  Double_t maxLambda0 = 0.4,
42  Double_t maxRtrack = 0.025,
43  Double_t minCellEne = 0.4,
44  Double_t minTime = -20.,
45  Double_t maxTime = 20.,
46  Bool_t pileupFromSPDFlag = kFALSE,
47  TString referenceFileName = "alien:///alice/cern.ch/user/j/jblair/TimeCalibRef/Reference_LHC17n_mcp1_step3.root",//Reference.root
48  TString referenceSMFileName = "alien:///alice/cern.ch/user/j/jblair/TimeCalibRef/ReferenceSM_LHC17n_mcp1_step1.root",//ReferenceSM.root
49  Bool_t badReconstruction = kFALSE,
50  Bool_t fillHeavyHistos = kTRUE,
51  Int_t badMapType = 1,
52  TString badMapFileName = "",
53  Bool_t mostEneCellOnly = kFALSE,
54  TString PARFileName = "")
55 {
56  // Get the pointer to the existing analysis manager via the static access method.
57  //==============================================================================
58  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
59  if (!mgr)
60  {
61  ::Error("AddTaskEMCALTimeCalibration", "No analysis manager to connect to.");
62  return NULL;
63  }
64 
65  // Check the analysis type using the event handlers connected to the analysis manager.
66  //==============================================================================
67  if (!mgr->GetInputEventHandler())
68  {
69  ::Error("AddTaskEMCALTimeCalibration", "This task requires an input event handler");
70  return NULL;
71  }
72 
73  AliAnalysisTaskEMCALTimeCalib *taskmbemcal = new AliAnalysisTaskEMCALTimeCalib("TimeCalibTask");
74  taskmbemcal->SelectCollisionCandidates(AliVEvent::kEMC1|AliVEvent::kEMC7|AliVEvent::kEMC8|AliVEvent::kEMCEJE|AliVEvent::kEMCEGA);
75  taskmbemcal->SetGeometryName(geometryName);
76  taskmbemcal->SetMinClusterEnergy (minClusterEne);
77  taskmbemcal->SetMaxClusterEnergy (maxClusterEne);
78  taskmbemcal->SetMinNcells (minNcells);
79  taskmbemcal->SetMaxNcells (maxNcells);
80  taskmbemcal->SetMinLambda0 (minLambda0);
81  taskmbemcal->SetMaxLambda0 (maxLambda0);
82  taskmbemcal->SetMinLambda0LG (minLambda0LG);
83  taskmbemcal->SetMaxLambda0LG (maxLambda0LG);
84  taskmbemcal->SetMaxRtrack (maxRtrack);
85  taskmbemcal->SetMinCellEnergy (minCellEne);
86  taskmbemcal->SetMinTime (minTime);
87  taskmbemcal->SetMaxTime (maxTime);
88 
89  if(fillHeavyHistos) taskmbemcal->SwithOnFillHeavyHisto();
90  else taskmbemcal->SwithOffFillHeavyHisto();
91 
92  if(mostEneCellOnly) taskmbemcal->SwitchOnMostEneCellOnly();
93  else taskmbemcal->SwitchOffMostEneCellOnly();
94 
95  // pass1
96  taskmbemcal->SetRawTimeHisto(200,400.,800.);
97  taskmbemcal->SetPassTimeHisto (200,400.,800.);
98  // pass2
99  if(referenceSMFileName.Length()!=0){
100  taskmbemcal->SetReferenceRunByRunFileName(referenceSMFileName);
101  taskmbemcal->LoadReferenceRunByRunHistos();
102  taskmbemcal->SetPassTimeHisto(800,400.,800.);
103  if(badReconstruction) { //add for runs before LHC15n muon_calo_pass1 in run2
104  taskmbemcal->SwitchOnBadReco();
105  taskmbemcal->SetPassTimeHisto(500,-100.,150.);
106  }
107  }
108 
109  //pass3
110  if(referenceFileName.Length()!=0){
111  taskmbemcal->SetReferenceFileName(referenceFileName);
112  taskmbemcal->LoadReferenceHistos();
113  taskmbemcal->SetPassTimeHisto(1000,-250.,250.);
114  }
115  if(pileupFromSPDFlag==kTRUE) taskmbemcal->SwitchOnPileupFromSPD();
116  else taskmbemcal->SwitchOffPileupFromSPD();
117 
118  //bad channel map
119  taskmbemcal->SetBadChannelMapSource(badMapType);
120  if(badMapType==2){
121  taskmbemcal->SetBadChannelFileName(badMapFileName);
122  taskmbemcal->LoadBadChannelMap();
123  }
124 
125  //set-up PAR file
126  if(PARFileName.Length()!=0){
127  //printf("We Got to the PAR part of the Add Task!");
128  taskmbemcal->SetPARInfo(PARFileName);
129  }
130 
131  //taskmbemcal->PrintInfo();
132 
133  if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName();
134 
135  // Create containers for input/output
136  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
137  AliAnalysisDataContainer *coutput = mgr->CreateContainer("chistolist", TList::Class(),
138  AliAnalysisManager::kOutputContainer,
139  outputFile.Data());
140 
141  mgr->AddTask(taskmbemcal);
142  mgr->ConnectInput (taskmbemcal, 0, cinput1);
143  mgr->ConnectOutput (taskmbemcal, 1, coutput);
144 
145  return taskmbemcal;
146 }
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=0.9, 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="alien:///alice/cern.ch/user/j/jblair/TimeCalibRef/Reference_LHC17n_mcp1_step3.root", TString referenceSMFileName="alien:///alice/cern.ch/user/j/jblair/TimeCalibRef/ReferenceSM_LHC17n_mcp1_step1.root", Bool_t badReconstruction=kFALSE, Bool_t fillHeavyHistos=kTRUE, Int_t badMapType=1, TString badMapFileName="", Bool_t mostEneCellOnly=kFALSE, TString PARFileName="")
void LoadBadChannelMap()
Load Bad Channel Map from different source.
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