2 // General macro to configure the RSN analysis task.
3 // It calls all configs desired by the user, by means
4 // of the boolean switches defined in the first lines.
7 // 1) flag to know if running on MC or data
8 // 2) path where all configs are stored
11 // kTRUE --> initialization successful
12 // kFALSE --> initialization failed (some config gave errors)
17 Bool_t useKaonMonitor = 1;
19 Bool_t useKStarTPC = 0;
21 Bool_t AddAnalysisTaskRsn
26 const char *path = "$(HOME)/code/resonances/alice-rsn-package/PWG2resonances/RESONANCES/macros/test/pulvir"
30 // -- INITIALIZATION ----------------------------------------------------------------------------
33 // retrieve analysis manager
34 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
36 // create the task and connect with physics selection
37 AliRsnAnalysisTask *task = new AliRsnAnalysisTask("RSN");
38 task->SelectCollisionCandidates();
42 // -- EVENT CUTS (same for all configs) ---------------------------------------------------------
45 // cut on primary vertex:
46 // - 2nd argument --> |Vz| range
47 // - 3rd argument --> minimum required number of contributors
48 // - 4th argument --> tells if TPC stand-alone vertexes must be accepted
49 AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
51 // set the check for pileup
52 ::Info("AddAnalysisTaskRsn", "Check of pile-up from SPD is %s", (checkPileUp ? "active" : "disabled"));
53 cutVertex->SetCheckPileUp(checkPileUp);
55 // define and fill cut set
56 AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent);
57 eventCuts->AddCut(cutVertex);
58 eventCuts->SetCutScheme(cutVertex->GetName());
61 // -- CONFIGS -----------------------------------------------------------------------------------
64 // add configs and count how many are added
65 // will return kFALSE if none is added
70 // NOTE: this is a test and will had its own definition of event cuts
71 // ----> will not use those defined above
72 gROOT->LoadMacro(Form("%s/RsnConfigTest.C", path));
73 if (!RsnConfigTest(task, isMC)) return kFALSE;
78 gROOT->LoadMacro(Form("%s/RsnConfigEvent.C", path));
79 if (!RsnConfigEvent(task, isMC, useCentrality, eventCuts)) return kFALSE;
84 gROOT->LoadMacro(Form("%s/RsnConfigMonitorTPC.C", path));
85 if (!RsnConfigMonitorTPC(task, isMC, useCentrality, eventCuts)) return kFALSE;
90 gROOT->LoadMacro(Form("%s/RsnConfigPhiTPC.C", path));
91 if (!RsnConfigPhiTPC(task, isMC, useCentrality, eventCuts)) return kFALSE;
96 gROOT->LoadMacro(Form("%s/RsnConfigKStarTPC.C", path));
97 if (!RsnConfigKStarTPC(task, isMC, useCentrality, eventCuts)) return kFALSE;
101 ::Info("AddAnalysisTaskRsn.C", "Added %d configs", added);
103 ::Error("AddAnalysisTaskRsn.C", "Cannot process an empty task!");
108 // -- CONTAINERS --------------------------------------------------------------------------------
111 const char *file = AliAnalysisManager::GetCommonFileName();
112 AliAnalysisDataContainer *output = mgr->CreateContainer("RsnOut", TList::Class(), AliAnalysisManager::kOutputContainer, file);
113 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
114 mgr->ConnectOutput(task, 1, output);