1 #ifndef ALIEVE_CASCADE_H
2 #define ALIEVE_CASCADE_H
4 /***********************************************************************
5 * This code defines the reconstructed cascades visualized with EVE
7 * Ludovic Gaudichet (gaudichet@to.infn.it)
8 ************************************************************************/
10 #include <Reve/PODs.h>
11 #include <Reve/RenderElement.h>
12 #include <Reve/Track.h>
14 #include <TPolyMarker3D.h>
15 #include <TPolyLine3D.h>
25 class Cascade : public Reve::RenderElement,
29 typedef std::vector<Reve::PathMark*> vpPathMark_t;
32 friend class CascadeList;
34 Cascade(const Cascade&); // Not implemented
35 Cascade& operator=(const Cascade&); // Not implemented
38 typedef std::vector<Reve::PathMark*>::iterator vpPathMark_i;
40 Reve::Vector fV_neg; // Vertex of negative track
41 Reve::Vector fP_neg; // Momentum of negative track
42 Reve::Vector fV_pos; // Vertex of positive track
43 Reve::Vector fP_pos; // Momentum of positive track
44 Reve::Vector fV_bach; // Vertex of positive track
45 Reve::Vector fP_bach; // Momentum of positive track
47 Reve::Vector fV_decay; //decay point of the cascade
48 Reve::Vector fV_birth; // Reconstructed birth point of neutral particle
50 vpPathMark_t fPathMarksNeg;
51 vpPathMark_t fPathMarksPos;
52 vpPathMark_t fPathMarksBach;
53 Reve::TrackRnrStyle *fRnrStyle;
55 TPolyLine3D fPolyLineNeg;
56 TPolyLine3D fPolyLinePos;
57 TPolyLine3D fPolyLineBach;
58 TPolyLine3D fPolyLineV0; // line of V0 travel
59 TPolyLine3D fPolyLineCas; // line of cascade travel
68 Float_t fCasCosPointingAngle;
69 Float_t fCasDecayLength;
71 static const Float_t fgkMassPion2;
72 static const Float_t fgkMassKaon2;
73 static const Float_t fgkMassProton2;
74 static const Float_t fgkMassLambda2;
78 Cascade(Reve::TrackRnrStyle* rs);
81 virtual void SetESDIndex(Int_t ind) { fESDIndex = ind;}
82 virtual void SetMainColor(Color_t col)
84 fMarkerColor = col; fMainColorPtr = &fMarkerColor;
85 fPolyLineV0.SetLineColor(fMarkerColor);
87 virtual void SetTracksColor(Color_t cNeg, Color_t cPos, Color_t cBach)
89 fPolyLineNeg.SetLineColor(cNeg); fPolyLinePos.SetLineColor(cPos);
90 fPolyLineBach.SetLineColor(cBach);
92 void SetRnrStyle(Reve::TrackRnrStyle* rs) { fRnrStyle = rs; }
94 void AddPathMarkPos(Reve::PathMark* pm) { fPathMarksPos.push_back(pm); }
95 void AddPathMarkNeg(Reve::PathMark* pm) { fPathMarksNeg.push_back(pm); }
96 void AddPathMarkBach(Reve::PathMark* pm) { fPathMarksBach.push_back(pm); }
98 virtual void PaintV0Daughters(Option_t* option="") {
99 if(fRnrSelf) {fPolyLineNeg.Paint(option);fPolyLinePos.Paint(option); } }
100 virtual void PaintBachelor(Option_t* option="") {
101 if(fRnrSelf) fPolyLineBach.Paint(option); }
102 virtual void Paint(Option_t* option="") {
103 if(fRnrSelf) TPolyMarker3D::Paint(option);}
104 virtual void PaintV0Path(Option_t* option="") {
105 if(fRnrSelf) fPolyLineV0.Paint(option);}
106 virtual void PaintCasPath(Option_t* option="") {
107 if(fRnrSelf) fPolyLineCas.Paint(option);}
109 void Reset(TPolyLine3D* polyLine);
110 void MakeTrack(vpPathMark_t& pathMark, Reve::Vector& vtx, Reve::Vector& p,
111 Int_t charge, Float_t beta, TPolyLine3D& polyLine);
116 void SetBeta(Float_t betaNeg, Float_t betaPos, Float_t betaBach);
117 void SetDCA_v0_Bach(Float_t dca) {fDCA_v0_Bach = dca;}
118 void SetCasCosPointingAngle(Float_t cos) {fCasCosPointingAngle = cos;}
119 void SetNegP(Float_t px, Float_t py, Float_t pz) {fP_neg.x = px; fP_neg.y = py; fP_neg.z = pz;}
120 void SetPosP(Float_t px, Float_t py, Float_t pz) {fP_pos.x = px; fP_pos.y = py; fP_pos.z = pz;}
121 void SetBachP(Float_t px, Float_t py, Float_t pz) {fP_bach.x = px; fP_bach.y = py; fP_bach.z = pz;}
123 void SetV0vtx(Float_t vx, Float_t vy, Float_t vz) {
124 fV_neg.x = vx; fV_neg.y = vy; fV_neg.z = vz;
125 fV_pos.x = vx; fV_pos.y = vy; fV_pos.z = vz;
127 void SetCascadeVtx(Float_t vx, Float_t vy, Float_t vz) {
128 fV_decay.x = vx; fV_decay.y = vy; fV_decay.z = vz; }
130 void SetDecayLength(Float_t primx, Float_t primy, Float_t primz);
132 Int_t GetESDIndex() const { return fESDIndex; }
133 virtual const Text_t* GetName() const { return Form("ESDcascade_%i",fESDIndex); }
134 virtual const Text_t* GetTitle() const { return Form("ESDcascade_%i",fESDIndex); }
136 Float_t GetDCA_v0_Bach() const;
137 Float_t GetCasCosPointingAngle() const;
138 Float_t GetRadius() const;
139 Float_t GetPseudoRapidity() const;
140 Float_t GetPt2() const;
141 Float_t GetPt() const;
142 Float_t GetP2() const;
143 Float_t GetMomentum() const;
144 Float_t GetPx() const;
145 Float_t GetPy() const;
146 Float_t GetPz() const;
147 Float_t GetCasAlphaArmenteros() const;
148 Float_t GetCasPtArmenteros() const;
149 Float_t GetPosP2() const;
150 Float_t GetPosP() const;
151 Float_t GetPosPt() const;
152 Float_t GetPosPseudoRapidity() const;
153 Float_t GetNegP2() const;
154 Float_t GetNegP() const;
155 Float_t GetNegPt() const;
156 Float_t GetNegPseudoRapidity() const;
157 Float_t GetBachP2() const;
158 Float_t GetBachP() const;
159 Float_t GetBachPt() const;
160 Float_t GetBachPseudoRapidity() const;
162 Float_t GetV0P2() const;
163 Float_t GetLambdaE() const;
164 Float_t GetXiE() const;
165 Float_t GetOmegaE() const;
166 Float_t GetXiMass() const;
167 Float_t GetAntiXiMass() const;
168 Float_t GetOmegaMass() const;
169 Float_t GetAntiOmegaMass() const;
171 ClassDef(Cascade, 1); // Visual representation of a cascade.
172 }; // endclass Cascade
176 //______________________________________________________________________
178 inline void Cascade::SetBeta(Float_t betaNeg, Float_t betaPos, Float_t betaBach) {
181 fBeta_bach = betaBach;
185 //______________________________________________________________________
187 inline Float_t Cascade::GetV0P2() const {
188 Float_t px = fP_neg.x + fP_pos.x, py = fP_neg.y + fP_pos.y,
189 pz = fP_neg.z+fP_pos.z;
190 return px*px + py*py + pz*pz;
194 inline Float_t Cascade::GetLambdaE() const {
195 return sqrt(fgkMassLambda2+GetV0P2());
198 inline Float_t Cascade::GetXiE() const {
199 Float_t e = GetLambdaE() +
200 sqrt(fgkMassPion2 + fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y +
201 fP_bach.z*fP_bach.z);
205 inline Float_t Cascade::GetOmegaE() const {
206 Float_t e = GetLambdaE() +
207 sqrt(fgkMassKaon2 + fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y +
208 fP_bach.z*fP_bach.z);
212 inline Float_t Cascade::GetXiMass() const {
213 Float_t e = GetXiE();
214 return sqrt(e*e - GetP2());
217 inline Float_t Cascade::GetAntiXiMass() const { return GetXiMass();}
219 inline Float_t Cascade::GetOmegaMass() const {
220 Float_t e = GetOmegaE();
221 return sqrt(e*e - GetP2());
224 inline Float_t Cascade::GetAntiOmegaMass() const { return GetOmegaMass();}
227 //______________________________________________________________________
229 inline Float_t Cascade::GetDCA_v0_Bach() const {
233 inline Float_t Cascade::GetCasCosPointingAngle() const {
234 return fCasCosPointingAngle;
237 inline Float_t Cascade::GetRadius() const {
238 return sqrt(fV_birth.x*fV_birth.x + fV_birth.y*fV_birth.y);
241 //inline Float_t Cascade::GetDecayLength() const {
242 //return fDecayLength;
245 inline Float_t Cascade::GetPseudoRapidity() const {
246 Float_t theta = acos( GetPz()/GetMomentum() );
247 return ( -log(tan(theta/2.)) );
251 //______________________________________________________________________
252 inline Float_t Cascade::GetPt2() const {
253 Float_t px = GetPx(), py = GetPy();
254 return (px*px+py*py);
257 inline Float_t Cascade::GetP2() const {
259 Float_t px = GetPx(), py = GetPy(), pz = GetPz();
260 return (px*px+py*py+pz*pz);
263 inline Float_t Cascade::GetPt() const {
264 return sqrt(GetPt2());
267 inline Float_t Cascade::GetMomentum() const {
268 return sqrt(GetP2());
271 inline Float_t Cascade::GetPx() const {
272 return (fP_neg.x + fP_pos.x + fP_bach.x);
275 inline Float_t Cascade::GetPy() const {
276 return (fP_neg.y + fP_pos.y + fP_bach.y);
279 inline Float_t Cascade::GetPz() const {
280 return (fP_neg.z + fP_pos.z + fP_bach.z);
283 //______________________________________________________________________
285 inline Float_t Cascade::GetPosP2() const {
286 return (fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y + fP_pos.z*fP_pos.z);
289 inline Float_t Cascade::GetPosP() const {
290 return sqrt(GetPosP2());
293 inline Float_t Cascade::GetPosPt() const {
294 return sqrt(fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y);
297 inline Float_t Cascade::GetPosPseudoRapidity() const {
298 Float_t theta = acos( fP_pos.z/GetPosP() );
299 return ( -log(tan(theta/2.)) );
302 //______________________________________________________________________
303 inline Float_t Cascade::GetNegP2() const {
304 return (fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y + fP_neg.z*fP_neg.z);
307 inline Float_t Cascade::GetNegP() const {
308 return sqrt(GetNegP2());
311 inline Float_t Cascade::GetNegPt() const {
312 return sqrt(fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y);
315 inline Float_t Cascade::GetNegPseudoRapidity() const {
316 Float_t theta = acos( fP_neg.z/GetNegP() );
317 return ( -log(tan(theta/2.)) );
321 //______________________________________________________________________
322 inline Float_t Cascade::GetBachP2() const {
323 return (fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y + fP_bach.z*fP_bach.z);
326 inline Float_t Cascade::GetBachP() const {
327 return sqrt(GetBachP2());
330 inline Float_t Cascade::GetBachPt() const {
331 return sqrt(fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y);
334 inline Float_t Cascade::GetBachPseudoRapidity() const {
335 Float_t theta = acos( fP_bach.z/GetBachP() );
336 return ( -log(tan(theta/2.)) );
340 /***********************************************************************
344 ************************************************************************/
346 class CascadeList : public Reve::RenderElementList
348 CascadeList(const CascadeList&); // Not implemented
349 CascadeList& operator=(const CascadeList&); // Not implemented
357 Reve::TrackRnrStyle *fRnrStyle;
360 Bool_t fRnrV0Daughters;
370 static const Int_t fgkNcutVar = 14;
371 TH1F *fHist[fgkNcutVar];
372 Float_t fMin[fgkNcutVar];
373 Float_t fMax[fgkNcutVar];
375 static const Int_t fgkNcutVar2D = 1;
376 TH2F *fHist2D[fgkNcutVar2D];
377 Float_t fMinX[fgkNcutVar2D];
378 Float_t fMinY[fgkNcutVar2D];
379 Float_t fMaxX[fgkNcutVar2D];
380 Float_t fMaxY[fgkNcutVar2D];
383 CascadeList(Reve::TrackRnrStyle* rs=0);
384 CascadeList(const Text_t* name, Reve::TrackRnrStyle* rs=0);
386 virtual const Text_t* GetTitle() const { return fTitle; }
387 virtual void SetTitle(const Text_t* t) { fTitle = t; }
388 virtual void SetTracksColor(Color_t cNeg, Color_t cPos, Color_t cBach)
389 { fNegColor = cNeg; fPosColor = cPos; fBachColor = cBach; }
391 virtual Bool_t CanEditMainColor() { return kTRUE; }
393 virtual void Paint(Option_t* option="");
395 void SetRnrStyle(Reve::TrackRnrStyle* rst) { fRnrStyle= rst; }
396 Reve::TrackRnrStyle* GetRnrStyle() { return fRnrStyle; }
398 Bool_t GetRnrCasVtx() const { return fRnrCasVtx; }
399 Bool_t GetRnrCasPath() const { return fRnrCasPath; }
400 Bool_t GetRnrV0vtx() const { return fRnrV0vtx; }
401 Bool_t GetRnrV0path() const { return fRnrV0path; }
402 Bool_t GetRnrV0Daughters() const { return fRnrV0Daughters; }
403 Bool_t GetRnrBachelor() const { return fRnrBach; }
405 void SetRnrV0vtx(Bool_t);
406 void SetRnrV0path(Bool_t);
407 void SetRnrV0Daughters(Bool_t);
408 void SetRnrBachelor(Bool_t);
409 void SetRnrCasPath(Bool_t);
410 void SetRnrCasVtx(Bool_t);
411 void SetMin(Int_t i, Float_t val) {
412 if ((i>=0)&&(i<fgkNcutVar)) fMin[i]=val;}
413 void SetMax(Int_t i, Float_t val) {
414 if ((i>=0)&&(i<fgkNcutVar)) fMax[i]=val;}
418 TH1F* GetHist(Int_t i) {
419 if ((i>=0)&&(i<fgkNcutVar)) return fHist[i]; else return 0;}
420 TH2F* GetHist2D(Int_t i) {
421 if ((i>=0)&&(i<fgkNcutVar2D)) return fHist2D[i]; else return 0;}
422 Float_t GetMin(Int_t i) {
423 if ((i>=0)&&(i<fgkNcutVar)) return fMin[i]; else return 0;}
424 Float_t GetMax(Int_t i) {
425 if ((i>=0)&&(i<fgkNcutVar)) return fMax[i]; else return 0;}
426 void GetCasIndexRange(Int_t &imin, Int_t &imax);
428 void AdjustHist(Int_t iHist);
429 void UnFill(Cascade* cas);
430 void Filter(Cascade* cas);
433 void XiMassFilter(Float_t min, Float_t max);
434 void OmegaMassFilter(Float_t min, Float_t max);
435 void IndexFilter(Float_t min, Float_t max);
436 void CosPointingFilter(Float_t min, Float_t max);
437 void BachV0DCAFilter(Float_t min, Float_t max);
438 void RadiusFilter(Float_t min, Float_t max);
439 void PtFilter(Float_t min, Float_t max);
440 void PseudoRapFilter(Float_t min, Float_t max);
441 void NegPtFilter(Float_t min, Float_t max);
442 void NegEtaFilter(Float_t min, Float_t max);
443 void PosPtFilter(Float_t min, Float_t max);
444 void PosEtaFilter(Float_t min, Float_t max);
445 void BachPtFilter(Float_t min, Float_t max);
446 void BachEtaFilter(Float_t min, Float_t max);
448 //--------------------------------
450 ClassDef(CascadeList, 1); // A list of Cascade objects.
453 } // namespace Alieve