]>
Commit | Line | Data |
---|---|---|
9075f05b | 1 | AliAnalysisTask *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); | |
0792aa82 | 25 | hfecuts->SetMinNTrackletsTRD(1); |
9075f05b | 26 | //hfecuts->SetCheckITSLayerStatus(kFALSE); |
27 | ||
0792aa82 | 28 | AliAnalysisTaskHFE *task = new AliAnalysisTaskHFE("Heavy Flavour Electron Analysis"); |
29 | task->SetPIDStrategy(4); | |
9075f05b | 30 | task->SetHFECuts(hfecuts); |
31 | task->SetQAOn(AliAnalysisTaskHFE::kMCqa); | |
d2af20c5 | 32 | task->SwitchOnPlugin(AliAnalysisTaskHFE::kSecVtx); |
33 | //task->SwitchOnPlugin(AliAnalysisTaskHFE::kIsElecBackGround); | |
9075f05b | 34 | mgr->AddTask(task); |
35 | ||
36 | //---------------------- | |
37 | //create data containers | |
38 | //---------------------- | |
39 | ||
40 | //find input container | |
41 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
f4f6300d | 42 | TString containerName = mgr->GetCommonFileName(); |
43 | containerName += ":PWG3_hfe"; | |
9075f05b | 44 | |
d2af20c5 | 45 | task->ConnectOutput(1, mgr->CreateContainer("nEvents", TH1I::Class(), |
f4f6300d | 46 | AliAnalysisManager::kOutputContainer, containerName.Data())); |
d2af20c5 | 47 | task->ConnectOutput(2, mgr->CreateContainer("Results", TList::Class(), |
f4f6300d | 48 | AliAnalysisManager::kOutputContainer, containerName.Data())); |
d2af20c5 | 49 | task->ConnectOutput(3, mgr->CreateContainer("QA", TList::Class(), |
f4f6300d | 50 | AliAnalysisManager::kOutputContainer, containerName.Data())); |
9075f05b | 51 | mgr->ConnectInput (task, 0, cinput ); |
52 | ||
53 | return task; | |
54 | } |