ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/StableData.h
Revision: 1.5
Committed: Tue Dec 9 17:47:00 2008 UTC (16 years, 4 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006b, Mit_006a
Changes since 1.4: +11 -10 lines
Log Message:
Added ObjType to retrieve type of object.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.5 // $Id: StableData.h,v 1.4 2008/10/31 17:42:08 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 loizides 1.5 Bool_t BadLayer(Track::EHitLayer l) const { return fBadLayers.TestBit(l); }
36     const BitMask48 &BadLayers() const { return fBadLayers; }
37     Double_t E() const { return TMath::Sqrt(P()*P()+Mass()*Mass()); }
38     Double_t P() const { return fMomAtVertex.R(); }
39 bendavid 1.1 Double_t Px() const { return fMomAtVertex.X(); }
40     Double_t Py() const { return fMomAtVertex.Y(); }
41     Double_t Pz() const { return fMomAtVertex.Z(); }
42 loizides 1.5 Double_t Mass() const { return Original()->Mass(); }
43 bendavid 1.4 const BitMask48 MissedHits() const;
44 loizides 1.5 FourVector Mom() const;
45 bendavid 1.2 UInt_t NMissedHits() const { return MissedHits().NBitsSet(); }
46     UInt_t NWrongHits() const { return WrongHits().NBitsSet(); }
47 loizides 1.5 UInt_t NWrongOrMissingHits() const { return fBadLayers.NBitsSet(); }
48     EObjType ObjType() const { return kStableData; }
49     const ThreeVector &ThreeMom() const { return fMomAtVertex; }
50     const BitMask48 WrongHits() const;
51 bendavid 1.3 void SetBadLayer(Track::EHitLayer l) { fBadLayers.SetBit(l); }
52 bendavid 1.4 void SetBadLayers(const BitMask48 &layers) { fBadLayers = layers; }
53 bendavid 1.1 void SetThreeMom(Double_t px, Double_t y, Double_t z);
54     void SetThreeMom(const ThreeVector &mom) { fMomAtVertex = mom; }
55    
56     protected:
57 bendavid 1.3 ThreeVector32 fMomAtVertex; //fitted momentum at vertex
58 bendavid 1.4 BitMask48 fBadLayers; //layer mask for incorrect or missing hits from
59 bendavid 1.3 //before or after the decay vertex
60     //using same bit-layer mapping as mithep::Track
61 bendavid 1.1
62 bendavid 1.3 ClassDef(StableData, 3) // Stable daughter class
63 bendavid 1.1 };
64     }
65     //-------------------------------------------------------------------------------------------------
66     inline mithep::FourVector mithep::StableData::Mom() const
67     {
68     // Return Momentum
69    
70     return FourVector(Px(), Py(), Pz(), E());
71     }
72    
73     //--------------------------------------------------------------------------------------------------
74     inline void mithep::StableData::SetThreeMom(Double_t px, Double_t py, Double_t pz)
75     {
76     // Set four momentum.
77    
78     fMomAtVertex.SetXYZ(px, py, pz);
79     }
80     #endif