src
SimG4Core
Notification
src
TrackInformationExtractor.cc
Go to the documentation of this file.
1
#include "
SimG4Core/Notification/interface/TrackInformationExtractor.h
"
2
3
#include "G4Track.hh"
4
5
const
TrackInformation
&
TrackInformationExtractor::operator()
(
const
G4Track >k)
const
{
6
G4VUserTrackInformation *gui = gtk.GetUserInformation();
7
const
TrackInformation
*tkInfo =
dynamic_cast<
const
TrackInformation
*
>
(gui);
8
if
(gui ==
nullptr
) {
9
missing
(gtk);
10
}
else
if
(tkInfo ==
nullptr
) {
11
wrongType
();
12
}
13
return
*tkInfo;
14
}
15
16
TrackInformation
&
TrackInformationExtractor::operator()
(G4Track >k)
const
{
17
G4VUserTrackInformation *gui = gtk.GetUserInformation();
18
TrackInformation
*tkInfo =
dynamic_cast<
TrackInformation
*
>
(gui);
19
if
(gui ==
nullptr
) {
20
missing
(gtk);
21
}
else
if
(tkInfo ==
nullptr
) {
22
wrongType
();
23
}
24
return
*tkInfo;
25
}
26
27
void
TrackInformationExtractor::missing
(
const
G4Track &)
const
{
28
G4Exception(
29
"SimG4Core/Notification"
,
"mc001"
, FatalException,
"TrackInformationExtractor: G4Track has no TrackInformation"
);
30
}
31
32
void
TrackInformationExtractor::wrongType
()
const
{
33
G4Exception(
34
"SimG4Core/Notification"
,
"mc001"
, FatalException,
"User information in G4Track is not of TrackInformation type"
);
35
}
TrackInformationExtractor::missing
void missing(const G4Track >k) const
Definition:
TrackInformationExtractor.cc:27
TrackInformationExtractor.h
TrackInformationExtractor::operator()
const TrackInformation & operator()(const G4Track >k) const
Definition:
TrackInformationExtractor.cc:5
TrackInformation
Definition:
TrackInformation.h:12
TrackInformationExtractor::wrongType
void wrongType() const
Definition:
TrackInformationExtractor.cc:32
Generated for CMSSW Reference Manual by
1.8.14