ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/DecayParticle.h
Revision: 1.13
Committed: Tue Sep 30 12:53:58 2008 UTC (16 years, 7 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_004
Changes since 1.12: +72 -110 lines
Log Message:
updated DecayParticle to use proper decay parameters and StableData and DecayData classes

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.13 // $Id: DecayParticle.h,v 1.12 2008/09/27 06:10:09 loizides Exp $
3 loizides 1.1 //
4     // Decay Particle
5     //
6 bendavid 1.7 // Decay Particle for use in vertexing based analyses.
7 bendavid 1.10 // Stores vertex fit information (including four momentum) and links to daughters.
8 loizides 1.1 //
9 bendavid 1.10 // Note that Charge is still computed as a recursive loop over daughters, as inherited from
10     // CompositeParticle, but momentum is returned from the internally stored four vector
11     //
12     // Authors: Ch.Paus, J.Bendavid...
13 loizides 1.1 //--------------------------------------------------------------------------------------------------
14    
15     #ifndef DATATREE_DECAYPARTICLE_H
16     #define DATATREE_DECAYPARTICLE_H
17    
18 bendavid 1.7 #include <TDatabasePDG.h>
19     #include <TParticlePDG.h>
20 loizides 1.1 #include "MitAna/DataTree/interface/CompositeParticle.h"
21 bendavid 1.11 #include "MitAna/DataTree/interface/DaughterData.h"
22 bendavid 1.13 #include "MitAna/DataTree/interface/Vertex.h"
23     #include "MitAna/DataCont/interface/RefArray.h"
24 bendavid 1.7 #include "MitAna/DataTree/interface/Types.h"
25 loizides 1.1
26     namespace mithep
27     {
28 bendavid 1.13 class DecayParticle : public Particle
29 loizides 1.1 {
30     public:
31 loizides 1.2 DecayParticle() {}
32 bendavid 1.13 DecayParticle(Int_t absPdgId) :
33 bendavid 1.7 fAbsPdgId(absPdgId),
34     fChi2(0),
35     fNdof(0),
36 bendavid 1.13 fMassError(0),
37 bendavid 1.7 fLxy(0),
38     fLxyError(0),
39     fDxy(0),
40     fDxyError(0),
41     fLz(0),
42 bendavid 1.13 fLzError(0) {}
43 loizides 1.1 ~DecayParticle() {}
44 bendavid 1.7
45 loizides 1.12 UInt_t AbsPdgId() const { return fAbsPdgId; }
46     void SetAbsPdgId(UInt_t apid) { fAbsPdgId=apid; }
47 bendavid 1.7 TParticlePDG *ParticlePdgEntry() const;
48 loizides 1.12 Double_t PdgMass() const;
49     Double_t Prob() const { return TMath::Prob(fChi2,fNdof); }
50     Double_t Chi2() const { return fChi2; }
51     Int_t Ndof() const { return fNdof; }
52     void SetChi2(Double_t chi2) { fChi2 = chi2;}
53     void SetNdof(Int_t ndof) { fNdof = ndof;}
54     using TObject::Error;
55 bendavid 1.7
56     // Fitted Mass Error
57 bendavid 1.13 Double_t MassError() const { return fMassError; }
58     void SetMassError(Double_t massError) { fMassError = massError;}
59 bendavid 1.7 // Lxy
60 loizides 1.12 Double_t Lxy() const { return fLxy; }
61 bendavid 1.7 void SetLxy(Double_t lxy) { fLxy = lxy;}
62     // Lxy Error
63 loizides 1.12 Double_t LxyError() const { return fLxyError; }
64 bendavid 1.7 void SetLxyError(Double_t lxyError) { fLxyError = lxyError;}
65     // Dxy (two dimensional impact parameter)
66 loizides 1.12 Double_t Dxy() const { return fDxy; }
67 bendavid 1.7 void SetDxy(Double_t dxy) { fDxy = dxy;}
68     // Dxy Error
69 loizides 1.12 Double_t DxyError() const { return fDxyError; }
70 bendavid 1.7 void SetDxyError(Double_t dxyError) { fDxyError = dxyError;}
71     // Lz
72 loizides 1.12 Double_t Lz() const { return fLz; }
73 bendavid 1.7 void SetLz(Double_t lz) { fLz = lz;}
74     // Lz Error
75 loizides 1.12 Double_t LzError() const { return fLzError; }
76 bendavid 1.7 void SetLzError(Double_t lzError) { fLzError = lzError;}
77     //----------------------------------------------------------------------------------------------
78     // Accessors/Setter: Extended Vertex fit info from this level
79 bendavid 1.13 //----------------------------------------------------------------------------------------------
80    
81     Double_t Charge() const;
82 bendavid 1.7
83 bendavid 1.10 //Momentum Accessors/setter
84 bendavid 1.13 FourVector Mom() const { return fMomentum; }
85     void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
86     void SetMom(const FourVector &p) { fMomentum = p; }
87 bendavid 1.11
88 bendavid 1.13 UInt_t NDaughters() const { return fDaughterData.Entries(); }
89     const Particle *Daughter(UInt_t i) const { return DaughterDat(i)->Original(); }
90     const DaughterData *DaughterDat(UInt_t i) const { return fDaughterData.At(i); }
91 bendavid 1.11
92 bendavid 1.13 void AddDaughterData(DaughterData *ddata) { fDaughterData.Add(ddata); }
93    
94     const ThreeVector Position() const;
95     const ThreeVector RelativePosition() const;
96    
97     const Vertex *PriVertex() const;
98     void SetPriVertex(Vertex *v) { fPriVertex = v; }
99 bendavid 1.11
100 loizides 1.1 protected:
101 bendavid 1.13 UInt_t fAbsPdgId;
102 bendavid 1.7 // Fit quality
103 bendavid 1.13 Double_t fChi2;
104     Int_t fNdof;
105 bendavid 1.7 // Base vertex fit info
106 bendavid 1.13 Double_t fMassError;
107     Double_t fLxy;
108     Double_t fLxyError;
109     Double_t fDxy;
110     Double_t fDxyError;
111     Double_t fLz;
112     Double_t fLzError;
113 bendavid 1.7 // Extended vertex fit info
114 bendavid 1.13 FourVector fMomentum; //momentum fourvector
115     RefArray<DaughterData> fDaughterData; //||momentum of daughters at vertex
116     TRef fPriVertex; //reference to primary vertex
117 loizides 1.1
118 paus 1.6 ClassDef(DecayParticle, 1) // Decay particle class
119 loizides 1.1 };
120     }
121 bendavid 1.7
122     //--------------------------------------------------------------------------------------------------
123     inline TParticlePDG *mithep::DecayParticle::ParticlePdgEntry() const
124     {
125     // Return entry to pdg database for the PARTICLE.
126    
127     return TDatabasePDG::Instance()->GetParticle(fAbsPdgId);
128     }
129 bendavid 1.8
130     //--------------------------------------------------------------------------------------------------
131     inline void mithep::DecayParticle::SetMom(Double_t px, Double_t py, Double_t pz, Double_t e)
132     {
133     // Set four vector.
134    
135 bendavid 1.11 fMomentum.SetXYZT(px,py,pz,e);
136     }
137    
138     //--------------------------------------------------------------------------------------------------
139 bendavid 1.13 inline const mithep::ThreeVector mithep::DecayParticle::Position() const
140     {
141     // Return absolute position of decay
142    
143     const mithep::Vertex *pv = PriVertex();
144    
145     if (pv)
146     return ( pv->Position() + RelativePosition() );
147     else
148     return RelativePosition();
149    
150     }
151    
152     //--------------------------------------------------------------------------------------------------
153     inline const mithep::ThreeVector mithep::DecayParticle::RelativePosition() const
154     {
155     //compute the position vector of the decay vertex relative to the primary vertex
156    
157     mithep::ThreeVector dz(0,0,fLz*TMath::Abs(fMomentum.Pz())/fMomentum.Pz());
158    
159     mithep::ThreeVector momPerp(fMomentum.Px(),fMomentum.Py(),0);
160     mithep::ThreeVector zHat(0,0,1.0);
161    
162     mithep::ThreeVector dxy = -momPerp.Cross(zHat)*fDxy/momPerp.R();
163     mithep::ThreeVector dlxy = momPerp*fLxy/momPerp.R();
164    
165     return (dxy+dlxy+dz);
166     }
167    
168     //--------------------------------------------------------------------------------------------------
169     inline const mithep::Vertex *mithep::DecayParticle::PriVertex() const
170     {
171     // Return primary vertex
172 bendavid 1.11
173 bendavid 1.13 return static_cast<const Vertex*>(fPriVertex.GetObject());
174 bendavid 1.8 }
175 loizides 1.1 #endif