20#include "BDSTrajectory.hh"
21#include "BDSTrajectoryPoint.hh"
24#include "G4Allocator.hh"
27#include "G4VProcess.hh"
28#include "G4TrajectoryContainer.hh"
33G4Allocator<BDSTrajectory> bdsTrajectoryAllocator;
35BDSTrajectory::BDSTrajectory(
const G4Track* aTrack,
39 interactive(interactiveIn),
40 storageOptions(storageOptionsIn),
47 suppressTransportationAndNotInteractive = storageOptionsIn.suppressTransportationSteps && !interactiveIn;
48 const G4VProcess* proc = aTrack->GetCreatorProcess();
51 creatorProcessType = aTrack->GetCreatorProcess()->GetProcessType();
52 creatorProcessSubType = aTrack->GetCreatorProcess()->GetProcessSubType();
56 creatorProcessType = -1;
57 creatorProcessSubType = -1;
59 weight = aTrack->GetWeight();
62 fpBDSPointsContainer =
new BDSTrajectoryPointsContainer();
65 storageOptions.storeLocal,
66 storageOptions.storeLinks,
67 storageOptions.storeIon));
70BDSTrajectory::~BDSTrajectory()
81 if (suppressTransportationAndNotInteractive)
87 {(*fpBDSPointsContainer)[0]->SetMaterial(pointIn->
GetMaterial());}
96 {(*fpBDSPointsContainer)[0]->SetMaterial(pointIn->
GetMaterial());}
104 if (!storageOptions.storeIon)
105 {point->DeleteExtraIon();}
106 if (!storageOptions.storeLinks)
107 {point->DeleteExtraLinks();}
108 if (!storageOptions.storeLocal)
109 {point->DeleteExtraLocal();}
122 {(*fpBDSPointsContainer)[0]->SetMaterial(aStep->GetTrack()->GetMaterial());}
123 if (suppressTransportationAndNotInteractive)
128 auto postStepPoint = aStep->GetPostStepPoint();
129 const G4VProcess* postProcess = postStepPoint->GetProcessDefinedStep();
132 G4int postProcessType = postProcess->GetProcessType();
133 if(postProcessType != 1 &&
134 postProcessType != 10 )
137 storageOptions.storeLocal,
138 storageOptions.storeLinks,
139 storageOptions.storeIon));
146 storageOptions.storeLocal,
147 storageOptions.storeLinks,
148 storageOptions.storeIon));
154 if(!secondTrajectory)
160 for (G4int i = 1; i < ent; ++i)
176 G4cout << __METHOD_NAME__ <<
"no interaction" << G4endl;
191 G4cout << __METHOD_NAME__ <<
"no interaction" << G4endl;
199 {out << *(static_cast<BDSTrajectoryPoint*>(t.
GetPoint(i))) << G4endl;}
A Point in a trajectory with extra information.
G4bool NotTransportationLimitedStep() const
Return true if step isn't defined by transportation processes.
G4bool IsScatteringPoint() const
G4Material * GetMaterial() const
Accessor.
Trajectory information from track including last scatter etc.
virtual int GetPointEntries() const
Get number of trajectory points in this trajectory.
BDSTrajectoryPoint * FirstInteraction() const
virtual void MergeTrajectory(G4VTrajectory *secondTrajectory)
Merge another trajectory into this one.
virtual G4VTrajectoryPoint * GetPoint(G4int i) const
Access a point - use this class's container.
void CleanPoint(BDSTrajectoryPoint *point) const
virtual void AppendStep(const G4Step *aStep)
BDSTrajectoryPointsContainer * fpBDSPointsContainer