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