]>
Commit | Line | Data |
---|---|---|
1 | /*************************************************************************** | |
2 | fbellini@cern.ch - last modified on 06/08/2012 | |
3 | // | |
4 | // General macro to configure the RSN analysis task. | |
5 | // It calls all configs desired by the user, by means | |
6 | // of the boolean switches defined in the first lines. | |
7 | // --- | |
8 | // Inputs: | |
9 | // 1) flag to know if running on MC or data | |
10 | // 2) path where all configs are stored | |
11 | // --- | |
12 | // Returns: | |
13 | // kTRUE --> initialization successful | |
14 | // kFALSE --> initialization failed (some config gave errors) | |
15 | // | |
16 | ****************************************************************************/ | |
17 | ||
18 | AliRsnMiniAnalysisTask * AddAnalysisTaskD0 | |
19 | ( | |
20 | Bool_t isMC, | |
21 | Bool_t isPP, | |
22 | Bool_t ispPb, | |
23 | Bool_t monitor = kTRUE, | |
24 | TString centrality = "V0M", | |
25 | Int_t aodFilterBit = 5, | |
26 | Float_t nsigmaTPCPi = 3.0, | |
27 | Float_t nsigmaTPCKa = 3.0, | |
28 | Float_t nsigmaTOFPi = 2.0, | |
29 | Float_t nsigmaTOFKa = 2.0, | |
30 | Float_t trackDCAcutMax = 7.0, | |
31 | Float_t trackDCAcutMin = 0.0, | |
32 | Float_t trackDCAZcutMax = 2.0, | |
33 | Int_t NTPCcluster = 70, | |
34 | Int_t minSPDclt = 0, | |
35 | Double_t minpt = 0.15, | |
36 | TString triggerMask = AliVEvent::kMB, | |
37 | Short_t maxSisters = 2, | |
38 | Bool_t checkP = kTRUE, | |
39 | Bool_t minDCAcutFixed = kFALSE, | |
40 | Bool_t maxDCAcutFixed = kFALSE, | |
41 | Bool_t ptdepPIDcut = kFALSE, | |
42 | Bool_t fixedYcut = kTRUE, | |
43 | Bool_t checkpileup = kFALSE, | |
44 | Bool_t SPDpileup = kTRUE, | |
45 | Bool_t doCalculationInMC = kTRUE, | |
46 | UShort_t originDselection = 0, | |
47 | Int_t nmix = 5, | |
48 | Double_t minYlab = -0.5, | |
49 | Double_t maxYlab = 0.5, | |
50 | Float_t mineta = -0.8, | |
51 | Float_t maxeta = 0.8, | |
52 | Float_t min_inv_mass = 0.6, | |
53 | Float_t max_inv_mass = 2.2, | |
54 | Int_t bins = 320, | |
55 | Double_t dcaProduct = -1E-4, | |
56 | Float_t maxDiffVzMix = 1.0, | |
57 | Float_t maxDiffMultMix = 10.0, | |
58 | Float_t maxDiffAngleMixDeg = 20.0, | |
59 | TString outNameSuffix = "D0" | |
60 | ) | |
61 | { | |
62 | // | |
63 | // -- INITIALIZATION ---------------------------------------------------------------------------- | |
64 | // retrieve analysis manager | |
65 | // | |
66 | Float_t cutV = 10.0; | |
67 | Bool_t checkFeedDown = kTRUE; | |
68 | Bool_t checkQuark = kTRUE; | |
69 | Int_t aodN = 0; | |
70 | ||
71 | ||
72 | UInt_t trigger = 0; | |
73 | ||
74 | ||
75 | ||
76 | TString eventType = ""; | |
77 | if(triggerMask=="AliVEvent::kMB | AliVEvent::kCentral") {trigger = AliVEvent::kMB | AliVEvent::kCentral; eventType+="Central";} | |
78 | else if(triggerMask=="AliVEvent::kMB | AliVEvent::kSemiCentral") {trigger = AliVEvent::kMB | AliVEvent::kSemiCentral; eventType+="SemiCentral";} | |
79 | else if(triggerMask=="AliVEvent::kINT7") {trigger = AliVEvent::kINT7; eventType+="kINT7";} | |
80 | else if(triggerMask=="AliVEvent::kMB") {trigger = AliVEvent::kMB; eventType+="MinimumBias";} | |
81 | ||
82 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
83 | if (!mgr) { | |
84 | ::Error("AddAnalysisTaskD0", "No analysis manager to connect to."); | |
85 | return NULL; | |
86 | } | |
87 | ||
88 | // create the task and configure | |
89 | TString taskName = Form("D0%s%s_%.1f_%d_%d_%.1f_%.1f_%.1f_%.1f_%.1f_%.4f_%.1f_%.5f_%.2f_%d_%s", (isPP? "pp" : ispPb? "pPB": "PbPb"), (isMC ? "MC" : "Data"), cutV, NTPCcluster, minSPDclt, nsigmaTPCPi, nsigmaTPCKa, nsigmaTOFPi, nsigmaTOFKa, trackDCAcutMax, trackDCAcutMin, trackDCAZcutMax, dcaProduct, minpt, originDselection, eventType.Data()); | |
90 | AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask(taskName.Data(), isMC); | |
91 | if (!isMC && !isPP){ | |
92 | Printf(Form("========== SETTING USE CENTRALITY PATCH AOD049 : %s", (aodN==49)? "yes" : "no")); | |
93 | task->SetUseCentralityPatch(aodN==49); | |
94 | } | |
95 | ||
96 | ::Info("AddAnalysisTaskD0", Form("TriggerMask: %i",trigger)); | |
97 | ||
98 | task->SelectCollisionCandidates(trigger); | |
99 | task->SetMaxNDaughters(maxSisters); | |
100 | task->SetCheckMomentumConservation(checkP); | |
101 | task->SetCheckFeedDown(checkFeedDown); | |
102 | task->SetRejectCandidateIfNotFromQuark(checkQuark); | |
103 | task->SetDselection(originDselection); | |
104 | ||
105 | ||
106 | ::Info("AddAnalysisTaskD0", Form("Maximum numbers of daughters allowed (-1 means cut not applied): %i",maxSisters)); | |
107 | ::Info("AddAnalysisTaskD0", Form("Are we checking the momentum conservation? %s", checkP? "yes" : "no")); | |
108 | ::Info("AddAnalysisTaskD0", Form("Are we checking the feedown? %s", checkFeedDown? "yes" : "no")); | |
109 | ::Info("AddAnalysisTaskD0", Form("Are we rejecting the Hijing generated? %s", checkQuark? "yes" : "no")); | |
110 | ::Info("AddAnalysisTaskD0", Form("Which D0 are we keeping? %s", (originDselection==0? "only from c quark" : originDselection==1? "only from b quark" : "both from c and b quark") )); | |
111 | ||
112 | ||
113 | if (isPP) | |
114 | task->UseMultiplicity("QUALITY"); | |
115 | else | |
116 | task->UseCentrality(centrality); | |
117 | // set event mixing options | |
118 | task->UseContinuousMix(); | |
119 | //task->UseBinnedMix(); | |
120 | task->SetNMix(nmix); | |
121 | task->SetMaxDiffVz(maxDiffVzMix); | |
122 | task->SetMaxDiffMult(maxDiffMultMix); | |
123 | if (!isPP && !ispPb) task->SetMaxDiffAngle(maxDiffAngleMixDeg*TMath::DegToRad()); //set angle diff in rad | |
124 | ::Info("AddAnalysisTaskD0", Form("Event mixing configuration: \n events to mix = %i \n max diff. vtxZ = cm %5.3f \n max diff multi = %5.3f \n max diff EP angle = %5.3f deg", nmix, maxDiffVzMix, maxDiffMultMix, (isPP ? 0.0 : ispPb ? 0.0 : maxDiffAngleMixDeg))); | |
125 | ||
126 | mgr->AddTask(task); | |
127 | ||
128 | // | |
129 | // -- EVENT CUTS (same for all configs) --------------------------------------------------------- | |
130 | // | |
131 | // cut on primary vertex: | |
132 | // - 2nd argument --> |Vz| range | |
133 | // - 3rd argument --> minimum required number of contributors | |
134 | // - 4th argument --> tells if TPC stand-alone vertexes must be accepted | |
135 | AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", cutV, 0, kFALSE); | |
136 | if(checkpileup == kTRUE){ | |
137 | if(SPDpileup == kTRUE)cutVertex->SetCheckPileUp(kTRUE); | |
138 | AliRsnCutEventUtils *eventUtils = new AliRsnCutEventUtils("cutEventUtils", kFALSE, kFALSE); | |
139 | if(SPDpileup == kFALSE)eventUtils->SetUseMVPlpSelection(kTRUE); | |
140 | } | |
141 | ||
142 | ::Info("AddAnalysisTaskD0", Form("Checking Pile up? %s", (checkpileup ? "yes" : "no") )); | |
143 | ::Info("AddAnalysisTaskD0", Form("Which Method? %s", (checkpileup? (SPDpileup ? "SPD" : "Multi Vertex") : "none" ))); | |
144 | ||
145 | // define and fill cut set for event cut | |
146 | AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); | |
147 | eventCuts->AddCut(cutVertex); | |
148 | eventCuts->SetCutScheme(cutVertex->GetName()); | |
149 | // set cuts in task | |
150 | task->SetEventCuts(eventCuts); | |
151 | ||
152 | // | |
153 | // -- EVENT-ONLY COMPUTATIONS ------------------------------------------------------------------- | |
154 | // | |
155 | //vertex | |
156 | Int_t vtxID = task->CreateValue(AliRsnMiniValue::kVz, kFALSE); | |
157 | AliRsnMiniOutput *outVtx = task->CreateOutput("eventVtx", "HIST", "EVENT"); | |
158 | outVtx->AddAxis(vtxID, 400, -20.0, 20.0); | |
159 | ||
160 | //multiplicity or centrality | |
161 | Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE); | |
162 | AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT"); | |
163 | if (isPP) | |
164 | outMult->AddAxis(multID, 400, 0.0, 400.0); | |
165 | else | |
166 | outMult->AddAxis(multID, 100, 0.0, 100.0); | |
167 | ||
168 | //tracklets | |
169 | //Int_t trackletID = task->CreateValue(AliRsnMiniValue::kTracklets, kFALSE); | |
170 | //AliRsnMiniOutput *outTracklets = task->CreateOutput("eventTracklets", "HIST", "EVENT"); | |
171 | //outTracklets->AddAxis(trackletID, 400, 0.0, 400.0); | |
172 | ||
173 | ||
174 | //event plane (only for PbPb) | |
175 | Int_t planeID = task->CreateValue(AliRsnMiniValue::kPlaneAngle, kFALSE); | |
176 | AliRsnMiniOutput *outPlane = 0x0; | |
177 | if (!isPP){ | |
178 | outPlane = task->CreateOutput("eventPlane", "HIST", "EVENT"); | |
179 | outPlane->AddAxis(planeID, 180, 0.0, TMath::Pi()); | |
180 | } | |
181 | ||
182 | TH2F* hvz=new TH2F("hVzVsCent","",100,0.,100., 220,-11.,11.); | |
183 | task->SetEventQAHist("vz",hvz);//plugs this histogram into the fHAEventVz data member | |
184 | ||
185 | TH2F* hmc=new TH2F("MultiVsCent","",100,0.,100.,4000,0.,4000.); | |
186 | hmc->GetYaxis()->SetTitle("QUALITY"); | |
187 | task->SetEventQAHist("multicent",hmc);//plugs this histogram into the fHAEventMultiCent data member | |
188 | ||
189 | TH2F* hep=new TH2F("hEventPlaneVsCent","",100,0.,100., 180,0.,TMath::Pi()); | |
190 | task->SetEventQAHist("eventplane",hep);//plugs this histogram into the fHAEventPlane data member | |
191 | ||
192 | // | |
193 | // -- PAIR CUTS (common to all resonances) ------------------------------------------------------ | |
194 | // | |
195 | AliRsnCutMiniPair *cutY = 0x0; | |
196 | ||
197 | if(fixedYcut == kTRUE){ | |
198 | cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityRange); | |
199 | cutY->SetRangeD(minYlab, maxYlab); | |
200 | } | |
201 | else { | |
202 | cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityFiducialRegion); | |
203 | cutY->SetRangeD(-0.8, 0.8); | |
204 | cutY->SetPtDepCut(kTRUE); | |
205 | cutY->SetMinPt(0.0); | |
206 | cutY->SetMaxPt(5.0); | |
207 | cutY->SetPtDepCutMaxFormula("-0.2/15*pt*pt+1.9/15*pt+0.5"); | |
208 | cutY->SetPtDepCutMinFormula("0.2/15*pt*pt-1.9/15*pt-0.5"); | |
209 | } | |
210 | ||
211 | ::Info("AddAnalysisTaskD0", Form("Fixed Y cut? %s", (fixedYcut ? "yes" : "no") )); | |
212 | ||
213 | AliRsnCutMiniPair *cutDCAproduct = new AliRsnCutMiniPair("cutDCAproduct", AliRsnCutMiniPair::kDCAproduct); | |
214 | cutDCAproduct->SetRangeD(-1E20, dcaProduct); | |
215 | ||
216 | AliRsnCutSet *cutsPairY = new AliRsnCutSet("pairCutsY", AliRsnTarget::kMother); | |
217 | cutsPairY->AddCut(cutY); | |
218 | cutsPairY->UseMonitor(kTRUE); | |
219 | cutsPairY->SetCutScheme("setPairD0_Y"); | |
220 | cutsPairY->ShowCuts(); | |
221 | cutsPairY->PrintSetInfo(); | |
222 | ||
223 | AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother); | |
224 | cutsPair->AddCut(cutY); | |
225 | cutsPair->AddCut(cutDCAproduct); | |
226 | cutsPair->UseMonitor(kTRUE); | |
227 | cutsPair->SetCutScheme(Form("%s&%s", cutY->GetName(), cutDCAproduct->GetName())); | |
228 | cutsPair->ShowCuts(); | |
229 | cutsPair->PrintSetInfo(); | |
230 | ||
231 | // | |
232 | // -- CONFIG ANALYSIS -------------------------------------------------------------------------- | |
233 | gROOT->LoadMacro("$ALICE_ROOT/PWGLF/RESONANCES/macros/mini/ConfigD0.C"); | |
234 | ||
235 | if (isMC) { | |
236 | Printf("========================== MC analysis - PID cuts used"); | |
237 | } else | |
238 | Printf("========================== DATA analysis - PID cuts used"); | |
239 | if (!ConfigD0(task, isPP, isMC, monitor, nsigmaTPCPi, nsigmaTPCKa, nsigmaTOFPi, nsigmaTOFKa, aodFilterBit, trackDCAcutMax, trackDCAcutMin, trackDCAZcutMax, NTPCcluster, minSPDclt, minpt, maxSisters, checkP, minDCAcutFixed, maxDCAcutFixed, ptdepPIDcut, checkFeedDown, checkQuark, doCalculationInMC, originDselection, mineta, maxeta, min_inv_mass, max_inv_mass, bins, "", cutsPairY, cutsPair)) return 0x0; | |
240 | ||
241 | // | |
242 | // -- CONTAINERS -------------------------------------------------------------------------------- | |
243 | // | |
244 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
245 | Printf("AddAnalysisTaskD0 - Set OutputFileName : \n %s\n", outputFileName.Data() ); | |
246 | ||
247 | AliAnalysisDataContainer *output = mgr->CreateContainer(Form("%s_%.1f_%d_%d_%.1f_%.1f_%.1f_%.1f_%.1f_%.4f_%.1f_%.5f_%.2f_%d_%s",outNameSuffix.Data(),cutV,NTPCcluster,minSPDclt,nsigmaTPCPi,nsigmaTPCKa,nsigmaTOFPi,nsigmaTOFKa,trackDCAcutMax,trackDCAcutMin,trackDCAZcutMax,dcaProduct,minpt,originDselection,eventType.Data()), | |
248 | TList::Class(), | |
249 | AliAnalysisManager::kOutputContainer, | |
250 | outputFileName); | |
251 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
252 | mgr->ConnectOutput(task, 1, output); | |
253 | ||
254 | return task; | |
255 | } |