]>
Commit | Line | Data |
---|---|---|
03d23846 | 1 | // |
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. | |
5 | // --- | |
6 | // Inputs: | |
7 | // 1) flag to know if running on MC or data | |
8 | // 2) path where all configs are stored | |
9 | // --- | |
10 | // Returns: | |
11 | // kTRUE --> initialization successful | |
12 | // kFALSE --> initialization failed (some config gave errors) | |
13 | // | |
14 | ||
15 | Bool_t usePhi = 1; | |
caef2e3c | 16 | Bool_t useKStar = 1; |
4d4577fb | 17 | Bool_t usePhiRAA = 1; |
03d23846 | 18 | |
abd75728 | 19 | //set to kTRUE if using data AOD049 - needed to enable centrality patch |
20 | Bool_t isAOD049 = 0; | |
21 | ||
03d23846 | 22 | AliRsnMiniAnalysisTask * AddAnalysisTaskRsnMini |
23 | ( | |
24 | Bool_t isMC, | |
caef2e3c | 25 | Bool_t isPP, |
03d23846 | 26 | const char *path, |
27 | Int_t nmix = 0 | |
28 | ) | |
29 | { | |
30 | // | |
31 | // -- INITIALIZATION ---------------------------------------------------------------------------- | |
32 | // | |
33 | ||
34 | // retrieve analysis manager | |
35 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
36 | ||
37 | // create the task and connect with physics selection | |
caef2e3c | 38 | AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask("RSN", isMC); |
abd75728 | 39 | if (isAOD049 && !isMC && !isPP){ |
40 | task->SetUseCentralityPatch(kTRUE); | |
41 | } | |
03d23846 | 42 | mgr->AddTask(task); |
43 | ||
44 | // settings | |
caef2e3c | 45 | if (isPP) |
46 | task->UseMultiplicity("QUALITY"); | |
47 | else | |
48 | task->UseCentrality("V0M"); | |
03d23846 | 49 | |
50 | // set mixing | |
caef2e3c | 51 | task->UseContinuousMix(); |
52 | //task->UseBinnedMix(); | |
03d23846 | 53 | task->SetNMix(nmix); |
caef2e3c | 54 | task->SetMaxDiffVz(1.0); |
03d23846 | 55 | task->SetMaxDiffMult(10.0); |
56 | task->SetMaxDiffAngle(1E20); | |
57 | ||
58 | // | |
59 | // -- EVENT CUTS (same for all configs) --------------------------------------------------------- | |
60 | // | |
61 | ||
62 | // cut on primary vertex: | |
63 | // - 2nd argument --> |Vz| range | |
64 | // - 3rd argument --> minimum required number of contributors | |
65 | // - 4th argument --> tells if TPC stand-alone vertexes must be accepted | |
66 | AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE); | |
67 | ||
68 | // set the check for pileup | |
caef2e3c | 69 | if (isPP) cutVertex->SetCheckPileUp(kTRUE); |
03d23846 | 70 | |
71 | // define and fill cut set | |
72 | AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); | |
73 | eventCuts->AddCut(cutVertex); | |
74 | eventCuts->SetCutScheme(cutVertex->GetName()); | |
75 | ||
76 | // set cuts in task | |
77 | task->SetEventCuts(eventCuts); | |
78 | ||
caef2e3c | 79 | // |
80 | // -- EVENT-ONLY COMPUTATIONS ------------------------------------------------------------------- | |
81 | // | |
82 | ||
83 | // initialize value computation for multiplicity/centrality | |
84 | // second argument tells if the value must be taken from MC | |
85 | // (when this can be done) | |
86 | // after creating the value, the task returns its ID | |
87 | Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE); | |
88 | ||
89 | // create event-related output | |
90 | AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT"); | |
91 | // set axes, by passing value ID and defining the binning | |
92 | if (isPP) | |
93 | outMult->AddAxis(multID, 300, 0.0, 300.0); | |
94 | else | |
95 | outMult->AddAxis(multID, 100, 0.0, 100.0); | |
96 | ||
97 | // | |
98 | // -- PAIR CUTS (common to all resonances) ------------------------------------------------------ | |
99 | // | |
100 | ||
101 | AliRsnCutMiniPair *cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityRange); | |
102 | cutY->SetRangeD(-0.5, 0.5); | |
103 | ||
104 | AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother); | |
105 | cutsPair->AddCut(cutY); | |
106 | cutsPair->SetCutScheme(cutY->GetName()); | |
107 | ||
03d23846 | 108 | // |
109 | // -- CONFIGS ----------------------------------------------------------------------------------- | |
110 | // | |
111 | ||
4d4577fb | 112 | if (usePhiRAA){ |
113 | if (!isMC) { | |
114 | gROOT->LoadMacro(Form("%s/ConfigPhiRAApp.C", path)); | |
115 | if (!ConfigPhiRAApp(task, isMC, isPP, "", cutsPair)) return 0x0; | |
116 | } | |
117 | } | |
118 | ||
03d23846 | 119 | if (usePhi) { |
caef2e3c | 120 | if (isPP) { |
121 | gROOT->LoadMacro(Form("%s/ConfigPhi.C", path)); | |
122 | if (!ConfigPhi(task, isMC, "", cutsPair)) return 0x0; | |
123 | } else { | |
124 | gROOT->LoadMacro(Form("%s/ConfigPhiPbPb.C", path)); | |
125 | if (!ConfigPhiPbPb(task, isMC, "", cutsPair)) return 0x0; | |
126 | } | |
127 | if (isMC) { | |
128 | gROOT->LoadMacro(Form("%s/ConfigPhiMC.C", path)); | |
129 | if (!ConfigPhiMC(task, isPP, "", cutsPair)) return 0x0; | |
130 | } | |
03d23846 | 131 | } |
132 | ||
caef2e3c | 133 | if (useKStar) { |
134 | gROOT->LoadMacro(Form("%s/ConfigKStar.C", path)); | |
135 | if (!ConfigKStar(task, isMC, "", cutsPair)) return 0x0; | |
136 | if (isMC) { | |
137 | gROOT->LoadMacro(Form("%s/ConfigKStarMC.C", path)); | |
138 | if (!ConfigKStarMC(task, isPP, "", cutsPair)) return 0x0; | |
139 | } | |
03d23846 | 140 | } |
141 | ||
142 | // | |
143 | // -- CONTAINERS -------------------------------------------------------------------------------- | |
144 | // | |
145 | ||
146 | const char *file = AliAnalysisManager::GetCommonFileName(); | |
147 | AliAnalysisDataContainer *output = mgr->CreateContainer("RsnOut", TList::Class(), AliAnalysisManager::kOutputContainer, file); | |
148 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
149 | mgr->ConnectOutput(task, 1, output); | |
150 | ||
151 | return task; | |
152 | } |