1 |
bendavid |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
paus |
1.14 |
// $Id: StableParticle.h,v 1.13 2012/03/28 12:15:34 paus 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.8 |
StableParticle(UInt_t absPdgId, const Track *track) : fAbsPdgId(absPdgId), fTrackRef(track) {}
|
24 |
bendavid |
1.1 |
|
25 |
loizides |
1.7 |
UInt_t AbsPdgId() const { return fAbsPdgId; }
|
26 |
bendavid |
1.8 |
const Track *Trk() const { return fTrackRef.Obj(); }
|
27 |
loizides |
1.7 |
const Track *TrackerTrk() const { return Trk(); }
|
28 |
|
|
EObjType ObjType() const { return kStableParticle; }
|
29 |
loizides |
1.11 |
TParticlePDG *PdgEntry() const;
|
30 |
|
|
void SetAbsPdgId(UInt_t apdg) { fAbsPdgId=apdg; ClearMom(); }
|
31 |
|
|
void SetTrk(const Track *t) { fTrackRef = t; ClearMom(); ClearCharge(); }
|
32 |
bendavid |
1.1 |
|
33 |
paus |
1.13 |
// Some structural tools
|
34 |
paus |
1.14 |
void Mark(UInt_t i=1) const;
|
35 |
paus |
1.13 |
|
36 |
bendavid |
1.1 |
protected:
|
37 |
loizides |
1.9 |
Double_t GetMass() const;
|
38 |
|
|
|
39 |
loizides |
1.11 |
UInt_t fAbsPdgId; //pdg identifier (absolute value)
|
40 |
|
|
Ref<Track> fTrackRef; //tracker track reference
|
41 |
bendavid |
1.1 |
|
42 |
loizides |
1.4 |
ClassDef(StableParticle, 1) // Stable particle class
|
43 |
bendavid |
1.1 |
};
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
//--------------------------------------------------------------------------------------------------
|
47 |
paus |
1.14 |
inline void mithep::StableParticle::Mark(UInt_t ib) const
|
48 |
paus |
1.13 |
{
|
49 |
|
|
// mark myself
|
50 |
paus |
1.14 |
mithep::DataObject::Mark(ib);
|
51 |
paus |
1.13 |
// mark my dependencies if they are there
|
52 |
|
|
if (fTrackRef.IsValid())
|
53 |
paus |
1.14 |
fTrackRef.Obj()->Mark(ib);
|
54 |
paus |
1.13 |
}
|
55 |
|
|
|
56 |
|
|
//--------------------------------------------------------------------------------------------------
|
57 |
loizides |
1.9 |
inline Double_t mithep::StableParticle::GetMass() const
|
58 |
|
|
{
|
59 |
loizides |
1.11 |
// Get mass from pdg lookup.
|
60 |
loizides |
1.9 |
|
61 |
loizides |
1.11 |
TParticlePDG *pdgEntry = PdgEntry();
|
62 |
loizides |
1.9 |
if (pdgEntry)
|
63 |
|
|
return pdgEntry->Mass();
|
64 |
|
|
else {
|
65 |
|
|
Error("GetMass",
|
66 |
|
|
"Absolute pdg code %i not found in table, returning mass=-99.0 GeV", fAbsPdgId);
|
67 |
|
|
return -99.0;
|
68 |
|
|
}
|
69 |
|
|
}
|
70 |
bendavid |
1.1 |
#endif
|