BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
TTrackHEP.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TTrackHEP.h,v 1.6 2010/03/31 09:58:59 liucy Exp $
3//-----------------------------------------------------------------------------
4// Filename : TTrackHEP.h
5// Section : Tracking
6// Owner : Yoshi Iwasaki
7// Email : [email protected]
8//-----------------------------------------------------------------------------
9// Description : A class to represent a GEN_HEPEVT particle in tracking.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifndef TTrackHEP_FLAG_
14#define TTrackHEP_FLAG_
15
16#ifdef TRKRECO_DEBUG_DETAIL
17#ifndef TRKRECO_DEBUG
18#define TRKRECO_DEBUG
19#endif
20#endif
21
22// itostring
23#include "CLHEP/String/Strings.h"
24
25#define HEP_SHORT_NAMES
26#include "CLHEP/Alist/AList.h"
27#include "CLHEP/Vector/ThreeVector.h"
28#include "CLHEP/Vector/LorentzVector.h"
29//#include "tables/hepevt.h"
31#include "TrkReco/TMDC.h"
32
33using CLHEP::Hep3Vector;
34using CLHEP::HepLorentzVector;
35
36/// A class to represent a GEN_HEPEVT particle in tracking.
37class TTrackHEP {
38
39 public:
40 /// returns a list of TTrackHEP's.
41 static const AList<TTrackHEP> & list(void);
42
43 /// returns a pointer to TTrackHEP of given Gen_hepevt.
44 static TTrackHEP * hep(const Gen_hepevt *);
45
46 private:
47 /// updates information.
48 static void update(void);
49
50 private:
51 /// Constructor
52 TTrackHEP(const Gen_hepevt *);
53
54 public:
55 /// Destructor
56 virtual ~TTrackHEP();
57
58 public:
59 /// returns name.
60 std::string name(void) const;
61
62 /// returns an id started from 0.
63 unsigned id(void) const;
64
65 /// returns status.
66 int status(void) const;
67
68 /// returns particle type.
69 int pType(void) const;
70
71 /// returns a pointer to a mother.
72 TTrackHEP * mother(void) const;
73
74 /// returns a pointer to i'th child.
75 TTrackHEP * child(unsigned i) const;
76
77 /// returns momentum vector.
78// const VectorL & p(void) const;
79 const HepLorentzVector & p(void) const;
80
81 /// returns position vector.
82 const Hep3Vector & v(void) const;
83
84 /// dumps debug information.
85 void dump(const std::string & message = std::string(""),
86 const std::string & prefix = std::string("")) const;
87
88 /// returns a list of TMDCWireHitMC.
89 const AList<TMDCWireHitMC> & hits(void) const;
90
91 /// returns a pointer to Gen_hepevt.
92 const Gen_hepevt * gen(void) const;
93
94 private:
95 const Gen_hepevt * _hep;
96 TTrackHEP * _mother;
97 AList<TTrackHEP> _children;
98// const VectorL _p;
99 const HepLorentzVector _p;
100 const Hep3Vector _v;
102
103 private:// static members
104 static AList<TTrackHEP> _list;
105
106 friend void TMDC::updateMC(void);
107};
108
109//-----------------------------------------------------------------------------
110
111#ifdef TRKRECO_NO_INLINE
112#define inline
113#else
114#undef inline
115#define TTrackHEP_INLINE_DEFINE_HERE
116#endif
117
118#ifdef TTrackHEP_INLINE_DEFINE_HERE
119
120inline
121unsigned
122TTrackHEP::id(void) const {
123 return _hep->id - 1;
124}
125
126inline
127int
128TTrackHEP::status(void) const {
129 return _hep->isthep;
130}
131
132inline
133int
134TTrackHEP::pType(void) const {
135 return _hep->idhep;
136}
137
138inline
139TTrackHEP *
140TTrackHEP::mother(void) const {
141 return _mother;
142}
143
144inline
145TTrackHEP *
146TTrackHEP::child(unsigned i) const {
147 return _children[i];
148}
149
150inline
151const HepLorentzVector &
152TTrackHEP::p(void) const {
153 return _p;
154}
155
156inline
157const Hep3Vector &
158TTrackHEP::v(void) const {
159 return _v;
160}
161
162inline
163TTrackHEP *
165 if (! h) return 0;
166 unsigned id = h->id - 1;
167 return _list[id];
168}
169
170inline
172TTrackHEP::hits(void) const {
173 return _hits;
174}
175
176inline
177std::string
178TTrackHEP::name(void) const {
179 return "mc" + itostring(id());
180}
181
182inline
183const Gen_hepevt *
184TTrackHEP::gen(void) const {
185 return _hep;
186}
187
188#endif
189
190#undef inline
191
192#endif /* TTrackHEP_FLAG_ */
void updateMC(void)
updates TMDC information for MC.
Definition: TMDC.cxx:376
A class to represent a GEN_HEPEVT particle in tracking.
Definition: TTrackHEP.h:37
const AList< TMDCWireHitMC > & hits(void) const
returns a list of TMDCWireHitMC.
Definition: TTrackHEP.h:172
unsigned id(void) const
returns an id started from 0.
Definition: TTrackHEP.h:122
int status(void) const
returns status.
Definition: TTrackHEP.h:128
const HepLorentzVector & p(void) const
returns momentum vector.
Definition: TTrackHEP.h:152
TTrackHEP * child(unsigned i) const
returns a pointer to i'th child.
Definition: TTrackHEP.h:146
const Gen_hepevt * gen(void) const
returns a pointer to Gen_hepevt.
Definition: TTrackHEP.h:184
TTrackHEP * mother(void) const
returns a pointer to a mother.
Definition: TTrackHEP.h:140
std::string name(void) const
returns name.
Definition: TTrackHEP.h:178
int pType(void) const
returns particle type.
Definition: TTrackHEP.h:134
static TTrackHEP * hep(const Gen_hepevt *)
returns a pointer to TTrackHEP of given Gen_hepevt.
Definition: TTrackHEP.h:164
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition: TTrackHEP.cxx:59
virtual ~TTrackHEP()
Destructor.
Definition: TTrackHEP.cxx:55
const Hep3Vector & v(void) const
returns position vector.
Definition: TTrackHEP.h:158
static const AList< TTrackHEP > & list(void)
returns a list of TTrackHEP's.
Definition: TTrackHEP.cxx:72