ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/StableParticle.h
Revision: 1.2
Committed: Tue Jul 29 07:55:40 2008 UTC (16 years, 9 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.1: +1 -2 lines
Log Message:
Have consistent Trk implementation.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.2 // $Id: StableParticle.h,v 1.1 2008/07/25 16:04:44 bendavid Exp $
3 bendavid 1.1 //
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 *Trk() const;
27     Double_t Mass() const;
28     TParticlePDG *ParticlePdgEntry() const;
29    
30     void SetAbsPdgId(UInt_t absPdgId) { fAbsPdgId=absPdgId; }
31     void SetTrk(Track* t) { fTrackRef = t; }
32    
33     protected:
34     UInt_t fAbsPdgId; //pdg identifier (absolute value)
35     TRef fTrackRef; //tracker track reference
36    
37     ClassDef(StableParticle, 1) // StableParticle class
38     };
39     }
40    
41     //--------------------------------------------------------------------------------------------------
42     inline const mithep::Track *mithep::StableParticle::Trk() const
43     {
44     // Return tracker track.
45    
46     return static_cast<const Track*>(fTrackRef.GetObject());
47     }
48    
49     //--------------------------------------------------------------------------------------------------
50     inline TParticlePDG *mithep::StableParticle::ParticlePdgEntry() const
51     {
52     // Return entry to pdg database for the PARTICLE.
53    
54     return TDatabasePDG::Instance()->GetParticle(fAbsPdgId);
55     }
56     #endif