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

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: StableData.h,v 1.10 2009/03/20 18:23:27 loizides Exp $
3 //
4 // StableData
5 //
6 // Additional information on a stable daughter which is specific to a particular decay.
7 //
8 // Authors: J.Bendavid
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef MITANA_DATATREE_STABLEDATA_H
12 #define MITANA_DATATREE_STABLEDATA_H
13
14 #include "MitAna/DataCont/interface/BitMask.h"
15 #include "MitAna/DataTree/interface/StableParticle.h"
16 #include "MitAna/DataTree/interface/DaughterData.h"
17 #include "MitAna/DataTree/interface/Track.h"
18 #include "MitAna/DataTree/interface/Types.h"
19 #include "MitCommon/DataFormats/interface/Vect3C.h"
20
21 namespace mithep
22 {
23 class StableData : public DaughterData
24 {
25 public:
26 StableData() {}
27 StableData(const Particle *p, const ThreeVector &mom) :
28 DaughterData(p), fMomAtVertex(mom), fNHitsBeforeVtx(0), fDlClosestHitToVtx(0), fDlClosestHitToVtxErr(0) {}
29 StableData(const Particle *p, const ThreeVectorC &mom) :
30 DaughterData(p), fMomAtVertex(mom), fNHitsBeforeVtx(0), fDlClosestHitToVtx(0), fDlClosestHitToVtxErr(0) {}
31 StableData(const Particle *p, Double_t px, Double_t py, Double_t pz) :
32 DaughterData(p), fMomAtVertex(ThreeVector(px,py,pz)), fNHitsBeforeVtx(0), fDlClosestHitToVtx(0), fDlClosestHitToVtxErr(0) {}
33
34 Bool_t BadLayer(Track::EHitLayer l) const { return fBadLayers.TestBit(l); }
35 const BitMask48 &BadLayers() const { return fBadLayers; }
36 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 EObjType ObjType() const { return kStableData; }
45 ThreeVectorC ThreeMom() const { return fMomAtVertex.V(); }
46 const BitMask48 WrongLayers() const;
47 void SetBadLayer(Track::EHitLayer l) { fBadLayers.SetBit(l); }
48 void SetBadLayers(const BitMask48 &layers) { fBadLayers = layers; }
49 void SetDlClosestHitToVtx(Double_t x) { fDlClosestHitToVtx = x; }
50 void SetDlClosestHitToVtxErr(Double_t x) { fDlClosestHitToVtxErr = x; }
51 void SetThreeMom(Double_t px, Double_t y, Double_t z);
52 void SetThreeMom(const ThreeVector &mom) { fMomAtVertex = mom; ClearMom(); }
53 void SetNHitsBeforeVtx(UShort_t n) { fNHitsBeforeVtx = n; }
54
55 protected:
56 Double_t GetMass() const { return Original()->Mass(); }
57 void GetMom() const;
58
59 Vect3C fMomAtVertex; //fitted momentum at vertex
60 BitMask48 fBadLayers; //layer mask for incorrect or missing hits from
61 //before or after the decay vertex
62 //using same bit-layer mapping as mithep::Track
63 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
67 ClassDef(StableData, 2) // Stable data class
68 };
69 }
70
71 //--------------------------------------------------------------------------------------------------
72 inline void mithep::StableData::GetMom() const
73 {
74 // Get momentum values from stored values.
75
76 fCachedMom.SetCoordinates(fMomAtVertex.Rho(),fMomAtVertex.Eta(),fMomAtVertex.Phi(),GetMass());
77 }
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 ClearMom();
86 }
87 #endif