]>
Commit | Line | Data |
---|---|---|
931f8b00 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
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 | // Analysis Taks for reconstructed particle correlation | |
18 | // (first implementation done for D mesons) with jets | |
19 | // (use the so called Emcal framework) | |
20 | // | |
21 | //----------------------------------------------------------------------- | |
22 | // Authors: | |
23 | // C. Bianchin (Utrecht University) chiara.bianchin@cern.ch | |
24 | // A. Grelli (Utrecht University) a.grelli@uu.nl | |
25 | // X. Zhang (LBNL) XMZhang@lbl.gov | |
26 | //----------------------------------------------------------------------- | |
27 | ||
28 | #include <TDatabasePDG.h> | |
29 | #include <TParticle.h> | |
30 | #include "TROOT.h" | |
31 | #include <TH3F.h> | |
32 | #include <THnSparse.h> | |
33 | ||
34 | #include "AliAnalysisTaskFlavourJetCorrelations.h" | |
35 | #include "AliAODMCHeader.h" | |
36 | #include "AliAODHandler.h" | |
37 | #include "AliAnalysisManager.h" | |
38 | #include "AliLog.h" | |
39 | #include "AliEmcalJet.h" | |
40 | #include "AliJetContainer.h" | |
41 | #include "AliAODRecoDecay.h" | |
42 | #include "AliAODRecoCascadeHF.h" | |
43 | #include "AliAODRecoDecayHF2Prong.h" | |
44 | #include "AliESDtrack.h" | |
45 | #include "AliAODMCParticle.h" | |
46 | #include "AliPicoTrack.h" | |
47 | #include "AliRDHFCutsD0toKpi.h" | |
48 | #include "AliRDHFCutsDStartoKpipi.h" | |
49 | ||
50 | ClassImp(AliAnalysisTaskFlavourJetCorrelations) | |
51 | ||
52 | ||
53 | //_______________________________________________________________________________ | |
54 | ||
55 | AliAnalysisTaskFlavourJetCorrelations::AliAnalysisTaskFlavourJetCorrelations() : | |
56 | AliAnalysisTaskEmcalJet("",kFALSE), | |
57 | fUseMCInfo(kTRUE), | |
58 | fUseReco(kTRUE), | |
59 | fCandidateType(), | |
60 | fPDGmother(), | |
61 | fNProngs(), | |
62 | fPDGdaughters(), | |
63 | fBranchName(), | |
64 | fmyOutput(0), | |
65 | fCuts(0), | |
66 | fMinMass(), | |
67 | fMaxMass(), | |
68 | fJetArrName(0), | |
69 | fCandArrName(0), | |
70 | fLeadingJetOnly(kFALSE), | |
71 | fJetRadius(0) | |
72 | { | |
73 | // | |
74 | // Default ctor | |
75 | // | |
76 | //SetMakeGeneralHistograms(kTRUE); | |
77 | ||
78 | } | |
79 | ||
80 | //_______________________________________________________________________________ | |
81 | ||
82 | AliAnalysisTaskFlavourJetCorrelations::AliAnalysisTaskFlavourJetCorrelations(const Char_t* name, AliRDHFCuts* cuts,ECandidateType candtype) : | |
83 | AliAnalysisTaskEmcalJet(name,kFALSE), | |
84 | fUseMCInfo(kTRUE), | |
85 | fUseReco(kTRUE), | |
86 | fCandidateType(), | |
87 | fPDGmother(), | |
88 | fNProngs(), | |
89 | fPDGdaughters(), | |
90 | fBranchName(), | |
91 | fmyOutput(0), | |
92 | fCuts(0), | |
93 | fMinMass(), | |
94 | fMaxMass(), | |
95 | fJetArrName(0), | |
96 | fCandArrName(0), | |
97 | fLeadingJetOnly(kFALSE), | |
98 | fJetRadius(0) | |
99 | { | |
100 | // | |
101 | // Constructor. Initialization of Inputs and Outputs | |
102 | // | |
103 | ||
104 | Info("AliAnalysisTaskFlavourJetCorrelations","Calling Constructor"); | |
105 | fCuts=cuts; | |
106 | fCandidateType=candtype; | |
107 | const Int_t nptbins=fCuts->GetNPtBins(); | |
108 | Float_t defaultSigmaD013[13]={0.012, 0.012, 0.012, 0.015, 0.015,0.018,0.018,0.020,0.020,0.030,0.030,0.037,0.040}; | |
109 | ||
110 | switch(fCandidateType){ | |
111 | case 0: | |
112 | fPDGmother=421; | |
113 | fNProngs=2; | |
114 | fPDGdaughters[0]=211;//pi | |
115 | fPDGdaughters[1]=321;//K | |
116 | fPDGdaughters[2]=0; //empty | |
117 | fPDGdaughters[3]=0; //empty | |
118 | fBranchName="D0toKpi"; | |
119 | fCandArrName="D0"; | |
120 | break; | |
121 | case 1: | |
122 | fPDGmother=413; | |
123 | fNProngs=3; | |
124 | fPDGdaughters[1]=211;//pi soft | |
125 | fPDGdaughters[0]=421;//D0 | |
126 | fPDGdaughters[2]=211;//pi fromD0 | |
127 | fPDGdaughters[3]=321; // K from D0 | |
128 | fBranchName="Dstar"; | |
129 | fCandArrName="Dstar"; | |
130 | ||
131 | if(nptbins<=13){ | |
132 | for(Int_t ipt=0;ipt<nptbins;ipt++) fSigmaD0[ipt]= defaultSigmaD013[ipt]; | |
133 | } else { | |
134 | AliFatal(Form("Default sigma D0 not enough for %d pt bins, use SetSigmaD0ForDStar to set them",nptbins)); | |
135 | } | |
136 | break; | |
137 | default: | |
138 | printf("%d not accepted!!\n",fCandidateType); | |
139 | break; | |
140 | } | |
141 | ||
142 | if(fCandidateType==kD0toKpi)SetMassLimits(0.15,fPDGmother); | |
143 | if(fCandidateType==kDstartoKpipi) SetMassLimits(0.015, fPDGmother); | |
144 | ||
145 | DefineOutput(1,TList::Class()); // histos | |
146 | DefineOutput(2,AliRDHFCuts::Class()); // my cuts | |
147 | ||
148 | } | |
149 | ||
150 | //_______________________________________________________________________________ | |
151 | ||
152 | AliAnalysisTaskFlavourJetCorrelations::~AliAnalysisTaskFlavourJetCorrelations() { | |
153 | // | |
154 | // destructor | |
155 | // | |
156 | ||
157 | Info("~AliAnalysisTaskFlavourJetCorrelations","Calling Destructor"); | |
158 | ||
159 | delete fmyOutput; | |
160 | delete fCuts; | |
161 | ||
162 | } | |
163 | ||
164 | //_______________________________________________________________________________ | |
165 | ||
166 | void AliAnalysisTaskFlavourJetCorrelations::Init(){ | |
167 | // | |
168 | // Initialization | |
169 | // | |
170 | ||
171 | if(fDebug > 1) printf("AnalysisTaskRecoJetCorrelations::Init() \n"); | |
172 | switch(fCandidateType){ | |
173 | case 0: | |
174 | { | |
175 | AliRDHFCutsD0toKpi* copyfCuts=new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fCuts))); | |
176 | copyfCuts->SetName("AnalysisCutsDzero"); | |
177 | // Post the data | |
178 | PostData(2,copyfCuts); | |
179 | } | |
180 | break; | |
181 | case 1: | |
182 | { | |
183 | AliRDHFCutsDStartoKpipi* copyfCuts=new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fCuts))); | |
184 | copyfCuts->SetName("AnalysisCutsDStar"); | |
185 | // Post the cuts | |
186 | PostData(2,copyfCuts); | |
187 | } | |
188 | break; | |
189 | default: | |
190 | return; | |
191 | } | |
192 | ||
193 | return; | |
194 | } | |
195 | ||
196 | //_______________________________________________________________________________ | |
197 | ||
198 | void AliAnalysisTaskFlavourJetCorrelations::UserCreateOutputObjects() { | |
199 | // output | |
200 | Info("UserCreateOutputObjects","CreateOutputObjects of task %s\n", GetName()); | |
201 | fmyOutput = new TList(); | |
202 | fmyOutput->SetOwner(); | |
203 | fmyOutput->SetName("pippo"); | |
204 | // define histograms | |
205 | DefineHistoForAnalysis(); | |
206 | PostData(1,fmyOutput); | |
207 | ||
208 | return; | |
209 | } | |
210 | ||
211 | //_______________________________________________________________________________ | |
212 | ||
213 | void AliAnalysisTaskFlavourJetCorrelations::UserExec(Option_t *) | |
214 | { | |
215 | // user exec | |
216 | if (!fInitialized){ | |
217 | AliAnalysisTaskEmcalJet::ExecOnce(); | |
218 | } | |
219 | ||
220 | // Load the event | |
221 | AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent); | |
222 | ||
223 | TClonesArray *arrayDStartoD0pi=0; | |
224 | TClonesArray *trackArr = 0; | |
225 | TClonesArray *candidatesArr = 0; | |
226 | TClonesArray *sbcandArr = 0; | |
227 | ||
228 | if (!aodEvent && AODEvent() && IsStandardAOD()) { | |
229 | ||
230 | // In case there is an AOD handler writing a standard AOD, use the AOD | |
231 | // event in memory rather than the input (ESD) event. | |
232 | aodEvent = dynamic_cast<AliAODEvent*> (AODEvent()); | |
233 | ||
234 | // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root) | |
235 | // have to taken from the AOD event hold by the AliAODExtension | |
236 | AliAODHandler* aodHandler = (AliAODHandler*) | |
237 | ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
238 | if(aodHandler->GetExtensions()) { | |
239 | AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root"); | |
240 | AliAODEvent *aodFromExt = ext->GetAOD(); | |
241 | arrayDStartoD0pi=(TClonesArray*)aodFromExt->GetList()->FindObject(fBranchName.Data()); | |
242 | } | |
243 | } else { | |
244 | arrayDStartoD0pi=(TClonesArray*)aodEvent->GetList()->FindObject(fBranchName.Data()); | |
245 | } | |
246 | ||
247 | if (!arrayDStartoD0pi) { | |
248 | AliInfo(Form("Could not find array %s, skipping the event",fBranchName.Data())); | |
249 | // return; | |
250 | } else AliDebug(2, Form("Found %d vertices",arrayDStartoD0pi->GetEntriesFast())); | |
251 | ||
252 | TClonesArray* mcArray = 0x0; | |
253 | if (fUseMCInfo) { | |
254 | mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
255 | if (!mcArray) { | |
256 | printf("AliAnalysisTaskSEDStarSpectra::UserExec: MC particles not found!\n"); | |
257 | return; | |
258 | } | |
259 | } | |
260 | ||
261 | //retrieve jets | |
262 | trackArr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject("PicoTracks")); | |
263 | //clusArr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject("CaloClustersCorr")); | |
264 | //jetArr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetArrName)); | |
265 | fJetRadius=GetJetContainer(0)->GetJetRadius(); | |
266 | ||
267 | if(!trackArr){ | |
268 | AliInfo(Form("Could not find the track array\n")); | |
269 | return; | |
270 | } | |
271 | ||
272 | ||
273 | TString arrname="fCandidateArray"; | |
274 | TString candarrname=Form("%s%s%s",arrname.Data(),fCandArrName.Data(),fUseReco ? "rec" : "gen"); | |
275 | candidatesArr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(candarrname)); | |
276 | if (!candidatesArr) { | |
277 | Printf("%s array not found",candarrname.Data()); | |
278 | InputEvent()->GetList()->ls(); | |
279 | return; | |
280 | } | |
281 | //Printf("ncandidates found %d",candidatesArr->GetEntriesFast()); | |
282 | ||
283 | TString arrSBname="fSideBandArray"; | |
284 | TString sbarrname=Form("%s%s%s",arrSBname.Data(),fCandArrName.Data(),fUseReco ? "rec" : "gen"); | |
285 | sbcandArr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(sbarrname)); | |
286 | if (fCandidateType==1 && !sbcandArr) { | |
287 | Printf("%s array not found",sbarrname.Data()); | |
288 | InputEvent()->GetList()->ls(); | |
289 | return; | |
290 | } | |
291 | //Printf("nSBCand or Bkg found %d",sbcandArr->GetEntriesFast()); | |
292 | ||
293 | ||
294 | //Histograms | |
295 | TH1I* hstat=(TH1I*)fmyOutput->FindObject("hstat"); | |
296 | TH1F* hPtJetTrks=(TH1F*)fmyOutput->FindObject("hPtJetTrks"); | |
297 | TH1F* hPhiJetTrks=(TH1F*)fmyOutput->FindObject("hPhiJetTrks"); | |
298 | TH1F* hEtaJetTrks=(TH1F*)fmyOutput->FindObject("hEtaJetTrks"); | |
299 | TH1F* hEjetTrks=(TH1F*)fmyOutput->FindObject("hEjetTrks"); | |
300 | TH1F* hPtJet=(TH1F*)fmyOutput->FindObject("hPtJet"); | |
301 | TH1F* hPhiJet=(TH1F*)fmyOutput->FindObject("hPhiJet"); | |
302 | TH1F* hEtaJet=(TH1F*)fmyOutput->FindObject("hEtaJet"); | |
303 | TH1F* hEjet=(TH1F*)fmyOutput->FindObject("hEjet"); | |
304 | TH1F* hNtrArr=(TH1F*)fmyOutput->FindObject("hNtrArr"); | |
305 | TH1F* hNJetPerEv=(TH1F*)fmyOutput->FindObject("hNJetPerEv"); | |
306 | TH1F* hdeltaRJetTracks=((TH1F*)fmyOutput->FindObject("hdeltaRJetTracks")); | |
307 | ||
308 | hstat->Fill(0); | |
309 | ||
310 | // fix for temporary bug in ESDfilter | |
311 | // the AODs with null vertex pointer didn't pass the PhysSel | |
312 | if(!aodEvent->GetPrimaryVertex() || TMath::Abs(aodEvent->GetMagneticField())<0.001) return; | |
313 | ||
314 | //Event selection | |
315 | Bool_t iseventselected=fCuts->IsEventSelected(aodEvent); | |
316 | TString firedTriggerClasses=((AliAODEvent*)aodEvent)->GetFiredTriggerClasses(); | |
317 | if(!iseventselected) return; | |
318 | ||
319 | hstat->Fill(1); | |
320 | ||
321 | //trigger on jets | |
322 | ||
323 | Int_t njets=GetJetContainer()->GetNJets(); | |
324 | if(njets == 0) return; | |
325 | ||
326 | //retrieve charm candidates selected | |
327 | Int_t candidates = candidatesArr->GetEntriesFast(); | |
328 | ||
329 | // we start with jets | |
330 | Double_t ejet = 0; | |
331 | Double_t phiJet = 0; | |
332 | Double_t etaJet = 0; | |
333 | Double_t ptjet = 0; | |
334 | Double_t leadingJet =0; | |
335 | ||
336 | Int_t ntrarr=trackArr->GetEntriesFast(); | |
337 | hNtrArr->Fill(ntrarr); | |
338 | ||
339 | for(Int_t i=0;i<ntrarr;i++){ | |
340 | AliVTrack *jtrack=static_cast<AliVTrack*>(trackArr->At(i)); | |
341 | //reusing histograms | |
342 | hPtJetTrks->Fill(jtrack->Pt()); | |
343 | hPhiJetTrks->Fill(jtrack->Phi()); | |
344 | hEtaJetTrks->Fill(jtrack->Eta()); | |
345 | hEjetTrks->Fill(jtrack->E()); | |
346 | } | |
347 | ||
348 | ||
349 | //option to use only the leading jet | |
350 | if(fLeadingJetOnly){ | |
351 | for (Int_t iJetsL = 0; iJetsL<njets; iJetsL++) { | |
352 | AliEmcalJet* jetL = (AliEmcalJet*)GetJetFromArray(iJetsL); | |
353 | ptjet = jetL->Pt(); | |
354 | if(ptjet>leadingJet ) leadingJet = ptjet; | |
355 | ||
356 | } | |
357 | } | |
358 | ||
359 | Int_t cntjet=0; | |
360 | //loop over jets and consider only the leading jet in the event | |
361 | for (Int_t iJets = 0; iJets<njets; iJets++) { | |
362 | //Printf("Jet N %d",iJets); | |
363 | AliEmcalJet* jet = (AliEmcalJet*)GetJetFromArray(iJets); | |
364 | //Printf("Corr task Accept Jet"); | |
365 | if(!AcceptJet(jet)) { | |
366 | hstat->Fill(5); | |
367 | continue; | |
368 | } | |
369 | ||
370 | //jets variables | |
371 | ejet = jet->E(); | |
372 | phiJet = jet->Phi(); | |
373 | etaJet = jet->Eta(); | |
374 | ptjet = jet->Pt(); | |
375 | ||
376 | // choose the leading jet | |
377 | if(fLeadingJetOnly && (ejet<leadingJet)) continue; | |
378 | //used for normalization | |
379 | hstat->Fill(3); | |
380 | cntjet++; | |
381 | // fill energy, eta and phi of the jet | |
382 | hEjet ->Fill(ejet); | |
383 | hPhiJet ->Fill(phiJet); | |
384 | hEtaJet ->Fill(etaJet); | |
385 | hPtJet ->Fill(ptjet); | |
386 | ||
387 | //loop on jet particles | |
388 | Int_t ntrjet= jet->GetNumberOfTracks(); | |
389 | for(Int_t itrk=0;itrk<ntrjet;itrk++){ | |
390 | ||
391 | AliPicoTrack* jetTrk=(AliPicoTrack*)jet->TrackAt(itrk,trackArr); | |
392 | hdeltaRJetTracks->Fill(DeltaR(jet,jetTrk)); | |
393 | ||
394 | }//end loop on jet tracks | |
395 | ||
396 | //Printf("N candidates %d ", candidates); | |
397 | for(Int_t ic = 0; ic < candidates; ic++) { | |
398 | ||
399 | // D* candidates | |
400 | AliVParticle* charm=0x0; | |
401 | charm=(AliVParticle*)candidatesArr->At(ic); | |
402 | if(!charm) continue; | |
403 | hstat->Fill(2); | |
404 | ||
405 | FlagFlavour(charm, jet); | |
406 | if (jet->TestFlavourTag(AliEmcalJet::kDStar)) hstat->Fill(4); | |
407 | ||
408 | FillHistogramsRecoJetCorr(charm, jet); | |
409 | ||
410 | } | |
411 | //retrieve side band background candidates for Dstar | |
412 | Int_t nsbcand = 0; if(sbcandArr) nsbcand=sbcandArr->GetEntriesFast(); | |
413 | ||
414 | for(Int_t ib=0;ib<nsbcand;ib++){ | |
415 | if(fCandidateType==kDstartoKpipi && !fUseMCInfo){ | |
416 | AliAODRecoCascadeHF *sbcand=(AliAODRecoCascadeHF*)sbcandArr->At(ib); | |
417 | if(!sbcand) continue; | |
418 | SideBandBackground(sbcand,jet); | |
419 | } | |
420 | if(fUseMCInfo){ | |
421 | AliAODRecoDecayHF* charmbg = 0x0; | |
422 | charmbg=(AliAODRecoDecayHF*)candidatesArr->At(ib); | |
423 | if(!charmbg) continue; | |
424 | MCBackground(charmbg,jet); | |
425 | } | |
426 | } | |
427 | } // end of jet loop | |
428 | ||
429 | hNJetPerEv->Fill(cntjet); | |
430 | ||
431 | PostData(1,fmyOutput); | |
432 | ||
433 | } | |
434 | ||
435 | //_______________________________________________________________________________ | |
436 | ||
437 | void AliAnalysisTaskFlavourJetCorrelations::Terminate(Option_t*) | |
438 | { | |
439 | // The Terminate() function is the last function to be called during | |
440 | // a query. It always runs on the client, it can be used to present | |
441 | // the results graphically or save the results to file. | |
442 | ||
443 | Info("Terminate"," terminate"); | |
444 | AliAnalysisTaskSE::Terminate(); | |
445 | ||
446 | fmyOutput = dynamic_cast<TList*> (GetOutputData(1)); | |
447 | if (!fmyOutput) { | |
448 | printf("ERROR: fmyOutput not available\n"); | |
449 | return; | |
450 | } | |
451 | } | |
452 | ||
453 | //_______________________________________________________________________________ | |
454 | ||
455 | void AliAnalysisTaskFlavourJetCorrelations::SetMassLimits(Double_t range, Int_t pdg){ | |
456 | Float_t mass=0; | |
457 | Int_t abspdg=TMath::Abs(pdg); | |
458 | ||
459 | mass=TDatabasePDG::Instance()->GetParticle(abspdg)->Mass(); | |
460 | // compute the Delta mass for the D* | |
461 | if(fCandidateType==kDstartoKpipi){ | |
462 | Float_t mass1=0; | |
463 | mass1=TDatabasePDG::Instance()->GetParticle(421)->Mass(); | |
464 | mass = mass-mass1; | |
465 | } | |
466 | ||
467 | fMinMass = mass-range; | |
468 | fMaxMass = mass+range; | |
469 | ||
470 | AliInfo(Form("Setting mass limits to %f, %f",fMinMass,fMaxMass)); | |
471 | if (fMinMass<0 || fMaxMass<=0 || fMaxMass<fMinMass) AliFatal("Wrong mass limits!\n"); | |
472 | } | |
473 | ||
474 | //_______________________________________________________________________________ | |
475 | ||
476 | void AliAnalysisTaskFlavourJetCorrelations::SetMassLimits(Double_t lowlimit, Double_t uplimit){ | |
477 | if(uplimit>lowlimit) | |
478 | { | |
479 | fMinMass = lowlimit; | |
480 | fMaxMass = uplimit; | |
481 | } | |
482 | else{ | |
483 | printf("Error! Lower limit larger than upper limit!\n"); | |
484 | fMinMass = uplimit - uplimit*0.2; | |
485 | fMaxMass = uplimit; | |
486 | } | |
487 | } | |
488 | ||
489 | //_______________________________________________________________________________ | |
490 | ||
491 | Bool_t AliAnalysisTaskFlavourJetCorrelations::SetD0WidthForDStar(Int_t nptbins,Float_t *width){ | |
492 | if(nptbins>30) { | |
493 | AliInfo("Maximum number of bins allowed is 30!"); | |
494 | return kFALSE; | |
495 | } | |
496 | if(!width) return kFALSE; | |
497 | for(Int_t ipt=0;ipt<nptbins;ipt++) fSigmaD0[ipt]=width[ipt]; | |
498 | return kTRUE; | |
499 | } | |
500 | ||
501 | //_______________________________________________________________________________ | |
502 | ||
503 | Double_t AliAnalysisTaskFlavourJetCorrelations::Z(AliVParticle* part,AliEmcalJet* jet) const{ | |
504 | if(!part || !jet){ | |
505 | printf("Particle or jet do not exist!\n"); | |
506 | return -99; | |
507 | } | |
508 | Double_t p[3],pj[3]; | |
509 | Bool_t okpp=part->PxPyPz(p); | |
510 | Bool_t okpj=jet->PxPyPz(pj); | |
511 | if(!okpp || !okpj){ | |
512 | printf("Problems getting momenta\n"); | |
513 | return -999; | |
514 | } | |
515 | Double_t pjet=jet->P(); | |
516 | Double_t z=(p[0]*pj[0]+p[1]*pj[1]+p[2]*pj[2])/(pjet*pjet); | |
517 | return z; | |
518 | } | |
519 | ||
520 | //_______________________________________________________________________________ | |
521 | ||
522 | Bool_t AliAnalysisTaskFlavourJetCorrelations::DefineHistoForAnalysis(){ | |
523 | ||
524 | // Statistics | |
525 | TH1I* hstat=new TH1I("hstat","Statistics",6,-0.5,5.5); | |
526 | hstat->GetXaxis()->SetBinLabel(1,"N ev anal"); | |
527 | hstat->GetXaxis()->SetBinLabel(2,"N ev sel"); | |
528 | hstat->GetXaxis()->SetBinLabel(3,"N cand sel cuts"); | |
529 | hstat->GetXaxis()->SetBinLabel(4,"N jets"); | |
530 | hstat->GetXaxis()->SetBinLabel(5,"N cand in jet"); | |
531 | hstat->GetXaxis()->SetBinLabel(6,"N jet rej"); | |
532 | hstat->SetNdivisions(1); | |
533 | fmyOutput->Add(hstat); | |
534 | ||
535 | const Int_t nbinsmass=200; | |
536 | const Int_t nbinsptjet=500; | |
537 | const Int_t nbinsptD=100; | |
538 | const Int_t nbinsz=100; | |
539 | const Int_t nbinsphi=200; | |
540 | ||
541 | const Float_t ptjetlims[2]={0.,200.}; | |
542 | const Float_t ptDlims[2]={0.,50.}; | |
543 | const Float_t zlims[2]={0.,1.2}; | |
544 | const Float_t philims[2]={0.,6.3}; | |
545 | ||
546 | if(fCandidateType==kDstartoKpipi) | |
547 | { | |
548 | ||
549 | TH2F* hDiffSideBand = new TH2F("hDiffSideBand","M(kpipi)-M(kpi) Side Band Background",nbinsmass,fMinMass,fMaxMass,nbinsptD, ptDlims[0],ptDlims[1]); | |
550 | hDiffSideBand->SetStats(kTRUE); | |
551 | hDiffSideBand->GetXaxis()->SetTitle("M(kpipi)-M(Kpi) GeV"); | |
552 | hDiffSideBand->GetYaxis()->SetTitle("p_{t}^{D} (GeV/c)"); | |
553 | hDiffSideBand->Sumw2(); | |
554 | fmyOutput->Add(hDiffSideBand); | |
555 | ||
556 | ||
557 | TH1F* hPtPion = new TH1F("hPtPion","Primary pions candidates pt ",500,0,10); | |
558 | hPtPion->SetStats(kTRUE); | |
559 | hPtPion->GetXaxis()->SetTitle("GeV/c"); | |
560 | hPtPion->GetYaxis()->SetTitle("Entries"); | |
561 | hPtPion->Sumw2(); | |
562 | fmyOutput->Add(hPtPion); | |
563 | ||
564 | } | |
565 | ||
566 | // jet related fistograms | |
567 | ||
568 | TH1F* hEjetTrks = new TH1F("hEjetTrks", "Jet tracks energy distribution;Energy (GeV)",500,0,200); | |
569 | hEjetTrks->Sumw2(); | |
570 | TH1F* hPhiJetTrks = new TH1F("hPhiJetTrks","Jet tracks #phi distribution; #phi (rad)", nbinsphi,philims[0],philims[1]); | |
571 | hPhiJetTrks->Sumw2(); | |
572 | TH1F* hEtaJetTrks = new TH1F("hEtaJetTrks","Jet tracks #eta distribution; #eta", 100,-1.5,1.5); | |
573 | hEtaJetTrks->Sumw2(); | |
574 | TH1F* hPtJetTrks = new TH1F("hPtJetTrks", "Jet tracks Pt distribution; p_{T} (GeV/c)",nbinsptjet,ptjetlims[0],ptjetlims[1]); | |
575 | hPtJetTrks->Sumw2(); | |
576 | ||
577 | TH1F* hEjet = new TH1F("hEjet", "Jet energy distribution;Energy (GeV)",500,0,200); | |
578 | hEjet->Sumw2(); | |
579 | TH1F* hPhiJet = new TH1F("hPhiJet","Jet #phi distribution; #phi (rad)", nbinsphi,philims[0],philims[1]); | |
580 | hPhiJet->Sumw2(); | |
581 | TH1F* hEtaJet = new TH1F("hEtaJet","Jet #eta distribution; #eta", 100,-1.5,1.5); | |
582 | hEtaJet->Sumw2(); | |
583 | TH1F* hPtJet = new TH1F("hPtJet", "Jet Pt distribution; p_{T} (GeV/c)",nbinsptjet,ptjetlims[0],ptjetlims[1]); | |
584 | hPtJet->Sumw2(); | |
585 | ||
586 | TH3F* hPtJetWithD=new TH3F("hPtJetWithD","D-Jet Pt distribution; p_{T} (GeV/c);delta mass (GeV/c^{2})",nbinsptjet,ptjetlims[0],ptjetlims[1],nbinsmass,fMinMass,fMaxMass,nbinsptD, ptDlims[0],ptDlims[1]); | |
587 | hPtJetWithD->Sumw2(); | |
588 | //for the MC this histogram is filled with the real background | |
589 | TH3F* hPtJetWithDsb=new TH3F("hPtJetWithDsb","D(background)-Jet Pt distribution; p_{T} (GeV/c);delta mass (GeV/c^{2});p_{T}^{D} (GeV/c)",nbinsptjet,ptjetlims[0],ptjetlims[1],nbinsmass,fMinMass,fMaxMass,nbinsptD, ptDlims[0],ptDlims[1]); | |
590 | hPtJetWithDsb->Sumw2(); | |
591 | ||
592 | TH1F* hdeltaRJetTracks=new TH1F("hdeltaRJetTracks","Delta R of tracks in the jets",200, 0.,10.); | |
593 | hdeltaRJetTracks->Sumw2(); | |
594 | ||
595 | TH1F* hNtrArr= new TH1F("hNtrArr", "Number of tracks in the array of jets; number of tracks",500,0,1000); | |
596 | hNtrArr->Sumw2(); | |
597 | TH1F *hNJetPerEv=new TH1F("hNJetPerEv","Number of jets used per event; number of jets/ev",10,-0.5,9.5); | |
598 | hNJetPerEv->Sumw2(); | |
599 | ||
600 | fmyOutput->Add(hEjetTrks); | |
601 | fmyOutput->Add(hPhiJetTrks); | |
602 | fmyOutput->Add(hEtaJetTrks); | |
603 | fmyOutput->Add(hPtJetTrks); | |
604 | fmyOutput->Add(hEjet); | |
605 | fmyOutput->Add(hPhiJet); | |
606 | fmyOutput->Add(hEtaJet); | |
607 | fmyOutput->Add(hPtJet); | |
608 | fmyOutput->Add(hPtJetWithD); | |
609 | fmyOutput->Add(hPtJetWithDsb); | |
610 | fmyOutput->Add(hdeltaRJetTracks); | |
611 | fmyOutput->Add(hNtrArr); | |
612 | fmyOutput->Add(hNJetPerEv); | |
613 | ||
614 | TH1F* hDeltaRD=new TH1F("hDeltaRD","#Delta R distribution of D candidates selected;#Delta R",200, 0.,10.); | |
615 | hDeltaRD->Sumw2(); | |
616 | fmyOutput->Add(hDeltaRD); | |
617 | ||
618 | //background (side bands for the Dstar and like sign for D0) | |
619 | fJetRadius=GetJetContainer(0)->GetJetRadius(); | |
620 | TH2F* hInvMassptD = new TH2F("hInvMassptD",Form("D (Delta R < %.1f) invariant mass distribution p_{T}^{j} > threshold",fJetRadius),nbinsmass,fMinMass,fMaxMass,nbinsptD,ptDlims[0],ptDlims[1]); | |
621 | hInvMassptD->SetStats(kTRUE); | |
622 | hInvMassptD->GetXaxis()->SetTitle("mass (GeV)"); | |
623 | hInvMassptD->GetYaxis()->SetTitle("p_{t}^{D} (GeV/c)"); | |
624 | hInvMassptD->Sumw2(); | |
625 | ||
626 | fmyOutput->Add(hInvMassptD); | |
627 | ||
628 | if(fUseMCInfo){ | |
629 | TH2F* hInvMassptDbg = new TH2F("hInvMassptDbg",Form("Background D (Delta R < %.1f) invariant mass distribution p_{T}^{j} > threshold",fJetRadius),nbinsmass,fMinMass,fMaxMass,nbinsptD,ptDlims[0],ptDlims[1]); | |
630 | hInvMassptDbg->GetXaxis()->SetTitle(Form("%s (GeV)",(fCandidateType==kDstartoKpipi) ? "M(Kpipi)" : "M(Kpi)")); | |
631 | hInvMassptDbg->GetYaxis()->SetTitle("p_{t}^{D} (GeV/c)"); | |
632 | hInvMassptDbg->Sumw2(); | |
633 | fmyOutput->Add(hInvMassptDbg); | |
634 | ||
635 | } | |
636 | Double_t pi=TMath::Pi(), philims2[2]; | |
637 | philims2[0]=-pi*1./2.; | |
638 | philims2[1]=pi*3./2.; | |
639 | const Int_t nAxis=6; | |
640 | const Int_t nbinsSparse[nAxis]={nbinsz,nbinsphi,nbinsptjet,nbinsptD,nbinsmass,2}; | |
641 | const Double_t minSparse[nAxis]={zlims[0],philims2[0],ptjetlims[0],ptDlims[0],fMinMass,-0.5}; | |
642 | const Double_t maxSparse[nAxis]={zlims[1],philims2[1],ptjetlims[1],ptDlims[1],fMaxMass, 1.5}; | |
643 | THnSparseF *hsDphiz=new THnSparseF("hsDphiz","Z and #Delta#phi vs p_{T}^{jet}, p_{T}^{D}, and mass", nAxis, nbinsSparse, minSparse, maxSparse); | |
644 | hsDphiz->Sumw2(); | |
645 | ||
646 | fmyOutput->Add(hsDphiz); | |
647 | ||
648 | PostData(1, fmyOutput); | |
649 | ||
650 | return kTRUE; | |
651 | } | |
652 | ||
653 | //_______________________________________________________________________________ | |
654 | ||
655 | void AliAnalysisTaskFlavourJetCorrelations::FillHistogramsRecoJetCorr(AliVParticle* candidate, AliEmcalJet *jet){ | |
656 | ||
657 | Double_t ptD=candidate->Pt(); | |
658 | Double_t ptjet=jet->Pt(); | |
659 | Double_t deltaR=DeltaR(candidate,jet); | |
660 | Double_t deltaphi = jet->Phi()-candidate->Phi(); | |
661 | if(deltaphi<=-(TMath::Pi())/2) deltaphi = deltaphi+2*(TMath::Pi()); | |
662 | if(deltaphi>(3*(TMath::Pi()))/2) deltaphi = deltaphi-2*(TMath::Pi()); | |
663 | Double_t z=Z(candidate,jet); | |
664 | ||
665 | TH1F* hDeltaRD=(TH1F*)fmyOutput->FindObject("hDeltaRD"); | |
666 | hDeltaRD->Fill(deltaR); | |
667 | if(fUseReco){ | |
668 | if(fCandidateType==kD0toKpi) { | |
669 | AliAODRecoDecayHF* dzero=(AliAODRecoDecayHF*)candidate; | |
670 | FillHistogramsD0JetCorr(dzero,deltaphi,z,ptD,ptjet,deltaR, AODEvent()); | |
671 | ||
672 | } | |
673 | ||
674 | if(fCandidateType==kDstartoKpipi) { | |
675 | AliAODRecoCascadeHF* dstar = (AliAODRecoCascadeHF*)candidate; | |
676 | FillHistogramsDstarJetCorr(dstar,deltaphi,z,ptD,ptjet,deltaR); | |
677 | ||
678 | } | |
679 | } else{ //generated level | |
680 | //AliInfo("Non reco"); | |
681 | FillHistogramsMCGenDJetCorr(deltaphi,z,ptD,ptjet,deltaR); | |
682 | } | |
683 | } | |
684 | ||
685 | //_______________________________________________________________________________ | |
686 | ||
687 | void AliAnalysisTaskFlavourJetCorrelations::FillHistogramsD0JetCorr(AliAODRecoDecayHF* candidate, Double_t dPhi, Double_t z, Double_t ptD, Double_t ptj,Double_t deltaR, AliAODEvent* aodEvent){ | |
688 | ||
689 | //dPhi and z not used at the moment,but will be (re)added | |
690 | ||
691 | Double_t masses[2]={0.,0.}; | |
692 | Int_t pdgdaughtersD0[2]={211,321};//pi,K | |
693 | Int_t pdgdaughtersD0bar[2]={321,211};//K,pi | |
694 | ||
695 | masses[0]=candidate->InvMass(fNProngs,(UInt_t*)pdgdaughtersD0); //D0 | |
696 | masses[1]=candidate->InvMass(fNProngs,(UInt_t*)pdgdaughtersD0bar); //D0bar | |
697 | ||
698 | TH3F* hPtJetWithD=(TH3F*)fmyOutput->FindObject("hPtJetWithD"); | |
699 | THnSparseF* hsDphiz=(THnSparseF*)fmyOutput->FindObject("hsDphiz"); | |
700 | Double_t point[5]={z,dPhi,ptj,ptD,masses[0]}; | |
701 | ||
702 | Int_t isselected=fCuts->IsSelected(candidate,AliRDHFCuts::kAll,aodEvent); | |
703 | if(isselected==1 || isselected==3) { | |
704 | ||
705 | if(deltaR<fJetRadius) hPtJetWithD->Fill(ptj,masses[0],ptD); | |
706 | ||
707 | FillMassHistograms(masses[0], ptD, deltaR); | |
708 | hsDphiz->Fill(point,1.); | |
709 | } | |
710 | if(isselected>=2) { | |
711 | if(deltaR<fJetRadius) hPtJetWithD->Fill(ptj,masses[1],ptD); | |
712 | ||
713 | FillMassHistograms(masses[1], ptD, deltaR); | |
714 | point[4]=masses[1]; | |
715 | hsDphiz->Fill(point,1.); | |
716 | } | |
717 | ||
718 | } | |
719 | ||
720 | //_______________________________________________________________________________ | |
721 | ||
722 | void AliAnalysisTaskFlavourJetCorrelations::FillHistogramsDstarJetCorr(AliAODRecoCascadeHF* dstar, Double_t dPhi, Double_t z, Double_t ptD, Double_t ptj, Double_t deltaR){ | |
723 | //dPhi and z not used at the moment,but will be (re)added | |
724 | ||
725 | AliAODTrack *softpi = (AliAODTrack*)dstar->GetBachelor(); | |
726 | Double_t deltamass= dstar->DeltaInvMass(); | |
727 | //Double_t massD0= dstar->InvMassD0(); | |
728 | ||
729 | ||
730 | TH1F* hPtPion=(TH1F*)fmyOutput->FindObject("hPtPion"); | |
731 | hPtPion->Fill(softpi->Pt()); | |
732 | ||
733 | TH3F* hPtJetWithD=(TH3F*)fmyOutput->FindObject("hPtJetWithD"); | |
734 | THnSparseF* hsDphiz=(THnSparseF*)fmyOutput->FindObject("hsDphiz"); | |
735 | Int_t isSB=IsDzeroSideBand(dstar); | |
736 | ||
737 | Double_t point[6]={z,dPhi,ptj,ptD,deltamass,isSB}; | |
738 | ||
739 | if(deltaR<fJetRadius) hPtJetWithD->Fill(ptj,deltamass,ptD); | |
740 | ||
741 | FillMassHistograms(deltamass, ptD, deltaR); | |
742 | hsDphiz->Fill(point,1.); | |
743 | ||
744 | } | |
745 | ||
746 | //_______________________________________________________________________________ | |
747 | ||
748 | void AliAnalysisTaskFlavourJetCorrelations::FillHistogramsMCGenDJetCorr(Double_t dPhi,Double_t z,Double_t ptD,Double_t ptjet,Double_t deltaR){ | |
749 | ||
750 | Double_t pdgmass=0; | |
751 | TH3F* hPtJetWithD=(TH3F*)fmyOutput->FindObject("hPtJetWithD"); | |
752 | THnSparseF* hsDphiz=(THnSparseF*)fmyOutput->FindObject("hsDphiz"); | |
753 | Double_t point[6]={z,dPhi,ptjet,ptD,pdgmass,0}; | |
754 | ||
755 | if(fCandidateType==kD0toKpi) pdgmass=TDatabasePDG::Instance()->GetParticle(421)->Mass(); | |
756 | if(fCandidateType==kDstartoKpipi) pdgmass=TDatabasePDG::Instance()->GetParticle(413)->Mass()-TDatabasePDG::Instance()->GetParticle(421)->Mass(); | |
757 | point[4]=pdgmass; | |
758 | ||
759 | if(deltaR<fJetRadius) { | |
760 | hPtJetWithD->Fill(ptjet,pdgmass,ptD); // candidates within a jet | |
761 | hsDphiz->Fill(point,1.); | |
762 | } | |
763 | ||
764 | } | |
765 | ||
766 | //_______________________________________________________________________________ | |
767 | ||
768 | void AliAnalysisTaskFlavourJetCorrelations::FillMassHistograms(Double_t mass,Double_t ptD, Double_t deltaR){ | |
769 | ||
770 | if(deltaR<fJetRadius) { | |
771 | TH2F* hInvMassptD=(TH2F*)fmyOutput->FindObject("hInvMassptD"); | |
772 | hInvMassptD->Fill(mass,ptD); | |
773 | } | |
774 | } | |
775 | ||
776 | void AliAnalysisTaskFlavourJetCorrelations::FlagFlavour(AliVParticle *charm, AliEmcalJet *jet){ | |
777 | Double_t deltaR=DeltaR(charm, jet); | |
778 | AliEmcalJet::EFlavourTag tag=AliEmcalJet::kDStar; | |
779 | if (fCandidateType==kD0toKpi) tag=AliEmcalJet::kD0; | |
780 | if (deltaR<fJetRadius) jet->AddFlavourTag(tag); | |
781 | ||
782 | return; | |
783 | ||
784 | } | |
785 | ||
786 | //_______________________________________________________________________________ | |
787 | ||
788 | void AliAnalysisTaskFlavourJetCorrelations::SideBandBackground(AliAODRecoCascadeHF *candDstar, AliEmcalJet *jet){ | |
789 | ||
790 | // D* side band background method. Two side bands, in M(Kpi) are taken at ~6 sigmas | |
791 | // (expected detector resolution) on the left and right frm the D0 mass. Each band | |
792 | // has a width of ~5 sigmas. Two band needed for opening angle considerations | |
793 | TH2F* hDiffSideBand=(TH2F*)fmyOutput->FindObject("hDiffSideBand"); | |
794 | TH3F* hPtJetWithDsb=(TH3F*)fmyOutput->FindObject("hPtJetWithDsb"); | |
795 | ||
796 | Double_t deltaM=candDstar->DeltaInvMass(); | |
797 | //Printf("Inv mass = %f between %f and %f or %f and %f?",invM, sixSigmal,fourSigmal,fourSigmar,sixSigmar); | |
798 | Double_t ptD=candDstar->Pt(); | |
799 | Double_t ptjet=jet->Pt(); | |
800 | Double_t dPhi=jet->Phi()-candDstar->Phi(); | |
801 | Double_t deltaR=DeltaR(candDstar,jet); | |
802 | if(dPhi>TMath::Pi())dPhi = dPhi - 2.*TMath::Pi(); | |
803 | if(dPhi<(-1.*TMath::Pi()))dPhi = dPhi + 2.*TMath::Pi(); | |
804 | ||
805 | Int_t isSideBand=IsDzeroSideBand(candDstar); | |
806 | //fill the background histogram with the side bands or when looking at MC with the real background | |
807 | if(isSideBand==1){ | |
808 | hDiffSideBand->Fill(deltaM,ptD); // M(Kpipi)-M(Kpi) side band background | |
809 | //hdeltaPhiDjaB->Fill(deltaM,ptD,dPhi); | |
810 | ||
811 | if(deltaR<fJetRadius){ // evaluate in the near side | |
812 | //hzptDB->Fill(Z(candDstar,jet),deltaM,ptD); | |
813 | hPtJetWithDsb->Fill(ptjet,deltaM,ptD); | |
814 | } | |
815 | } | |
816 | } | |
817 | ||
818 | //_______________________________________________________________________________ | |
819 | ||
820 | void AliAnalysisTaskFlavourJetCorrelations::MCBackground(AliAODRecoDecayHF *candbg, AliEmcalJet *jet){ | |
821 | ||
822 | //need mass, deltaR, pt jet, ptD | |
823 | //two cases: D0 and Dstar | |
824 | ||
825 | Int_t isselected=fCuts->IsSelected(candbg,AliRDHFCuts::kAll, AODEvent()); | |
826 | if(!isselected) return; | |
827 | ||
828 | Double_t ptD=candbg->Pt(); | |
829 | Double_t ptjet=jet->Pt(); | |
830 | Double_t deltaR=DeltaR(candbg,jet); | |
831 | ||
832 | TH2F* hInvMassptDbg=(TH2F*)fmyOutput->FindObject("hInvMassptDbg"); | |
833 | TH3F* hPtJetWithDsb=(TH3F*)fmyOutput->FindObject("hPtJetWithDsb"); | |
834 | ||
835 | ||
836 | if(fCandidateType==kDstartoKpipi){ | |
837 | AliAODRecoCascadeHF* dstarbg = (AliAODRecoCascadeHF*)candbg; | |
838 | Double_t deltaM=dstarbg->DeltaInvMass(); | |
839 | hInvMassptDbg->Fill(deltaM,ptD); | |
840 | if(deltaR<fJetRadius) hPtJetWithDsb->Fill(ptjet,deltaM,ptD); | |
841 | } | |
842 | ||
843 | if(fCandidateType==kD0toKpi){ | |
844 | Double_t masses[2]={0.,0.}; | |
845 | Int_t pdgdaughtersD0[2]={211,321};//pi,K | |
846 | Int_t pdgdaughtersD0bar[2]={321,211};//K,pi | |
847 | ||
848 | masses[0]=candbg->InvMass(fNProngs,(UInt_t*)pdgdaughtersD0); //D0 | |
849 | masses[1]=candbg->InvMass(fNProngs,(UInt_t*)pdgdaughtersD0bar); //D0bar | |
850 | ||
851 | ||
852 | if(isselected==1 || isselected==3) { | |
853 | if(deltaR<fJetRadius) hPtJetWithDsb->Fill(ptjet,masses[0],ptD); | |
854 | hInvMassptDbg->Fill(masses[0],ptD); | |
855 | } | |
856 | if(isselected>=2) { | |
857 | if(deltaR<fJetRadius) hPtJetWithDsb->Fill(ptjet,masses[1],ptD); | |
858 | hInvMassptDbg->Fill(masses[1],ptD); | |
859 | } | |
860 | ||
861 | ||
862 | } | |
863 | } | |
864 | ||
865 | //_______________________________________________________________________________ | |
866 | ||
867 | Float_t AliAnalysisTaskFlavourJetCorrelations::DeltaR(AliVParticle *p1, AliVParticle *p2) const { | |
868 | //Calculate DeltaR between p1 and p2: DeltaR=sqrt(Delataphi^2+DeltaEta^2) | |
869 | ||
870 | if(!p1 || !p2) return -1; | |
871 | Double_t phi1=p1->Phi(),eta1=p1->Eta(); | |
872 | Double_t phi2 = p2->Phi(),eta2 = p2->Eta() ; | |
873 | ||
874 | Double_t dPhi=phi1-phi2; | |
875 | if(dPhi<=-(TMath::Pi())/2) dPhi = dPhi+2*(TMath::Pi()); | |
876 | if(dPhi>(3*(TMath::Pi()))/2) dPhi = dPhi-2*(TMath::Pi()); | |
877 | ||
878 | Double_t dEta=eta1-eta2; | |
879 | Double_t deltaR=TMath::Sqrt(dEta*dEta + dPhi*dPhi ); | |
880 | return deltaR; | |
881 | ||
882 | } | |
883 | ||
884 | //_______________________________________________________________________________ | |
885 | ||
886 | Int_t AliAnalysisTaskFlavourJetCorrelations::IsDzeroSideBand(AliAODRecoCascadeHF *candDstar){ | |
887 | ||
888 | Double_t ptD=candDstar->Pt(); | |
889 | Int_t bin = fCuts->PtBin(ptD); | |
890 | if (bin < 0){ | |
891 | // /PWGHF/vertexingHF/AliRDHFCuts::PtBin(Double_t) const may return values below zero depending on config. | |
892 | bin = 9999; // void result code for coverity (bin later in the code non-zero) - will coverity pick up on this? | |
893 | return -1; // out of bounds | |
894 | } | |
895 | ||
896 | Double_t invM=candDstar->InvMassD0(); | |
897 | Double_t mPDGD0=TDatabasePDG::Instance()->GetParticle(421)->Mass(); | |
898 | ||
899 | Float_t fourSigmal= mPDGD0-4.*fSigmaD0[bin] , sixSigmal= mPDGD0-8.*fSigmaD0[bin]; | |
900 | Float_t fourSigmar= mPDGD0+4.*fSigmaD0[bin] , sixSigmar= mPDGD0+8.*fSigmaD0[bin]; | |
901 | ||
902 | if((invM>=sixSigmal && invM<fourSigmal) || (invM>fourSigmar && invM<=sixSigmar)) return 1; | |
903 | else return 0; | |
904 | ||
905 | } |