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