]>
Commit | Line | Data |
---|---|---|
344100c4 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Authors: Svein Lindal, Daniel Lohner * | |
5 | * Version 1.0 * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | //////////////////////////////////////////////// | |
17 | //--------------------------------------------- | |
18 | // Class handling all kinds of selection cuts for | |
19 | // Gamma Conversion analysis | |
20 | //--------------------------------------------- | |
21 | //////////////////////////////////////////////// | |
22 | ||
23 | #include "AliConvEventCuts.h" | |
24 | ||
25 | #include "AliAODTrack.h" | |
26 | #include "AliESDtrack.h" | |
27 | #include "AliAnalysisManager.h" | |
28 | #include "AliInputEventHandler.h" | |
29 | #include "AliMCEventHandler.h" | |
30 | #include "AliAODHandler.h" | |
31 | #include "TH1.h" | |
32 | #include "TH2.h" | |
33 | #include "TF1.h" | |
34 | #include "AliStack.h" | |
35 | #include "TObjString.h" | |
36 | #include "AliAODEvent.h" | |
37 | #include "AliESDEvent.h" | |
38 | #include "AliCentrality.h" | |
39 | #include "TList.h" | |
40 | #include "TFile.h" | |
41 | #include "AliLog.h" | |
42 | #include "AliGenCocktailEventHeader.h" | |
43 | #include "AliGenDPMjetEventHeader.h" | |
44 | #include "AliGenPythiaEventHeader.h" | |
45 | #include "AliGenHijingEventHeader.h" | |
46 | #include "AliTriggerAnalysis.h" | |
47 | #include "AliV0ReaderV1.h" | |
48 | #include "AliAODMCParticle.h" | |
49 | #include "AliAODMCHeader.h" | |
50 | ||
51 | class iostream; | |
52 | ||
53 | using namespace std; | |
54 | ||
55 | ClassImp(AliConvEventCuts) | |
56 | ||
57 | ||
58 | const char* AliConvEventCuts::fgkCutNames[AliConvEventCuts::kNCuts] = { | |
59 | "HeavyIon", //0 | |
60 | "CentralityMin", //1 | |
61 | "CentralityMax", //2 | |
62 | "SelectSpecialTrigger", //3 | |
63 | "SelectSpecialSubTriggerClass", //4 | |
64 | "RemovePileUp", //5 | |
65 | "RejectExtraSignals", //6 | |
66 | }; | |
67 | ||
68 | ||
69 | //________________________________________________________________________ | |
70 | AliConvEventCuts::AliConvEventCuts(const char *name,const char *title) : | |
71 | AliAnalysisCuts(name,title), | |
72 | fHistograms(NULL), | |
73 | fHeaderList(NULL), | |
74 | fEventQuality(-1), | |
75 | fIsHeavyIon(0), | |
76 | fDetectorCentrality(0), | |
77 | fModCentralityClass(0), | |
78 | fMaxVertexZ(10), | |
79 | fCentralityMin(0), | |
80 | fCentralityMax(0), | |
81 | fMultiplicityMethod(0), | |
82 | fSpecialTrigger(0), | |
83 | fSpecialSubTrigger(0), | |
84 | fRemovePileUp(kFALSE), | |
85 | fRejectExtraSignals(0), | |
86 | fOfflineTriggerMask(0), | |
87 | fHasV0AND(kTRUE), | |
88 | fIsSDDFired(kTRUE), | |
89 | fRandom(0), | |
90 | fnHeaders(0), | |
91 | fNotRejectedStart(NULL), | |
92 | fNotRejectedEnd(NULL), | |
93 | fGeneratorNames(NULL), | |
94 | fCutString(NULL), | |
95 | fUtils(NULL), | |
96 | fEtaShift(0.0), | |
97 | fDoEtaShift(kFALSE), | |
98 | fDoReweightHistoMCPi0(kFALSE), | |
99 | fDoReweightHistoMCEta(kFALSE), | |
100 | fDoReweightHistoMCK0s(kFALSE), | |
101 | fPathTrFReweighting(""), | |
102 | fNameHistoReweightingPi0(""), | |
103 | fNameHistoReweightingEta(""), | |
104 | fNameHistoReweightingK0s(""), | |
105 | fNameFitDataPi0(""), | |
106 | fNameFitDataEta(""), | |
107 | fNameFitDataK0s(""), | |
108 | fHistoEventCuts(NULL), | |
109 | hCentrality(NULL), | |
110 | hCentralityVsNumberOfPrimaryTracks(NULL), | |
111 | hVertexZ(NULL), | |
112 | hTriggerClass(NULL), | |
113 | hTriggerClassSelected(NULL), | |
114 | hReweightMCHistPi0(NULL), | |
115 | hReweightMCHistEta(NULL), | |
116 | hReweightMCHistK0s(NULL), | |
117 | fFitDataPi0(NULL), | |
118 | fFitDataEta(NULL), | |
119 | fFitDataK0s(NULL), | |
120 | fAddedSignalPDGCode(0), | |
121 | fPreSelCut(kFALSE), | |
122 | fTriggerSelectedManually(kFALSE), | |
123 | fSpecialTriggerName(""), | |
124 | fSpecialSubTriggerName(""), | |
125 | fNSpecialSubTriggerOptions(0) | |
126 | ||
127 | { | |
128 | for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;} | |
129 | fCutString=new TObjString((GetCutNumber()).Data()); | |
130 | ||
131 | fUtils = new AliAnalysisUtils(); | |
132 | //if you do not want to apply the cut on the distance between the SPD and TRK vertex: | |
133 | //fUtils->SetCutOnZVertexSPD(kFALSE); | |
134 | ||
135 | ||
136 | } | |
137 | ||
138 | //________________________________________________________________________ | |
139 | AliConvEventCuts::AliConvEventCuts(const AliConvEventCuts &ref) : | |
140 | AliAnalysisCuts(ref), | |
141 | fHistograms(NULL), | |
142 | fHeaderList(ref.fHeaderList), | |
143 | fEventQuality(ref.fEventQuality), | |
144 | fIsHeavyIon(ref.fIsHeavyIon), | |
145 | fDetectorCentrality(ref.fDetectorCentrality), | |
146 | fModCentralityClass(ref.fModCentralityClass), | |
147 | fMaxVertexZ(ref.fMaxVertexZ), | |
148 | fCentralityMin(ref.fCentralityMin), | |
149 | fCentralityMax(ref.fCentralityMax), | |
150 | fMultiplicityMethod(ref.fMultiplicityMethod), | |
151 | fSpecialTrigger(ref.fSpecialTrigger), | |
152 | fSpecialSubTrigger(ref.fSpecialSubTrigger), | |
153 | fRemovePileUp(ref.fRemovePileUp), | |
154 | fRejectExtraSignals(ref.fRejectExtraSignals), | |
155 | fOfflineTriggerMask(ref.fOfflineTriggerMask), | |
156 | fHasV0AND(ref.fHasV0AND), | |
157 | fIsSDDFired(ref.fIsSDDFired), | |
158 | fRandom(ref.fRandom), | |
159 | fnHeaders(ref.fnHeaders), | |
160 | fNotRejectedStart(NULL), | |
161 | fNotRejectedEnd(NULL), | |
162 | fGeneratorNames(ref.fGeneratorNames), | |
163 | fCutString(NULL), | |
164 | fUtils(NULL), | |
165 | fEtaShift(ref.fEtaShift), | |
166 | fDoEtaShift(ref.fDoEtaShift), | |
167 | fDoReweightHistoMCPi0(ref.fDoReweightHistoMCPi0), | |
168 | fDoReweightHistoMCEta(ref.fDoReweightHistoMCEta), | |
169 | fDoReweightHistoMCK0s(ref.fDoReweightHistoMCK0s), | |
170 | fPathTrFReweighting(ref.fPathTrFReweighting), | |
171 | fNameHistoReweightingPi0(ref.fNameHistoReweightingPi0), | |
172 | fNameHistoReweightingEta(ref.fNameHistoReweightingEta), | |
173 | fNameHistoReweightingK0s(ref.fNameHistoReweightingK0s), | |
174 | fNameFitDataPi0(ref.fNameFitDataPi0), | |
175 | fNameFitDataEta(ref.fNameFitDataEta), | |
176 | fNameFitDataK0s(ref.fNameFitDataK0s), | |
177 | fHistoEventCuts(NULL), | |
178 | hCentrality(NULL), | |
179 | hCentralityVsNumberOfPrimaryTracks(NULL), | |
180 | hVertexZ(NULL), | |
181 | hTriggerClass(NULL), | |
182 | hTriggerClassSelected(NULL), | |
183 | hReweightMCHistPi0(ref.hReweightMCHistPi0), | |
184 | hReweightMCHistEta(ref.hReweightMCHistEta), | |
185 | hReweightMCHistK0s(ref.hReweightMCHistK0s), | |
186 | fFitDataPi0(ref.fFitDataPi0), | |
187 | fFitDataEta(ref.fFitDataEta), | |
188 | fFitDataK0s(ref.fFitDataK0s), | |
189 | fAddedSignalPDGCode(ref.fAddedSignalPDGCode), | |
190 | fPreSelCut(ref.fPreSelCut), | |
191 | fTriggerSelectedManually(ref.fTriggerSelectedManually), | |
192 | fSpecialTriggerName(ref.fSpecialTriggerName), | |
193 | fSpecialSubTriggerName(ref.fSpecialSubTriggerName), | |
194 | fNSpecialSubTriggerOptions(ref.fNSpecialSubTriggerOptions) | |
195 | { | |
196 | // Copy Constructor | |
197 | for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];} | |
198 | fCutString=new TObjString((GetCutNumber()).Data()); | |
199 | fUtils = new AliAnalysisUtils(); | |
200 | // dont copy histograms (if you like histograms, call InitCutHistograms()) | |
201 | ||
202 | } | |
203 | ||
204 | ||
205 | //________________________________________________________________________ | |
206 | AliConvEventCuts::~AliConvEventCuts() { | |
207 | // Destructor | |
208 | //Deleting fHistograms leads to seg fault it it's added to output collection of a task | |
209 | // if(fHistograms) | |
210 | // delete fHistograms; | |
211 | // fHistograms = NULL; | |
212 | if(fCutString != NULL){ | |
213 | delete fCutString; | |
214 | fCutString = NULL; | |
215 | } | |
216 | if(fNotRejectedStart){ | |
217 | delete[] fNotRejectedStart; | |
218 | fNotRejectedStart = NULL; | |
219 | } | |
220 | if(fNotRejectedEnd){ | |
221 | delete[] fNotRejectedEnd; | |
222 | fNotRejectedEnd = NULL; | |
223 | } | |
224 | if(fGeneratorNames){ | |
225 | delete[] fGeneratorNames; | |
226 | fGeneratorNames = NULL; | |
227 | } | |
228 | if(fUtils){ | |
229 | delete fUtils; | |
230 | fUtils = NULL; | |
231 | } | |
232 | ||
233 | } | |
234 | ||
235 | //________________________________________________________________________ | |
236 | void AliConvEventCuts::InitCutHistograms(TString name, Bool_t preCut){ | |
237 | ||
238 | // Initialize Cut Histograms for QA (only initialized and filled if function is called) | |
239 | TH1::AddDirectory(kFALSE); | |
240 | ||
241 | if(fHistograms != NULL){ | |
242 | delete fHistograms; | |
243 | fHistograms=NULL; | |
244 | } | |
245 | if(fHistograms==NULL){ | |
246 | fHistograms=new TList(); | |
247 | fHistograms->SetOwner(kTRUE); | |
248 | if(name=="")fHistograms->SetName(Form("ConvEventCuts_%s",GetCutNumber().Data())); | |
249 | else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data())); | |
250 | } | |
251 | ||
252 | if (hReweightMCHistPi0){ | |
253 | hReweightMCHistPi0->SetName("MCInputForWeightingPi0"); | |
254 | fHistograms->Add(hReweightMCHistPi0); | |
255 | } | |
256 | if (hReweightMCHistEta){ | |
257 | hReweightMCHistEta->SetName("MCInputForWeightingEta"); | |
258 | fHistograms->Add(hReweightMCHistEta); | |
259 | } | |
260 | if (hReweightMCHistK0s){ | |
261 | hReweightMCHistK0s->SetName("MCInputForWeightingK0s"); | |
262 | fHistograms->Add(hReweightMCHistK0s); | |
263 | } | |
264 | ||
265 | hCentrality=new TH1F(Form("Centrality %s",GetCutNumber().Data()),"Centrality",100,0,100); | |
266 | fHistograms->Add(hCentrality); | |
267 | hCentralityVsNumberOfPrimaryTracks=new TH2F(Form("Centrality vs Primary Tracks %s",GetCutNumber().Data()),"Centrality vs Primary Tracks ",100,0,100,4000,0,4000); | |
268 | fHistograms->Add(hCentralityVsNumberOfPrimaryTracks); | |
269 | ||
270 | // Event Cuts and Info | |
271 | if(preCut){ | |
272 | fHistoEventCuts=new TH1F(Form("ESD_EventCuts %s",GetCutNumber().Data()),"Event Cuts",7,-0.5,6.5); | |
273 | fHistoEventCuts->GetXaxis()->SetBinLabel(1,"in"); | |
274 | fHistoEventCuts->GetXaxis()->SetBinLabel(2,"OfflineTrigger"); | |
275 | fHistoEventCuts->GetXaxis()->SetBinLabel(3,"nvtxcontr"); | |
276 | fHistoEventCuts->GetXaxis()->SetBinLabel(4,"VertexZ"); | |
277 | fHistoEventCuts->GetXaxis()->SetBinLabel(5,"pileup"); | |
278 | fHistoEventCuts->GetXaxis()->SetBinLabel(6,"centrsel"); | |
279 | fHistoEventCuts->GetXaxis()->SetBinLabel(7,"out"); | |
280 | fHistograms->Add(fHistoEventCuts); | |
281 | ||
282 | hVertexZ=new TH1F(Form("VertexZ %s",GetCutNumber().Data()),"VertexZ",1000,-50,50); | |
283 | fHistograms->Add(hVertexZ); | |
284 | ||
285 | hTriggerClass= new TH1F(Form("OfflineTrigger %s",GetCutNumber().Data()),"OfflineTrigger",35,-0.5,34.5); | |
286 | hTriggerClass->GetXaxis()->SetBinLabel( 1,"kMB"); | |
287 | hTriggerClass->GetXaxis()->SetBinLabel( 2,"kINT7"); | |
288 | hTriggerClass->GetXaxis()->SetBinLabel( 3,"kMUON"); | |
289 | hTriggerClass->GetXaxis()->SetBinLabel( 4,"kHighMult"); | |
290 | hTriggerClass->GetXaxis()->SetBinLabel( 5,"kKEMC1"); | |
291 | hTriggerClass->GetXaxis()->SetBinLabel( 6,"kCINT5"); | |
292 | hTriggerClass->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB"); | |
293 | hTriggerClass->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB"); | |
294 | hTriggerClass->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB"); | |
295 | hTriggerClass->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB"); | |
296 | hTriggerClass->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8"); | |
297 | hTriggerClass->GetXaxis()->SetBinLabel(12,"kMUS7"); | |
298 | hTriggerClass->GetXaxis()->SetBinLabel(13,"kPHI1"); | |
299 | hTriggerClass->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb"); | |
300 | hTriggerClass->GetXaxis()->SetBinLabel(15,"kEMCEJE"); | |
301 | hTriggerClass->GetXaxis()->SetBinLabel(16,"kEMCEGA"); | |
302 | hTriggerClass->GetXaxis()->SetBinLabel(17,"kCentral"); | |
303 | hTriggerClass->GetXaxis()->SetBinLabel(18,"kSemiCentral"); | |
304 | hTriggerClass->GetXaxis()->SetBinLabel(19,"kDG5"); | |
305 | hTriggerClass->GetXaxis()->SetBinLabel(20,"kZED"); | |
306 | hTriggerClass->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI"); | |
307 | hTriggerClass->GetXaxis()->SetBinLabel(22,"kINT8"); | |
308 | hTriggerClass->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8"); | |
309 | hTriggerClass->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8"); | |
310 | hTriggerClass->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8"); | |
311 | hTriggerClass->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8"); | |
312 | hTriggerClass->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0"); | |
313 | hTriggerClass->GetXaxis()->SetBinLabel(28,"kUserDefined"); | |
314 | hTriggerClass->GetXaxis()->SetBinLabel(29,"kTRD"); | |
315 | hTriggerClass->GetXaxis()->SetBinLabel(30,"kFastOnly"); | |
316 | hTriggerClass->GetXaxis()->SetBinLabel(31,"kAnyINT"); | |
317 | hTriggerClass->GetXaxis()->SetBinLabel(32,"kAny"); | |
318 | hTriggerClass->GetXaxis()->SetBinLabel(33,"V0AND"); | |
319 | hTriggerClass->GetXaxis()->SetBinLabel(34,"NOT kFastOnly"); | |
320 | hTriggerClass->GetXaxis()->SetBinLabel(35,"failed Physics Selection"); | |
321 | fHistograms->Add(hTriggerClass); | |
322 | } | |
323 | if(!preCut){ | |
324 | hTriggerClassSelected= new TH1F(Form("OfflineTriggerSelected %s",GetCutNumber().Data()),"OfflineTriggerSelected",34,-0.5,33.5); | |
325 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 1,"kMB"); | |
326 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 2,"kINT7"); | |
327 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 3,"kMUON"); | |
328 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 4,"kHighMult"); | |
329 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 5,"kKEMC1"); | |
330 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 6,"kCINT5"); | |
331 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB"); | |
332 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB"); | |
333 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB"); | |
334 | hTriggerClassSelected->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB"); | |
335 | hTriggerClassSelected->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8"); | |
336 | hTriggerClassSelected->GetXaxis()->SetBinLabel(12,"kMUS7"); | |
337 | hTriggerClassSelected->GetXaxis()->SetBinLabel(13,"kPHI1"); | |
338 | hTriggerClassSelected->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb"); | |
339 | hTriggerClassSelected->GetXaxis()->SetBinLabel(15,"kEMCEJE"); | |
340 | hTriggerClassSelected->GetXaxis()->SetBinLabel(16,"kEMCEGA"); | |
341 | hTriggerClassSelected->GetXaxis()->SetBinLabel(17,"kCentral"); | |
342 | hTriggerClassSelected->GetXaxis()->SetBinLabel(18,"kSemiCentral"); | |
343 | hTriggerClassSelected->GetXaxis()->SetBinLabel(19,"kDG5"); | |
344 | hTriggerClassSelected->GetXaxis()->SetBinLabel(20,"kZED"); | |
345 | hTriggerClassSelected->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI"); | |
346 | hTriggerClassSelected->GetXaxis()->SetBinLabel(22,"kINT8"); | |
347 | hTriggerClassSelected->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8"); | |
348 | hTriggerClassSelected->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8"); | |
349 | hTriggerClassSelected->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8"); | |
350 | hTriggerClassSelected->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8"); | |
351 | hTriggerClassSelected->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0"); | |
352 | hTriggerClassSelected->GetXaxis()->SetBinLabel(28,"kUserDefined"); | |
353 | hTriggerClassSelected->GetXaxis()->SetBinLabel(29,"kTRD"); | |
354 | hTriggerClassSelected->GetXaxis()->SetBinLabel(30,"kFastOnly"); | |
355 | hTriggerClassSelected->GetXaxis()->SetBinLabel(31,"kAnyINT"); | |
356 | hTriggerClassSelected->GetXaxis()->SetBinLabel(32,"kAny"); | |
357 | hTriggerClassSelected->GetXaxis()->SetBinLabel(33,"V0AND"); | |
358 | hTriggerClassSelected->GetXaxis()->SetBinLabel(34,"NOT kFastOnly"); | |
359 | fHistograms->Add(hTriggerClassSelected); | |
360 | ||
361 | } | |
362 | TH1::AddDirectory(kTRUE); | |
363 | } | |
364 | ||
365 | ///________________________________________________________________________ | |
366 | Bool_t AliConvEventCuts::EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent){ | |
367 | // Process Event Selection | |
368 | ||
369 | Int_t cutindex=0; | |
370 | if(fHistoEventCuts)fHistoEventCuts->Fill(cutindex); | |
371 | cutindex++; | |
372 | ||
373 | // Check for MC event | |
374 | if(fMCEvent && fInputEvent->IsA()==AliESDEvent::Class()){ | |
375 | // Check if MC event is correctly loaded | |
376 | AliMCEventHandler* mcHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
377 | if (!mcHandler){ | |
378 | fEventQuality = 2; | |
379 | return kFALSE; | |
380 | } | |
381 | if (!mcHandler->InitOk() ){ | |
382 | fEventQuality = 2; | |
383 | return kFALSE; | |
384 | } | |
385 | if (!mcHandler->TreeK() ){ | |
386 | fEventQuality = 2; | |
387 | return kFALSE; | |
388 | } | |
389 | if (!mcHandler->TreeTR() ) { | |
390 | fEventQuality = 2; | |
391 | return kFALSE; | |
392 | } | |
393 | } | |
394 | ||
395 | // Event Trigger | |
396 | // cout << "before event trigger" << endl; | |
397 | if(!IsTriggerSelected(fInputEvent)){ | |
398 | if(fHistoEventCuts)fHistoEventCuts->Fill(cutindex); | |
399 | fEventQuality = 3; | |
400 | return kFALSE; | |
401 | } | |
402 | cutindex++; | |
403 | ||
404 | if(fInputEvent->IsA()==AliESDEvent::Class()){ | |
405 | AliTriggerAnalysis fTriggerAnalysis;// = new AliTriggerAnalysis; | |
406 | fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((AliESDEvent*)fInputEvent, AliTriggerAnalysis::kV0AND); | |
407 | if(fHasV0AND&&hTriggerClass)hTriggerClass->Fill(32); | |
408 | } | |
409 | // cout << "event number " << ((AliESDEvent*)fInputEvent)->GetEventNumberInFile() << " entered"<< endl; | |
410 | ||
411 | ||
412 | // Number of Contributors Cut | |
413 | if(GetNumberOfContributorsVtx(fInputEvent)<=0) { | |
414 | if(fHistoEventCuts)fHistoEventCuts->Fill(cutindex); | |
415 | fEventQuality = 5; | |
416 | return kFALSE; | |
417 | } | |
418 | cutindex++; | |
419 | ||
420 | // Z Vertex Position Cut | |
421 | if(!VertexZCut(fInputEvent)){ | |
422 | if(fHistoEventCuts)fHistoEventCuts->Fill(cutindex); | |
423 | fEventQuality = 4; | |
424 | return kFALSE; | |
425 | } | |
426 | cutindex++; | |
427 | ||
428 | // Pile Up Rejection | |
429 | ||
430 | if(fRemovePileUp){ | |
431 | if(fInputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){ | |
432 | if(fHistoEventCuts)fHistoEventCuts->Fill(cutindex); | |
433 | fEventQuality = 6; | |
434 | return kFALSE; | |
435 | } | |
436 | } | |
437 | cutindex++; | |
438 | ||
439 | // Centrality Selection | |
440 | if(!IsCentralitySelected(fInputEvent,fMCEvent)){ | |
441 | if(fHistoEventCuts)fHistoEventCuts->Fill(cutindex); | |
442 | fEventQuality = 1; | |
443 | return kFALSE; | |
444 | } | |
445 | cutindex++; | |
446 | ||
447 | // Fill Event Histograms | |
448 | if(fHistoEventCuts)fHistoEventCuts->Fill(cutindex); | |
449 | if(hVertexZ)hVertexZ->Fill(fInputEvent->GetPrimaryVertex()->GetZ()); | |
450 | if(hCentrality)hCentrality->Fill(GetCentrality(fInputEvent)); | |
451 | if(hCentralityVsNumberOfPrimaryTracks) | |
452 | hCentralityVsNumberOfPrimaryTracks->Fill(GetCentrality(fInputEvent), | |
453 | ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager() | |
454 | ->GetTask("V0ReaderV1"))->GetNumberOfPrimaryTracks()); | |
455 | fEventQuality = 0; | |
456 | return kTRUE; | |
457 | } | |
458 | ||
459 | ///________________________________________________________________________ | |
460 | Bool_t AliConvEventCuts::UpdateCutString() { | |
461 | ///Update the cut string (if it has been created yet) | |
462 | ||
463 | if(fCutString && fCutString->GetString().Length() == kNCuts) { | |
464 | fCutString->SetString(GetCutNumber()); | |
465 | } else { | |
466 | return kFALSE; | |
467 | } | |
468 | return kTRUE; | |
469 | } | |
470 | ||
471 | ///________________________________________________________________________ | |
472 | void AliConvEventCuts::LoadReweightingHistosMCFromFile() { | |
473 | ||
474 | AliInfo("Entering loading of histograms for weighting"); | |
475 | TFile *f = TFile::Open(fPathTrFReweighting.Data()); | |
476 | if(!f){ | |
477 | AliError(Form("file for weighting %s not found",fPathTrFReweighting.Data())); | |
478 | return; | |
479 | } | |
480 | if (fNameHistoReweightingPi0.CompareTo("") != 0 && fDoReweightHistoMCPi0 ){ | |
481 | cout << "I have to find: " << fNameHistoReweightingPi0.Data() << endl; | |
482 | TH1D *hReweightMCHistPi0temp = (TH1D*)f->Get(fNameHistoReweightingPi0.Data()); | |
483 | hReweightMCHistPi0 = new TH1D(*hReweightMCHistPi0temp); | |
484 | if (hReweightMCHistPi0) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingPi0.Data(),fPathTrFReweighting.Data() )); | |
485 | else AliWarning(Form("%s not found in %s", fNameHistoReweightingPi0.Data() ,fPathTrFReweighting.Data())); | |
486 | hReweightMCHistPi0->SetDirectory(0); | |
487 | } | |
488 | if (fNameFitDataPi0.CompareTo("") != 0 && fDoReweightHistoMCPi0 ){ | |
489 | cout << "I have to find: " << fNameFitDataPi0.Data() << endl; | |
490 | TF1 *fFitDataPi0temp = (TF1*)f->Get(fNameFitDataPi0.Data()); | |
491 | fFitDataPi0 = new TF1(*fFitDataPi0temp); | |
492 | if (fFitDataPi0) AliInfo(Form("%s has been loaded from %s", fNameFitDataPi0.Data(),fPathTrFReweighting.Data() )); | |
493 | else AliWarning(Form("%s not found in %s",fPathTrFReweighting.Data(), fNameFitDataPi0.Data() )); | |
494 | } | |
495 | ||
496 | if (fNameHistoReweightingEta.CompareTo("") != 0 && fDoReweightHistoMCEta){ | |
497 | cout << "I have to find: " << fNameHistoReweightingEta.Data() << endl; | |
498 | TH1D *hReweightMCHistEtatemp = (TH1D*)f->Get(fNameHistoReweightingEta.Data()); | |
499 | hReweightMCHistEta = new TH1D(*hReweightMCHistEtatemp); | |
500 | if (hReweightMCHistEta) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingEta.Data(),fPathTrFReweighting.Data() )); | |
501 | else AliWarning(Form("%s not found in %s", fNameHistoReweightingEta.Data(),fPathTrFReweighting.Data() )); | |
502 | hReweightMCHistEta->SetDirectory(0); | |
503 | } | |
504 | ||
505 | if (fNameFitDataEta.CompareTo("") != 0 && fDoReweightHistoMCEta){ | |
506 | cout << "I have to find: " << fNameFitDataEta.Data() << endl; | |
507 | TF1 *fFitDataEtatemp = (TF1*)f->Get(fNameFitDataEta.Data()); | |
508 | fFitDataEta = new TF1(*fFitDataEtatemp); | |
509 | if (fFitDataEta) AliInfo(Form("%s has been loaded from %s", fNameFitDataEta.Data(),fPathTrFReweighting.Data() )); | |
510 | else AliWarning(Form("%s not found in %s", fNameFitDataEta.Data(),fPathTrFReweighting.Data() )); | |
511 | ||
512 | } | |
513 | if (fNameHistoReweightingK0s.CompareTo("") != 0 && fDoReweightHistoMCK0s){ | |
514 | cout << "I have to find: " << fNameHistoReweightingK0s.Data() << endl; | |
515 | TH1D *hReweightMCHistK0stemp = (TH1D*)f->Get(fNameHistoReweightingK0s.Data()); | |
516 | hReweightMCHistK0s = new TH1D(*hReweightMCHistK0stemp); | |
517 | if (hReweightMCHistK0s) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingK0s.Data(),fPathTrFReweighting.Data() )); | |
518 | else AliWarning(Form("%s not found in %s", fNameHistoReweightingK0s.Data(),fPathTrFReweighting.Data() )); | |
519 | hReweightMCHistK0s->SetDirectory(0); | |
520 | } | |
521 | ||
522 | if (fNameFitDataK0s.CompareTo("") != 0 && fDoReweightHistoMCK0s){ | |
523 | cout << "I have to find: " << fNameFitDataK0s.Data() << endl; | |
524 | TF1 *fFitDataK0stemp = (TF1*)f->Get(fNameFitDataK0s.Data()); | |
525 | fFitDataK0s = new TF1(*fFitDataK0stemp); | |
526 | if (fFitDataK0s) AliInfo(Form("%s has been loaded from %s", fNameFitDataK0s.Data(),fPathTrFReweighting.Data() )); | |
527 | else AliWarning(Form("%s not found in %s", fNameFitDataK0s.Data(),fPathTrFReweighting.Data() )); | |
528 | } | |
529 | f->Close(); | |
530 | delete f; | |
531 | } | |
532 | ||
533 | ||
534 | ///________________________________________________________________________ | |
535 | Bool_t AliConvEventCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) { | |
536 | // Initialize Cuts from a given Cut string | |
537 | if(fDoReweightHistoMCPi0 || fDoReweightHistoMCEta || fDoReweightHistoMCK0s) { | |
538 | AliInfo("Weighting was enabled"); | |
539 | LoadReweightingHistosMCFromFile(); | |
540 | } | |
541 | ||
542 | AliInfo(Form("Set Event Cut Number: %s",analysisCutSelection.Data())); | |
543 | if(analysisCutSelection.Length()!=kNCuts) { | |
544 | AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts)); | |
545 | return kFALSE; | |
546 | } | |
547 | if(!analysisCutSelection.IsDigit()){ | |
548 | AliError("Cut selection contains characters"); | |
549 | return kFALSE; | |
550 | } | |
551 | ||
552 | const char *cutSelection = analysisCutSelection.Data(); | |
553 | #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0' | |
554 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
555 | ASSIGNARRAY(ii); | |
556 | } | |
557 | ||
558 | // Set Individual Cuts | |
559 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
560 | if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE; | |
561 | } | |
562 | ||
563 | PrintCutsWithValues(); | |
564 | ||
565 | return kTRUE; | |
566 | } | |
567 | ||
568 | ///________________________________________________________________________ | |
569 | Bool_t AliConvEventCuts::SetCut(cutIds cutID, const Int_t value) { | |
570 | ///Set individual cut ID | |
571 | ||
572 | switch (cutID) { | |
573 | case kremovePileUp: | |
574 | if( SetRemovePileUp(value)) { | |
575 | fCuts[kremovePileUp] = value; | |
576 | UpdateCutString(); | |
577 | return kTRUE; | |
578 | } else return kFALSE; | |
579 | case kSelectSpecialTriggerAlias: | |
580 | if( SetSelectSpecialTrigger(value)) { | |
581 | fCuts[kSelectSpecialTriggerAlias] = value; | |
582 | UpdateCutString(); | |
583 | return kTRUE; | |
584 | } else return kFALSE; | |
585 | case kSelectSubTriggerClass: | |
586 | if( SetSelectSubTriggerClass(value)) { | |
587 | fCuts[kSelectSubTriggerClass] = value; | |
588 | UpdateCutString(); | |
589 | return kTRUE; | |
590 | } else return kFALSE; | |
591 | case kisHeavyIon: | |
592 | if( SetIsHeavyIon(value)) { | |
593 | fCuts[kisHeavyIon] = value; | |
594 | UpdateCutString(); | |
595 | return kTRUE; | |
596 | } else return kFALSE; | |
597 | case kCentralityMin: | |
598 | if( SetCentralityMin(value)) { | |
599 | fCuts[kCentralityMin] = value; | |
600 | UpdateCutString(); | |
601 | return kTRUE; | |
602 | } else return kFALSE; | |
603 | case kCentralityMax: | |
604 | if( SetCentralityMax(value)) { | |
605 | fCuts[kCentralityMax] = value; | |
606 | UpdateCutString(); | |
607 | return kTRUE; | |
608 | } else return kFALSE; | |
609 | case kExtraSignals: | |
610 | if( SetRejectExtraSignalsCut(value)) { | |
611 | fCuts[kExtraSignals] = value; | |
612 | UpdateCutString(); | |
613 | return kTRUE; | |
614 | } else return kFALSE; | |
615 | case kNCuts: | |
616 | AliError("Cut id out of range"); | |
617 | return kFALSE; | |
618 | } | |
619 | ||
620 | AliError("Cut id %d not recognized"); | |
621 | return kFALSE; | |
622 | } | |
623 | ||
624 | ///________________________________________________________________________ | |
625 | void AliConvEventCuts::PrintCuts() { | |
626 | // Print out current Cut Selection | |
627 | for(Int_t ic = 0; ic < kNCuts; ic++) { | |
628 | printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]); | |
629 | } | |
630 | } | |
631 | ||
632 | void AliConvEventCuts::PrintCutsWithValues() { | |
633 | // Print out current Cut Selection with value | |
634 | printf("\nEvent cutnumber \n"); | |
635 | for(Int_t ic = 0; ic < kNCuts; ic++) { | |
636 | printf("%d",fCuts[ic]); | |
637 | } | |
638 | printf("\n\n"); | |
639 | ||
640 | if (fIsHeavyIon == 0) { | |
641 | printf("Running in pp mode \n"); | |
642 | if (fSpecialTrigger == 0){ | |
643 | printf("\t only events triggered by V0OR will be analysed \n"); | |
644 | } else if (fSpecialTrigger == 1){ | |
645 | printf("\t only events triggered by V0AND will be analysed \n"); | |
646 | } else if (fSpecialTrigger == 2){ | |
647 | printf("\t only events where SDD was present will be analysed \n"); | |
648 | } else if (fSpecialTrigger == 3){ | |
649 | printf("\t only events where SDD was present will be analysed and triggered by VOAND\n"); | |
650 | } else if (fSpecialTrigger > 3){ | |
651 | printf("\t only events triggered by %s %s\n", fSpecialTriggerName.Data(), fSpecialSubTriggerName.Data()); | |
652 | } | |
653 | } else if (fIsHeavyIon == 1){ | |
654 | printf("Running in PbPb mode \n"); | |
655 | if (fDetectorCentrality == 0){ | |
656 | printf("\t centrality selection based on V0M \n"); | |
657 | } else if (fDetectorCentrality == 1){ | |
658 | printf("\t centrality selection based on Cl1 \n"); | |
659 | } | |
660 | if (fModCentralityClass == 0){ | |
661 | printf("\t %d - %d \n", fCentralityMin*10, fCentralityMax*10); | |
662 | } else if ( fModCentralityClass == 1){ | |
663 | printf("\t %d - %d \n", fCentralityMin*5, fCentralityMax*5); | |
664 | } else if ( fModCentralityClass == 2){ | |
665 | printf("\t %d - %d \n", fCentralityMin*5+45, fCentralityMax*5+45); | |
666 | } else if (fModCentralityClass == 3){ | |
667 | printf("\t %d - %d, with Track mult in MC as data \n", fCentralityMin*10, fCentralityMax*10); | |
668 | } else if ( fModCentralityClass == 4){ | |
669 | printf("\t %d - %d, with Track mult in MC as data \n", fCentralityMin*5, fCentralityMax*5); | |
670 | } else if ( fModCentralityClass == 5){ | |
671 | printf("\t %d - %d, with Track mult in MC as data \n", fCentralityMin*5+45, fCentralityMax*5+45); | |
672 | } | |
673 | if (fSpecialTrigger == 0){ | |
674 | printf("\t only events triggered by kMB, kCentral, kSemiCentral will be analysed \n"); | |
675 | } else if (fSpecialTrigger > 4){ | |
676 | printf("\t only events triggered by %s %s\n", fSpecialTriggerName.Data(), fSpecialSubTriggerName.Data()); | |
677 | } | |
678 | } else if (fIsHeavyIon == 2){ | |
679 | printf("Running in pPb mode \n"); | |
680 | if (fDetectorCentrality == 0){ | |
681 | printf("\t centrality selection based on V0A \n"); | |
682 | } else if (fDetectorCentrality == 1){ | |
683 | printf("\t centrality selection based on Cl1 \n"); | |
684 | } | |
685 | if (fModCentralityClass == 0){ | |
686 | printf("\t %d - %d \n", fCentralityMin*10, fCentralityMax*10); | |
687 | } | |
688 | if (fSpecialTrigger == 0){ | |
689 | printf("\t only events triggered by kINT7 will be analysed \n"); | |
690 | } else if (fSpecialTrigger > 4){ | |
691 | printf("\t only events triggered by %s %s\n", fSpecialTriggerName.Data(), fSpecialSubTriggerName.Data()); | |
692 | } | |
693 | } | |
694 | printf("MC event cuts: \n"); | |
695 | if (fRejectExtraSignals == 0) printf("\t no rejection was applied \n"); | |
696 | else if (fRejectExtraSignals == 1) printf("\t only MB header will be inspected \n"); | |
697 | else if (fRejectExtraSignals > 1) printf("\t special header have been selected \n"); | |
698 | } | |
699 | ||
700 | ///________________________________________________________________________ | |
701 | Bool_t AliConvEventCuts::SetIsHeavyIon(Int_t isHeavyIon) | |
702 | { // Set Cut | |
703 | switch(isHeavyIon){ | |
704 | case 0: | |
705 | fIsHeavyIon=0; | |
706 | break; | |
707 | case 1: | |
708 | fIsHeavyIon=1; | |
709 | fDetectorCentrality=0; | |
710 | break; | |
711 | case 2: | |
712 | fIsHeavyIon=1; | |
713 | fDetectorCentrality=1; | |
714 | break; | |
715 | case 3: //allows to select centrality 0-45% in steps of 5% for V0 Multiplicity | |
716 | fIsHeavyIon=1; | |
717 | fDetectorCentrality=0; | |
718 | fModCentralityClass=1; | |
719 | break; | |
720 | case 4: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity | |
721 | fIsHeavyIon=1; | |
722 | fDetectorCentrality=0; | |
723 | fModCentralityClass=2; | |
724 | break; | |
725 | case 5: //strict cut on v0 tracks for MC | |
726 | fIsHeavyIon=1; | |
727 | fDetectorCentrality=0; | |
728 | fModCentralityClass=3; | |
729 | break; | |
730 | case 6: //allows to select centrality 0-45% in steps of 5% for track mult | |
731 | //strict cut on v0 tracks for MC | |
732 | fIsHeavyIon=1; | |
733 | fDetectorCentrality=0; | |
734 | fModCentralityClass=4; | |
735 | break; | |
736 | case 7: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity | |
737 | //strict cut on v0 tracks for MC | |
738 | fIsHeavyIon=1; | |
739 | fDetectorCentrality=0; | |
740 | fModCentralityClass=5; | |
741 | break; | |
742 | case 8: | |
743 | fIsHeavyIon=2; | |
744 | fDetectorCentrality=0; | |
745 | break; | |
746 | case 9: | |
747 | fIsHeavyIon=2; | |
748 | fDetectorCentrality=1; | |
749 | break; | |
750 | default: | |
751 | AliError(Form("SetHeavyIon not defined %d",isHeavyIon)); | |
752 | return kFALSE; | |
753 | } | |
754 | return kTRUE; | |
755 | } | |
756 | ||
757 | //___________________________________________________________________ | |
758 | Bool_t AliConvEventCuts::SetCentralityMin(Int_t minCentrality) | |
759 | { | |
760 | // Set Cut | |
761 | if(minCentrality<0||minCentrality>9){ | |
762 | AliError(Form("minCentrality not defined %d",minCentrality)); | |
763 | return kFALSE; | |
764 | } | |
765 | ||
766 | fCentralityMin=minCentrality; | |
767 | return kTRUE; | |
768 | } | |
769 | ||
770 | //___________________________________________________________________ | |
771 | Bool_t AliConvEventCuts::SetCentralityMax(Int_t maxCentrality) | |
772 | { | |
773 | // Set Cut | |
774 | if(maxCentrality<0||maxCentrality>9){ | |
775 | AliError(Form("maxCentrality not defined %d",maxCentrality)); | |
776 | return kFALSE; | |
777 | } | |
778 | fCentralityMax=maxCentrality; | |
779 | return kTRUE; | |
780 | } | |
781 | ||
782 | ///________________________________________________________________________ | |
783 | Bool_t AliConvEventCuts::SetSelectSpecialTrigger(Int_t selectSpecialTrigger) | |
784 | {// Set Cut | |
785 | ||
786 | switch(selectSpecialTrigger){ | |
787 | case 0: | |
788 | fSpecialTrigger=0; // dont care | |
789 | break; | |
790 | case 1: | |
791 | fSpecialTrigger=1; // V0AND | |
792 | break; | |
793 | case 2: | |
794 | fSpecialTrigger=2; // with SDD requested | |
795 | break; | |
796 | case 3: | |
797 | fSpecialTrigger=3; // V0AND plus with SDD requested | |
798 | break; | |
799 | // allows to run MB & 6 other different trigger classes in parallel with the same photon cut | |
800 | case 4: | |
801 | fSpecialTrigger=4; // trigger alias kTRD | |
802 | fOfflineTriggerMask=AliVEvent::kTRD; | |
803 | fTriggerSelectedManually = kTRUE; | |
804 | fSpecialTriggerName="AliVEvent::kTRD"; | |
805 | break; | |
806 | case 5: | |
807 | fSpecialTrigger=5; // trigger alias kEMC | |
808 | fOfflineTriggerMask=AliVEvent::kEMC7 | AliVEvent::kEMC8 | AliVEvent::kEMC1 ; | |
809 | fTriggerSelectedManually = kTRUE; | |
810 | fSpecialTriggerName="AliVEvent::kEMC7/kEMC8/kEMC1"; | |
811 | break; | |
812 | case 6: | |
813 | fSpecialTrigger=6; // trigger alias kPHI | |
814 | fOfflineTriggerMask=AliVEvent::kPHI7 | AliVEvent::kPHI1 | AliVEvent::kPHI8 | AliVEvent::kPHOSPb; | |
815 | fTriggerSelectedManually = kTRUE; | |
816 | fSpecialTriggerName="AliVEvent::kPHI7/kPHI1/kPHI8/kPHOSPb"; | |
817 | break; | |
818 | case 7: | |
819 | fSpecialTrigger=7; // trigger alias kHighMult | |
820 | fOfflineTriggerMask=AliVEvent::kHighMult; | |
821 | fTriggerSelectedManually = kTRUE; | |
822 | fSpecialTriggerName="AliVEvent::kHighMult"; | |
823 | break; | |
824 | case 8: | |
825 | fSpecialTrigger=8; // trigger alias kEMCEGA | |
826 | fOfflineTriggerMask=AliVEvent::kEMCEGA; | |
827 | fTriggerSelectedManually = kTRUE; | |
828 | fSpecialTriggerName="AliVEvent::kEMCEGA"; | |
829 | break; | |
830 | case 9: | |
831 | fSpecialTrigger=9; // trigger alias kEMCEJE | |
832 | fOfflineTriggerMask=AliVEvent::kEMCEJE; | |
833 | fTriggerSelectedManually = kTRUE; | |
834 | fSpecialTriggerName="AliVEvent::kEMCEJE"; | |
835 | break; | |
836 | default: | |
837 | AliError("Warning: Special Trigger Not known"); | |
838 | return 0; | |
839 | } | |
840 | return 1; | |
841 | } | |
842 | ||
843 | ///________________________________________________________________________ | |
844 | Bool_t AliConvEventCuts::SetSelectSubTriggerClass(Int_t selectSpecialSubTriggerClass) | |
845 | {// Set Cut | |
846 | ||
847 | if (fSpecialTrigger == 1){ //V0AND with different detectors | |
848 | switch(selectSpecialSubTriggerClass){ | |
849 | case 0: //with VZERO | |
850 | fSpecialTrigger=1; | |
851 | fSpecialSubTrigger=0; | |
852 | // AliInfo("Info: Nothing to be done"); | |
853 | break; | |
854 | case 1: //with TZERO | |
855 | fSpecialTrigger=0; | |
856 | fSpecialSubTrigger=0; | |
857 | fOfflineTriggerMask=AliVEvent::kINT8; | |
858 | fTriggerSelectedManually = kTRUE; | |
859 | fSpecialTriggerName="AliVEvent::kINT8"; | |
860 | break; | |
861 | default: | |
862 | AliError("Warning: Special Subtrigger Class Not known"); | |
863 | return 0; | |
864 | } | |
865 | ||
866 | } else if (fSpecialTrigger == 4){ // Subdivision of TRD trigger classes | |
867 | switch(selectSpecialSubTriggerClass){ | |
868 | case 0: // all together | |
869 | fSpecialSubTrigger=0; | |
870 | fSpecialSubTriggerName=""; | |
871 | // AliInfo("Info: Nothing to be done"); | |
872 | break; | |
873 | case 1: // 7WUHSH - V0AND with single electron in TRD & EMCAL | |
874 | fSpecialSubTrigger=1; | |
875 | fNSpecialSubTriggerOptions=1; | |
876 | fSpecialSubTriggerName="7WUHEE"; | |
877 | break; | |
878 | case 2: // 8WUHSH - T0AND with single electron in TRD & EMCAL | |
879 | fSpecialSubTrigger=1; | |
880 | fNSpecialSubTriggerOptions=1; | |
881 | fSpecialSubTriggerName="8WUHEE"; | |
882 | break; | |
883 | case 3: // 7WUHSE - V0AND with single high pt electron in TRD | |
884 | fSpecialSubTrigger=1; | |
885 | fNSpecialSubTriggerOptions=1; | |
886 | fSpecialSubTriggerName="7WUHSE"; | |
887 | break; | |
888 | case 4: // 8WUHSE - T0AND with single high pt electron in TRD | |
889 | fSpecialSubTrigger=1; | |
890 | fNSpecialSubTriggerOptions=1; | |
891 | fSpecialSubTriggerName="8WUHSE"; | |
892 | break; | |
893 | case 5: // 7WUHJE - V0AND with jet in TRD | |
894 | fSpecialSubTrigger=1; | |
895 | fNSpecialSubTriggerOptions=1; | |
896 | fSpecialSubTriggerName="7WUHJT"; | |
897 | break; | |
898 | case 6: // 8WUHJE - T0AND with jet in TRD | |
899 | fSpecialSubTrigger=1; | |
900 | fNSpecialSubTriggerOptions=1; | |
901 | fSpecialSubTriggerName="8WUHJT"; | |
902 | break; | |
903 | case 7: // 7WUHQU - V0AND with dielectron pair in TRD | |
904 | fSpecialSubTrigger=1; | |
905 | fNSpecialSubTriggerOptions=1; | |
906 | fSpecialSubTriggerName="7WUHQU"; | |
907 | break; | |
908 | case 8: // 8WUHQU - T0AND with dielectron pair in TRD | |
909 | fSpecialSubTrigger=1; | |
910 | fNSpecialSubTriggerOptions=1; | |
911 | fSpecialSubTriggerName="8WUHQU"; | |
912 | break; | |
913 | default: | |
914 | AliError("Warning: Special Subtrigger Class Not known"); | |
915 | return 0; | |
916 | } | |
917 | } else if (fSpecialTrigger == 5){ // Subdivision of kEMC trigger classes | |
918 | switch(selectSpecialSubTriggerClass){ | |
919 | case 0: // all together | |
920 | fSpecialSubTrigger=0; | |
921 | fSpecialSubTriggerName=""; | |
922 | // AliInfo("Info: Nothing to be done"); | |
923 | break; | |
924 | case 1: // CEMC1 - V0OR and EMCAL fired | |
925 | fOfflineTriggerMask=AliVEvent::kEMC1; | |
926 | fSpecialTriggerName="AliVEvent::kEMC1"; | |
927 | fSpecialSubTrigger=1; | |
928 | fNSpecialSubTriggerOptions=1; | |
929 | fSpecialSubTriggerName="CEMC1"; | |
930 | break; | |
931 | case 2: // CEMC7 - V0AND and EMCAL fired | |
932 | fSpecialSubTrigger=1; | |
933 | fOfflineTriggerMask=AliVEvent::kEMC7; | |
934 | fSpecialTriggerName="AliVEvent::kEMC7"; | |
935 | fNSpecialSubTriggerOptions=1; | |
936 | fSpecialSubTriggerName="CEMC7"; | |
937 | break; | |
938 | case 3: // CEMC8 - T0OR and EMCAL fired | |
939 | fOfflineTriggerMask=AliVEvent::kEMC8; | |
940 | fSpecialTriggerName="AliVEvent::kEMC8"; | |
941 | fSpecialSubTrigger=1; | |
942 | fNSpecialSubTriggerOptions=1; | |
943 | fSpecialSubTriggerName="CEMC8"; | |
944 | break; | |
945 | default: | |
946 | AliError("Warning: Special Subtrigger Class Not known"); | |
947 | return 0; | |
948 | } | |
949 | } else if (fSpecialTrigger == 6){ // Subdivision of kPHI trigger classes | |
950 | switch(selectSpecialSubTriggerClass){ | |
951 | case 0: // all together | |
952 | fSpecialSubTrigger=0; | |
953 | fSpecialSubTriggerName=""; | |
954 | // AliInfo("Info: Nothing to be done"); | |
955 | break; | |
956 | case 1: // CEMC1 - V0OR and EMCAL fired | |
957 | fOfflineTriggerMask=AliVEvent::kPHI1; | |
958 | fSpecialTriggerName="AliVEvent::kPHI1"; | |
959 | fSpecialSubTrigger=1; | |
960 | fNSpecialSubTriggerOptions=1; | |
961 | fSpecialSubTriggerName="CPHI1"; | |
962 | break; | |
963 | case 2: // CEMC7 - V0AND and EMCAL fired | |
964 | fSpecialSubTrigger=1; | |
965 | fOfflineTriggerMask=AliVEvent::kPHI7; | |
966 | fSpecialTriggerName="AliVEvent::kPHI7"; | |
967 | fNSpecialSubTriggerOptions=1; | |
968 | fSpecialSubTriggerName="CPHI7"; | |
969 | break; | |
970 | case 3: // CEMC8 - T0OR and EMCAL fired | |
971 | fOfflineTriggerMask=AliVEvent::kPHI8; | |
972 | fSpecialTriggerName="AliVEvent::kPHI8"; | |
973 | fSpecialSubTrigger=1; | |
974 | fNSpecialSubTriggerOptions=1; | |
975 | fSpecialSubTriggerName="CPHI8"; | |
976 | break; | |
977 | default: | |
978 | AliError("Warning: Special Subtrigger Class Not known"); | |
979 | return 0; | |
980 | } | |
981 | } else if (fSpecialTrigger == 7){ // Subdivision of kHighMult trigger classes | |
982 | switch(selectSpecialSubTriggerClass){ | |
983 | case 0: // all together | |
984 | fSpecialSubTrigger=0; | |
985 | fSpecialSubTriggerName=""; | |
986 | // AliInfo("Info: Nothing to be done"); | |
987 | break; | |
988 | case 1: // CSHM1 - V0OR and high mult fired | |
989 | fSpecialSubTrigger=1; | |
990 | fNSpecialSubTriggerOptions=1; | |
991 | fSpecialSubTriggerName="CSHM1"; | |
992 | break; | |
993 | case 2: // CSHM7 - V0AND and high mult fired | |
994 | fSpecialSubTrigger=1; | |
995 | fNSpecialSubTriggerOptions=1; | |
996 | fSpecialSubTriggerName="CSHM7"; | |
997 | break; | |
998 | case 3: // CSHM8 - T0OR and high mult fired | |
999 | fSpecialSubTrigger=1; | |
1000 | fNSpecialSubTriggerOptions=1; | |
1001 | fSpecialSubTriggerName="CSHM8"; | |
1002 | break; | |
1003 | default: | |
1004 | AliError("Warning: Special Subtrigger Class Not known"); | |
1005 | return 0; | |
1006 | } | |
1007 | } else if (fSpecialTrigger == 8){ // Subdivision of kEMCEGA trigger classes | |
1008 | switch(selectSpecialSubTriggerClass){ | |
1009 | case 0: // all together | |
1010 | fSpecialSubTrigger=0; | |
1011 | fSpecialSubTriggerName=""; | |
1012 | // AliInfo("Info: Nothing to be done"); | |
1013 | break; | |
1014 | case 1: // 7EGA - CINT7 EGA | |
1015 | fSpecialSubTrigger=1; | |
1016 | fNSpecialSubTriggerOptions=1; | |
1017 | fSpecialSubTriggerName="7EGA"; | |
1018 | break; | |
1019 | case 2: // 8EGA - CINT8 EGA | |
1020 | fSpecialSubTrigger=1; | |
1021 | fNSpecialSubTriggerOptions=1; | |
1022 | fSpecialSubTriggerName="8EGA"; | |
1023 | break; | |
1024 | case 3: // 7EG1 - CINT7 EG1 | |
1025 | fSpecialSubTrigger=1; | |
1026 | fNSpecialSubTriggerOptions=1; | |
1027 | fSpecialSubTriggerName="7EG1"; | |
1028 | break; | |
1029 | case 4: // 8EG1 - CINT8 EG1 | |
1030 | fSpecialSubTrigger=1; | |
1031 | fNSpecialSubTriggerOptions=1; | |
1032 | fSpecialSubTriggerName="8EG1"; | |
1033 | break; | |
1034 | case 5: // 7EG2 - CINT7 EG2 | |
1035 | fSpecialSubTrigger=1; | |
1036 | fNSpecialSubTriggerOptions=1; | |
1037 | fSpecialSubTriggerName="7EG2"; | |
1038 | break; | |
1039 | case 6: // 8EG2 - CINT8 EG2 | |
1040 | fSpecialSubTrigger=1; | |
1041 | fNSpecialSubTriggerOptions=1; | |
1042 | fSpecialSubTriggerName="8EG2"; | |
1043 | break; | |
1044 | default: | |
1045 | AliError("Warning: Special Subtrigger Class Not known"); | |
1046 | return 0; | |
1047 | } | |
1048 | } else if (fSpecialTrigger == 9){ // Subdivision of kEMCEGA trigger classes | |
1049 | switch(selectSpecialSubTriggerClass){ | |
1050 | case 0: // all together | |
1051 | fSpecialSubTrigger=0; | |
1052 | fSpecialSubTriggerName=""; | |
1053 | // AliInfo("Info: Nothing to be done"); | |
1054 | break; | |
1055 | case 1: // 7EJE - CINT7 EJE | |
1056 | fSpecialSubTrigger=1; | |
1057 | fNSpecialSubTriggerOptions=1; | |
1058 | fSpecialSubTriggerName="7EJE"; | |
1059 | break; | |
1060 | case 2: // 8EJE - CINT8 EJE | |
1061 | fSpecialSubTrigger=1; | |
1062 | fNSpecialSubTriggerOptions=1; | |
1063 | fSpecialSubTriggerName="8EJE"; | |
1064 | break; | |
1065 | case 3: // 7EJ1 - CINT7 EJ1 | |
1066 | fSpecialSubTrigger=1; | |
1067 | fNSpecialSubTriggerOptions=1; | |
1068 | fSpecialSubTriggerName="7EJ1"; | |
1069 | break; | |
1070 | case 4: // 8EJ1 - CINT8 EJ1 | |
1071 | fSpecialSubTrigger=1; | |
1072 | fNSpecialSubTriggerOptions=1; | |
1073 | fSpecialSubTriggerName="8EJ1"; | |
1074 | break; | |
1075 | case 5: // 7EJ2 - CINT7 EJ2 | |
1076 | fSpecialSubTrigger=1; | |
1077 | fNSpecialSubTriggerOptions=1; | |
1078 | fSpecialSubTriggerName="7EJ2"; | |
1079 | break; | |
1080 | case 6: // 8EJ2 - CINT8 EJ2 | |
1081 | fSpecialSubTrigger=1; | |
1082 | fNSpecialSubTriggerOptions=1; | |
1083 | fSpecialSubTriggerName="8EJ2"; | |
1084 | break; | |
1085 | default: | |
1086 | AliError("Warning: Special Subtrigger Class Not known"); | |
1087 | return 0; | |
1088 | } | |
1089 | } | |
1090 | return 1; | |
1091 | } | |
1092 | ||
1093 | ///________________________________________________________________________ | |
1094 | Bool_t AliConvEventCuts::SetMultiplicityMethod(Int_t multiplicityMethod) | |
1095 | { | |
1096 | // Set Cut | |
1097 | fMultiplicityMethod=multiplicityMethod; | |
1098 | ||
1099 | // 0 Photon Multiplicity | |
1100 | // 1 TPC Track multiplicity | |
1101 | // 2 V0 Mult | |
1102 | // 3 SPD Mult | |
1103 | ||
1104 | return kTRUE; | |
1105 | } | |
1106 | ||
1107 | ///________________________________________________________________________ | |
1108 | Bool_t AliConvEventCuts::SetRemovePileUp(Int_t removePileUp) | |
1109 | {// Set Cut | |
1110 | switch(removePileUp){ | |
1111 | case 0: | |
1112 | fRemovePileUp=kFALSE; | |
1113 | break; | |
1114 | case 1: | |
1115 | fRemovePileUp=kTRUE; | |
1116 | break; | |
1117 | default: | |
1118 | AliError("RemovePileUpCut not defined"); | |
1119 | return kFALSE; | |
1120 | } | |
1121 | return kTRUE; | |
1122 | } | |
1123 | ||
1124 | ///________________________________________________________________________ | |
1125 | Bool_t AliConvEventCuts::SetRejectExtraSignalsCut(Int_t extraSignal) { | |
1126 | ||
1127 | switch(extraSignal){ | |
1128 | case 0: | |
1129 | fRejectExtraSignals = 0; | |
1130 | break; // No Rejection | |
1131 | case 1: | |
1132 | fRejectExtraSignals = 1; | |
1133 | break; // MinBias Header | |
1134 | case 2: | |
1135 | fRejectExtraSignals = 2; | |
1136 | break; // User String Array | |
1137 | case 3: | |
1138 | fRejectExtraSignals = 3; | |
1139 | break; // Rejection for Gamma Correction only | |
1140 | default: | |
1141 | AliError(Form("Extra Signal Rejection not defined %d",extraSignal)); | |
1142 | return kFALSE; | |
1143 | } | |
1144 | return kTRUE; | |
1145 | } | |
1146 | ||
1147 | //------------------------------------------------------------- | |
1148 | Double_t AliConvEventCuts::GetCentrality(AliVEvent *event) | |
1149 | { // Get Event Centrality | |
1150 | ||
1151 | AliESDEvent *esdEvent=dynamic_cast<AliESDEvent*>(event); | |
1152 | if(esdEvent){ | |
1153 | AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality(); | |
1154 | if(fDetectorCentrality==0){ | |
1155 | if (fIsHeavyIon==2){ | |
1156 | return fESDCentrality->GetCentralityPercentile("V0A"); // default for pPb | |
1157 | } else{ | |
1158 | return fESDCentrality->GetCentralityPercentile("V0M"); // default | |
1159 | } | |
1160 | } | |
1161 | if(fDetectorCentrality==1){ | |
1162 | return fESDCentrality->GetCentralityPercentile("CL1"); | |
1163 | } | |
1164 | } | |
1165 | ||
1166 | AliAODEvent *aodEvent=dynamic_cast<AliAODEvent*>(event); | |
1167 | if(aodEvent){ | |
1168 | if(aodEvent->GetHeader()){return aodEvent->GetHeader()->GetCentrality();} | |
1169 | } | |
1170 | ||
1171 | return -1; | |
1172 | } | |
1173 | ||
1174 | //_____________________________________________________________________________________ | |
1175 | Bool_t AliConvEventCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCEvent) | |
1176 | { // Centrality Selection | |
1177 | if(!fIsHeavyIon)return kTRUE; | |
1178 | ||
1179 | if(fCentralityMin == fCentralityMax ) return kTRUE;//0-100% | |
1180 | else if(fCentralityMax==0) fCentralityMax=10; //CentralityRange = fCentralityMin-100% | |
1181 | ||
1182 | Double_t centrality=GetCentrality(event); | |
1183 | if(centrality<0)return kFALSE; | |
1184 | ||
1185 | Int_t centralityC=0; | |
1186 | if (fModCentralityClass == 0){ | |
1187 | centralityC= Int_t(centrality/10); | |
1188 | if(centralityC >= fCentralityMin && centralityC < fCentralityMax) | |
1189 | return kTRUE; | |
1190 | else return kFALSE; | |
1191 | } | |
1192 | else if (fModCentralityClass ==1){ | |
1193 | centralityC= Int_t(centrality); | |
1194 | if(centralityC >= fCentralityMin*5 && centralityC < fCentralityMax*5){ | |
1195 | return kTRUE; | |
1196 | } else return kFALSE; | |
1197 | } | |
1198 | else if (fModCentralityClass ==2){ | |
1199 | centralityC= Int_t(centrality); | |
1200 | if(centralityC >= ((fCentralityMin*5)+45) && centralityC < ((fCentralityMax*5)+45)) | |
1201 | return kTRUE; | |
1202 | else return kFALSE; | |
1203 | } | |
1204 | ||
1205 | Int_t nprimaryTracks = ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->GetNumberOfPrimaryTracks(); | |
1206 | Int_t PrimaryTracks10[10][2] = | |
1207 | { | |
1208 | {9999,9999}, // 0 | |
1209 | {1210, 928}, // 10 | |
1210 | { 817, 658}, // 20 | |
1211 | { 536, 435}, // 30 | |
1212 | { 337, 276}, // 40 | |
1213 | { 197, 162}, // 50 | |
1214 | { 106, 100}, // 60 | |
1215 | { 51, 44}, // 70 | |
1216 | { 21, 18}, // 80 | |
1217 | { 0, 0} // 90 | |
1218 | }; | |
1219 | Int_t PrimaryTracks5a[10][2] = | |
1220 | { | |
1221 | {9999,9999}, // 0 | |
1222 | {1485,1168}, // 5 | |
1223 | {1210, 928}, // 10 | |
1224 | { 995, 795}, // 15 | |
1225 | { 817, 658}, // 20 | |
1226 | { 666, 538}, // 25 | |
1227 | { 536, 435}, // 30 | |
1228 | { 428, 350}, // 35 | |
1229 | { 337, 276}, // 40 | |
1230 | { 260, 214} // 45 | |
1231 | }; | |
1232 | Int_t PrimaryTracks5b[10][2] = | |
1233 | { | |
1234 | { 260, 214}, // 45 | |
1235 | { 197, 162}, // 50 | |
1236 | { 147, 125}, // 55 | |
1237 | { 106, 100}, // 60 | |
1238 | { 75, 63}, // 65 | |
1239 | { 51, 44}, // 70 | |
1240 | { 34, 29}, // 75 | |
1241 | { 21, 18}, // 80 | |
1242 | { 13, 11}, // 85 | |
1243 | { 0, 0} // 90 | |
1244 | }; | |
1245 | Int_t column = 0; | |
1246 | if(event->IsA()==AliESDEvent::Class()) column = 0; | |
1247 | if(event->IsA()==AliAODEvent::Class()) column = 1; | |
1248 | ||
1249 | if (fModCentralityClass == 3){ | |
1250 | if(fMCEvent){ | |
1251 | if(nprimaryTracks > PrimaryTracks10[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks10[fCentralityMin][column]) | |
1252 | return kTRUE; | |
1253 | else return kFALSE; | |
1254 | } | |
1255 | else{ | |
1256 | centralityC= Int_t(centrality/10); | |
1257 | if(centralityC >= fCentralityMin && centralityC < fCentralityMax) | |
1258 | return kTRUE; | |
1259 | else return kFALSE; | |
1260 | } | |
1261 | } | |
1262 | else if (fModCentralityClass ==4){ | |
1263 | if(fMCEvent){ | |
1264 | if(nprimaryTracks > PrimaryTracks5a[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks5a[fCentralityMin][column]) | |
1265 | return kTRUE; | |
1266 | else return kFALSE; | |
1267 | } | |
1268 | else{ | |
1269 | centralityC= Int_t(centrality); | |
1270 | if(centralityC >= fCentralityMin*5 && centralityC < fCentralityMax*5){ | |
1271 | return kTRUE; | |
1272 | } else return kFALSE; | |
1273 | } | |
1274 | } | |
1275 | else if (fModCentralityClass ==5){ | |
1276 | if(fMCEvent){ | |
1277 | if(nprimaryTracks > PrimaryTracks5b[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks5b[fCentralityMin][column]) | |
1278 | return kTRUE; | |
1279 | else return kFALSE; | |
1280 | } | |
1281 | else{ | |
1282 | centralityC= Int_t(centrality); | |
1283 | if(centralityC >= ((fCentralityMin*5)+45) && centralityC < ((fCentralityMax*5)+45)) | |
1284 | return kTRUE; | |
1285 | else return kFALSE; | |
1286 | } | |
1287 | } | |
1288 | ||
1289 | return kFALSE; | |
1290 | } | |
1291 | ||
1292 | ///________________________________________________________________________ | |
1293 | Bool_t AliConvEventCuts::VertexZCut(AliVEvent *event){ | |
1294 | // Cut on z position of primary vertex | |
1295 | Double_t fVertexZ=event->GetPrimaryVertex()->GetZ(); | |
1296 | Double_t fVertexZSPD = 0; | |
1297 | AliESDEvent *fESDEvent=dynamic_cast<AliESDEvent*>(event); | |
1298 | if(fESDEvent){ | |
1299 | fVertexZSPD = fESDEvent->GetPrimaryVertexSPD()->GetZ(); | |
1300 | } | |
1301 | AliAODEvent *fAODEvent=dynamic_cast<AliAODEvent*>(event); | |
1302 | if(fAODEvent){ | |
1303 | fVertexZSPD = fAODEvent->GetPrimaryVertexSPD()->GetZ(); | |
1304 | } | |
1305 | ||
1306 | if(abs(fVertexZ)>fMaxVertexZ)return kFALSE; | |
1307 | ||
1308 | TString periodName = ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager() | |
1309 | ->GetTask("V0ReaderV1"))->GetPeriodName(); | |
1310 | if (periodName.CompareTo("LHC11h")==0){ | |
1311 | if (abs(fVertexZ-fVertexZSPD) > 0.1) return kFALSE; | |
1312 | } | |
1313 | if (fIsHeavyIon == 2){ | |
1314 | if(fUtils->IsFirstEventInChunk(event)) return kFALSE; | |
1315 | if(!fUtils->IsVertexSelected2013pA(event)) return kFALSE; | |
1316 | if(fUtils->IsPileUpEvent(event)) return kFALSE; | |
1317 | } | |
1318 | ||
1319 | return kTRUE; | |
1320 | } | |
1321 | ||
1322 | ///________________________________________________________________________ | |
1323 | Int_t AliConvEventCuts::GetNumberOfContributorsVtx(AliVEvent *event){ | |
1324 | // returns number of contributors to the vertex | |
1325 | ||
1326 | AliESDEvent *fESDEvent=dynamic_cast<AliESDEvent*>(event); | |
1327 | if(fESDEvent){ | |
1328 | if (fESDEvent->GetPrimaryVertex() != NULL){ | |
1329 | if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) { | |
1330 | // cout << "accepted global" << fESDEvent->GetEventNumberInFile() << " with NCont: " << fESDEvent->GetPrimaryVertex()->GetNContributors() << endl; | |
1331 | return fESDEvent->GetPrimaryVertex()->GetNContributors(); | |
1332 | } | |
1333 | } | |
1334 | ||
1335 | if(fESDEvent->GetPrimaryVertexSPD() !=NULL){ | |
1336 | if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) { | |
1337 | // cout << "accepted SPD" << fESDEvent->GetEventNumberInFile() << " with NCont: " << fESDEvent->GetPrimaryVertexSPD()->GetNContributors() << endl; | |
1338 | return fESDEvent->GetPrimaryVertexSPD()->GetNContributors(); | |
1339 | } else { | |
1340 | AliWarning(Form("Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName())); | |
1341 | // cout << "rejected " << fESDEvent->GetEventNumberInFile() << endl; | |
1342 | return 0; | |
1343 | } | |
1344 | } | |
1345 | } | |
1346 | ||
1347 | AliAODEvent *fAODEvent=dynamic_cast<AliAODEvent*>(event); | |
1348 | if(fAODEvent){ | |
1349 | if (fAODEvent->GetPrimaryVertex() != NULL){ | |
1350 | if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) { | |
1351 | return fAODEvent->GetPrimaryVertex()->GetNContributors(); | |
1352 | } | |
1353 | } | |
1354 | if(fAODEvent->GetPrimaryVertexSPD() !=NULL){ | |
1355 | if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) { | |
1356 | return fAODEvent->GetPrimaryVertexSPD()->GetNContributors(); | |
1357 | } else { | |
1358 | AliWarning(Form("Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName())); | |
1359 | return 0; | |
1360 | } | |
1361 | } | |
1362 | } | |
1363 | // cout << "rejected " << fESDEvent->GetEventNumberInFile() << endl; | |
1364 | return 0; | |
1365 | } | |
1366 | ||
1367 | ||
1368 | ///________________________________________________________________________ | |
1369 | Bool_t AliConvEventCuts::IsTriggerSelected(AliVEvent *fInputEvent) | |
1370 | { | |
1371 | ||
1372 | AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); | |
1373 | ||
1374 | UInt_t isSelected = AliVEvent::kAny; | |
1375 | TString periodName = ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->GetPeriodName(); | |
1376 | // cout << periodName.Data() << endl; | |
1377 | ||
1378 | if (fInputHandler==NULL) return kFALSE; | |
1379 | if( fInputHandler->GetEventSelection() || fInputEvent->IsA()==AliAODEvent::Class()) { | |
1380 | ||
1381 | TString firedTrigClass = fInputEvent->GetFiredTriggerClasses(); | |
1382 | if (!fTriggerSelectedManually){ | |
1383 | if (fPreSelCut) fOfflineTriggerMask = AliVEvent::kAny; | |
1384 | else { | |
1385 | if (fIsHeavyIon == 1) fOfflineTriggerMask = AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral; | |
1386 | else if (fIsHeavyIon == 2) fOfflineTriggerMask = AliVEvent::kINT7; | |
1387 | else if (periodName.CompareTo("LHC11c") == 0 || periodName.CompareTo("LHC11d") == 0 || periodName.CompareTo("LHC11e") == 0 || periodName.CompareTo("LHC11f") == 0 || periodName.CompareTo("LHC11g") == 0 || periodName.CompareTo("LHC12a") == 0 || periodName.CompareTo("LHC12b") == 0 || periodName.CompareTo("LHC12c") == 0 || periodName.CompareTo("LHC12d") == 0 || periodName.CompareTo("LHC12f") == 0 || periodName.CompareTo("LHC12g") == 0 || periodName.CompareTo("LHC12h") == 0 || periodName.CompareTo("LHC12i") == 0 ||periodName.CompareTo("LHC13g") == 0 ) { | |
1388 | fOfflineTriggerMask = AliVEvent::kINT7; | |
1389 | // cout << "will take kINT7 as trigger mask" << endl; | |
1390 | } | |
1391 | else fOfflineTriggerMask = AliVEvent::kMB; | |
1392 | } | |
1393 | } | |
1394 | // Get the actual offline trigger mask for the event and AND it with the | |
1395 | // requested mask. If no mask requested select by default the event. | |
1396 | // if (fPreSelCut) cout << "Trigger selected from outside: "<< fTriggerSelectedManually <<"\t Offline Trigger mask for Precut: " << fOfflineTriggerMask << endl; | |
1397 | // else cout << "Trigger selected from outside: "<< fTriggerSelectedManually <<"\t Offline Trigger mask: " << fOfflineTriggerMask << endl; | |
1398 | ||
1399 | if (fOfflineTriggerMask){ | |
1400 | isSelected = fOfflineTriggerMask & fInputHandler->IsEventSelected(); | |
1401 | if (isSelected && !fPreSelCut){ | |
1402 | if (fSpecialSubTrigger>0){ | |
1403 | if (!firedTrigClass.Contains(fSpecialSubTriggerName.Data())) isSelected = 0; | |
1404 | } | |
1405 | } | |
1406 | } | |
1407 | } | |
1408 | fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly); | |
1409 | ||
1410 | // Fill Histogram | |
1411 | if(hTriggerClass){ | |
1412 | if (fIsSDDFired) hTriggerClass->Fill(33); | |
1413 | if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClass->Fill(0); | |
1414 | if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClass->Fill(1); | |
1415 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClass->Fill(2); | |
1416 | if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)hTriggerClass->Fill(3); | |
1417 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)hTriggerClass->Fill(4); | |
1418 | if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)hTriggerClass->Fill(5); | |
1419 | if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)hTriggerClass->Fill(6); | |
1420 | // if (fInputHandler->IsEventSelected() & AliVEvent::kMUSPB)hTriggerClass->Fill(6); | |
1421 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)hTriggerClass->Fill(7); | |
1422 | // if (fInputHandler->IsEventSelected() & AliVEvent::kMUSHPB)hTriggerClass->Fill(7); | |
1423 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)hTriggerClass->Fill(8); | |
1424 | // if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikePB)hTriggerClass->Fill(8); | |
1425 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)hTriggerClass->Fill(9); | |
1426 | // if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikePB)hTriggerClass->Fill(9); | |
1427 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)hTriggerClass->Fill(10); | |
1428 | // if (fInputHandler->IsEventSelected() & AliVEvent::kEMC8)hTriggerClass->Fill(10); | |
1429 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)hTriggerClass->Fill(11); | |
1430 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)hTriggerClass->Fill(12); | |
1431 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)hTriggerClass->Fill(13); | |
1432 | // if (fInputHandler->IsEventSelected() & AliVEvent::kPHI8)hTriggerClass->Fill(13); | |
1433 | // if (fInputHandler->IsEventSelected() & AliVEvent::kPHOSPb)hTriggerClass->Fill(13); | |
1434 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)hTriggerClass->Fill(14); | |
1435 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)hTriggerClass->Fill(15); | |
1436 | if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)hTriggerClass->Fill(16); | |
1437 | if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)hTriggerClass->Fill(17); | |
1438 | if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)hTriggerClass->Fill(18); | |
1439 | if (fInputHandler->IsEventSelected() & AliVEvent::kZED)hTriggerClass->Fill(19); | |
1440 | if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)hTriggerClass->Fill(20); | |
1441 | // if (fInputHandler->IsEventSelected() & AliVEvent::kSPI)hTriggerClass->Fill(20); | |
1442 | if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)hTriggerClass->Fill(21); | |
1443 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)hTriggerClass->Fill(22); | |
1444 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)hTriggerClass->Fill(23); | |
1445 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)hTriggerClass->Fill(24); | |
1446 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClass->Fill(25); | |
1447 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClass->Fill(26); | |
1448 | if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClass->Fill(27); | |
1449 | if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)hTriggerClass->Fill(28); | |
1450 | if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClass->Fill(29); | |
1451 | if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClass->Fill(30); | |
1452 | if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClass->Fill(31); | |
1453 | if (!fInputHandler->IsEventSelected()) hTriggerClass->Fill(34); | |
1454 | } | |
1455 | ||
1456 | if(hTriggerClassSelected && isSelected){ | |
1457 | if (!fIsSDDFired) hTriggerClassSelected->Fill(33); | |
1458 | if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClassSelected->Fill(0); | |
1459 | if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClassSelected->Fill(1); | |
1460 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClassSelected->Fill(2); | |
1461 | if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)hTriggerClassSelected->Fill(3); | |
1462 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)hTriggerClassSelected->Fill(4); | |
1463 | if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)hTriggerClassSelected->Fill(5); | |
1464 | if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)hTriggerClassSelected->Fill(6); | |
1465 | // if (fInputHandler->IsEventSelected() & AliVEvent::kMUSPB)hTriggerClassSelected->Fill(6); | |
1466 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)hTriggerClassSelected->Fill(7); | |
1467 | // if (fInputHandler->IsEventSelected() & AliVEvent::kMUSHPB)hTriggerClassSelected->Fill(7); | |
1468 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)hTriggerClassSelected->Fill(8); | |
1469 | // if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikePB)hTriggerClassSelected->Fill(8); | |
1470 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)hTriggerClassSelected->Fill(9); | |
1471 | // if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikePB)hTriggerClassSelected->Fill(9); | |
1472 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)hTriggerClassSelected->Fill(10); | |
1473 | // if (fInputHandler->IsEventSelected() & AliVEvent::kEMC8)hTriggerClassSelected->Fill(10); | |
1474 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)hTriggerClassSelected->Fill(11); | |
1475 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)hTriggerClassSelected->Fill(12); | |
1476 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)hTriggerClassSelected->Fill(13); | |
1477 | // if (fInputHandler->IsEventSelected() & AliVEvent::kPHI8)hTriggerClassSelected->Fill(13); | |
1478 | // if (fInputHandler->IsEventSelected() & AliVEvent::kPHOSPb)hTriggerClassSelected->Fill(13); | |
1479 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)hTriggerClassSelected->Fill(14); | |
1480 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)hTriggerClassSelected->Fill(15); | |
1481 | if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)hTriggerClassSelected->Fill(16); | |
1482 | if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)hTriggerClassSelected->Fill(17); | |
1483 | if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)hTriggerClassSelected->Fill(18); | |
1484 | if (fInputHandler->IsEventSelected() & AliVEvent::kZED)hTriggerClassSelected->Fill(19); | |
1485 | if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)hTriggerClassSelected->Fill(20); | |
1486 | // if (fInputHandler->IsEventSelected() & AliVEvent::kSPI)hTriggerClassSelected->Fill(20); | |
1487 | if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)hTriggerClassSelected->Fill(21); | |
1488 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)hTriggerClassSelected->Fill(22); | |
1489 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)hTriggerClassSelected->Fill(23); | |
1490 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)hTriggerClassSelected->Fill(24); | |
1491 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClassSelected->Fill(25); | |
1492 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClassSelected->Fill(26); | |
1493 | if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClassSelected->Fill(27); | |
1494 | if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)hTriggerClassSelected->Fill(28); | |
1495 | if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClassSelected->Fill(29); | |
1496 | if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClassSelected->Fill(30); | |
1497 | if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClassSelected->Fill(31); | |
1498 | } | |
1499 | ||
1500 | if(!isSelected)return kFALSE; | |
1501 | return kTRUE; | |
1502 | ||
1503 | } | |
1504 | ||
1505 | ///________________________________________________________________________ | |
1506 | TString AliConvEventCuts::GetCutNumber(){ | |
1507 | // returns TString with current cut number | |
1508 | TString a(kNCuts); | |
1509 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
1510 | a.Append(Form("%d",fCuts[ii])); | |
1511 | } | |
1512 | return a; | |
1513 | } | |
1514 | ||
1515 | ///________________________________________________________________________ | |
1516 | void AliConvEventCuts::GetNotRejectedParticles(Int_t rejection, TList *HeaderList, AliVEvent *MCEvent){ | |
1517 | ||
1518 | TString periodName = ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->GetPeriodName(); | |
1519 | ||
1520 | ||
1521 | if(fNotRejectedStart){ | |
1522 | delete[] fNotRejectedStart; | |
1523 | fNotRejectedStart = NULL; | |
1524 | } | |
1525 | if(fNotRejectedEnd){ | |
1526 | delete[] fNotRejectedEnd; | |
1527 | fNotRejectedEnd = NULL; | |
1528 | } | |
1529 | if(fGeneratorNames){ | |
1530 | delete[] fGeneratorNames; | |
1531 | fGeneratorNames = NULL; | |
1532 | } | |
1533 | ||
1534 | if(rejection == 0) return; // No Rejection | |
1535 | ||
1536 | AliGenCocktailEventHeader *cHeader = 0x0; | |
1537 | AliAODMCHeader *cHeaderAOD = 0x0; | |
1538 | Bool_t headerFound = kFALSE; | |
1539 | AliStack *fMCStack = 0x0; | |
1540 | TClonesArray *fMCStackAOD = 0x0; | |
1541 | if(MCEvent->IsA()==AliMCEvent::Class()){ | |
1542 | cHeader = dynamic_cast<AliGenCocktailEventHeader*>(dynamic_cast<AliMCEvent*>(MCEvent)->GenEventHeader()); | |
1543 | if(cHeader) headerFound = kTRUE; | |
1544 | if(dynamic_cast<AliMCEvent*>(MCEvent))fMCStack = dynamic_cast<AliStack*>(dynamic_cast<AliMCEvent*>(MCEvent)->Stack()); | |
1545 | } | |
1546 | if(MCEvent->IsA()==AliAODEvent::Class()){ // MCEvent is a AODEvent in case of AOD | |
1547 | cHeaderAOD = dynamic_cast<AliAODMCHeader*>(MCEvent->FindListObject(AliAODMCHeader::StdBranchName())); | |
1548 | fMCStackAOD = dynamic_cast<TClonesArray*>(MCEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
1549 | ||
1550 | ||
1551 | if(cHeaderAOD) headerFound = kTRUE; | |
1552 | } | |
1553 | ||
1554 | if(headerFound){ | |
1555 | TList *genHeaders = 0x0; | |
1556 | if(cHeader) genHeaders = cHeader->GetHeaders(); | |
1557 | if(cHeaderAOD){ | |
1558 | genHeaders = cHeaderAOD->GetCocktailHeaders(); | |
1559 | if(genHeaders->GetEntries()==1){ | |
1560 | SetRejectExtraSignalsCut(0); | |
1561 | return; | |
1562 | } | |
1563 | } | |
1564 | AliGenEventHeader* gh = 0; | |
1565 | fnHeaders = 0; | |
1566 | Int_t firstindexA = 0; | |
1567 | Int_t lastindexA = -1; | |
1568 | if(rejection == 1 || rejection == 3) fnHeaders = 1; // MinBiasHeader | |
1569 | if(rejection == 2){ // TList of Headers Names | |
1570 | for(Int_t i = 0; i<genHeaders->GetEntries();i++){ | |
1571 | gh = (AliGenEventHeader*)genHeaders->At(i); | |
1572 | TString GeneratorName = gh->GetName(); | |
1573 | lastindexA = lastindexA + gh->NProduced(); | |
1574 | // cout << i << "\t" << GeneratorName.Data() << endl; | |
1575 | for(Int_t j = 0; j<HeaderList->GetEntries();j++){ | |
1576 | TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString(); | |
1577 | if(GeneratorName.CompareTo(GeneratorInList) == 0){ | |
1578 | if (GeneratorInList.CompareTo("PARAM") == 0 || GeneratorInList.CompareTo("BOX") == 0 ){ | |
1579 | if(fMCStack){ | |
1580 | if (fMCStack->Particle(firstindexA)->GetPdgCode() == fAddedSignalPDGCode ) { | |
1581 | if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0 ){ | |
1582 | if (gh->NProduced() > 10 && fMCStack->Particle(firstindexA+10)->GetPdgCode() == fAddedSignalPDGCode ){ | |
1583 | // cout << "cond 1: "<< fnHeaders << endl; | |
1584 | fnHeaders++; | |
1585 | continue; | |
1586 | } | |
1587 | continue; | |
1588 | } else { | |
1589 | // cout << "cond 2: " << fnHeaders << endl; | |
1590 | fnHeaders++; | |
1591 | continue; | |
1592 | } | |
1593 | } | |
1594 | } | |
1595 | if ( fMCStackAOD){ | |
1596 | AliAODMCParticle *aodMCParticle = static_cast<AliAODMCParticle*>(fMCStackAOD->At(firstindexA)); | |
1597 | if ( aodMCParticle->GetPdgCode() == fAddedSignalPDGCode ){ | |
1598 | if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0 ){ | |
1599 | if (gh->NProduced() > 10){ | |
1600 | AliAODMCParticle *aodMCParticle2 = static_cast<AliAODMCParticle*>(fMCStackAOD->At(firstindexA+10)); | |
1601 | if ( aodMCParticle2->GetPdgCode() == fAddedSignalPDGCode ){ | |
1602 | // cout << "cond 1: " << fnHeaders << endl; | |
1603 | fnHeaders++; | |
1604 | continue; | |
1605 | } | |
1606 | } | |
1607 | continue; | |
1608 | } else { | |
1609 | // cout << "cond 2: " << fnHeaders << endl; | |
1610 | fnHeaders++; | |
1611 | continue; | |
1612 | } | |
1613 | } | |
1614 | } | |
1615 | continue; | |
1616 | } | |
1617 | // cout << "cond 3: "<< fnHeaders << endl; | |
1618 | fnHeaders++; | |
1619 | continue; | |
1620 | } | |
1621 | } | |
1622 | firstindexA = firstindexA + gh->NProduced(); | |
1623 | } | |
1624 | } | |
1625 | // cout << "number of headers: " <<fnHeaders << endl; | |
1626 | ||
1627 | fNotRejectedStart = new Int_t[fnHeaders]; | |
1628 | fNotRejectedEnd = new Int_t[fnHeaders]; | |
1629 | fGeneratorNames = new TString[fnHeaders]; | |
1630 | ||
1631 | if(rejection == 1 || rejection == 3){ | |
1632 | fNotRejectedStart[0] = 0; | |
1633 | fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1; | |
1634 | fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName(); | |
1635 | return; | |
1636 | } | |
1637 | ||
1638 | Int_t firstindex = 0; | |
1639 | Int_t lastindex = -1; | |
1640 | Int_t number = 0; | |
1641 | ||
1642 | for(Int_t i = 0; i<genHeaders->GetEntries();i++){ | |
1643 | gh = (AliGenEventHeader*)genHeaders->At(i); | |
1644 | TString GeneratorName = gh->GetName(); | |
1645 | lastindex = lastindex + gh->NProduced(); | |
1646 | for(Int_t j = 0; j<HeaderList->GetEntries();j++){ | |
1647 | TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString(); | |
1648 | // cout << i << "\t" << GeneratorName.Data() << endl; | |
1649 | if(GeneratorName.CompareTo(GeneratorInList) == 0){ | |
1650 | if (GeneratorInList.CompareTo("PARAM") == 0 || GeneratorInList.CompareTo("BOX") == 0 ){ | |
1651 | if(fMCStack){ | |
1652 | if (fMCStack->Particle(firstindex)->GetPdgCode() == fAddedSignalPDGCode ) { | |
1653 | if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0 ){ | |
1654 | // cout << "produced " << gh->NProduced() << " with box generator" << endl; | |
1655 | if (gh->NProduced() > 10 && fMCStack->Particle(firstindex+10)->GetPdgCode() == fAddedSignalPDGCode){ | |
1656 | // cout << "one of them was a pi0 or eta" << endl; | |
1657 | fNotRejectedStart[number] = firstindex; | |
1658 | fNotRejectedEnd[number] = lastindex; | |
1659 | fGeneratorNames[number] = GeneratorName; | |
1660 | number++; | |
1661 | // cout << "Number of particles produced for: " << i << "\t" << GeneratorName.Data() << "\t" << lastindex-firstindex+1 << endl; | |
1662 | continue; | |
1663 | } | |
1664 | } else { | |
1665 | fNotRejectedStart[number] = firstindex; | |
1666 | fNotRejectedEnd[number] = lastindex; | |
1667 | fGeneratorNames[number] = GeneratorName; | |
1668 | number++; | |
1669 | continue; | |
1670 | } | |
1671 | } | |
1672 | } | |
1673 | if ( fMCStackAOD){ | |
1674 | AliAODMCParticle *aodMCParticle = static_cast<AliAODMCParticle*>(fMCStackAOD->At(firstindex)); | |
1675 | if ( aodMCParticle->GetPdgCode() == fAddedSignalPDGCode ){ | |
1676 | if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0 ){ | |
1677 | if (gh->NProduced() > 10) { | |
1678 | AliAODMCParticle *aodMCParticle2 = static_cast<AliAODMCParticle*>(fMCStackAOD->At(firstindex+10)); | |
1679 | if ( aodMCParticle2->GetPdgCode() == fAddedSignalPDGCode ){ | |
1680 | fNotRejectedEnd[number] = lastindex; | |
1681 | fNotRejectedStart[number] = firstindex; | |
1682 | fGeneratorNames[number] = GeneratorName; | |
1683 | number++; | |
1684 | } | |
1685 | continue; | |
1686 | } | |
1687 | } else { | |
1688 | fNotRejectedStart[number] = firstindex; | |
1689 | fNotRejectedEnd[number] = lastindex; | |
1690 | fGeneratorNames[number] = GeneratorName; | |
1691 | number++; | |
1692 | continue; | |
1693 | } | |
1694 | } | |
1695 | } | |
1696 | continue; | |
1697 | } else { | |
1698 | fNotRejectedStart[number] = firstindex; | |
1699 | fNotRejectedEnd[number] = lastindex; | |
1700 | fGeneratorNames[number] = GeneratorName; | |
1701 | // cout << "Number of particles produced for: " << i << "\t" << GeneratorName.Data() << "\t" << lastindex-firstindex+1 << endl; | |
1702 | number++; | |
1703 | continue; | |
1704 | } | |
1705 | ||
1706 | } | |
1707 | } | |
1708 | firstindex = firstindex + gh->NProduced(); | |
1709 | } | |
1710 | // for (Int_t i = 0; i < number; i++){ | |
1711 | // cout << i << "\t" <<fGeneratorNames[i] << "\t" << fNotRejectedStart[i] << "\t" <<fNotRejectedEnd[i] << endl; | |
1712 | // } | |
1713 | ||
1714 | } else { // No Cocktail Header Found | |
1715 | fNotRejectedStart = new Int_t[1]; | |
1716 | fNotRejectedEnd = new Int_t[1]; | |
1717 | ||
1718 | fnHeaders = 1; | |
1719 | fNotRejectedStart[0] = 0; | |
1720 | fNotRejectedEnd[0] = static_cast<AliMCEvent*>(MCEvent)->Stack()->GetNprimary()-1; | |
1721 | fGeneratorNames = new TString[1]; | |
1722 | fGeneratorNames[0] = "NoCocktailGeneratorFound"; | |
1723 | ||
1724 | AliGenPythiaEventHeader *mcHeaderPythia = dynamic_cast<AliGenPythiaEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader()); | |
1725 | if (mcHeaderPythia) fGeneratorNames[0] = "NoCocktailGeneratorFound_Pythia"; | |
1726 | AliGenDPMjetEventHeader *mcHeaderPhojet = dynamic_cast<AliGenDPMjetEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader()); | |
1727 | if (mcHeaderPhojet) fGeneratorNames[0] = "NoCocktailGeneratorFound_Phojet"; | |
1728 | AliGenHijingEventHeader *mcHeaderHijing = dynamic_cast<AliGenHijingEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader()); | |
1729 | if (mcHeaderHijing) fGeneratorNames[0] = "NoCocktailGeneratorFound_Hijing"; | |
1730 | ||
1731 | SetRejectExtraSignalsCut(0); | |
1732 | } | |
1733 | ||
1734 | } | |
1735 | ||
1736 | //_________________________________________________________________________ | |
1737 | Int_t AliConvEventCuts::IsParticleFromBGEvent(Int_t index, AliStack *MCStack, AliVEvent *InputEvent){ | |
1738 | ||
1739 | // Not Accepted == kFALSE == 0 | |
1740 | // Accepted == kTRUE == 1 | |
1741 | // FirstHeader == kTRUE == 3 | |
1742 | if(index < 0) return 0; // No Particle | |
1743 | ||
1744 | // if (index == 100){ | |
1745 | // cout << "possible headers" << endl; | |
1746 | // for(Int_t i = 0;i<fnHeaders;i++){ | |
1747 | // cout << i << "\t" <<fGeneratorNames[i] << "\t" << fNotRejectedStart[i] << "\t" <<fNotRejectedEnd[i] << endl; | |
1748 | // } | |
1749 | // } | |
1750 | Int_t accepted = 0; | |
1751 | if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){ | |
1752 | if( index >= MCStack->GetNprimary()){ // Secondary Particle | |
1753 | if( ((TParticle*)MCStack->Particle(index))->GetMother(0) < 0) return 1; // Secondary Particle without Mother?? | |
1754 | return IsParticleFromBGEvent(((TParticle*)MCStack->Particle(index))->GetMother(0),MCStack,InputEvent); | |
1755 | } | |
1756 | for(Int_t i = 0;i<fnHeaders;i++){ | |
1757 | if(index >= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){ | |
1758 | accepted = 1; | |
1759 | if(i == 0) accepted = 2; // MB Header | |
1760 | } | |
1761 | } | |
1762 | } | |
1763 | else if(InputEvent->IsA()==AliAODEvent::Class()){ | |
1764 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
1765 | if (AODMCTrackArray){ | |
1766 | AliAODMCParticle *aodMCParticle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index)); | |
1767 | if(!aodMCParticle) return 1; // Photon Without a Mother ? --> Accepted | |
1768 | if(!aodMCParticle->IsPrimary()){ | |
1769 | if( aodMCParticle->GetMother() < 0) return 1;// Secondary Particle without Mother?? | |
1770 | return IsParticleFromBGEvent(aodMCParticle->GetMother(),MCStack,InputEvent); | |
1771 | } | |
1772 | index = abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel()); | |
1773 | for(Int_t i = 0;i<fnHeaders;i++){ | |
1774 | if(index >= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){ | |
1775 | accepted = 1; | |
1776 | if(i == 0) accepted = 2; // MB Header | |
1777 | } | |
1778 | } | |
1779 | } | |
1780 | } | |
1781 | ||
1782 | return accepted; | |
1783 | } | |
1784 | ||
1785 | //_________________________________________________________________________ | |
1786 | Int_t AliConvEventCuts::IsEventAcceptedByCut(AliConvEventCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Int_t isHeavyIon){ | |
1787 | ||
1788 | if ( !IsTriggerSelected(InputEvent) ) | |
1789 | return 3; | |
1790 | ||
1791 | if(isHeavyIon != 0 && !(IsCentralitySelected(InputEvent,MCEvent))) | |
1792 | return 1; // Check Centrality --> Not Accepted => eventQuality = 1 | |
1793 | ||
1794 | if(isHeavyIon == 0 && GetIsFromPileup()){ | |
1795 | if(InputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){ | |
1796 | return 6; // Check Pileup --> Not Accepted => eventQuality = 6 | |
1797 | } | |
1798 | } | |
1799 | ||
1800 | Bool_t hasV0And = ReaderCuts->HasV0AND(); | |
1801 | Bool_t isSDDFired = ReaderCuts->IsSDDFired(); | |
1802 | if( (IsSpecialTrigger() == 2 || IsSpecialTrigger() == 3) && !isSDDFired && !MCEvent) | |
1803 | return 7; // With SDD requested but no fired | |
1804 | ||
1805 | if( (IsSpecialTrigger() == 1 || IsSpecialTrigger() == 3) && !hasV0And) | |
1806 | return 8; // V0AND requested but no fired | |
1807 | ||
1808 | if(hCentrality)hCentrality->Fill(GetCentrality(InputEvent)); | |
1809 | if(hCentralityVsNumberOfPrimaryTracks) | |
1810 | hCentralityVsNumberOfPrimaryTracks->Fill(GetCentrality(InputEvent), | |
1811 | ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager() | |
1812 | ->GetTask("V0ReaderV1"))->GetNumberOfPrimaryTracks()); | |
1813 | ||
1814 | return 0; | |
1815 | } | |
1816 | ||
1817 | //_________________________________________________________________________ | |
1818 | Float_t AliConvEventCuts::GetWeightForMeson(TString period, Int_t index, AliStack *MCStack, AliVEvent *InputEvent){ | |
1819 | if (!(period.CompareTo("LHC12f1a") == 0 || period.CompareTo("LHC12f1b") == 0 || period.CompareTo("LHC12i3") == 0 || period.CompareTo("LHC11a10a") == 0 || period.CompareTo("LHC11a10b") == 0 || period.CompareTo("LHC11a10b_bis") == 0 || period.CompareTo("LHC11a10a_bis") == 0 || period.CompareTo("LHC11a10b_plus") == 0 || period.Contains("LHC13d2")|| period.Contains("LHC14a1") || | |
1820 | period.CompareTo("LHC13e7") == 0 || period.Contains("LHC13b2_efix") || period.CompareTo("LHC14b2") == 0 )) return 1.; | |
1821 | ||
1822 | Int_t kCaseGen = 0; | |
1823 | for (Int_t i = 0; i < fnHeaders; i++){ | |
1824 | if (index >= fNotRejectedStart[i] && index < fNotRejectedEnd[i]+1){ | |
1825 | if (fGeneratorNames[i].CompareTo("Pythia") == 0){ | |
1826 | kCaseGen = 1; | |
1827 | } else if (fGeneratorNames[i].CompareTo("DPMJET") == 0){ | |
1828 | kCaseGen = 2; | |
1829 | } else if (fGeneratorNames[i].CompareTo("HIJING") == 0 || | |
1830 | fGeneratorNames[i].CompareTo("Hijing") == 0 || | |
1831 | fGeneratorNames[i].Contains("hijing")){ | |
1832 | kCaseGen = 3; | |
1833 | } else if (fGeneratorNames[i].CompareTo("BOX") == 0){ | |
1834 | kCaseGen = 4; | |
1835 | } else if (fGeneratorNames[i].CompareTo("PARAM") == 0){ | |
1836 | kCaseGen = 5; | |
1837 | } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound") == 0){ | |
1838 | kCaseGen = 6; | |
1839 | } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Pythia") == 0){ | |
1840 | kCaseGen = 1; | |
1841 | } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Phojet") == 0){ | |
1842 | kCaseGen = 2; | |
1843 | } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Hijing") == 0){ | |
1844 | kCaseGen = 3; | |
1845 | } | |
1846 | if (period.Contains("LHC13d2") || period.CompareTo("LHC13e7") == 0 || period.Contains("LHC13b2_efix") || period.Contains("LHC14a1") || period.CompareTo("LHC14b2") == 0 ){ | |
1847 | kCaseGen = 3; | |
1848 | } | |
1849 | } | |
1850 | } | |
1851 | if (kCaseGen == 0) return 1; | |
1852 | ||
1853 | ||
1854 | Double_t mesonPt = 0; | |
1855 | Double_t mesonMass = 0; | |
1856 | Int_t PDGCode = 0; | |
1857 | if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){ | |
1858 | mesonPt = ((TParticle*)MCStack->Particle(index))->Pt(); | |
1859 | mesonMass = ((TParticle*)MCStack->Particle(index))->GetCalcMass(); | |
1860 | PDGCode = ((TParticle*)MCStack->Particle(index))->GetPdgCode(); | |
1861 | } | |
1862 | else if(InputEvent->IsA()==AliAODEvent::Class()){ | |
1863 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
1864 | if (AODMCTrackArray){ | |
1865 | AliAODMCParticle *aodMCParticle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index)); | |
1866 | mesonPt = aodMCParticle->Pt(); | |
1867 | mesonMass = aodMCParticle->GetCalcMass(); | |
1868 | PDGCode = aodMCParticle->GetPdgCode(); | |
1869 | } else { | |
1870 | return 1; | |
1871 | } | |
1872 | } | |
1873 | ||
1874 | Float_t functionResultMC = 1.; | |
1875 | if (kCaseGen == 1){ // Pythia 6 | |
1876 | Float_t dNdyMC = 2.1462; | |
1877 | Float_t nMC = 7.06055; | |
1878 | Float_t tMC = 0.12533; | |
1879 | if ( PDGCode == 111){ | |
1880 | dNdyMC = 2.1462; | |
1881 | nMC = 7.06055; | |
1882 | tMC = 0.12533; | |
1883 | } else if ( PDGCode == 221){ | |
1884 | dNdyMC = 0.2357; | |
1885 | nMC = 5.9105; | |
1886 | tMC = 0.1525; | |
1887 | } | |
1888 | functionResultMC = dNdyMC / ( 2 * TMath::Pi())*(nMC-1.)*(nMC-2.) / (nMC*tMC*(nMC*tMC+mesonMass*(nMC-2.))) * TMath::Power(1.+(TMath::Sqrt(mesonPt*mesonPt+mesonMass*mesonMass)-mesonMass)/(nMC*tMC), -nMC); | |
1889 | } else if (kCaseGen == 2){ // Phojet | |
1890 | Float_t dNdyMC = 2.35978; | |
1891 | Float_t nMC = 6.81795; | |
1892 | Float_t tMC = 0.11492; | |
1893 | if ( PDGCode == 111){ | |
1894 | dNdyMC = 2.35978; | |
1895 | nMC = 6.81795; | |
1896 | tMC = 0.11492; | |
1897 | } else if ( PDGCode == 221){ | |
1898 | dNdyMC = 0.3690; | |
1899 | nMC = 5.55809; | |
1900 | tMC = 0.13387; | |
1901 | } | |
1902 | functionResultMC = dNdyMC / ( 2 * TMath::Pi())*(nMC-1.)*(nMC-2.) / (nMC*tMC*(nMC*tMC+mesonMass*(nMC-2.))) * TMath::Power(1.+(TMath::Sqrt(mesonPt*mesonPt+mesonMass*mesonMass)-mesonMass)/(nMC*tMC), -nMC); | |
1903 | } else if (kCaseGen == 4){ // BOX generators pp | |
1904 | // functionResultMC = 1./sqrt(1.-mesonMass*mesonMass/((mesonMass*mesonMass+mesonPt*mesonPt)*cosh(mesonY)*cosh(mesonY))); | |
1905 | Float_t a = 0.23437; | |
1906 | Float_t b = 5.6661; | |
1907 | Float_t c = -1430.5863; | |
1908 | Float_t d = -0.6966624; | |
1909 | Float_t e = 252.3742; | |
1910 | if ( PDGCode == 111){ | |
1911 | a = 0.23437; | |
1912 | b = 5.6661; | |
1913 | c = -1430.5863; | |
1914 | d = -0.6966624; | |
1915 | e = 252.3742; | |
1916 | } else if ( PDGCode == 221){ | |
1917 | a = 0.10399; | |
1918 | b = 4.35311; | |
1919 | c = -12.17723; | |
1920 | d = -0.01172; | |
1921 | e =1.85140; | |
1922 | } | |
1923 | functionResultMC = a*TMath::Power(mesonPt,-1.*(b+c/(TMath::Power(mesonPt,d)+e)))*1./mesonPt *1./1.6 *1./(2.* TMath::Pi()); | |
1924 | // cout << functionResultMC << endl; | |
1925 | } else if (kCaseGen == 3 ){ // HIJING | |
1926 | if ( PDGCode == 111 && fDoReweightHistoMCPi0 && hReweightMCHistPi0!= 0x0){ | |
1927 | functionResultMC = hReweightMCHistPi0->Interpolate(mesonPt); | |
1928 | } | |
1929 | if ( PDGCode == 221 && fDoReweightHistoMCEta && hReweightMCHistEta!= 0x0){ | |
1930 | functionResultMC = hReweightMCHistEta->Interpolate(mesonPt); | |
1931 | } | |
1932 | if ( PDGCode == 310 && fDoReweightHistoMCK0s && hReweightMCHistK0s!= 0x0){ | |
1933 | functionResultMC = hReweightMCHistK0s->Interpolate(mesonPt); | |
1934 | } | |
1935 | } | |
1936 | ||
1937 | Float_t functionResultData = 1; | |
1938 | if (kCaseGen == 1 || kCaseGen == 2 || kCaseGen == 4 ){ | |
1939 | Float_t dNdyData = 2.2328; | |
1940 | Float_t nData = 7.1473; | |
1941 | Float_t tData = 0.1346; | |
1942 | if ( PDGCode == 111){ | |
1943 | dNdyData = 2.2328; | |
1944 | nData = 7.1473; | |
1945 | tData = 0.1346; | |
1946 | } else if ( PDGCode == 221){ | |
1947 | dNdyData = 0.38992; //be careful this fit is not optimal, eta in data still has problems | |
1948 | nData = 5.72778; | |
1949 | tData = 0.13835; | |
1950 | } | |
1951 | functionResultData = dNdyData / ( 2 * TMath::Pi())*(nData-1.)*(nData-2.) / (nData*tData*(nData*tData+mesonMass*(nData-2.))) * TMath::Power(1.+(TMath::Sqrt(mesonPt*mesonPt+mesonMass*mesonMass)-mesonMass)/(nData*tData), -nData); | |
1952 | // cout << functionResultData << endl; | |
1953 | } else { | |
1954 | if ( PDGCode == 111 && fDoReweightHistoMCPi0 && fFitDataPi0!= 0x0){ | |
1955 | functionResultData = fFitDataPi0->Eval(mesonPt); | |
1956 | } | |
1957 | if ( PDGCode == 221 && fDoReweightHistoMCEta && fFitDataEta!= 0x0){ | |
1958 | functionResultData = fFitDataEta->Eval(mesonPt); | |
1959 | } | |
1960 | if ( PDGCode == 310 && fDoReweightHistoMCK0s && fFitDataK0s!= 0x0){ | |
1961 | functionResultData = fFitDataK0s->Eval(mesonPt); | |
1962 | } | |
1963 | ||
1964 | } | |
1965 | ||
1966 | Double_t weight = 1; | |
1967 | if (PDGCode == 111 || PDGCode == 221){ | |
1968 | if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){ | |
1969 | weight = functionResultData/functionResultMC; | |
1970 | if ( kCaseGen == 3){ | |
1971 | if (PDGCode == 111){ | |
1972 | if (!(fDoReweightHistoMCPi0 && hReweightMCHistPi0!= 0x0 && PDGCode == 111)){ | |
1973 | weight = 1.; | |
1974 | } | |
1975 | } | |
1976 | if (PDGCode == 221){ | |
1977 | if (!(fDoReweightHistoMCEta && hReweightMCHistEta!= 0x0 && PDGCode == 221)){ | |
1978 | weight = 1.; | |
1979 | } | |
1980 | } | |
1981 | } | |
1982 | if (!isfinite(functionResultData)) weight = 1.; | |
1983 | if (!isfinite(weight)) weight = 1.; | |
1984 | } | |
1985 | } else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){ | |
1986 | weight = functionResultMC; | |
1987 | } | |
1988 | ||
1989 | // if (fModCentralityClass == 0 && fCentralityMin == 4 && fCentralityMax == 6 && PDGCode == 111){ | |
1990 | // cout << period.Data() << "\t" << kCaseGen << "\t" <<fModCentralityClass<< "\t" <<fCentralityMin<< "\t" <<fCentralityMax << "\t" << mesonPt << "\t" <<mesonMass<< "\t"<<functionResultData << "\t"<< functionResultMC << "\t" << weight <<endl; | |
1991 | // } | |
1992 | return weight; | |
1993 | } | |
1994 | ||
1995 | ||
1996 | ///________________________________________________________________________ | |
1997 | void AliConvEventCuts::GetCorrectEtaShiftFromPeriod(TString periodName){ | |
1998 | ||
1999 | if(periodName.CompareTo("LHC12g") == 0 || //pilot run 2012 | |
2000 | periodName.CompareTo("LHC13b") == 0 || //mainly minimum bias | |
2001 | periodName.CompareTo("LHC13c") == 0 || //mainly minimum bias | |
2002 | periodName.CompareTo("LHC13d") == 0 || //mainly triggered | |
2003 | periodName.CompareTo("LHC13e") == 0 || //mainly triggered | |
2004 | periodName.CompareTo("LHC13c3") == 0 || //MC Starlight, anchor LHC13d+e | |
2005 | periodName.CompareTo("LHC13c2") == 0 || //MC Starlight, coherent J/Psi, UPC muon anchor LHC13d+e | |
2006 | periodName.CompareTo("LHC13b4") == 0 || //MC Pythia 6 (Jet-Jet), anchor LHC13b | |
2007 | periodName.CompareTo("LHC13b2_fix_1") == 0 || //MC DPMJET, anchr LHC13b+c | |
2008 | periodName.CompareTo("LHC13b2_efix_p1") == 0 || //MC DPMJET, anchr LHC13b+c | |
2009 | periodName.CompareTo("LHC13b2_efix_p2") == 0 || //MC DPMJET, anchr LHC13b+c | |
2010 | periodName.CompareTo("LHC13b2_efix_p3") == 0 || //MC DPMJET, anchr LHC13b+c | |
2011 | periodName.CompareTo("LHC13b2_efix_p4") == 0 || //MC DPMJET, anchr LHC13b+c | |
2012 | periodName.CompareTo("LHC13e7") == 0 || //MC DPMJET, anchr LHC13b+c | |
2013 | periodName.CompareTo("LHC13b3") == 0 || //MC HIJING, weighted to number of events per run, anchor LHC13b | |
2014 | periodName.CompareTo("LHC13b2") == 0 || // MC DPMJET, wrong energy, anchor LHC13b | |
2015 | periodName.CompareTo("LHC13b2_plus") == 0 || // MC DPMJET, weighted to number event per run, anchor LHC13b | |
2016 | periodName.CompareTo("LHC13c1_bis") == 0 || // MC AMPT fast generation, pT hardbin, anchor ? | |
2017 | periodName.CompareTo("LHC13c1") == 0 || // MC AMPT fast generation, anchor ? | |
2018 | periodName.CompareTo("LHC13b1") == 0 || // MC DPMJET, fragments, with fixed label 0, anchor LHC12g | |
2019 | periodName.CompareTo("LHC12g4b_fix") == 0 || // MC DPMJET, with fixed label 0, anchor LHC12g | |
2020 | periodName.CompareTo("LHC12g1_fix") == 0 || // MC ?, with fixed label 0, anchor LHC12g | |
2021 | periodName.CompareTo("LHC12g4c") == 0 || // MC DPMJET, shifted vertex runs, anchor LHC12g | |
2022 | periodName.CompareTo("LHC12h6") == 0 || // MC muon cocktail, anchor LHC12g | |
2023 | periodName.CompareTo("LHC12g4b") == 0 || // MC DPMJET 3rd iteration, anchor LHC12g | |
2024 | periodName.CompareTo("LHC12g4a") == 0 || // MC DPMJET improved, anchor LHC12g | |
2025 | periodName.CompareTo("LHC12g4") == 0 || // MC DPMJET, anchor LHC12g | |
2026 | periodName.CompareTo("LHC12g5") == 0 || // MC PHOJET, anchor LHC12g | |
2027 | periodName.CompareTo("LHC12g2") == 0 || // MC Starlight background, anchor LHC12g | |
2028 | periodName.CompareTo("LHC12g1") == 0 ) // MC ?, anchor LHC12g | |
2029 | { | |
2030 | printf(" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(GetCutNumber()).Data(),-0.465); | |
2031 | SetEtaShift(-0.465); | |
2032 | } | |
2033 | else if(periodName.CompareTo("LHC13f") == 0 || | |
2034 | periodName.CompareTo("LHC13c6b") == 0 ||// MC Jpsi -> mumu, anchor LHC13f | |
2035 | periodName.CompareTo("LHC13c5") == 0 || //MC Starlight, gamma gamma UPC muon, anchor LHC13f | |
2036 | periodName.CompareTo("LHC13c4") == 0 )//MC Starlight, coherent JPsi, UPC muon, anchor LHC13f | |
2037 | { | |
2038 | printf(" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(GetCutNumber()).Data(),0.465); | |
2039 | SetEtaShift(+0.465); | |
2040 | } | |
2041 | else printf(" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(GetCutNumber()).Data()); | |
2042 | } | |
2043 |