ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/StableParticle.h
Revision: 1.6
Committed: Fri Oct 31 17:41:44 2008 UTC (16 years, 6 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006
Changes since 1.5: +2 -1 lines
Log Message:
Added TrackerTrk accessor to ChargedParticle and StableParticle

File Contents

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