2 // Main author: Davide Caffarri 2009
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * ee http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
11 #include "AliAODRecoDecay.h"
13 #include <TEveTrack.h>
14 #include <TEveTrackPropagator.h>
15 #include <TEveManager.h>
17 #include <TPolyLine3D.h>
18 #include <TPolyMarker3D.h>
21 #include <TDatabasePDG.h>
22 #include <TParticlePDG.h>
27 /***********************************************************************
31 ************************************************************************/
36 //______________________________________________________________________________
43 fRecDecayMomHF(0,0,0),
57 fProngMaxProbPdg(0x0),
58 fProngMaxProbPid(0x0),
59 fInvariantMassPart(0),
60 fInvariantMassAntiPart(0),
64 // Default constructor.
66 // Override from TEveElement.
68 fMainColorPtr = &fMarkerColor;
71 //______________________________________________________________________________
72 AliEveHF::AliEveHF(TEveRecTrack* tNeg, TEveRecTrack* tPos, Double_t primVtx[3], AliAODRecoDecay* aodObj, TEveTrackPropagator* rs) :
77 fRecBirthHF(primVtx[0], primVtx[1], primVtx[2]),
78 fRecDecayHF(aodObj->GetSecVtxX(), aodObj->GetSecVtxY(), aodObj->GetSecVtxZ()),
79 fRecDecayMomHF(aodObj->Px(),aodObj->Py(),aodObj->Pz()),
80 fPointingAngleHF(aodObj->CosPointingAngle(primVtx)),
82 fNegTrack(new TEveTrack(tNeg, rs)),
83 fPosTrack(new TEveTrack(tPos, rs)),
85 fPointingLine(new TEveLine("Pointing line")),
87 fnProng(aodObj->GetNProngs()),
89 fChi2SecondVtx(aodObj->GetReducedChi2()),
95 fInvariantMassPart(0),
96 fInvariantMassAntiPart(0),
100 // Constructor with full HF specification.
101 // Override from TEveElement.
103 fMainColorPtr = &fMarkerColor;
106 fMarkerColor = kSpring + 6;
109 fPointingLine->SetLineColor(fMarkerColor);
110 fPointingLine->SetLineWidth(2);
111 fPointingLine->IncDenyDestroy();
112 AddElement(fPointingLine);
114 fPosTrack->SetLineColor(2); // red
115 fPosTrack->SetStdTitle();
116 fNegTrack->SetLineColor(7); // light blue
117 fNegTrack->SetStdTitle();
119 fNegTrack->IncDenyDestroy();
120 AddElement(fNegTrack);
121 fPosTrack->IncDenyDestroy();
122 AddElement(fPosTrack);
125 //______________________________________________________________________________
126 AliEveHF::~AliEveHF()
128 // Destructor. Dereferences pos/neg tracks and pointing-line objects.
130 fNegTrack->DecDenyDestroy();
131 fPosTrack->DecDenyDestroy();
132 fPointingLine->DecDenyDestroy();
135 //_____________________________________________________________________________
136 void AliEveHF::SetProngDCA() const
138 for(Int_t ip=0; ip<fnProng; ip++)
139 fProngDCA[ip] = fAODobj->GetDCA(ip);
142 //______________________________________________________________________________
143 void AliEveHF::Setd0Prong() const
145 for(Int_t ip=0; ip<fnProng; ip++)
146 fProngd0[ip] = fAODobj->Getd0Prong(ip);
150 //______________________________________________________________________________
151 void AliEveHF::SetMaxProbPdgPid()
153 // Sets the maximum probability Pdg value and Pid for one daughter
154 // Should be moved to TEveTrack property eventually (or AliEveTrack creation)
158 for (Int_t ip=0; ip<fnProng; ip++){
159 fAODobj->GetPIDProng(ip, pid);
161 fProngMaxProbPid[ip]=pid[0];
162 for (Int_t pp=1; pp<5; pp++)
163 if (pid[pp]>pid[pp-1]) {
164 fProngMaxProbPid[ip]=pid[pp];
169 fProngMaxProbPdg[ip] = -11;
172 fProngMaxProbPdg[ip] = -13;
175 fProngMaxProbPdg[ip] = 211;
178 fProngMaxProbPdg[ip] = 321;
181 fProngMaxProbPdg[ip] = 2212;
188 //________________________________________________________________________________________
189 void AliEveHF::CalculateInvMass(Int_t decay)
192 //Method to calculate the invariant mass of the particle and the antiparticle.
199 pdg2[0]=211; pdg2[1]=321;
200 mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
201 minv = fAODobj->InvMass(fnProng,pdg2);
202 fInvariantMassPart=minv;
204 pdg2[0]=321; pdg2[1]=211;
205 minv = fAODobj->InvMass(fnProng,pdg2);
206 fInvariantMassAntiPart=minv;
212 //______________________________________________________________________________
213 Bool_t AliEveHF::SelectInvMass(Int_t decay, Float_t decayCuts)
216 //Member fuction to select particles using the invariant mass cuts.
220 Bool_t retval=kFALSE;
224 pdg2[0]=211; pdg2[1]=321;
225 mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
226 minv = fAODobj->InvMass(fnProng,pdg2);
227 fInvariantMassPart=minv;
228 if(TMath::Abs(minv-mPDG)<decayCuts) retval=kTRUE;
229 pdg2[0]=321; pdg2[1]=211;
230 minv = fAODobj->InvMass(fnProng,pdg2);
231 fInvariantMassAntiPart=minv;
232 if(TMath::Abs(minv-mPDG)<decayCuts) retval=kTRUE;
240 //______________________________________________________________________________
241 void AliEveHF::MakeHF()
243 // Set all dependant components for drawing.
245 SetPoint(0, fRecDecayHF.fX, fRecDecayHF.fY, fRecDecayHF.fZ);
247 fNegTrack->MakeTrack();
248 fPosTrack->MakeTrack();
250 fPointingLine->SetPoint(0, fRecBirthHF.fX, fRecBirthHF.fY, fRecBirthHF.fZ);
251 fPointingLine->SetPoint(1, fRecDecayHF.fX, fRecDecayHF.fY, fRecDecayHF.fZ);
254 /***********************************************************************
258 ************************************************************************/
260 ClassImp(AliEveHFList)
262 //______________________________________________________________________________
263 AliEveHFList::AliEveHFList() :
267 fRnrDaughters(kTRUE),
277 fMinCosPointingAngle(0),
278 fMaxCosPointingAngle(1),
281 fProngCheckedPid(0x0),
282 fProngCheckedProb(0x0),
283 fDeltaInvariantMass(0),
286 // Default constructor.
288 fChildClass = AliEveHF::Class(); // override member from base TEveElementList
291 //______________________________________________________________________________
292 AliEveHFList::AliEveHFList(TEveTrackPropagator* rs) :
296 fRnrDaughters(kTRUE),
306 fMinCosPointingAngle(0),
307 fMaxCosPointingAngle(1),
310 fProngCheckedPid(0x0),
311 fProngCheckedProb(0x0),
312 fDeltaInvariantMass(1),
315 // Constructor with given track-propagator..
317 fChildClass = AliEveHF::Class(); // override member from base TEveElementList
322 //______________________________________________________________________________
323 AliEveHFList::AliEveHFList(const Text_t* name, TEveTrackPropagator* rs) :
327 fRnrDaughters(kTRUE),
337 fMinCosPointingAngle(0),
338 fMaxCosPointingAngle(1),
341 fProngCheckedPid(0x0),
342 fProngCheckedProb(0x0),
343 fDeltaInvariantMass(1),
346 // Standard constructor.
348 fChildClass = AliEveHF::Class(); // override member from base TEveElementList
354 //______________________________________________________________________________
355 void AliEveHFList::Init()
357 // Initialize members needed for drawing operations.
359 if (fRnrStyle== 0) fRnrStyle = new TEveTrackPropagator;
362 /******************************************************************************/
364 //______________________________________________________________________________
365 void AliEveHFList::MakeHFs()
367 // Call MakeHF() for all elements.
369 for(List_i i=fChildren.begin(); i!=fChildren.end(); i++) {
370 ((AliEveHF*)(*i))->MakeHF();
375 /******************************************************************************/
378 //______________________________________________________________________________
379 void AliEveHFList::FilterByPt(Float_t minPt, Float_t maxPt)
382 //Select visibility of elements based on their Pt
387 for(List_i i = fChildren.begin(); i != fChildren.end(); ++i)
389 AliEveHF *hf = (AliEveHF*) *i;
390 Float_t pt = hf->GetPt();
391 Bool_t show = ((pt >= fMinPt) && (pt <= fMaxPt));
392 hf->SetRnrState(show);
397 //______________________________________________________________________________
398 void AliEveHFList::FilterByRadius(Float_t minR, Float_t maxR)
400 // Select visibility of elements based on their axial radius.
405 for(List_i i = fChildren.begin(); i != fChildren.end(); ++i)
407 AliEveHF *hf = (AliEveHF*) *i;
408 Float_t rad = hf->GetRadius();
409 Bool_t show = rad >= fMinRCut && rad <= fMaxRCut;
410 hf->SetRnrState(show);
416 /******************************************************************************/
419 //______________________________________________________________________________
420 void AliEveHFList::FilterByCosPointingAngle(Float_t minCosPointingAngle, Float_t maxCosPointingAngle)
422 // Select visibility of elements based on the HF cosine of the pointing angle
424 fMinCosPointingAngle = minCosPointingAngle;
425 fMaxCosPointingAngle = maxCosPointingAngle;
428 for(List_i i = fChildren.begin(); i != fChildren.end(); ++i)
430 AliEveHF *hf = (AliEveHF*) *i;
431 Float_t cosPointingAngle = hf->GetCosPointingAngle();
432 Bool_t show = cosPointingAngle >= fMinCosPointingAngle && cosPointingAngle <= fMaxCosPointingAngle;
433 hf->SetRnrState(show);
439 //______________________________________________________________________________
440 void AliEveHFList::FilterByd0(Float_t mind0, Float_t maxd0)
442 // Select visibility of elements based on the HF impact parameter.
447 for(List_i i = fChildren.begin(); i != fChildren.end(); ++i)
449 AliEveHF *hf = (AliEveHF*) *i;
450 Int_t nProng=(Int_t)hf->GetAODobj()->GetNProngs();
451 for(Int_t ip = 1; ip < nProng; ++ip) {
452 Double_t d0 = hf->Getd0Prong(ip);
453 Bool_t show = d0 >= fMind0 && d0 <= fMaxd0;
454 hf->SetRnrState(show);
462 //______________________________________________________________________________
463 void AliEveHFList::FilterByDCA(Float_t minDaughterDCA, Float_t maxDaughterDCA)
465 // Select visibility of elements based on the DCA between daughters.
467 fMinDaughterDCA = minDaughterDCA;
468 fMaxDaughterDCA = maxDaughterDCA;
474 for(List_i i = fChildren.begin(); i != fChildren.end(); ++i)
476 AliEveHF* hf = (AliEveHF*) *i;
477 Int_t nProng=(Int_t)hf->GetAODobj()->GetNProngs();
478 for(Int_t ip = 1; ip < nProng; ++ip) {
479 dca = hf->GetProngDCA(ip);
480 Bool_t show = dca >= fMinDaughterDCA && dca <= fMaxDaughterDCA;
481 hf->SetRnrState(show);
488 /******************************************************************************/
489 //______________________________________________________________________________
490 /*void AliEveHFList::FilterByCheckedPidMinProb(Int_t rFlag,Int_t rDaughter, Int_t rPid, Float_t rProb)
494 fNegCheckedPid = rPid;
495 fNegCheckedProb = rProb;
498 fPosCheckedPid = rPid;
499 fPosCheckedProb = rProb;
502 // Select visibility of elements based on one of the V0 daughters PID
503 for(List_i i = fChildren.begin(); i != fChildren.end(); ++i)
505 AliEveHF* hf = (AliEveHF*) *i;
509 if (!rDaughter) {// Negative daughter checked
510 pid = hf->GetNegMaxProbPdg();
511 prob = hf->GetNegMaxProbPid();
512 show = (pid == fNegCheckedPid && prob > fNegCheckedProb) || !rFlag ;
514 else if (rDaughter) {// Positive daughter checked
515 pid = hf->GetPosMaxProbPdg();
516 prob = hf->GetPosMaxProbPid();
517 show = (pid == fPosCheckedPid && prob > fPosCheckedProb) || !rFlag ;
519 hf->SetRnrState(show);
525 //______________________________________________________________________________
527 void AliEveHFList::FilterByInvariantMass(Int_t decay, Float_t deltaInvariantMass)
529 // Select visibility of elements based on the HF invariant mass.
531 fDeltaInvariantMass = deltaInvariantMass;
534 for(List_i i = fChildren.begin(); i != fChildren.end(); ++i)
536 AliEveHF* hf = (AliEveHF*) *i;
537 Bool_t show = hf->SelectInvMass(decay, fDeltaInvariantMass);
538 // if (show) show = (invMass >= (fInvariantMass-fDeltaInvariantMass)) && (invMass <= (fInvariantMass+fDeltaInvariantMass));
539 hf->SetRnrState(show);