66 std::vector<G4ThreeVector> positions;
75 if (positions.size() == 0 ||
76 trajectoryPointPosition != positions[positions.size()-1]) {
84 std::vector<G4AttValue>* trajectoryPointAttValues =
86 if (!trajectoryPointAttValues) {
87 static G4bool warnedNoAttValues =
false;
88 if (!warnedNoAttValues) {
90 "*************************************************************************"
91 "\n* WARNING: G4TrajectoryDrawerUtils::GetPointsAndTimes: no att values."
92 "\n*************************************************************************"
94 warnedNoAttValues =
true;
98 G4bool foundPreTime =
false, foundPostTime =
false;
99 for (std::vector<G4AttValue>::iterator i =
100 trajectoryPointAttValues->begin();
101 i != trajectoryPointAttValues->end(); ++i) {
102 if (i->GetName() ==
"PreT") {
103 trajectoryPointPreTime =
107 if (i->GetName() ==
"PostT") {
108 trajectoryPointPostTime =
110 foundPostTime =
true;
113 if (!foundPreTime || !foundPostTime) {
114 static G4bool warnedTimesNotFound =
false;
115 if (!warnedTimesNotFound) {
117 "*************************************************************************"
118 "\n* WARNING: G4TrajectoryDrawerUtils::GetPointsAndTimes: times not found."
119 "\n*************************************************************************"
121 warnedTimesNotFound =
true;
126 delete trajectoryPointAttValues;
129 const std::vector<G4ThreeVector>* auxiliaries
131 if (0 != auxiliaries) {
132 for (
size_t iAux=0; iAux<auxiliaries->size(); ++iAux) {
133 const G4ThreeVector& auxPointPosition = (*auxiliaries)[iAux];
134 if (positions.size() == 0 ||
135 auxPointPosition != positions[positions.size()-1]) {
137 positions.push_back(trajectoryPointPosition);
138 trajectoryLine.push_back(auxPointPosition);
139 auxiliaryPoints.push_back(auxPointPosition);
143 (auxPointPosition - lastTrajectoryPointPosition).mag();
145 (trajectoryPointPosition - auxPointPosition).mag();
146 G4double t = trajectoryPointPreTime +
147 (trajectoryPointPostTime - trajectoryPointPreTime) *
149 trajectoryLineTimes.push_back(t);
150 auxiliaryPointTimes.push_back(t);
156 positions.push_back(trajectoryPointPosition);
157 trajectoryLine.push_back(trajectoryPointPosition);
158 stepPoints.push_back(trajectoryPointPosition);
160 trajectoryLineTimes.push_back(trajectoryPointPostTime);
161 stepPointTimes.push_back(trajectoryPointPostTime);
163 lastTrajectoryPointPosition = trajectoryPointPosition;
virtual const std::vector< G4ThreeVector > * GetAuxiliaryPoints() const
virtual G4VTrajectoryPoint * GetPoint(G4int i) const =0
G4double GetTimeSliceInterval() const
static G4double ConvertToDimensionedDouble(const char *st)
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual int GetPointEntries() const =0
G4GLOB_DLL std::ostream G4cout
virtual const G4ThreeVector GetPosition() const =0
T max(const T t1, const T t2)
brief Return the largest of the two arguments