Belle II Software development
TrackMC.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9//-----------------------------------------------------------------------------
10// Description : A class to represent a GEN_HEPEVT particle in tracking.
11//-----------------------------------------------------------------------------
12
13#ifndef TRGCDCTrackMC_FLAG_
14#define TRGCDCTrackMC_FLAG_
15
16#include <vector>
17#include "CLHEP/Vector/LorentzVector.h"
18#include "trg/trg/Utilities.h"
19#include "trg/cdc/TRGCDC.h"
20
21#ifdef TRGCDC_SHORT_NAMES
22#define TCTrackMC TRGCDCTrackMC
23#endif
24
25namespace Belle2 {
33
34 public:
36 static std::vector<const TRGCDCTrackMC*> list(void);
37
38 private:
40 static void update(void);
41
42 private:
45
46 public:
48 virtual ~TRGCDCTrackMC();
49
50 public:
52 std::string name(void) const;
53
55 unsigned id(void) const;
56
58 int status(void) const;
59
61 int pType(void) const;
62
64 const TRGCDCTrackMC* mother(void) const;
65
67 const TRGCDCTrackMC* child(unsigned i) const;
68
70 const CLHEP::HepLorentzVector& p(void) const;
71
73 const CLHEP::Hep3Vector& v(void) const;
74
76 void dump(const std::string& message = std::string(""),
77 const std::string& prefix = std::string("")) const;
78
80 std::vector<const TRGCDCWireHitMC*> hits(void) const;
81
83//cnv const struct gen_hepevt * gen(void) const;
84
85 public:
86
89
90 private:
91 // const struct gen_hepevt * _hep;
95 std::vector<TRGCDCTrackMC*> _children;
97 const CLHEP::HepLorentzVector _p;
99 const CLHEP::Hep3Vector _v;
101 std::vector<TRGCDCWireHitMC*> _hits;
102
103 private:// static members
105 static std::vector<const TRGCDCTrackMC*> _list;
106
107 friend class TRGCDC;
108 };
109
110//-----------------------------------------------------------------------------
111
112 inline
113 unsigned
115 {
116//cnv return _hep->m_ID - 1;
117 return 0;
118 }
119
120 inline
121 int
123 {
124//cnv return _hep->m_isthep;
125 return 0;
126 }
127
128 inline
129 int
131 {
132// return _hep->m_idhep;
133 return 0;
134 }
135
136 inline
137 const TRGCDCTrackMC*
139 {
140 return _mother;
141 }
142
143 inline
144 const TRGCDCTrackMC*
145 TRGCDCTrackMC::child(unsigned i) const
146 {
147 return _children[i];
148 }
149
150 inline
151 const CLHEP::HepLorentzVector&
153 {
154 return _p;
155 }
156
157 inline
158 const CLHEP::Hep3Vector&
160 {
161 return _v;
162 }
163
164 inline
165 std::string
167 {
168 return "mc" + TRGUtilities::itostring(id());
169 }
170
172} // namespace Belle2
173
174#endif /* TRGCDCTrackMC_FLAG_ */
A class to represent a GEN_HEPEVT particle in tracking.
Definition: TrackMC.h:32
std::vector< TRGCDCWireHitMC * > _hits
vector of pointers to TRGCDCWireHitMC
Definition: TrackMC.h:101
TRGCDCTrackMC * _mother
pointer to mother TRGCDCTrackMC
Definition: TrackMC.h:93
std::vector< TRGCDCTrackMC * > _children
vector of pointers to children TRGCDCTrackMC
Definition: TrackMC.h:95
const CLHEP::HepLorentzVector _p
momentum
Definition: TrackMC.h:97
const CLHEP::Hep3Vector _v
vertex
Definition: TrackMC.h:99
The instance of TRGCDC is a singleton.
Definition: TRGCDC.h:69
const CLHEP::Hep3Vector & v(void) const
returns position vector.
Definition: TrackMC.h:159
static std::vector< const TRGCDCTrackMC * > _list
vector of pointers to TRGCDCTrackMC
Definition: TrackMC.h:105
std::vector< const TRGCDCWireHitMC * > hits(void) const
returns a list of TRGCDCWireHitMC.
Definition: TrackMC.cc:102
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition: TrackMC.cc:81
const TRGCDCTrackMC * child(unsigned i) const
returns a pointer to i'th child.
Definition: TrackMC.h:145
unsigned id(void) const
returns an id started from 0.
Definition: TrackMC.h:114
const CLHEP::HepLorentzVector & p(void) const
returns momentum vector.
Definition: TrackMC.h:152
const TRGCDCTrackMC * mother(void) const
returns a pointer to a mother.
Definition: TrackMC.h:138
int status(void) const
returns status.
Definition: TrackMC.h:122
virtual ~TRGCDCTrackMC()
Destructor.
Definition: TrackMC.cc:71
static void update(void)
updates information.
Definition: TrackMC.cc:29
static std::string itostring(int i)
converts int to string. (Use boost::lexical_cast)
Definition: Utilities.cc:50
static TRGCDCTrackMC * _undefined
returns a pointer to gen_hepevt.
Definition: TrackMC.h:88
TRGCDCTrackMC()
Constructor.
Definition: TrackMC.cc:67
std::string name(void) const
returns name.
Definition: TrackMC.h:166
int pType(void) const
returns particle type.
Definition: TrackMC.h:130
static std::vector< const TRGCDCTrackMC * > list(void)
returns a list of TRGCDCTrackMC's.
Definition: TrackMC.cc:94
Abstract base class for different kinds of events.