ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/DecayData.h
Revision: 1.9
Committed: Tue Mar 3 17:04:09 2009 UTC (16 years, 2 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre2, Mit_008pre1
Changes since 1.8: +4 -4 lines
Log Message:
Cleanup and double32.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.9 // $Id: DecayData.h,v 1.8 2009/02/26 17:06:24 bendavid Exp $
3 bendavid 1.1 //
4     // DecayData
5     //
6 loizides 1.6 // Additional information on a stable daughter which is specific to a particular decay.
7 bendavid 1.1 //
8     // Authors: J.Bendavid
9     //--------------------------------------------------------------------------------------------------
10    
11     #ifndef MITANA_DATATREE_DECAYDATA_H
12     #define MITANA_DATATREE_DECAYDATA_H
13    
14     #include "MitAna/DataTree/interface/DaughterData.h"
15     #include "MitAna/DataTree/interface/Types.h"
16    
17     namespace mithep
18     {
19     class DecayData : public DaughterData
20     {
21     public:
22 loizides 1.7 DecayData() : fMassError(0), fLxy(0), fLxyError(0),
23     fDxy(0), fDxyError(0), fLz(0), fLzError(0){}
24     DecayData(const Particle *p, const FourVector &mom) : DaughterData(p), fMomAtVertex(mom),
25     fMassError(0), fLxy(0), fLxyError(0), fDxy(0), fDxyError(0), fLz(0), fLzError(0) {}
26 bendavid 1.1
27 loizides 1.6 Double_t Dxy() const { return fDxy; }
28     Double_t DxyError() const { return fDxyError; }
29     Double_t E() const { return fMomAtVertex.E(); }
30     Double_t Lxy() const { return fLxy; }
31     Double_t LxyError() const { return fLxyError; }
32     Double_t Lz() const { return fLz; }
33     Double_t LzError() const { return fLzError; }
34     Double_t MassError() const { return fMassError; }
35     EObjType ObjType() const { return kDecayData; }
36     const ThreeVector32 RelativePosition() const;
37     void SetDxy(Double_t dxy) { fDxy = dxy; }
38     void SetDxyError(Double_t dxyError) { fDxyError = dxyError; }
39 loizides 1.9 void SetLxy(Double_t lxy) { fLxy = lxy; }
40 loizides 1.6 void SetLxyError(Double_t lxyError) { fLxyError = lxyError; }
41 loizides 1.9 void SetLz(Double_t lz) { fLz = lz; }
42 loizides 1.6 void SetLzError(Double_t lzError) { fLzError = lzError; }
43     void SetMom(Double_t px, Double_t y, Double_t z, Double_t e);
44 bendavid 1.8 void SetMom(const FourVector &mom) { fMomAtVertex = mom; ClearMom(); }
45 loizides 1.9 void SetMassError(Double_t massError) { fMassError = massError; }
46 bendavid 1.1
47     protected:
48 loizides 1.7 void GetMom() const;
49    
50 bendavid 1.3 FourVectorM32 fMomAtVertex; //fitted momentum at vertex
51 loizides 1.6 Double32_t fMassError; //fitted mass error
52     Double32_t fLxy; //fitted lxy
53     Double32_t fLxyError; //fitted lxy error
54     Double32_t fDxy; //fitted impact parameter
55     Double32_t fDxyError; //fitted impact parameter error
56     Double32_t fLz; //fitted lz
57     Double32_t fLzError; //fitted lz error
58 bendavid 1.1
59 loizides 1.6 ClassDef(DecayData, 1) // Decay data for stable daughter class
60 bendavid 1.1 };
61     }
62 loizides 1.7
63     //--------------------------------------------------------------------------------------------------
64     inline void mithep::DecayData::GetMom() const
65     {
66     // Get momentum values from stored values.
67    
68     fCachedMom.SetCoordinates(fMomAtVertex.Pt(),fMomAtVertex.Eta(),
69     fMomAtVertex.Phi(),fMomAtVertex.M());
70     }
71    
72 bendavid 1.1 //--------------------------------------------------------------------------------------------------
73     inline void mithep::DecayData::SetMom(Double32_t px, Double32_t py, Double32_t pz, Double32_t e)
74     {
75     // Set four momentum.
76    
77     fMomAtVertex.SetXYZT(px, py, pz, e);
78 bendavid 1.8 ClearMom();
79 bendavid 1.1 }
80    
81     //--------------------------------------------------------------------------------------------------
82     inline const mithep::ThreeVector32 mithep::DecayData::RelativePosition() const
83     {
84 loizides 1.6 //Compute the position vector of the decay vertex relative to the parent decay vertex.
85 bendavid 1.1
86     mithep::ThreeVector32 dz(0,0,fLz*TMath::Abs(fMomAtVertex.Pz())/fMomAtVertex.Pz());
87     mithep::ThreeVector32 momPerp(fMomAtVertex.Px(),fMomAtVertex.Py(),0);
88     mithep::ThreeVector32 zHat(0,0,1.0);
89     mithep::ThreeVector32 dxy = -momPerp.Cross(zHat)*fDxy/momPerp.R();
90     mithep::ThreeVector32 dlxy = momPerp*fLxy/momPerp.R();
91     return (dxy+dlxy+dz);
92     }
93     #endif