ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TrackHandle_SimulationTrack::Imp Class Reference
Collaboration diagram for TrackHandle_SimulationTrack::Imp:

Public Member Functions

 Imp (TrackHandle_SimulationTrack *tc, const SimBarCode &sbc, const SimHitList &shl)
 
void ensureInitAscObjs ()
 
void ensureInitTrkTracks ()
 
void createTrack (Trk::TrackStates *trackStateOnSurfaces)
 

Static Public Member Functions

static Trk::TrackStateOnSurfacecreateTSOS (Trk::TrackParameters *pars)
 
static void addPars (Trk::TrackStates *dv, Trk::TrackParameters *pars)
 

Public Attributes

TrackHandle_SimulationTracktheclass
 
SimBarCode simBarCode
 
SimHitList simHitList
 
bool ascObjVis
 
std::vector< AscObj_TruthPoint * > * ascObjs
 
const Trk::TracktrkTrack
 

Detailed Description

Definition at line 28 of file TrackHandle_SimulationTrack.cxx.

Constructor & Destructor Documentation

◆ Imp()

TrackHandle_SimulationTrack::Imp::Imp ( TrackHandle_SimulationTrack tc,
const SimBarCode sbc,
const SimHitList shl 
)
inline

Definition at line 30 of file TrackHandle_SimulationTrack.cxx.

32  : theclass(tc),
33  simBarCode(sbc),
34  simHitList(shl),
35  ascObjVis(false),
36  ascObjs(nullptr),
37  trkTrack(nullptr) {}

Member Function Documentation

◆ addPars()

static void TrackHandle_SimulationTrack::Imp::addPars ( Trk::TrackStates dv,
Trk::TrackParameters pars 
)
inlinestatic

Definition at line 56 of file TrackHandle_SimulationTrack.cxx.

57  {
58  if (!pars)
59  return;
61  if (tsos)
62  dv->push_back(tsos);
63  }

◆ createTrack()

void TrackHandle_SimulationTrack::Imp::createTrack ( Trk::TrackStates trackStateOnSurfaces)
inline

Definition at line 65 of file TrackHandle_SimulationTrack.cxx.

66  {
67  if (!trackStateOnSurfaces) {
68  VP1Msg::messageDebug("TrackHandle_SimulationTrack WARNING: Could not create track due to null TSOS vector");
69  return;
70  }
71  if (trackStateOnSurfaces->empty()) {
72  VP1Msg::messageDebug("TrackHandle_SimulationTrack WARNING: Could not create track due to empty TSOS vector");
73  delete trackStateOnSurfaces;
74  return;
75  }
76  if (trkTrack) {
77  VP1Msg::messageDebug("TrackHandle_SimulationTrack ERROR: Already create trkTrack previously!");
78  delete trackStateOnSurfaces;
79  return;
80  }
81 
84  /*track assumes ownership*/
85  std::unique_ptr<Trk::TrackStates> sink(trackStateOnSurfaces);
86  trkTrack = new Trk::Track(
87  ti,
88  std::move(sink),
89  nullptr /*fitquality*/);
90 
91  // if (VP1Msg::verbose())
92  // VP1Msg::messageVerbose("TrackHandle_SimulationTrack created track
93  // with "
94  // +QString::number(trackStateOnSurfaces->size())+"
95  // parameters");
96  }

◆ createTSOS()

static Trk::TrackStateOnSurface* TrackHandle_SimulationTrack::Imp::createTSOS ( Trk::TrackParameters pars)
inlinestatic

Definition at line 48 of file TrackHandle_SimulationTrack.cxx.

49  {
50  return pars ? new Trk::TrackStateOnSurface(
51  nullptr,
52  std::unique_ptr<Trk::TrackParameters>(pars),
53  nullptr)
54  : nullptr;
55  }

◆ ensureInitAscObjs()

void TrackHandle_SimulationTrack::Imp::ensureInitAscObjs ( )

Definition at line 230 of file TrackHandle_SimulationTrack.cxx.

231 {
232  if (ascObjs)
233  return;
234  ascObjs = new std::vector<AscObj_TruthPoint*>;
235  ascObjs->reserve(simHitList.size());
236 {
237  SimHitList::const_iterator it, itE(simHitList.end());
238  for ( it = simHitList.begin(); it != itE; ++it )
239  ascObjs->push_back(new AscObj_TruthPoint(theclass,it->second));
240  }
241  {
243  for (it=ascObjs->begin();it!=itE;++it)
245  for (it=ascObjs->begin();it!=itE;++it)
246  (*it)->setVisible(ascObjVis);
247  }
248 }

◆ ensureInitTrkTracks()

void TrackHandle_SimulationTrack::Imp::ensureInitTrkTracks ( )

Definition at line 128 of file TrackHandle_SimulationTrack.cxx.

