]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/macros/AddTaskPhysicsSelection.C
- BX ids are now selected by default. For the 7 TeV, the 2b_1_1_1 is assumed in the...
[u/mrichter/AliRoot.git] / ANALYSIS / macros / AddTaskPhysicsSelection.C
CommitLineData
73cc8654 1AliPhysicsSelectionTask* AddTaskPhysicsSelection(Bool_t mCAnalysisFlag = kFALSE, Bool_t withBckgndRejection = kTRUE, Bool_t computeBG = kFALSE)
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();
26 if (withBckgndRejection)
27 physSel->AddBackgroundIdentification(new AliBackgroundSelection());
28 if (mCAnalysisFlag)
29 physSel->SetAnalyzeMC();
73cc8654 30 if (computeBG)
31 physSel->SetComputeBG();
78167ba7 32
33 AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
34 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("cstatsout",
91bea6e7 35 TList::Class(),
36 AliAnalysisManager::kOutputContainer,
37 "EventStat_temp.root");
78167ba7 38
39 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
40 mgr->ConnectOutput(task,1,coutput1);
41
42 return task;
78167ba7 43}