CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
TTrackHEP.cxx
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TTrackHEP.cxx,v 1.4 2010/03/31 09:58:59 liucy Exp $
3//-----------------------------------------------------------------------------
4// Filename : TTrackHEP.cc
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#include "TrkReco/TTrackHEP.h"
14#include <vector>
16
18TTrackHEP::_list = AList<TTrackHEP>();
19
20void
21TTrackHEP::update(void) {
22 if (_list.length()) HepAListDeleteAll(_list);
23
24// unsigned n = BsCouTab(GEN_HEPEVT);
25// std::vector<Gen_hepevt>* genhep = GenHepevtCol::getGenHepevtCol();
26 unsigned n = GenHepevtCol::getGenHepevtCol()->size();
27// unsigned n = genhep -> size();
28
29 for (unsigned i = 0; i < n; i++) {
30// Gen_hepevt * h = *genhep[i];
32// (struct gen_hepevt *) BsGetEnt(GEN_HEPEVT, i + 1, BBS_No_Index);
33 if (! h) {
34 std::cout << "TTrackHEP::update !!! can not access to GEN_HEPEVT";
35 std::cout << std::endl;
36 break;
37 }
38
39 _list.append(new TTrackHEP(h));
40 }
41}
42
43TTrackHEP::TTrackHEP(const Gen_hepevt * h)
44: _hep(h),
45 _mother(0),
46 _p(h->P[0], h->P[1], h->P[2], h->P[3]),
47 _v(h->V[0], h->V[1], h->V[2]) {
48 if (_hep->mother != 0) {
49// _mother = _list[_hep->mother-1];
50 _mother = _list[_hep->mother->id];
51 _mother->_children.append(this);
52 }
53}
54
57
58void
59TTrackHEP::dump(const std::string & msg, const std::string & pre) const {
60 std::cout << pre;
61
62 std::cout << id() << ":";
63 std::cout << pType() << ":";
64 if (_mother) std::cout << _mother->id();
65 else std::cout << "-";
66 std::cout << ":";
67 std::cout << _p << ":" << _v;
68 std::cout << std::endl;
69}
70
71const AList<TTrackHEP> &
73 return _list;
74}
double P(RecMdcKalTrack *trk)
const Int_t n
static vector< Gen_hepevt > * getGenHepevtCol(void)
A class to represent a GEN_HEPEVT particle in tracking.
Definition TTrackHEP.h:37
unsigned id(void) const
returns an id started from 0.
Definition TTrackHEP.h:122
int pType(void) const
returns particle type.
Definition TTrackHEP.h:134
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
static const AList< TTrackHEP > & list(void)
returns a list of TTrackHEP's.
Definition TTrackHEP.cxx:72