ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitEdm/DataFormats/interface/DecayPart.h
Revision: 1.13
Committed: Fri Mar 20 17:13:33 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, Mit_010, Mit_009c, Mit_009b, Mit_009a, Mit_009, Mit_008
Changes since 1.12: +39 -39 lines
Log Message:
Cleanup

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: DecayPart.h,v 1.12 2008/10/03 23:53:46 loizides Exp $
3 //
4 // DecayPart
5 //
6 // Implementation of a decay particle class for use in vertexing based analyses. The contents of a
7 // decay particle is basically its link to the particles it decays to. This will be hopefully at
8 // some point a useful and good implementation. See the double dispatcher doAction(MyAction).
9 //
10 // Authors: C.Paus, J.Bendavid
11 //--------------------------------------------------------------------------------------------------
12
13 #ifndef MITEDM_DATAFORMATS_DECAYPART_H
14 #define MITEDM_DATAFORMATS_DECAYPART_H
15
16 #include <iostream>
17 #include <vector>
18 #include "MitEdm/DataFormats/interface/Types.h"
19 #include "MitEdm/DataFormats/interface/BasePart.h"
20 #include "MitEdm/DataFormats/interface/BasePartFwd.h"
21 #include "MitEdm/DataFormats/interface/StableData.h"
22 #include "MitEdm/DataFormats/interface/DecayData.h"
23
24 namespace mitedm
25 {
26 class BasePartAction;
27
28 class DecayPart : public BasePart
29 {
30
31 public:
32 enum DecayType {Fast, Slow};
33
34 DecayPart();
35 DecayPart(int pid);
36 DecayPart(int pid, DecayType dType);
37
38 // Accessors
39 DecayType decayType () const { return decayType_; }
40
41 // Override recursion helper method
42 virtual void doAction (BasePartAction *action) const;
43 virtual double charge () const { return 0.; }
44
45 // Extend the particle contents
46 void addDecayChild (DecayData &decay) { decayChildren_.push_back(decay); }
47 void addStableChild (StableData &stable) { stableChildren_.push_back(stable); }
48
49 const BasePartPtr getDaughterPtr(int i) const { return getDaughterData(i).originalPtr(); }
50
51 const DaughterData &getDaughterData(int i) const;
52 const DecayData &getDecayData (int i) const { return decayChildren_.at(i); }
53 const StableData &getStableData (int i) const { return stableChildren_.at(i); }
54 int nDecayChild () const { return decayChildren_.size(); }
55 int nStableChild () const { return stableChildren_.size(); }
56 int nChild () const { return nStableChild() + nDecayChild(); }
57
58 virtual void print (std::ostream& os = std::cout) const;
59
60 //----------------------------------------------------------------------------------------------
61 // Accessors/Setter: Base Vertex fit info from this level
62 //----------------------------------------------------------------------------------------------
63 // Fit quality (does not belong here)
64 double prob() const { return prob_; }
65 double chi2() const { return chi2_; }
66 int ndof() const { return ndof_; }
67 void setProb(double prob) { prob_ = prob;}
68 void setChi2(double chi2) { chi2_ = chi2;}
69 void setNdof(int ndof) { ndof_ = ndof;}
70
71 // Fitted Mass
72 double fittedMass() const { return fittedMass_; }
73 void setFittedMass(double fittedMass) { fittedMass_ = fittedMass;}
74 // Fitted Mass Error
75 double fittedMassError() const { return fittedMassError_; }
76 void setFittedMassError(double fittedMassError) { fittedMassError_ = fittedMassError;}
77 // Lxy
78 double lxy() const { return lxy_; }
79 void setLxy(double lxy) { lxy_ = lxy;}
80 // Lxy Error
81 double lxyError() const { return lxyError_; }
82 void setLxyError(double lxyError) { lxyError_ = lxyError;}
83 // LxyToPv (length to primary vertex)
84 double lxyToPv() const { return lxyToPv_; }
85 void setLxyToPv(double lxyToPv) { lxyToPv_ = lxyToPv;}
86 // LxyToPv Error
87 double lxyToPvError() const { return lxyToPvError_; }
88 void setLxyToPvError(double lxyToPvError) { lxyToPvError_ = lxyToPvError;}
89 // Dxy (two dimensional impact parameter)
90 double dxy() const { return dxy_; }
91 void setDxy(double dxy) { dxy_ = dxy;}
92 // Dxy Error
93 double dxyError() const { return dxyError_; }
94 void setDxyError(double dxyError) { dxyError_ = dxyError;}
95 // DxyToPv (two dimensional impact parameter with respect to primary vertex)
96 double dxyToPv() const { return dxyToPv_; }
97 void setDxyToPv(double dxyToPv) { dxyToPv_ = dxyToPv;}
98 // DlxyToPv Error
99 double dxyToPvError() const { return dxyToPvError_; }
100 void setDxyToPvError(double dxyToPvError) { dxyToPvError_ = dxyToPvError;}
101 // Lz
102 double lz() const { return lz_; }
103 void setLz(double lz) { lz_ = lz;}
104 // Lz Error
105 double lzError() const { return lzError_; }
106 void setLzError(double lzError) { lzError_ = lzError;}
107 // LzToPv (length to primary vertex)
108 double lzToPv() const { return lzToPv_; }
109 void setLzToPv(double lzToPv) { lzToPv_ = lzToPv;}
110 // LzToPv Error
111 double lzToPvError() const { return lzToPvError_; }
112 void setLzToPvError(double lzToPvError) { lzToPvError_ = lzToPvError;}
113 // CTau
114 double cTau() const { return cTau_; }
115 void setCTau(double cTau) { cTau_ = cTau;}
116 // CTau Error
117 double cTauError() const { return cTauError_; }
118 void setCTauError(double cTauError) { cTauError_ = cTauError;}
119 // Pt
120 double pt() const { return pt_; }
121 void setPt(double pt) { pt_ = pt;}
122 // Pt Error
123 double ptError() const { return ptError_; }
124 void setPtError(double ptError) { ptError_ = ptError;}
125 // Four momentum
126 const FourVector &fourMomentum() const { return fourMomentum_; }
127 void setFourMomentum(const FourVector &fourMomentum)
128 { fourMomentum_ = fourMomentum;}
129 //----------------------------------------------------------------------------------------------
130 // Accessors/Setter: Extended Vertex fit info from this level
131 //----------------------------------------------------------------------------------------------
132 // Position
133 const ThreeVector &position() const { return position_; }
134 void setPosition(const ThreeVector &position) { position_ = position; }
135 // Error
136 const ThreeSymMatrix &error() const { return error_; }
137 void setError(const ThreeSymMatrix &error) { error_ = error; }
138 // Big 7x7 Error Matrix
139 const SevenSymMatrix &bigError() const { return bigError_; }
140 void setBigError(const SevenSymMatrix &bigError) { bigError_ = bigError; }
141
142 VertexPtr primaryVertex() const { return primaryVertex_; }
143 void setPrimaryVertex(VertexPtr ptr) { primaryVertex_ = ptr; }
144
145 private:
146 // Decay type (either fast of slow)
147 DecayType decayType_; //type of decay
148 // Fit quality
149 double prob_; //fit probability
150 double chi2_; //chi2 value
151 int ndof_; //degrees of freedom
152 // Base vertex fit info
153 double fittedMass_; //mass from fit
154 double fittedMassError_; //mass error from fit
155 double normalizedMass_; //normalized mass
156 double lxy_; //lxy
157 double lxyError_; //lxy error
158 double lxyToPv_; //lxy wrt primary vertex
159 double lxyToPvError_; //error on lxy wrt primary vertex
160 double dxy_; //dxy
161 double dxyError_; //dxy error
162 double dxyToPv_; //dxy wrt primary vertex
163 double dxyToPvError_; //error on dxy wrt primary vertex
164 double lz_; //lz
165 double lzError_; //lz error
166 double lzToPv_; //lz wrt primary vertex
167 double lzToPvError_; //error on lz wrt primary vertex
168 double cTau_; //ctau
169 double cTauError_; //error on ctau
170 double pt_; //pt
171 double ptError_; //error on pt
172 FourVector fourMomentum_; //momentum at vertex
173 // Extended vertex fit info
174 ThreeVector position_; //vertex position
175 ThreeSymMatrix error_; //error matrix
176 SevenSymMatrix bigError_; //error matrix
177
178 VertexPtr primaryVertex_; //primary vertex
179
180 // Contents of the decay
181 std::vector<StableData> stableChildren_; //stable daughter
182 std::vector<DecayData> decayChildren_; //decay children
183 };
184 }
185
186 //--------------------------------------------------------------------------------------------------
187 inline const mitedm::DaughterData &mitedm::DecayPart::getDaughterData(int i) const
188 {
189 if (i < nStableChild())
190 return getStableData(i);
191 else
192 return getDecayData(i-nStableChild());
193 }
194 #endif