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