AliPhysics  a0db429 (a0db429)
 All Classes Namespaces Files Functions Variables Typedefs 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 
76  // pass2
77  if(referenceSMFileName.Length()!=0){
78  taskmbemcal->SetReferenceRunByRunFileName(referenceSMFileName);
79  taskmbemcal->SetPassTimeHisto(1200,300.,900.);
80  }
81 
82  //pass3
83  if(referenceFileName.Length()!=0){
84  taskmbemcal->SetReferenceFileName(referenceFileName);
85  taskmbemcal->LoadReferenceHistos();
86  taskmbemcal->SetPassTimeHisto(1400,-350.,350.);
87  }
88  if(pileupFromSPDFlag==kTRUE) taskmbemcal->SwitchOnPileupFromSPD();
89  else taskmbemcal->SwitchOffPileupFromSPD();
90 
91  //taskmbemcal->PrintInfo();
92 
93  if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName();
94 
95  // Create containers for input/output
96  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
97  AliAnalysisDataContainer *coutput = mgr->CreateContainer("chistolist", TList::Class(),
98  AliAnalysisManager::kOutputContainer,
99  outputFile.Data());
100 
101  mgr->AddTask(taskmbemcal);
102 
103 
104  mgr->ConnectInput (taskmbemcal, 0, cinput1);
105  mgr->ConnectOutput (taskmbemcal, 1, coutput);
106 
107 
108  return taskmbemcal;
109 }
void SetPassTimeHisto(Int_t nbins, Double_t lower, Double_t upper)
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.