CMS 3D CMS Logo

TrackInformationExtractor.cc
Go to the documentation of this file.
2 
3 #include "G4Track.hh"
4 
5 const TrackInformation &
6 TrackInformationExtractor::operator()(const G4Track & gtk) const
7 {
8  G4VUserTrackInformation * gui = gtk.GetUserInformation();
9  if (gui == nullptr) missing(gtk);
10  const TrackInformation * tkInfo = dynamic_cast<const TrackInformation *>(gui);
11  if (tkInfo == nullptr) wrongType();
12  return * tkInfo;
13 }
14 
17 {
18  G4VUserTrackInformation * gui = gtk.GetUserInformation();
19  if (gui == nullptr) missing(gtk);
20  TrackInformation * tkInfo = dynamic_cast<TrackInformation *>(gui);
21  if (tkInfo == nullptr) wrongType();
22  return * tkInfo;
23 }
24 
const TrackInformation & operator()(const G4Track &gtk) const
void missing(const G4Track &gtk) const