ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/StableParticle.h
Revision: 1.1
Committed: Fri Jul 25 16:04:44 2008 UTC (16 years, 9 months ago) by bendavid
Content type: text/plain
Branch: MAIN
Log Message:
Renamed Lepton to ChargedParticle and added StableParticle class

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2     // $Id: StableParticle.h,v 1.10 2008/07/14 20:55:19 loizides Exp $
3     //
4     // StableParticle
5     //
6     // Details to be worked out...
7     //
8     // Authors: C.Loizides, J.Bendavid
9     //--------------------------------------------------------------------------------------------------
10    
11     #ifndef DATATREE_STABLEPARTICLE_H
12     #define DATATREE_STABLEPARTICLE_H
13    
14     #include "MitAna/DataTree/interface/ChargedParticle.h"
15    
16     namespace mithep
17     {
18     class StableParticle : public ChargedParticle
19     {
20     public:
21     StableParticle() {}
22     StableParticle(UInt_t absPdgId, Track *track) : fAbsPdgId(absPdgId), fTrackRef(track) {}
23     ~StableParticle() {}
24    
25     UInt_t AbsPdgId() const { return fAbsPdgId; }
26     const Track *BestTrk() const { return Trk(); }
27     const Track *Trk() const;
28     Double_t Mass() const;
29     TParticlePDG *ParticlePdgEntry() const;
30    
31     void SetAbsPdgId(UInt_t absPdgId) { fAbsPdgId=absPdgId; }
32     void SetTrk(Track* t) { fTrackRef = t; }
33    
34     protected:
35     UInt_t fAbsPdgId; //pdg identifier (absolute value)
36     TRef fTrackRef; //tracker track reference
37    
38     ClassDef(StableParticle, 1) // StableParticle class
39     };
40     }
41    
42     //--------------------------------------------------------------------------------------------------
43     inline const mithep::Track *mithep::StableParticle::Trk() const
44     {
45     // Return tracker track.
46    
47     return static_cast<const Track*>(fTrackRef.GetObject());
48     }
49    
50     //--------------------------------------------------------------------------------------------------
51     inline TParticlePDG *mithep::StableParticle::ParticlePdgEntry() const
52     {
53     // Return entry to pdg database for the PARTICLE.
54    
55     return TDatabasePDG::Instance()->GetParticle(fAbsPdgId);
56     }
57     #endif