1 AliPhysicsSelectionTask* AddTaskPhysicsSelection(Bool_t mCAnalysisFlag = kFALSE, Bool_t withBckgndRejection = kTRUE, UInt_t computeBG = 0)
3 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
5 ::Error("AddTaskPhysicsSelection", "No analysis manager to connect to.");
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");
15 TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
18 //===========================================================================
22 AliPhysicsSelectionTask *task = new AliPhysicsSelectionTask("");
25 AliPhysicsSelection* physSel = task->GetPhysicsSelection();
26 if (withBckgndRejection)
27 physSel->AddBackgroundIdentification(new AliBackgroundSelection());
29 physSel->SetAnalyzeMC();
31 physSel->SetComputeBG(computeBG);
33 AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
34 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("cstatsout",
36 AliAnalysisManager::kOutputContainer,
37 "EventStat_temp.root");
39 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
40 mgr->ConnectOutput(task,1,coutput1);