]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/aod_HF.C
From Andrea - new macro for visualization of heavy-flavour decays.
[u/mrichter/AliRoot.git] / EVE / alice-macros / aod_HF.C
1 // $Id: esd_V0.C 26897 2008-06-25 23:58:36Z mtadel $
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4 /**************************************************************************
5  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 void esd_v0_init_rectrack(TEveRecTrack& rt, AliExternalTrackParam* tp)
11 {
12   Double_t      pbuf[3], vbuf[3];
13
14   rt.fSign = tp->GetSign();
15   tp->GetXYZ(vbuf);     rt.fV.Set(vbuf);
16   tp->GetPxPyPz(pbuf);  rt.fP.Set(pbuf);
17   // Double_t ep = at->GetP(), mc = at->GetMass();
18   rt.fBeta = 1; // ep/TMath::Sqrt(ep*ep + mc*mc);
19 }
20
21 AliEveV0* aod_make_HF(TEveTrackPropagator* rnrStyle, AliESDVertex* primVtx,
22                       AliESDtrack* neg, AliESDtrack* pos, AliAODRecoDecayHF* rd, Int_t i)
23 {
24   TEveRecTrack  rcPos;
25   TEveRecTrack  rcNeg;
26   TEveRecV0     rcV0;
27
28   Double_t p[3];
29   p[0]=rd->PxProng(0);  p[1]=rd->PyProng(0);  p[2]=rd->PzProng(0);
30   rcV0.fPPos.Set(p);
31   p[0]=rd->PxProng(1);  p[1]=rd->PyProng(1);  p[2]=rd->PzProng(1);
32   rcV0.fPNeg.Set(p);
33
34   p[0]=rd->Px();  p[1]=rd->Py();  p[2]=rd->Pz();
35
36   Double_t v[3] = {rd->Xv(),rd->Yv(),rd->Zv()}
37   printf("vertex %f %f %f\n",v[0],v[1],v[2]);
38   rcV0.fVCa.Set(v);
39
40   neg->GetXYZ(v);  rcV0.fVNeg.Set(v);
41   pos->GetXYZ(v);  rcV0.fVPos.Set(v);
42
43   rcV0.fV0Birth.Set(primVtx->GetXv(), primVtx->GetYv(), primVtx->GetZv());
44
45   // Simulation data not directly available in AliESDv0
46   //rcV0.fDLabel[0] = v0->GetNindex();
47   //rcV0.fDLabel[1] = v0->GetPindex();
48
49   esd_v0_init_rectrack(rcNeg, neg);
50   //rcNeg.fIndex = v0->GetNindex();
51   esd_v0_init_rectrack(rcPos, pos);
52   //rcPos.fIndex = v0->GetPindex();
53
54   AliEveV0* myD0 = new AliEveV0(&rcNeg, &rcPos, &rcV0, rnrStyle);
55   myD0->SetElementName(Form("D0->Kpi %d", i));
56   myD0->SetElementTitle(Form("CosPointingAngle %f",
57                              rd->CosPointingAngle()));
58   //myV0->SetESDIndex(i);
59   //myV0->SetOnFlyStatus(v0->GetOnFlyStatus());
60   //myV0->SetDaughterDCA(v0->GetDcaV0Daughters());
61
62   return myD0;
63 }
64
65
66 AliEveV0List* aod_HF()
67 {
68   AliAODEvent* aod = AliEveEventManager::AssertAOD();
69   AliESDEvent* esd = AliEveEventManager::AssertESD();
70
71   AliESDVertex* primVertex = (AliESDVertex*) esd->GetPrimaryVertex();
72
73   AliEveV0List* cont = new AliEveV0List("AOD HF vertices");
74   cont->SetMainColor(2);
75   TEveTrackPropagator* rnrStyle = cont->GetPropagator();
76   rnrStyle->SetMagField( 0.1*aod->GetMagneticField() );
77
78   gEve->AddElement(cont);
79
80
81   TEvePointSet* pointsD0toKpi = new TEvePointSet("D0->Kpi vertex locations");
82
83   // load D0->Kpi candidates
84   TClonesArray *arrayD0toKpi = 
85     (TClonesArray*)aod->GetList()->FindObject("D0toKpi"); 
86      
87   // load 3prong candidates
88   TClonesArray *array3Prong = 
89     (TClonesArray*)aod->GetList()->FindObject("Charm3Prong"); 
90
91
92   Int_t countD0 = 0;
93   for (Int_t iD0toKpi=0; iD0toKpi<arrayD0toKpi->GetEntriesFast(); iD0toKpi++) {
94     AliAODRecoDecayHF2Prong *rd = (AliAODRecoDecayHF2Prong*)arrayD0toKpi->UncheckedAt(iD0toKpi);
95     Bool_t unsetvtx=kFALSE;
96     if(!rd->GetOwnPrimaryVtx()) {
97       rd->SetOwnPrimaryVtx(vtx1); // needed to compute all variables
98       unsetvtx=kTRUE;
99     }
100
101     AliESDtrack* negTr = esd->GetTrack(rd->GetProngID(0));
102     AliESDtrack* posTr = esd->GetTrack(rd->GetProngID(1));
103
104     AliVVertex *secv = rd->GetSecondaryVtx();
105     negTr->PropagateToDCA((AliESDVertex*)secv,aod->GetMagneticField(),100.);
106     posTr->PropagateToDCA((AliESDVertex*)secv,aod->GetMagneticField(),100.);
107
108     AliEveV0* myD0 = aod_make_HF(rnrStyle,primVertex,negTr,posTr,rd,iD0toKpi);
109     if (myD0) {
110       gEve->AddElement(myD0,cont);
111       countD0++;
112     }
113
114     pointsD0toKpi->SetNextPoint(rd->Xv(),rd->Yv(),rd->Zv());
115     pointsD0toKpi->SetPointId(rd);
116
117     if(unsetvtx) rd->UnsetOwnPrimaryVtx();
118   }
119
120   cont->SetTitle("test");
121
122   cont->MakeV0s();
123   gEve->Redraw3D();
124
125   pointsD0toKpi->SetTitle(Form("N=%d",pointsD0toKpi->Size()));
126   pointsD0toKpi->SetMarkerStyle(4);
127   pointsD0toKpi->SetMarkerSize(1.5);
128   pointsD0toKpi->SetMarkerColor(kViolet);
129
130   gEve->AddElement(pointsD0toKpi);
131   gEve->Redraw3D();
132
133   return cont;
134 }
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150