LDMX Software
SimCore
src
SimCore
UserTrackInformation.cxx
1
#include "SimCore/UserTrackInformation.h"
2
3
/*~~~~~~~~~~~~~~~~*/
4
/* C++ StdLib */
5
/*~~~~~~~~~~~~~~~~*/
6
#include <iostream>
7
8
namespace
simcore {
9
10
UserTrackInformation
*
UserTrackInformation::get
(
const
G4Track* track) {
11
if
(!track->GetUserInformation()) {
12
const_cast<
G4Track*
>
(track)->SetUserInformation(
new
UserTrackInformation
);
13
}
14
return
dynamic_cast<
UserTrackInformation
*
>
(track->GetUserInformation());
15
}
16
17
void
UserTrackInformation::initialize
(
const
G4Track* track) {
18
initialMomentum_
= track->GetMomentum();
19
vertexVolume_
= track->GetLogicalVolumeAtVertex()->GetName();
20
vertex_time_
= track->GetGlobalTime();
21
}
22
void
UserTrackInformation::Print
()
const
{
23
std::cout <<
"Saving track: "
<<
saveFlag_
<<
"\n"
24
<<
"Is brem candidate: "
<<
isBremCandidate_
<<
"\n"
25
<< std::endl;
26
}
27
}
// namespace simcore
simcore::UserTrackInformation
Provides user defined information to associate with a Geant4 track.
Definition
UserTrackInformation.h:16
simcore::UserTrackInformation::vertexVolume_
std::string vertexVolume_
Volume the track was created in.
Definition
UserTrackInformation.h:161
simcore::UserTrackInformation::get
static UserTrackInformation * get(const G4Track *track)
get
Definition
UserTrackInformation.cxx:10
simcore::UserTrackInformation::Print
void Print() const override
Print the information associated with the track.
Definition
UserTrackInformation.cxx:22
simcore::UserTrackInformation::saveFlag_
bool saveFlag_
Flag for saving the track as a Trajectory.
Definition
UserTrackInformation.h:146
simcore::UserTrackInformation::initialize
void initialize(const G4Track *track)
Initialize the track information with the passed track.
Definition
UserTrackInformation.cxx:17
simcore::UserTrackInformation::initialMomentum_
G4ThreeVector initialMomentum_
The initial momentum of the track.
Definition
UserTrackInformation.h:167
simcore::UserTrackInformation::vertex_time_
double vertex_time_
Global Time of Creation.
Definition
UserTrackInformation.h:164
simcore::UserTrackInformation::isBremCandidate_
bool isBremCandidate_
Flag indicating whether this track is a brem candidate.
Definition
UserTrackInformation.h:149
Generated by
1.9.8