CMS 3D CMS Logo

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