AliPhysics  29d4213 (29d4213)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AddTaskEMCALTimeCalibration.C
Go to the documentation of this file.
1 
25 AliAnalysisTaskEMCALTimeCalib * AddTaskEMCALTimeCalibration(TString outputFile = "", // timeResults.root
26  TString geometryName = "",//EMCAL_COMPLETE12SMV1_DCAL_8SM
27  Double_t minClusterEne = 1.0,
28  Double_t maxClusterEne = 500,
29  Int_t minNcells = 2,
30  Int_t maxNcells = 200,
31  Double_t minLambda0LG = 0.1,
32  Double_t maxLambda0LG = 4.0,
33  Double_t minLambda0 = 0.1,
34  Double_t maxLambda0 = 0.4,
35  Double_t maxRtrack = 0.025,
36  Double_t minCellEne = 0.4,
37  Double_t minTime = -20.,
38  Double_t maxTime = 20.,
39  Bool_t pileupFromSPDFlag = kFALSE,
40  TString referenceFileName = "",
41  TString referenceSMFileName = "")//Reference.root
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("AddTaskEMCALTimeCalibration", "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("AddTaskEMCALTimeCalibration", "This task requires an input event handler");
57  return NULL;
58  }
59 
60  AliAnalysisTaskEMCALTimeCalib *taskmbemcal = new AliAnalysisTaskEMCALTimeCalib("TimeCalibTask");
61  taskmbemcal->SelectCollisionCandidates(AliVEvent::kEMC1|AliVEvent::kEMC7|AliVEvent::kEMC8|AliVEvent::kEMCEJE|AliVEvent::kEMCEGA);
62  taskmbemcal->SetGeometryName(geometryName);
63  taskmbemcal->SetMinClusterEnergy (minClusterEne);
64  taskmbemcal->SetMaxClusterEnergy (maxClusterEne);
65  taskmbemcal->SetMinNcells (minNcells);
66  taskmbemcal->SetMaxNcells (maxNcells);
67  taskmbemcal->SetMinLambda0 (minLambda0);
68  taskmbemcal->SetMaxLambda0 (maxLambda0);
69  taskmbemcal->SetMinLambda0LG (minLambda0LG);
70  taskmbemcal->SetMaxLambda0LG (maxLambda0LG);
71  taskmbemcal->SetMaxRtrack (maxRtrack);
72  taskmbemcal->SetMinCellEnergy (minCellEne);
73  taskmbemcal->SetMinTime (minTime);
74  taskmbemcal->SetMaxTime (maxTime);
75  if(referenceFileName.Length()!=0){
76  taskmbemcal->SetReferenceFileName(referenceFileName);
77  taskmbemcal->LoadReferenceHistos();
78  }
79  if(pileupFromSPDFlag==kTRUE) taskmbemcal->SwitchOnPileupFromSPD();
80  else taskmbemcal->SwitchOffPileupFromSPD();
81 
82  if(referenceSMFileName.Length()!=0){
83  taskmbemcal->SetReferenceRunByRunFileName("ReferenceSM_LHC15i.root");
84  }
85 
86  //taskmbemcal->PrintInfo();
87 
88  if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName();
89 
90  // Create containers for input/output
91  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
92  AliAnalysisDataContainer *coutput = mgr->CreateContainer("chistolist", TList::Class(),
93  AliAnalysisManager::kOutputContainer,
94  outputFile.Data());
95 
96  mgr->AddTask(taskmbemcal);
97 
98 
99  mgr->ConnectInput (taskmbemcal, 0, cinput1);
100  mgr->ConnectOutput (taskmbemcal, 1, coutput);
101 
102 
103  return taskmbemcal;
104 }
Task to work on Time Calibration for EMCal/DCal.
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="")
void LoadReferenceHistos()
Load reference Histograms (for one period) from file.