]>
Commit | Line | Data |
---|---|---|
1ea7a921 | 1 | AliPhysicsSelectionTask* AddTaskPhysicsSelection(Bool_t mCAnalysisFlag = kFALSE, Bool_t deprecatedFlag = kTRUE, UInt_t computeBG = 0) |
91bea6e7 | 2 | { |
3 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
4 | if (!mgr) { | |
5 | ::Error("AddTaskPhysicsSelection", "No analysis manager to connect to."); | |
6 | return NULL; | |
7 | } | |
8 | ||
9 | // Check the analysis type using the event handlers connected to the analysis manager. | |
10 | //============================================================================== | |
11 | if (!mgr->GetInputEventHandler()) { | |
12 | ::Error("AddTaskPhysicsSelection", "This task requires an input event handler"); | |
13 | return NULL; | |
14 | } | |
15 | TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
16 | ||
17 | // Configure analysis | |
18 | //=========================================================================== | |
78167ba7 | 19 | |
20 | ||
21 | ||
91bea6e7 | 22 | AliPhysicsSelectionTask *task = new AliPhysicsSelectionTask(""); |
78167ba7 | 23 | mgr->AddTask(task); |
91bea6e7 | 24 | |
25 | AliPhysicsSelection* physSel = task->GetPhysicsSelection(); | |
91bea6e7 | 26 | if (mCAnalysisFlag) |
27 | physSel->SetAnalyzeMC(); | |
73cc8654 | 28 | if (computeBG) |
141265a2 | 29 | physSel->SetComputeBG(computeBG); |
78167ba7 | 30 | |
1ea7a921 | 31 | if(!deprecatedFlag) |
32 | AliFatal("The BG ID flag is deprecated. Please use the OADB to configure the cuts"); | |
33 | ||
78167ba7 | 34 | AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); |
35 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("cstatsout", | |
91bea6e7 | 36 | TList::Class(), |
37 | AliAnalysisManager::kOutputContainer, | |
38 | "EventStat_temp.root"); | |
ebb6dbd1 | 39 | |
78167ba7 | 40 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); |
41 | mgr->ConnectOutput(task,1,coutput1); | |
42 | ||
43 | return task; | |
78167ba7 | 44 | } |