"Setting correct gains for Pb-p in simulation"
[u/mrichter/AliRoot.git] / T0 / AddTaskT0Analysis.C
CommitLineData
c0fcf951 1//_____________________________________________________________________________
2AliAnalysisTask *AddTaskT0Analysis()
3{
4 //
5 // add calibration task
6 //
fa483c3c 7 gSystem->Load("libANALYSIS");
8 gSystem->Load("libANALYSISalice");
9 gSystem->Load("libT0calib");
c0fcf951 10
11 cout<<"@@@ AddTaskT0Analysis "<<endl;
7d375592 12 gSystem->Load("libANALYSIS");
13 gSystem->Load("libANALYSISalice");
14 gSystem->Load("libT0calib");
15
16
c0fcf951 17 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
18 if (!mgr) {
19 ::Error("AddTaskT0Analysis", "No analysis manager to connect to.");
20 return NULL;
21 }
22
23 // check the input handler
24 if (!mgr->GetInputEventHandler()) {
25 ::Error("AddTaskT0Analysis", "This task requires an input event handler");
26 return NULL;
27 }
28
29 // Check the analysis type using the event handlers connected to the analysis manager.
30 //==============================================================================
31 if (!mgr->GetInputEventHandler()) {
7d375592 32 ::Error("AddTaskT0Analysis", "This task requires an input event handler");
c0fcf951 33 return NULL;
34 }
35 TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
36
37 // setup task
38 AliT0CalibAnalysisTask *task1 = new AliT0CalibAnalysisTask("ObjectsTrain");
39 mgr->AddTask(task1);
40
41
42 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
43 if (!cinput1) cinput1 = mgr->CreateContainer("cchain",TChain::Class(),
44 AliAnalysisManager::kInputContainer);
2dc72e65 45 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("T0tree",TList::Class(), AliAnalysisManager::kOutputContainer,"T0AnalysisTree.root");
c0fcf951 46
47 mgr->ConnectInput(task1,0,cinput1);
48 mgr->ConnectOutput(task1,1,coutput1);
49 return task1;
50}