ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/StableData.h
Revision: 1.4
Committed: Fri Oct 31 17:42:08 2008 UTC (16 years, 6 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006
Changes since 1.3: +6 -6 lines
Log Message:
Switched track layer/hit masks from BitMask64 to BitMask48

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.4 // $Id: StableData.h,v 1.3 2008/10/16 16:19:39 bendavid Exp $
3 bendavid 1.1 //
4     // StableData
5     //
6     // Additional information on a stable daughter which is specific to a particular decay
7     //
8     //
9     // Authors: J.Bendavid
10     //--------------------------------------------------------------------------------------------------
11    
12     #ifndef MITANA_DATATREE_STABLEDATA_H
13     #define MITANA_DATATREE_STABLEDATA_H
14    
15     #include "MitAna/DataTree/interface/StableParticle.h"
16     #include "MitAna/DataTree/interface/DaughterData.h"
17 bendavid 1.2 #include "MitAna/DataTree/interface/Track.h"
18     #include "MitAna/DataTree/interface/BitMask.h"
19 bendavid 1.1 #include "MitAna/DataTree/interface/Types.h"
20    
21     namespace mithep
22     {
23     class StableData : public DaughterData
24     {
25     public:
26     StableData() {}
27     StableData(Particle* p, const ThreeVector &mom) :
28     DaughterData(p),
29     fMomAtVertex(mom) {}
30     StableData(Particle* p, Double_t px, Double_t py, Double_t pz) :
31     DaughterData(p),
32     fMomAtVertex(px,py,pz) {}
33     virtual ~StableData() {}
34    
35     Double_t Px() const { return fMomAtVertex.X(); }
36     Double_t Py() const { return fMomAtVertex.Y(); }
37     Double_t Pz() const { return fMomAtVertex.Z(); }
38     Double_t P() const { return fMomAtVertex.R(); }
39     Double_t E() const { return TMath::Sqrt(P()*P()+Mass()*Mass()); }
40 bendavid 1.3 Bool_t BadLayer(Track::EHitLayer l) const { return fBadLayers.TestBit(l); }
41 bendavid 1.4 const BitMask48 &BadLayers() const { return fBadLayers; }
42 bendavid 1.1 Double_t Mass() const { return Original()->Mass(); }
43 bendavid 1.4 const BitMask48 MissedHits() const;
44 bendavid 1.1 FourVector Mom() const;
45 bendavid 1.3 UInt_t NWrongOrMissingHits() const { return fBadLayers.NBitsSet(); }
46 bendavid 1.2 UInt_t NMissedHits() const { return MissedHits().NBitsSet(); }
47     UInt_t NWrongHits() const { return WrongHits().NBitsSet(); }
48 bendavid 1.3 void SetBadLayer(Track::EHitLayer l) { fBadLayers.SetBit(l); }
49 bendavid 1.4 void SetBadLayers(const BitMask48 &layers) { fBadLayers = layers; }
50 bendavid 1.1 void SetThreeMom(Double_t px, Double_t y, Double_t z);
51     void SetThreeMom(const ThreeVector &mom) { fMomAtVertex = mom; }
52     const ThreeVector &ThreeMom() const { return fMomAtVertex; }
53 bendavid 1.4 const BitMask48 WrongHits() const;
54 bendavid 1.1
55     protected:
56 bendavid 1.3 ThreeVector32 fMomAtVertex; //fitted momentum at vertex
57 bendavid 1.4 BitMask48 fBadLayers; //layer mask for incorrect or missing hits from
58 bendavid 1.3 //before or after the decay vertex
59     //using same bit-layer mapping as mithep::Track
60 bendavid 1.1
61 bendavid 1.3 ClassDef(StableData, 3) // Stable daughter class
62 bendavid 1.1 };
63     }
64     //-------------------------------------------------------------------------------------------------
65     inline mithep::FourVector mithep::StableData::Mom() const
66     {
67     // Return Momentum
68    
69     return FourVector(Px(), Py(), Pz(), E());
70     }
71    
72     //--------------------------------------------------------------------------------------------------
73     inline void mithep::StableData::SetThreeMom(Double_t px, Double_t py, Double_t pz)
74     {
75     // Set four momentum.
76    
77     fMomAtVertex.SetXYZ(px, py, pz);
78     }
79     #endif