5 #include <G4VProcess.hh> 6 #include <G4ParticleTable.hh> 7 #include <G4AttDefStore.hh> 9 #include <G4AttValue.hh> 10 #include <G4UnitsTable.hh> 19 : fPositionRecord(0), fTrackID(0), fParentID(0),
20 fPDGEncoding(0), fPDGCharge(0.0), fParticleName(
""),
21 fProcessName(
""), fInitialMomentum(G4ThreeVector()),
22 fSDEnergyDeposit(0), fSDTotalEnergyDeposit(0), fSDLength(0),
23 fSaveTrajectory(false) {;}
31 G4ParticleDefinition * fpParticleDefinition = aTrack->GetDefinition();
33 fPDGCharge = fpParticleDefinition->GetPDGCharge();
35 const G4VProcess* proc = aTrack->GetCreatorProcess();
68 delete (*fPositionRecord)[i];
79 double mass = p->GetPDGMass();
80 double kin = std::sqrt(mom*mom + mass*mass) - mass;
81 if (kin<0.0)
return 0.0;
92 return (last - first).mag();
104 if (
this == traj)
return;
110 std::map<G4String,G4AttDef>* store
111 = G4AttDefStore::GetInstance(
"EDepSim::Trajectory",isNew);
115 (*store)[
ID] = G4AttDef(ID,
117 "Bookkeeping",
"",
"G4int");
120 (*store)[PID] = G4AttDef(PID,
122 "Bookkeeping",
"",
"G4int");
125 (*store)[PN] = G4AttDef(PN,
127 "Physics",
"",
"G4String");
130 (*store)[Ch] = G4AttDef(Ch,
132 "Physics",
"",
"G4double");
135 (*store)[
PDG] = G4AttDef(PDG,
137 "Physics",
"",
"G4int");
139 G4String IMom(
"IMom");
140 (*store)[IMom] = G4AttDef(IMom,
141 "Momentum of track at start of trajectory",
142 "Physics",
"",
"G4ThreeVector");
145 (*store)[NTP] = G4AttDef(NTP,
147 "Physics",
"",
"G4int");
155 std::ostringstream
s(c);
157 std::vector<G4AttValue>*
values =
new std::vector<G4AttValue>;
159 s.seekp(std::ios::beg);
161 values->push_back(G4AttValue(
"ID",c.c_str(),
""));
163 s.seekp(std::ios::beg);
165 values->push_back(G4AttValue(
"PID",c.c_str(),
""));
169 s.seekp(std::ios::beg);
171 values->push_back(G4AttValue(
"Ch",c.c_str(),
""));
173 s.seekp(std::ios::beg);
175 values->push_back(G4AttValue(
"PDG",c.c_str(),
""));
177 s.seekp(std::ios::beg);
179 values->push_back(G4AttValue(
"IMom",c.c_str(),
""));
181 s.seekp(std::ios::beg);
183 values->push_back(G4AttValue(
"NTP",c.c_str(),
""));
194 return (G4ParticleTable::GetParticleTable()->FindParticle(
fParticleName));
198 if(!secondTrajectory)
return;
202 for(G4int i=1; i<ent; ++i) {
G4double GetInitialKineticEnergy() const
G4double fSDEnergyDeposit
G4ParticleDefinition * GetParticleDefinition() const
Get the full definition of the particle.
TrajectoryPointContainer * fPositionRecord
G4double GetRange() const
Get the range of the particle that created this trajectory.
virtual void AppendStep(const G4Step *aStep)
G4ThreeVector GetInitialMomentum() const
Get the initial momentum of the particle that created this trajectory.
G4Allocator< EDepSim::Trajectory > aTrajAllocator
virtual void MergeTrajectory(G4VTrajectory *secondTrajectory)
G4ThreeVector fInitialMomentum
virtual G4VTrajectoryPoint * GetPoint(G4int i) const
Get a particular trajectory point.
void MarkTrajectory(bool save=true)
Mark this trajectory as one that should be saved in the output.
G4double fSDTotalEnergyDeposit
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
std::vector< G4VTrajectoryPoint * > TrajectoryPointContainer
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual int GetPointEntries() const
Get the number of trajectory points saved with this trajectory.
second_as<> second
Type of time stored in seconds, in double precision.
static G4VTrajectory * Get(int trackId)
Provide a map between the track id and the trajectory object.