129 {
130  if (trkTrack)
131  return;
132 
133  if (!theclass->hasCharge()) {
134  VP1Msg::message("TrackHandle_SimulationTrack ERROR: Could not determine particle charge (pdg="
135  +QString::number(theclass->pdgCode())+").");//Fixme: I guess we could show non-extrapolated version?
136  return;
137  }
138  //const double charge = theclass->charge(); unused
139 
140  Trk::TrackStates* trackStateOnSurfaces = new Trk::TrackStates;
141 
142 
143  SimHitList::const_iterator it, itE(simHitList.end());
144  for ( it = simHitList.begin(); it != itE; ++it ) {
145  //Fixme: momentum() < 0 (i.e. not present);
146  //Fixme: Possibly add points for both posStart() and posEnd() (and use energy loss information to get different momenta?)
147  addPars(trackStateOnSurfaces,it->second->createTrackParameters());
148  }
149 
150 
151  createTrack(trackStateOnSurfaces);
152 }

Member Data Documentation

◆ ascObjs

std::vector<AscObj_TruthPoint*>* TrackHandle_SimulationTrack::Imp::ascObjs

Definition at line 43 of file TrackHandle_SimulationTrack.cxx.

◆ ascObjVis

bool TrackHandle_SimulationTrack::Imp::ascObjVis

Definition at line 42 of file TrackHandle_SimulationTrack.cxx.

◆ simBarCode

SimBarCode TrackHandle_SimulationTrack::Imp::simBarCode

Definition at line 39 of file TrackHandle_SimulationTrack.cxx.

◆ simHitList

SimHitList TrackHandle_SimulationTrack::Imp::simHitList

Definition at line 40 of file TrackHandle_SimulationTrack.cxx.

◆ theclass

TrackHandle_SimulationTrack* TrackHandle_SimulationTrack::Imp::theclass

Definition at line 38 of file TrackHandle_SimulationTrack.cxx.

◆ trkTrack

const Trk::Track* TrackHandle_SimulationTrack::Imp::trkTrack

Definition at line 45 of file TrackHandle_SimulationTrack.cxx.


The documentation for this class was generated from the following file:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
PlotCalibFromCool.dv
dv
Definition: PlotCalibFromCool.py:762
TrackHandle_SimulationTrack::Imp::addPars
static void addPars(Trk::TrackStates *dv, Trk::TrackParameters *pars)
Definition: TrackHandle_SimulationTrack.cxx:56
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TrackHandle_SimulationTrack::Imp::simBarCode
SimBarCode simBarCode
Definition: TrackHandle_SimulationTrack.cxx:39
TrackHandle_SimulationTrack::Imp::simHitList
SimHitList simHitList
Definition: TrackHandle_SimulationTrack.cxx:40
TrackHandle_SimulationTrack::pdgCode
virtual int pdgCode() const
0 means unknown
Definition: TrackHandle_SimulationTrack.cxx:176
TrackHandle_SimulationTrack::Imp::createTSOS
static Trk::TrackStateOnSurface * createTSOS(Trk::TrackParameters *pars)
Definition: TrackHandle_SimulationTrack.cxx:48
TruthTest.itE
itE
Definition: TruthTest.py:25
TrackHandleBase::registerAssocObject
void registerAssocObject(AssociatedObjectHandleBase *)
Trackhandle assumes ownership.
Definition: TrackHandleBase.cxx:1449
TrackHandle_SimulationTrack::Imp::createTrack
void createTrack(Trk::TrackStates *trackStateOnSurfaces)
Definition: TrackHandle_SimulationTrack.cxx:65
Trk::TrackStates
DataVector< const Trk::TrackStateOnSurface > TrackStates
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:30
DataVector< const Trk::TrackStateOnSurface >
TrackHandleBase::extrapolationParticleHypothesis
virtual Trk::ParticleHypothesis extrapolationParticleHypothesis() const
Default implementation of this next method bases hypothesis on pdgCode() and charge():
Definition: TrackHandleBase.cxx:1534
TrackHandle_SimulationTrack::Imp::trkTrack
const Trk::Track * trkTrack
Definition: TrackHandle_SimulationTrack.cxx:45
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
python.selection.number
number
Definition: selection.py:20
TrackHandle_SimulationTrack::Imp::ascObjVis
bool ascObjVis
Definition: TrackHandle_SimulationTrack.cxx:42
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition: VP1Msg.cxx:39
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition: VP1Msg.cxx:30
TrackHandle_SimulationTrack::Imp::ascObjs
std::vector< AscObj_TruthPoint * > * ascObjs
Definition: TrackHandle_SimulationTrack.cxx:43
AscObj_TruthPoint
Definition: AscObj_TruthPoint.h:27
TrackHandleBase::hasCharge
bool hasCharge() const
Definition: TrackHandleBase.h:99
TrackHandle_SimulationTrack::Imp::theclass
TrackHandle_SimulationTrack * theclass
Definition: TrackHandle_SimulationTrack.cxx:38
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
Trk::TrackInfo::Unknown
@ Unknown
Track fitter not defined.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:41