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 }
TrackInformationExtractor::operator()
const TrackInformation & operator()(const G4Track &gtk) const
Definition: TrackInformationExtractor.cc:5
TrackInformation
Definition: TrackInformation.h:12
TrackInformationExtractor::wrongType
void wrongType() const
Definition: TrackInformationExtractor.h:37
TrackInformationExtractor.h
TrackInformationExtractor::missing
void missing(const G4Track &gtk) const
Definition: TrackInformationExtractor.h:34