64 #ifndef ST_NO_NAMESPACES
68 #include "StMcVertex.hh"
69 #include "StMcTrack.hh"
70 #include "tables/St_g2t_vertex_Table.h"
72 static const char rcsid[] =
"$Id: StMcVertex.cc,v 2.13 2016/05/16 23:47:09 perev Exp $";
76 StMcVertex::StMcVertex()
80 mGeantVolume =
"aaaa";
83 mGeneratorProcess = 0;
88 StMcVertex::StMcVertex(g2t_vertex_st* vtx)
92 mPosition.setX(vtx->ge_x[0]);
93 mPosition.setY(vtx->ge_x[1]);
94 mPosition.setZ(vtx->ge_x[2]);
95 char tmp[5]; tmp[4]=0; strncpy(tmp,vtx->ge_volume,4);
98 mGeantProcess = vtx->ge_proc;
99 mGeneratorProcess = vtx->eg_proc;
101 mGeantMedium = vtx->ge_medium;
106 StMcVertex::~StMcVertex()
112 int StMcVertex::operator==(
const StMcVertex& v)
const
114 return (mGeantProcess == v.mGeantProcess &&
115 mPosition == v.mPosition &&
120 int StMcVertex::operator!=(
const StMcVertex& v)
const
122 return !(v == *
this);
125 ostream& operator<<(ostream& os,
const StMcVertex& v)
127 os <<
"Position : " << Form(
"%8.3f%8.3f%8.3f",v.position().x(),v.position().y(),v.position().z()) << endl;
128 os <<
"Geant Volume : " << v.geantVolume() << endl;
129 os <<
"Time of Flight: " << v.tof() << endl;
130 os <<
"Geant Process : " << v.geantProcess() << endl;
131 Int_t nDaughters = v.numberOfDaughters();
132 os <<
"N. Daughters : " << nDaughters;
141 void StMcVertex::setPosition(
const StThreeVectorF& val) { mPosition = val; }
143 void StMcVertex::setParent(
StMcTrack* val) { mParent = val; }
145 void StMcVertex::addDaughter(
StMcTrack* val) { mDaughters.push_back(val); }
147 void StMcVertex::setGeantVolume(
const Char_t *val) { mGeantVolume = val; }
149 void StMcVertex::setTof(
float val) { mTof = val; }
151 void StMcVertex::setGeantProcess(
int val) { mGeantProcess = val; }
153 void StMcVertex::removeDaughter(
StMcTrack* trk) {
154 StMcTrackIterator iter = find(mDaughters.begin(), mDaughters.end(), trk);
155 if (iter != mDaughters.end()) mDaughters.erase(iter);
158 void StMcVertex::Print(Option_t *option)
const {
159 cout <<
"StMcVertex: pos:" << Form(
"%8.3f%8.3f%8.3f",position().x(),position().y(),position().z())
160 <<
" Volume: " << geantVolume()
161 <<
" Time of Flight(ns): " << 1.e9*
tof()
162 <<
" Process: " << geantProcess();
163 Int_t nDaughters = numberOfDaughters();
164 cout <<
" N.Daughters: " << nDaughters;
165 for (
int j = 0; j < nDaughters; j++) {
166 cout <<
"\t" << daughter(j)->key();
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...