ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/StableParticle.h
Revision: 1.7
Committed: Tue Dec 9 17:47:00 2008 UTC (16 years, 4 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006b, Mit_006a
Changes since 1.6: +5 -5 lines
Log Message:
Added ObjType to retrieve type of object.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.7 // $Id: StableParticle.h,v 1.6 2008/10/31 17:41:44 bendavid 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 loizides 1.7 UInt_t AbsPdgId() const { return fAbsPdgId; }
27 bendavid 1.1 const Track *Trk() const;
28 loizides 1.7 const Track *TrackerTrk() const { return Trk(); }
29 bendavid 1.1 Double_t Mass() const;
30 loizides 1.7 EObjType ObjType() const { return kStableParticle; }
31 bendavid 1.1 TParticlePDG *ParticlePdgEntry() const;
32     void SetAbsPdgId(UInt_t absPdgId) { fAbsPdgId=absPdgId; }
33 loizides 1.7 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