ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/DecayParticle.h
Revision: 1.11
Committed: Fri Sep 19 11:58:41 2008 UTC (16 years, 7 months ago) by bendavid
Content type: text/plain
Branch: MAIN
Changes since 1.10: +22 -3 lines
Log Message:
Added DaughterData to DecayParticle

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.11 // $Id: DecayParticle.h,v 1.10 2008/08/01 11:19:04 bendavid 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     #include "MitAna/DataCont/interface/StackArray.h"
23 bendavid 1.7 #include "MitAna/DataTree/interface/Types.h"
24 loizides 1.1
25     namespace mithep
26     {
27     class DecayParticle : public CompositeParticle
28     {
29     public:
30 bendavid 1.7 // Decay type
31     enum DecayType {Fast, Slow};
32    
33 loizides 1.2 DecayParticle() {}
34 bendavid 1.7 DecayParticle(Int_t absPdgId, DecayType decayType) :
35     fAbsPdgId(absPdgId),
36     fDecayType(decayType),
37     fChi2(0),
38     fNdof(0),
39     fFittedMass(0),
40     fFittedMassError(0),
41     fNormalizedMass(0),
42     fLxy(0),
43     fLxyError(0),
44     fLxyToPv(0),
45     fLxyToPvError(0),
46     fDxy(0),
47     fDxyError(0),
48     fDxyToPv(0),
49     fDxyToPvError(0),
50     fLz(0),
51     fLzError(0),
52     fLzToPv(0),
53     fLzToPvError(0),
54     fCTau(0),
55     fCTauError(0),
56     fPt(0),
57     fPtError(0),
58     fPosition(0,0,0) {}
59 loizides 1.1 ~DecayParticle() {}
60 bendavid 1.7
61     UInt_t AbsPdgId() const { return fAbsPdgId; }
62     void SetAbsPdgId(UInt_t absPdgId) { fAbsPdgId=absPdgId; }
63     TParticlePDG *ParticlePdgEntry() const;
64    
65     Double_t PdgMass() const;
66    
67     Double_t Prob() const { return TMath::Prob(fChi2,fNdof); }
68     Double_t Chi2() const { return fChi2; }
69     Int_t Ndof() const { return fNdof; }
70     void SetChi2(Double_t chi2) { fChi2 = chi2;}
71     void SetNdof(Int_t ndof) { fNdof = ndof;}
72    
73     // Fitted Mass
74     Double_t FittedMass() const { return fFittedMass; }
75     void SetFittedMass(Double_t fittedMass) { fFittedMass = fittedMass;}
76     // Fitted Mass Error
77     Double_t FittedMassError() const { return fFittedMassError; }
78     void SetFittedMassError(Double_t fittedMassError) { fFittedMassError = fittedMassError;}
79     // Lxy
80     Double_t Lxy() const { return fLxy; }
81     void SetLxy(Double_t lxy) { fLxy = lxy;}
82     // Lxy Error
83     Double_t LxyError() const { return fLxyError; }
84     void SetLxyError(Double_t lxyError) { fLxyError = lxyError;}
85     // LxyToPv (length to primary vertex)
86     Double_t LxyToPv() const { return fLxyToPv; }
87     void SetLxyToPv(Double_t lxyToPv) { fLxyToPv = lxyToPv;}
88     // LxyToPv Error
89     Double_t LxyToPvError() const { return fLxyToPvError; }
90     void SetLxyToPvError(Double_t lxyToPvError) { fLxyToPvError = lxyToPvError;}
91     // Dxy (two dimensional impact parameter)
92     Double_t Dxy() const { return fDxy; }
93     void SetDxy(Double_t dxy) { fDxy = dxy;}
94     // Dxy Error
95     Double_t DxyError() const { return fDxyError; }
96     void SetDxyError(Double_t dxyError) { fDxyError = dxyError;}
97     // DxyToPv (two dimensional impact parameter with respect to primary vertex)
98     Double_t DxyToPv() const { return fDxyToPv; }
99     void SetDxyToPv(Double_t dxyToPv) { fDxyToPv = dxyToPv;}
100     // DlxyToPv Error
101     Double_t DxyToPvError() const { return fDxyToPvError; }
102     void SetDxyToPvError(Double_t dxyToPvError) { fDxyToPvError = dxyToPvError;}
103     // Lz
104     Double_t Lz() const { return fLz; }
105     void SetLz(Double_t lz) { fLz = lz;}
106     // Lz Error
107     Double_t LzError() const { return fLzError; }
108     void SetLzError(Double_t lzError) { fLzError = lzError;}
109     // LzToPv (length to primary vertex)
110     Double_t LzToPv() const { return fLzToPv; }
111     void SetLzToPv(Double_t lzToPv) { fLzToPv = lzToPv;}
112     // LzToPv Error
113     Double_t LzToPvError() const { return fLzToPvError; }
114     void SetLzToPvError(Double_t lzToPvError) { fLzToPvError = lzToPvError;}
115     // CTau
116     Double_t CTau() const { return fCTau; }
117     void SetCTau(Double_t cTau) { fCTau = cTau;}
118     // CTau Error
119     Double_t CTauError() const { return fCTauError; }
120     void SetCTauError(Double_t cTauError) { fCTauError = cTauError;}
121     // Pt
122     Double_t Pt() const { return fPt; }
123     void SetPt(Double_t pt) { fPt = pt;}
124     // Pt Error
125     Double_t PtError() const { return fPtError; }
126     void SetPtError(Double_t ptError) { fPtError = ptError;}
127     //----------------------------------------------------------------------------------------------
128     // Accessors/Setter: Extended Vertex fit info from this level
129     //----------------------------------------------------------------------------------------------
130     // Position
131 bendavid 1.9 const ThreeVector &Position() const { return fPosition; }
132     void SetPosition(const ThreeVector &position) { fPosition = position; }
133 bendavid 1.7 // Error
134 bendavid 1.9 const ThreeSymMatrix &Error() const { return fError; }
135     void SetError(const ThreeSymMatrix &error) { fError = error; }
136 bendavid 1.7 // Big 7x7 Error Matrix
137 bendavid 1.9 const SevenSymMatrix &BigError() const { return fBigError; }
138     void SetBigError(const SevenSymMatrix &bigError) { fBigError = bigError; }
139 bendavid 1.7 // void setBigError(const SevenMatrix &bigError) { fBigError = bigError; }
140    
141 bendavid 1.10 //Momentum Accessors/setter
142 bendavid 1.8 FourVector Mom() const { return fMomentum; }
143 bendavid 1.9 void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
144     void SetMom(const FourVector &p) { fMomentum = p; }
145 bendavid 1.11
146     const FourVector& DaughterMom(UInt_t i) const { return fDaughterData.At(i)->Mom(); }
147     const DaughterData& DaughterDat(UInt_t i) const { return *fDaughterData.At(i); }
148    
149     void AddDaughter(Particle *p, const DaughterData &ddata = DaughterData());
150    
151 loizides 1.1 protected:
152 bendavid 1.11 void AddDaughterData(const DaughterData &ddata) { fDaughterData.AddCopy(ddata); }
153    
154 bendavid 1.7 UInt_t fAbsPdgId;
155     DecayType fDecayType; // Decay type (either fast of slow)
156     // Fit quality
157     Double_t fChi2;
158     Int_t fNdof;
159     // Base vertex fit info
160     Double_t fFittedMass;
161     Double_t fFittedMassError;
162     Double_t fNormalizedMass;
163     Double_t fLxy;
164     Double_t fLxyError;
165     Double_t fLxyToPv;
166     Double_t fLxyToPvError;
167     Double_t fDxy;
168     Double_t fDxyError;
169     Double_t fDxyToPv;
170     Double_t fDxyToPvError;
171     Double_t fLz;
172     Double_t fLzError;
173     Double_t fLzToPv;
174     Double_t fLzToPvError;
175     Double_t fCTau;
176     Double_t fCTauError;
177     Double_t fPt;
178     Double_t fPtError;
179     // Extended vertex fit info
180     ThreeVector fPosition;
181     ThreeSymMatrix fError;
182     SevenSymMatrix fBigError;
183 bendavid 1.8 // momentum
184 bendavid 1.10 FourVector fMomentum; //momentum fourvector
185 bendavid 1.11 StackArray<DaughterData,32> fDaughterData; //||momentum of daughters at vertex
186 loizides 1.1
187 paus 1.6 ClassDef(DecayParticle, 1) // Decay particle class
188 loizides 1.1 };
189     }
190 bendavid 1.7
191     //--------------------------------------------------------------------------------------------------
192     inline TParticlePDG *mithep::DecayParticle::ParticlePdgEntry() const
193     {
194     // Return entry to pdg database for the PARTICLE.
195    
196     return TDatabasePDG::Instance()->GetParticle(fAbsPdgId);
197     }
198 bendavid 1.8
199     //--------------------------------------------------------------------------------------------------
200     inline void mithep::DecayParticle::SetMom(Double_t px, Double_t py, Double_t pz, Double_t e)
201     {
202     // Set four vector.
203    
204 bendavid 1.11 fMomentum.SetXYZT(px,py,pz,e);
205     }
206    
207     //--------------------------------------------------------------------------------------------------
208     inline void mithep::DecayParticle::AddDaughter(Particle *p, const DaughterData &ddata)
209     {
210     // Add daughter and associated fourvector
211    
212     CompositeParticle::AddDaughter(p);
213     AddDaughterData(ddata);
214 bendavid 1.8 }
215 loizides 1.1 #endif