1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id: DecayPart.h,v 1.13 2009/03/20 17:13:33 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 |
const reco::HitPattern &sharedHits() const { return sharedHits_; }
|
146 |
void setSharedHits(const reco::HitPattern &hits) { sharedHits_=hits; }
|
147 |
|
148 |
private:
|
149 |
// Decay type (either fast of slow)
|
150 |
DecayType decayType_; //type of decay
|
151 |
// Fit quality
|
152 |
double prob_; //fit probability
|
153 |
double chi2_; //chi2 value
|
154 |
int ndof_; //degrees of freedom
|
155 |
// Base vertex fit info
|
156 |
double fittedMass_; //mass from fit
|
157 |
double fittedMassError_; //mass error from fit
|
158 |
double normalizedMass_; //normalized mass
|
159 |
double lxy_; //lxy
|
160 |
double lxyError_; //lxy error
|
161 |
double lxyToPv_; //lxy wrt primary vertex
|
162 |
double lxyToPvError_; //error on lxy wrt primary vertex
|
163 |
double dxy_; //dxy
|
164 |
double dxyError_; //dxy error
|
165 |
double dxyToPv_; //dxy wrt primary vertex
|
166 |
double dxyToPvError_; //error on dxy wrt primary vertex
|
167 |
double lz_; //lz
|
168 |
double lzError_; //lz error
|
169 |
double lzToPv_; //lz wrt primary vertex
|
170 |
double lzToPvError_; //error on lz wrt primary vertex
|
171 |
double cTau_; //ctau
|
172 |
double cTauError_; //error on ctau
|
173 |
double pt_; //pt
|
174 |
double ptError_; //error on pt
|
175 |
FourVector fourMomentum_; //momentum at vertex
|
176 |
// Extended vertex fit info
|
177 |
ThreeVector position_; //vertex position
|
178 |
ThreeSymMatrix error_; //error matrix
|
179 |
SevenSymMatrix bigError_; //error matrix
|
180 |
|
181 |
reco::HitPattern sharedHits_; //hit pattern of daughter hits with shared clusters
|
182 |
|
183 |
VertexPtr primaryVertex_; //primary vertex
|
184 |
|
185 |
// Contents of the decay
|
186 |
std::vector<StableData> stableChildren_; //stable daughter
|
187 |
std::vector<DecayData> decayChildren_; //decay children
|
188 |
};
|
189 |
}
|
190 |
|
191 |
//--------------------------------------------------------------------------------------------------
|
192 |
inline const mitedm::DaughterData &mitedm::DecayPart::getDaughterData(int i) const
|
193 |
{
|
194 |
if (i < nStableChild())
|
195 |
return getStableData(i);
|
196 |
else
|
197 |
return getDecayData(i-nStableChild());
|
198 |
}
|
199 |
#endif
|