Revision: | 1.11 |
Committed: | Wed Mar 18 15:44:32 2009 UTC (16 years, 1 month ago) by loizides |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | Mit_024b, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, Mit_010, Mit_009c, Mit_009b, Mit_009a, Mit_009, Mit_008 |
Changes since 1.10: | +10 -10 lines |
Log Message: | Introduced Double32_t [0,0,14] consistently. Updated class descriptions. |
# | Content |
---|---|
1 | //-------------------------------------------------------------------------------------------------- |
2 | // $Id: StableParticle.h,v 1.10 2009/02/26 17:06:25 bendavid Exp $ |
3 | // |
4 | // StableParticle |
5 | // |
6 | // Generic stable particle with track. Stores absolute pdg code and link to track. |
7 | // |
8 | // Authors: C.Loizides, J.Bendavid |
9 | //-------------------------------------------------------------------------------------------------- |
10 | |
11 | #ifndef MITANA_DATATREE_STABLEPARTICLE_H |
12 | #define MITANA_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() : fAbsPdgId(0) {} |
22 | StableParticle(UInt_t absPdgId) : fAbsPdgId(absPdgId) {} |
23 | StableParticle(UInt_t absPdgId, const Track *track) : fAbsPdgId(absPdgId), fTrackRef(track) {} |
24 | |
25 | UInt_t AbsPdgId() const { return fAbsPdgId; } |
26 | const Track *Trk() const { return fTrackRef.Obj(); } |
27 | const Track *TrackerTrk() const { return Trk(); } |
28 | EObjType ObjType() const { return kStableParticle; } |
29 | TParticlePDG *PdgEntry() const; |
30 | void SetAbsPdgId(UInt_t apdg) { fAbsPdgId=apdg; ClearMom(); } |
31 | void SetTrk(const Track *t) { fTrackRef = t; ClearMom(); ClearCharge(); } |
32 | |
33 | protected: |
34 | Double_t GetMass() const; |
35 | |
36 | UInt_t fAbsPdgId; //pdg identifier (absolute value) |
37 | Ref<Track> fTrackRef; //tracker track reference |
38 | |
39 | ClassDef(StableParticle, 1) // Stable particle class |
40 | }; |
41 | } |
42 | |
43 | //-------------------------------------------------------------------------------------------------- |
44 | inline Double_t mithep::StableParticle::GetMass() const |
45 | { |
46 | // Get mass from pdg lookup. |
47 | |
48 | TParticlePDG *pdgEntry = PdgEntry(); |
49 | if (pdgEntry) |
50 | return pdgEntry->Mass(); |
51 | else { |
52 | Error("GetMass", |
53 | "Absolute pdg code %i not found in table, returning mass=-99.0 GeV", fAbsPdgId); |
54 | return -99.0; |
55 | } |
56 | } |
57 | |
58 | //-------------------------------------------------------------------------------------------------- |
59 | inline TParticlePDG *mithep::StableParticle::PdgEntry() const |
60 | { |
61 | // Return entry to pdg database for the particle. |
62 | |
63 | return TDatabasePDG::Instance()->GetParticle(fAbsPdgId); |
64 | } |
65 | #endif |