BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/TrkReco/include/TrkReco/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 : yoshihito.iwasaki@kek.jp
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// std::to_string
23// #include "CLHEP/String/Strings.h"
24
25// #define HEP_SHORT_NAMES
26#include "CLHEP/Alist/AList.h"
27#include "CLHEP/Vector/LorentzVector.h"
28#include "CLHEP/Vector/ThreeVector.h"
29// #include "tables/hepevt.h"
30#include "MdcTables/HepevtTables.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
39public:
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
46private:
47 /// updates information.
48 static void update( void );
49
50private:
51 /// Constructor
52 TTrackHEP( const Gen_hepevt* );
53
54public:
55 /// Destructor
56 virtual ~TTrackHEP();
57
58public:
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
94private:
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
103private: // 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 unsigned TTrackHEP::id( void ) const { return _hep->id - 1; }
121
122inline int TTrackHEP::status( void ) const { return _hep->isthep; }
123
124inline int TTrackHEP::pType( void ) const { return _hep->idhep; }
125
126inline TTrackHEP* TTrackHEP::mother( void ) const { return _mother; }
127
128inline TTrackHEP* TTrackHEP::child( unsigned i ) const { return _children[i]; }
129
130inline const HepLorentzVector& TTrackHEP::p( void ) const { return _p; }
131
132inline const Hep3Vector& TTrackHEP::v( void ) const { return _v; }
133
134inline TTrackHEP* TTrackHEP::hep( const Gen_hepevt* h ) {
135 if ( !h ) return 0;
136 unsigned id = h->id - 1;
137 return _list[id];
138}
139
140inline const AList<TMDCWireHitMC>& TTrackHEP::hits( void ) const { return _hits; }
141
142inline std::string TTrackHEP::name( void ) const { return "mc" + std::to_string( id() ); }
143
144inline const Gen_hepevt* TTrackHEP::gen( void ) const { return _hep; }
145
146#endif
147
148#undef inline
149
150#endif /* TTrackHEP_FLAG_ */
void updateMC(void)
updates TMDC information for MC.
Definition TMDC.cxx:336
A class to represent a GEN_HEPEVT particle in tracking.
const AList< TMDCWireHitMC > & hits(void) const
returns a list of TMDCWireHitMC.
unsigned id(void) const
returns an id started from 0.
int status(void) const
returns status.
const HepLorentzVector & p(void) const
returns momentum vector.
TTrackHEP * child(unsigned i) const
returns a pointer to i'th child.
const Gen_hepevt * gen(void) const
returns a pointer to Gen_hepevt.
TTrackHEP * mother(void) const
returns a pointer to a mother.
std::string name(void) const
returns name.
int pType(void) const
returns particle type.
static TTrackHEP * hep(const Gen_hepevt *)
returns a pointer to TTrackHEP of given Gen_hepevt.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
static const AList< TTrackHEP > & list(void)
returns a list of TTrackHEP's.
const Hep3Vector & v(void) const
returns position vector.
virtual ~TTrackHEP()
Destructor.
static TTrackHEP * hep(const Gen_hepevt *)
returns a pointer to TTrackHEP of given Gen_hepevt.