]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/hfe/AddTaskHFE.C
DA for calibrating energy by pi0 and MIP and related classes (Hisayuki Torii).
[u/mrichter/AliRoot.git] / PWG3 / hfe / AddTaskHFE.C
CommitLineData
9075f05b 1AliAnalysisTask *AddTaskHFE(){
2 //get the current analysis manager
3 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
4 if (!mgr) {
5 Error("AddTaskHFE", "No analysis manager found.");
6 return NULL;
7 }
8 if (!mgr->GetInputEventHandler()) {
9 ::Error("AddTaskHFE", "This task requires an input event handler");
10 return NULL;
11 }
12 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
13 if (type=="AOD"){
14 ::Error("AddTaskHFE", "The tasks exits because AODs are in input");
15 return NULL;
16 }
17
18 //============= Set Task Name ===================
19 //TString taskName=("AliAnalysisTaskHFE.cxx+");
20 //===============================================
21
22 AliHFEcuts *hfecuts = new AliHFEcuts;
23 hfecuts->CreateStandardCuts();
24 hfecuts->SetCutITSpixel(AliHFEextraCuts::kFirst);
25 //hfecuts->SetCheckITSLayerStatus(kFALSE);
26
27 AliAnalysisTaskHFE *task = new AliAnalysisTaskHFE;
28 task->AddPIDdetector("TPC");
29 //task->SetPIDStrategy(3);
30 task->SetHFECuts(hfecuts);
31 task->SetQAOn(AliAnalysisTaskHFE::kMCqa);
32 task->SetSecVtxOn();
33 mgr->AddTask(task);
34
35 //----------------------
36 //create data containers
37 //----------------------
38
39 //find input container
40 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
41
42 task->ConnectOutput(0, mgr->CreateContainer("nEvents", TH1I::Class(),
43 AliAnalysisManager::kOutputContainer, "HFEtask.root"));
44 task->ConnectOutput(1, mgr->CreateContainer("Results", TList::Class(),
45 AliAnalysisManager::kOutputContainer, "HFEtask.root"));
46 task->ConnectOutput(2, mgr->CreateContainer("QA", TList::Class(),
47 AliAnalysisManager::kOutputContainer, "HFEtask.root"));
48 mgr->ConnectInput (task, 0, cinput );
49
50 return task;
51}