]>
Commit | Line | Data |
---|---|---|
f71e445a | 1 | // $Id$ |
2 | ||
d7984cbd | 3 | AliEmcalPhysicsSelectionTask* |
4 | AddTaskEmcalPhysicsSelelection(Bool_t exFOnly, Bool_t rejectBG=kTRUE, Bool_t computeBG=kTRUE) | |
f71e445a | 5 | { |
6 | // Add EMCAL physics selection task. | |
7 | ||
8 | //get the current analysis manager | |
9 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
10 | if (!mgr) { | |
11 | ::Error("AddTask1PhysSel", "No analysis manager found."); | |
12 | return 0; | |
13 | } | |
14 | isMC = (mgr->GetMCtruthEventHandler()) ? kTRUE:kFALSE; | |
15 | ||
16 | AliEmcalPhysicsSelectionTask *pseltask = new AliEmcalPhysicsSelectionTask("PhysSel"); | |
17 | //pseltask->SetDoWriteHistos(kFALSE); | |
18 | AliEmcalPhysicsSelection *physSel = pseltask->GetPhysicsSelection(); | |
19 | physSel->SetExcludeFastOnly(exFOnly); | |
20 | if (rejectBG) | |
21 | physSel->AddBackgroundIdentification(new AliBackgroundSelection()); | |
22 | if (computeBG) | |
23 | physSel->SetComputeBG(computeBG); | |
24 | if (isMC) | |
25 | physSel->SetAnalyzeMC(); | |
26 | mgr->AddTask(pseltask); | |
27 | ||
28 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
29 | mgr->ConnectInput(pseltask, 0, cinput); | |
30 | TString oname("EventStat.root"); | |
31 | AliAnalysisDataContainer *co1 = | |
32 | mgr->CreateContainer("PhysSel", | |
33 | TList::Class(), | |
34 | AliAnalysisManager::kOutputContainer, | |
35 | oname); | |
36 | mgr->ConnectOutput(pseltask,1,co1); | |
37 | cout << " *** AliEmcalPhysicsTask configured *** " << endl; | |
d7984cbd | 38 | return task; |
f71e445a | 39 | } |