]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/esd_V0.C
Comment code, hide public data-members.
[u/mrichter/AliRoot.git] / EVE / alice-macros / esd_V0.C
CommitLineData
d810d0de 1// $Id$
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 **************************************************************************/
ca5fb6a4 9
10
11// #include "EVE/Alieve/EventAlieve.h"
84aff7a4 12// #include "TEveManager.h"
d810d0de 13// #include "AliEveV0.h"
ca5fb6a4 14
15// #include "AliESD.h"
16// #include "AliESDtrack.h"
17// #include "AliESDv0.h"
18// #include "AliESDVertex.h"
19
84aff7a4 20// using namespace TEveUtil;
ca5fb6a4 21// using namespace Alieve;
22
23
d810d0de 24AliEveV0* esd_make_v0(TEveTrackPropagator* rnrStyle, AliESDVertex* primVtx,
a9f14204 25 AliESDtrack* neg, AliESDtrack* pos, AliESDv0* v0, Int_t i)
26{
27 if (! v0->GetOnFlyStatus())
28 { // v0 on fly do not have the momentum vector filled...
84aff7a4 29 TEveRecTrack rcPos;
30 TEveRecTrack rcNeg;
31 TEveRecV0 rcV0;
8f14e54c 32
a9f14204 33 Double_t p[3];
34 v0->GetNPxPyPz(p[0], p[1], p[2]);
35 rcV0.P_pos.Set(p);
36 v0->GetPPxPyPz(p[0], p[1], p[2]);
37 rcV0.P_neg.Set(p);
8f14e54c 38
a9f14204 39 v0->GetPxPyPz(p[0], p[1], p[2]);
40 Double_t v[3];
41 v0->GetXYZ(v[0], v[1], v[2]);
ca5fb6a4 42
ca5fb6a4 43
a9f14204 44 // printf(" %f %f %f / %f %f %f %i\n",p[0], p[1], p[2],
45 // v[0], v[1], v[2], v0->GetOnFlyStatus());
ca5fb6a4 46
a9f14204 47 rcV0.V_neg.Set(v); //original track vertices at dca not stored
48 rcV0.V_pos.Set(v);
49 rcV0.V_ca.Set(v);
ca5fb6a4 50
a9f14204 51 rcV0.d_label[0] = v0->GetNindex();
52 rcV0.d_label[1] = v0->GetPindex();
ca5fb6a4 53
a9f14204 54 Double_t ep = neg->GetP(), mc = neg->GetMass();
55 rcNeg.beta = ep/TMath::Sqrt(ep*ep + mc*mc);
56 ep = pos->GetP(); mc = pos->GetMass();
57 rcPos.beta = ep/TMath::Sqrt(ep*ep + mc*mc);
ca5fb6a4 58
ca5fb6a4 59
d810d0de 60 AliEveV0* myV0 = new AliEveV0(&rcNeg, &rcPos, &rcV0, rnrStyle);
a9f14204 61 char ch[50];
62 // sprintf(ch,"ESDv0%i",i);
63 // myV0->SetName(ch);
64 // myV0->SetTitle(ch);
65 myV0->SetESDIndex(i);
66 myV0->SetDaughterDCA(v0->GetDcaV0Daughters());
ca5fb6a4 67
a9f14204 68 Double_t primx = primVtx->GetXv(),
69 primy = primVtx->GetYv(),
70 primz = primVtx->GetZv();
71 myV0->SetCosPointingAngle(v0->GetV0CosineOfPointingAngle(primx,primy,primz));
ca5fb6a4 72
a9f14204 73 myV0->SetDecayLength(primVtx->GetXv(), primVtx->GetYv(), primVtx->GetZv());
ca5fb6a4 74
a9f14204 75 return myV0;
ca5fb6a4 76 } else {
77 return 0;
78 }
79
80}
81
82
d810d0de 83V0List* esd_AliEveV0(Double_t min_pt=0.1, Double_t max_pt=100)
ca5fb6a4 84{
84aff7a4 85 printf("THIS SCRIPT DOES NOT WORK.\n"
d810d0de 86 "AliEveV0 classes have been temporarily removed.\n"
84aff7a4 87 "They need to be cleaned up.\n");
88 return;
ca5fb6a4 89
d810d0de 90 AliESDEvent* esd = AliEveEventManager::AssertESD();
ca5fb6a4 91 AliESDVertex* primVertex =(AliESDVertex*) esd->GetVertex();
92
d810d0de 93 V0List* cont = new V0List("ESD v0");
ca5fb6a4 94 cont->SetMainColor(Color_t(3)); // green
84aff7a4 95 TEveTrackPropagator* rnrStyle = cont->GetPropagator();
ca5fb6a4 96 rnrStyle->SetMagField( esd->GetMagneticField() );
97
84aff7a4 98 gEve->AddElement(cont);
ca5fb6a4 99
100 Int_t count = 0;
101 //for (Int_t n=0; count<3; n++) {
102 for (Int_t n=0; n<esd->GetNumberOfV0s(); n++) {
103
104 AliESDv0 *v0 = esd->GetV0(n);
105 if (v0->GetOnFlyStatus()) continue;
106
107 Int_t negInd = v0->GetNindex();
108 Int_t posInd = v0->GetPindex();
109 AliESDtrack* negTr = esd->GetTrack(negInd);
110 AliESDtrack* posTr = esd->GetTrack(posInd);
111
d810d0de 112 AliEveV0* myV0 = esd_make_v0(rnrStyle, primVertex, negTr,posTr, v0, n);
ca5fb6a4 113 if (myV0) {
84aff7a4 114 gEve->AddElement(myV0, cont);
ca5fb6a4 115 count++;
116 }
117 }
118
119 cont->SetTitle("testV0List ");
120 cont->UpdateItems();
121
122 cont->MakeV0s();
84aff7a4 123 gEve->Redraw3D();
ca5fb6a4 124
125 return cont;
126}
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142