1 |
loizides |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
loizides |
1.23 |
// $Id: DecayParticle.h,v 1.22 2009/02/17 15:09:45 bendavid Exp $
|
3 |
loizides |
1.1 |
//
|
4 |
loizides |
1.20 |
// DecayParticle
|
5 |
loizides |
1.1 |
//
|
6 |
loizides |
1.20 |
// The decay particle class is for use in vertexing based analyses. It
|
7 |
|
|
// stores vertex fit information (including four momentum) and links to daughters.
|
8 |
loizides |
1.1 |
//
|
9 |
loizides |
1.20 |
// 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 |
bendavid |
1.10 |
//
|
12 |
loizides |
1.14 |
// Authors: C.Paus, J.Bendavid
|
13 |
loizides |
1.1 |
//--------------------------------------------------------------------------------------------------
|
14 |
|
|
|
15 |
loizides |
1.21 |
#ifndef MITANA_DATATREE_DECAYPARTICLE_H
|
16 |
|
|
#define MITANA_DATATREE_DECAYPARTICLE_H
|
17 |
loizides |
1.1 |
|
18 |
loizides |
1.20 |
#include "MitAna/DataTree/interface/Types.h"
|
19 |
loizides |
1.1 |
#include "MitAna/DataTree/interface/CompositeParticle.h"
|
20 |
bendavid |
1.11 |
#include "MitAna/DataTree/interface/DaughterData.h"
|
21 |
bendavid |
1.13 |
#include "MitAna/DataTree/interface/Vertex.h"
|
22 |
|
|
#include "MitAna/DataCont/interface/RefArray.h"
|
23 |
loizides |
1.20 |
#include <TDatabasePDG.h>
|
24 |
|
|
#include <TParticlePDG.h>
|
25 |
|
|
|
26 |
loizides |
1.1 |
namespace mithep
|
27 |
|
|
{
|
28 |
bendavid |
1.13 |
class DecayParticle : public Particle
|
29 |
loizides |
1.1 |
{
|
30 |
|
|
public:
|
31 |
loizides |
1.23 |
DecayParticle() :
|
32 |
|
|
fAbsPdgId(0), fChi2(0), fNdof(0), fMassError(0),
|
33 |
|
|
fLxy(0), fLxyError(0), fDxy(0), fDxyError(0), fLz(0), fLzError(0) {}
|
34 |
loizides |
1.20 |
DecayParticle(Int_t absPdgId) :
|
35 |
loizides |
1.23 |
fAbsPdgId(absPdgId), fChi2(0), fNdof(0), fMassError(0),
|
36 |
|
|
fLxy(0), fLxyError(0), fDxy(0), fDxyError(0), fLz(0), fLzError(0) {}
|
37 |
bendavid |
1.7 |
|
38 |
loizides |
1.20 |
UInt_t AbsPdgId() const { return fAbsPdgId; }
|
39 |
|
|
Double_t Chi2() const { return fChi2; }
|
40 |
|
|
const Particle *Daughter(UInt_t i) const { return DaughterDat(i)->Original(); }
|
41 |
|
|
const DaughterData *DaughterDat(UInt_t i) const { return fDaughterData.At(i); }
|
42 |
|
|
Double_t Dxy() const { return fDxy; }
|
43 |
|
|
Double_t DxyError() const { return fDxyError; }
|
44 |
|
|
Bool_t HasDaughter(const Particle *p) const;
|
45 |
|
|
Bool_t HasCommonDaughter(const DecayParticle *p) const;
|
46 |
|
|
Bool_t HasSameDaughters(const DecayParticle *p) const;
|
47 |
loizides |
1.23 |
Bool_t HasPriVertex() const { return fPriVtx.IsValid(); }
|
48 |
|
|
Bool_t HasPriVertex(const Vertex *v)
|
49 |
|
|
const { return fPriVtx.RefsObject(v); }
|
50 |
loizides |
1.20 |
Double_t Lxy() const { return fLxy; }
|
51 |
|
|
Double_t LxyError() const { return fLxyError; }
|
52 |
|
|
Double_t MassError() const { return fMassError; }
|
53 |
|
|
UInt_t Ndof() const { return fNdof; }
|
54 |
|
|
Double_t Lz() const { return fLz; }
|
55 |
|
|
Double_t LzError() const { return fLzError; }
|
56 |
|
|
UInt_t NDaughters() const { return fDaughterData.Entries(); }
|
57 |
|
|
EObjType ObjType() const { return kDecayParticle; }
|
58 |
|
|
TParticlePDG *ParticlePdgEntry() const;
|
59 |
|
|
Double_t PdgMass() const;
|
60 |
|
|
Double_t Prob() const { return TMath::Prob(fChi2,fNdof); }
|
61 |
|
|
const ThreeVector Position() const;
|
62 |
|
|
const ThreeVector RelativePosition() const;
|
63 |
loizides |
1.23 |
const Vertex *PriVertex() const { return fPriVtx.Obj(); }
|
64 |
loizides |
1.20 |
void AddDaughterData(const DaughterData *dd) { fDaughterData.Add(dd); }
|
65 |
loizides |
1.23 |
void SetAbsPdgId(UInt_t apid) { fAbsPdgId=apid; }
|
66 |
|
|
void SetChi2(Double_t chi2) { fChi2 = chi2; }
|
67 |
|
|
void SetMassError(Double_t massError) { fMassError = massError;}
|
68 |
loizides |
1.20 |
void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
|
69 |
loizides |
1.23 |
void SetMom(const FourVector &p) { fMomentum = p; }
|
70 |
|
|
void SetNdof(UInt_t ndof) { fNdof = ndof; }
|
71 |
|
|
void SetDxy(Double_t dxy) { fDxy = dxy; }
|
72 |
|
|
void SetDxyError(Double_t dxyError) { fDxyError = dxyError; }
|
73 |
|
|
void SetLxy(Double_t lxy) { fLxy = lxy; }
|
74 |
|
|
void SetLxyError(Double_t lxyError) { fLxyError = lxyError; }
|
75 |
|
|
void SetLz(Double_t lz) { fLz = lz; }
|
76 |
|
|
void SetLzError(Double_t lzError) { fLzError = lzError; }
|
77 |
|
|
void SetPriVertex(const Vertex *v) { fPriVtx = v; }
|
78 |
loizides |
1.12 |
using TObject::Error;
|
79 |
loizides |
1.20 |
|
80 |
loizides |
1.1 |
protected:
|
81 |
loizides |
1.23 |
Double_t GetCharge() const;
|
82 |
|
|
void GetMom() const;
|
83 |
|
|
|
84 |
loizides |
1.20 |
UInt_t fAbsPdgId; //absolute value of pid code
|
85 |
|
|
Double32_t fChi2; //chi-squared of fit
|
86 |
|
|
UInt_t fNdof; //degrees of freedom for fit
|
87 |
|
|
Double32_t fMassError; //fitted mass error
|
88 |
|
|
Double32_t fLxy; //fitted lxy (decay length)
|
89 |
|
|
Double32_t fLxyError; //fitted lxy error
|
90 |
|
|
Double32_t fDxy; //fitted impact parameter
|
91 |
|
|
Double32_t fDxyError; //fitted impact parameter error
|
92 |
|
|
Double32_t fLz; //fitted lz (decay length)
|
93 |
|
|
Double32_t fLzError; //fitted lz error
|
94 |
|
|
FourVectorM32 fMomentum; //momentum fourvector
|
95 |
bendavid |
1.16 |
RefArray<DaughterData,32> fDaughterData; //momentum of daughters at vertex
|
96 |
loizides |
1.23 |
Ref<Vertex> fPriVtx; //reference to primary vertex
|
97 |
loizides |
1.1 |
|
98 |
loizides |
1.20 |
ClassDef(DecayParticle, 1) // Decay particle class
|
99 |
loizides |
1.1 |
};
|
100 |
|
|
}
|
101 |
bendavid |
1.7 |
|
102 |
|
|
//--------------------------------------------------------------------------------------------------
|
103 |
loizides |
1.23 |
inline Double_t mithep::DecayParticle::GetCharge() const
|
104 |
|
|
{
|
105 |
|
|
// Return sum of charge of daughter particles.
|
106 |
|
|
|
107 |
|
|
Double_t charge = 0;
|
108 |
|
|
for (UInt_t i=0; i<NDaughters(); ++i)
|
109 |
|
|
charge += DaughterDat(i)->Charge();
|
110 |
|
|
|
111 |
|
|
return charge;
|
112 |
|
|
}
|
113 |
|
|
|
114 |
|
|
//--------------------------------------------------------------------------------------------------
|
115 |
|
|
inline void mithep::DecayParticle::GetMom() const
|
116 |
|
|
{
|
117 |
|
|
// Get momentum values from stored values.
|
118 |
|
|
|
119 |
|
|
fCachedMom.SetCoordinates(fMomentum.Pt(),fMomentum.Eta(),
|
120 |
|
|
fMomentum.Phi(),fMomentum.M());
|
121 |
|
|
}
|
122 |
|
|
|
123 |
|
|
//--------------------------------------------------------------------------------------------------
|
124 |
bendavid |
1.7 |
inline TParticlePDG *mithep::DecayParticle::ParticlePdgEntry() const
|
125 |
|
|
{
|
126 |
loizides |
1.20 |
// Return entry to pdg database for the particle.
|
127 |
bendavid |
1.7 |
|
128 |
|
|
return TDatabasePDG::Instance()->GetParticle(fAbsPdgId);
|
129 |
|
|
}
|
130 |
bendavid |
1.8 |
|
131 |
|
|
//--------------------------------------------------------------------------------------------------
|
132 |
|
|
inline void mithep::DecayParticle::SetMom(Double_t px, Double_t py, Double_t pz, Double_t e)
|
133 |
|
|
{
|
134 |
loizides |
1.20 |
// Set four vector.
|
135 |
bendavid |
1.8 |
|
136 |
bendavid |
1.11 |
fMomentum.SetXYZT(px,py,pz,e);
|
137 |
|
|
}
|
138 |
|
|
|
139 |
|
|
//--------------------------------------------------------------------------------------------------
|
140 |
bendavid |
1.13 |
inline const mithep::ThreeVector mithep::DecayParticle::Position() const
|
141 |
|
|
{
|
142 |
loizides |
1.20 |
// Return absolute position of decay.
|
143 |
bendavid |
1.13 |
|
144 |
|
|
const mithep::Vertex *pv = PriVertex();
|
145 |
|
|
|
146 |
|
|
if (pv)
|
147 |
|
|
return ( pv->Position() + RelativePosition() );
|
148 |
|
|
else
|
149 |
|
|
return RelativePosition();
|
150 |
|
|
}
|
151 |
|
|
|
152 |
|
|
//--------------------------------------------------------------------------------------------------
|
153 |
|
|
inline const mithep::ThreeVector mithep::DecayParticle::RelativePosition() const
|
154 |
|
|
{
|
155 |
loizides |
1.20 |
// Compute the position vector of the decay vertex relative to the primary vertex.
|
156 |
bendavid |
1.13 |
|
157 |
|
|
mithep::ThreeVector dz(0,0,fLz*TMath::Abs(fMomentum.Pz())/fMomentum.Pz());
|
158 |
|
|
mithep::ThreeVector momPerp(fMomentum.Px(),fMomentum.Py(),0);
|
159 |
|
|
mithep::ThreeVector zHat(0,0,1.0);
|
160 |
paus |
1.17 |
mithep::ThreeVector dxy = -momPerp.Cross(zHat)*fDxy/momPerp.R();
|
161 |
|
|
mithep::ThreeVector dlxy = momPerp*fLxy/momPerp.R();
|
162 |
bendavid |
1.13 |
return (dxy+dlxy+dz);
|
163 |
|
|
}
|
164 |
|
|
|
165 |
loizides |
1.1 |
#endif
|