ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/StableData.h
Revision: 1.8
Committed: Sun Mar 8 12:09:59 2009 UTC (16 years, 2 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre2
Changes since 1.7: +2 -2 lines
Log Message:
Move away generic classes and keep only classes stored in the tree.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.8 // $Id: StableData.h,v 1.7 2009/02/26 17:06:25 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 loizides 1.8 #include "MitAna/DataCont/interface/BitMask.h"
16 bendavid 1.1 #include "MitAna/DataTree/interface/StableParticle.h"
17     #include "MitAna/DataTree/interface/DaughterData.h"
18 bendavid 1.2 #include "MitAna/DataTree/interface/Track.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 loizides 1.6 DaughterData(p), fMomAtVertex(mom) {}
29 bendavid 1.1 StableData(Particle* p, Double_t px, Double_t py, Double_t pz) :
30 loizides 1.6 DaughterData(p), fMomAtVertex(px,py,pz) {}
31 bendavid 1.1
32 loizides 1.5 Bool_t BadLayer(Track::EHitLayer l) const { return fBadLayers.TestBit(l); }
33 loizides 1.6 const BitMask48 &BadLayers() const { return fBadLayers; }
34     const BitMask48 MissedHits() const;
35 bendavid 1.2 UInt_t NMissedHits() const { return MissedHits().NBitsSet(); }
36     UInt_t NWrongHits() const { return WrongHits().NBitsSet(); }
37 loizides 1.5 UInt_t NWrongOrMissingHits() const { return fBadLayers.NBitsSet(); }
38 loizides 1.6 EObjType ObjType() const { return kStableData; }
39     const ThreeVector &ThreeMom() const { return fMomAtVertex; }
40     const BitMask48 WrongHits() const;
41     void SetBadLayer(Track::EHitLayer l) { fBadLayers.SetBit(l); }
42 bendavid 1.4 void SetBadLayers(const BitMask48 &layers) { fBadLayers = layers; }
43 bendavid 1.1 void SetThreeMom(Double_t px, Double_t y, Double_t z);
44 bendavid 1.7 void SetThreeMom(const ThreeVector &mom) { fMomAtVertex = mom; ClearMom(); }
45 bendavid 1.1
46     protected:
47 loizides 1.6 Double_t GetMass() const { return Original()->Mass(); }
48     void GetMom() const;
49    
50 bendavid 1.3 ThreeVector32 fMomAtVertex; //fitted momentum at vertex
51 bendavid 1.4 BitMask48 fBadLayers; //layer mask for incorrect or missing hits from
52 bendavid 1.3 //before or after the decay vertex
53     //using same bit-layer mapping as mithep::Track
54 bendavid 1.1
55 loizides 1.6 ClassDef(StableData, 1) // Stable daughter class
56 bendavid 1.1 };
57     }
58 loizides 1.6
59     //--------------------------------------------------------------------------------------------------
60     inline void mithep::StableData::GetMom() const
61 bendavid 1.1 {
62 loizides 1.6 // Get momentum values from stored values.
63 bendavid 1.1
64 loizides 1.6 Double_t pt = TMath::Sqrt(fMomAtVertex.X()*fMomAtVertex.X()+fMomAtVertex.Y()*fMomAtVertex.Y());
65     fCachedMom.SetCoordinates(pt,fMomAtVertex.Eta(),fMomAtVertex.Phi(),GetMass());
66 bendavid 1.1 }
67    
68     //--------------------------------------------------------------------------------------------------
69     inline void mithep::StableData::SetThreeMom(Double_t px, Double_t py, Double_t pz)
70     {
71     // Set four momentum.
72    
73     fMomAtVertex.SetXYZ(px, py, pz);
74 bendavid 1.7 ClearMom();
75 bendavid 1.1 }
76     #endif