ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/StableData.h
Revision: 1.11
Committed: Mon Nov 22 16:51:26 2010 UTC (14 years, 5 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, HEAD
Branch point for: Mit_025c_branch
Changes since 1.10: +20 -10 lines
Log Message:
accommodate conversion changes in 39

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.11 // $Id: StableData.h,v 1.10 2009/03/20 18:23:27 loizides Exp $
3 bendavid 1.1 //
4     // StableData
5     //
6 loizides 1.9 // 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_STABLEDATA_H
12     #define MITANA_DATATREE_STABLEDATA_H
13    
14 loizides 1.8 #include "MitAna/DataCont/interface/BitMask.h"
15 bendavid 1.1 #include "MitAna/DataTree/interface/StableParticle.h"
16     #include "MitAna/DataTree/interface/DaughterData.h"
17 bendavid 1.2 #include "MitAna/DataTree/interface/Track.h"
18 bendavid 1.1 #include "MitAna/DataTree/interface/Types.h"
19 loizides 1.9 #include "MitCommon/DataFormats/interface/Vect3C.h"
20 bendavid 1.1
21     namespace mithep
22     {
23     class StableData : public DaughterData
24     {
25     public:
26     StableData() {}
27 loizides 1.9 StableData(const Particle *p, const ThreeVector &mom) :
28 bendavid 1.11 DaughterData(p), fMomAtVertex(mom), fNHitsBeforeVtx(0), fDlClosestHitToVtx(0), fDlClosestHitToVtxErr(0) {}
29 loizides 1.9 StableData(const Particle *p, const ThreeVectorC &mom) :
30 bendavid 1.11 DaughterData(p), fMomAtVertex(mom), fNHitsBeforeVtx(0), fDlClosestHitToVtx(0), fDlClosestHitToVtxErr(0) {}
31 loizides 1.9 StableData(const Particle *p, Double_t px, Double_t py, Double_t pz) :
32 bendavid 1.11 DaughterData(p), fMomAtVertex(ThreeVector(px,py,pz)), fNHitsBeforeVtx(0), fDlClosestHitToVtx(0), fDlClosestHitToVtxErr(0) {}
33 bendavid 1.1
34 loizides 1.9 Bool_t BadLayer(Track::EHitLayer l) const { return fBadLayers.TestBit(l); }
35     const BitMask48 &BadLayers() const { return fBadLayers; }
36 bendavid 1.11 Double_t DlClosestHitToVtx() const { return fDlClosestHitToVtx; }
37     Double_t DlClosestHitToVtxErr() const { return fDlClosestHitToVtxErr; }
38     const BitMask48 MissedLayers() const;
39     UInt_t NMissedLayers() const { return MissedLayers().NBitsSet(); }
40     UInt_t NWrongLayers() const { return WrongLayers().NBitsSet(); }
41     UInt_t NWrongHits() const { return TMath::Max(UInt_t(fNHitsBeforeVtx),NWrongLayers()); }
42     UInt_t NWrongOrMissingLayers() const { return fBadLayers.NBitsSet(); }
43     UShort_t NHitsBeforeVtx() const { return fNHitsBeforeVtx; }
44 loizides 1.10 EObjType ObjType() const { return kStableData; }
45 loizides 1.9 ThreeVectorC ThreeMom() const { return fMomAtVertex.V(); }
46 bendavid 1.11 const BitMask48 WrongLayers() const;
47 loizides 1.9 void SetBadLayer(Track::EHitLayer l) { fBadLayers.SetBit(l); }
48     void SetBadLayers(const BitMask48 &layers) { fBadLayers = layers; }
49 bendavid 1.11 void SetDlClosestHitToVtx(Double_t x) { fDlClosestHitToVtx = x; }
50     void SetDlClosestHitToVtxErr(Double_t x) { fDlClosestHitToVtxErr = x; }
51 bendavid 1.1 void SetThreeMom(Double_t px, Double_t y, Double_t z);
52 bendavid 1.7 void SetThreeMom(const ThreeVector &mom) { fMomAtVertex = mom; ClearMom(); }
53 bendavid 1.11 void SetNHitsBeforeVtx(UShort_t n) { fNHitsBeforeVtx = n; }
54 bendavid 1.1
55     protected:
56 loizides 1.6 Double_t GetMass() const { return Original()->Mass(); }
57     void GetMom() const;
58    
59 loizides 1.9 Vect3C fMomAtVertex; //fitted momentum at vertex
60 bendavid 1.4 BitMask48 fBadLayers; //layer mask for incorrect or missing hits from
61 bendavid 1.3 //before or after the decay vertex
62     //using same bit-layer mapping as mithep::Track
63 bendavid 1.11 UShort_t fNHitsBeforeVtx; //number of hits before the vertex position
64     Double32_t fDlClosestHitToVtx; //[0,0,14]
65     Double32_t fDlClosestHitToVtxErr; //[0,0,14]
66 bendavid 1.1
67 bendavid 1.11 ClassDef(StableData, 2) // Stable data class
68 bendavid 1.1 };
69     }
70 loizides 1.6
71     //--------------------------------------------------------------------------------------------------
72     inline void mithep::StableData::GetMom() const
73 bendavid 1.1 {
74 loizides 1.6 // Get momentum values from stored values.
75 bendavid 1.1
76 loizides 1.9 fCachedMom.SetCoordinates(fMomAtVertex.Rho(),fMomAtVertex.Eta(),fMomAtVertex.Phi(),GetMass());
77 bendavid 1.1 }
78    
79     //--------------------------------------------------------------------------------------------------
80     inline void mithep::StableData::SetThreeMom(Double_t px, Double_t py, Double_t pz)
81     {
82     // Set four momentum.
83    
84     fMomAtVertex.SetXYZ(px, py, pz);
85 bendavid 1.7 ClearMom();
86 bendavid 1.1 }
87     #endif