ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/StableParticle.h
Revision: 1.5
Committed: Wed Sep 10 03:33:27 2008 UTC (16 years, 7 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_005, Mit_004
Changes since 1.4: +3 -3 lines
Log Message:
Cleanup

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.5 // $Id: StableParticle.h,v 1.4 2008/07/29 16:17:18 loizides Exp $
3 bendavid 1.1 //
4     // StableParticle
5     //
6 loizides 1.4 // Generic stable particle with track. Stores absolute pdg code and link to track.
7 bendavid 1.1 //
8     // Authors: C.Loizides, J.Bendavid
9     //--------------------------------------------------------------------------------------------------
10    
11 loizides 1.5 #ifndef MITANA_DATATREE_STABLEPARTICLE_H
12     #define MITANA_DATATREE_STABLEPARTICLE_H
13 bendavid 1.1
14     #include "MitAna/DataTree/interface/ChargedParticle.h"
15    
16     namespace mithep
17     {
18     class StableParticle : public ChargedParticle
19     {
20     public:
21 bendavid 1.3 StableParticle() : fAbsPdgId(0) {}
22     StableParticle(UInt_t absPdgId) : fAbsPdgId(absPdgId) {}
23 bendavid 1.1 StableParticle(UInt_t absPdgId, Track *track) : fAbsPdgId(absPdgId), fTrackRef(track) {}
24     ~StableParticle() {}
25    
26     UInt_t AbsPdgId() const { return fAbsPdgId; }
27     const Track *Trk() const;
28     Double_t Mass() const;
29     TParticlePDG *ParticlePdgEntry() const;
30    
31     void SetAbsPdgId(UInt_t absPdgId) { fAbsPdgId=absPdgId; }
32 loizides 1.4 void SetTrk(Track *t) { fTrackRef = t; }
33 bendavid 1.1
34     protected:
35     UInt_t fAbsPdgId; //pdg identifier (absolute value)
36     TRef fTrackRef; //tracker track reference
37    
38 loizides 1.4 ClassDef(StableParticle, 1) // Stable particle class
39 bendavid 1.1 };
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