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