41 {
"Invalid",
"Unknown",
"Initialising",
"IntersectsAF",
"IntersectsFB",
42 "NoIntersections-AForFB",
"RecalculatedB",
43 "InsertingMidPoint",
"RecalculatedB-2ndHalf",
49 const std::string & name,
50 const std::vector<G4LocatorChangeRecord> & vecRec )
54 if( vecRec.size() == 0 )
56 os <<
"Locator Change Record for " << name <<
" is empty" <<
G4endl;
60 G4int oldprc = os.precision(prec);
64 = std::vector<G4LocatorChangeRecord>::const_iterator(vecRec.cbegin());
66 os << setw( 7 ) <<
"Change#" <<
" "
67 << setw( 4 ) <<
"Iter" <<
" "
69 << setw( prec+9 ) <<
"Length" <<
" "
70 << setw( 15 ) <<
"Code-Location" <<
" "
72 os <<
"====================================================================="
77 auto locationCode= (*itRec).GetLocation();
79 << setw( 7 ) << (*itRec).GetCount() <<
" "
80 << setw( 4 ) << (*itRec).GetIteration() <<
" "
82 << setw( prec+9 ) << (*itRec).GetLength() <<
" "
83 << setw( 2 ) << locationCode <<
" "
90 }
while ( itRec != vecRec.cend() );
101 const std::vector<G4LocatorChangeRecord> & startA,
102 const std::vector<G4LocatorChangeRecord> & endB )
106 const G4bool confirm =
true;
107 G4int oldprc = os.precision(prec);
109 std::vector<G4LocatorChangeRecord>::const_iterator itrecA, itrecB;
110 itrecA= startA.begin();
111 itrecB= endB.begin();
113 os <<
"====================================================================="
115 os <<
" Size of individual change record: startA : " << startA.size()
116 <<
" endB : " << endB.size() <<
G4endl;
117 os <<
"====================================================================="
120 os << setw( 7 ) <<
"Change#" <<
" "
121 << setw( 4 ) <<
"Iter" <<
" "
122 << setw( 20 ) <<
"CodeLocation" <<
" "
123 << setw( prec+9 ) <<
"Length-A (start)" <<
" "
124 << setw( prec+9 ) <<
"Length-B (end)" <<
" "
126 os <<
"=====================================================================";
129 auto eventA = (*itrecA).GetCount();
130 auto eventB = (*itrecB).GetCount();
137 G4int maxEvent = std::max( startA[ startA.size() - 1 ].GetCount() ,
138 endB[ endB.size() - 1 ].GetCount() );
142 G4bool advanceA=
false, advanceB=
false;
148 if( ((
G4int)eventA>prevA) && ((
G4int)eventB>prevB) )
150 auto codeLocA= (*itrecA).GetLocation();
153 os << setw( 7 ) << eventA <<
" "
154 << setw( 4 ) << (*itrecA).GetIteration() <<
" "
155 << setw( 3 ) << codeLocA <<
" "
157 << setw( prec+9 ) << (*itrecA).GetLength() <<
" "
158 << setw( prec+9 ) << (*itrecB).GetLength() <<
" ";
161 os << setw( 4 ) << (*itrecB).GetIteration() <<
" "
162 << setw( 15 ) << (*itrecB).GetLocation();
167 if ( (
G4int)eventA > prevA )
169 auto codeLocA = (*itrecA).GetLocation();
171 os << setw( 7 ) << (*itrecA).GetCount() <<
" "
172 << setw( 4 ) << (*itrecA).GetIteration() <<
" "
173 << setw( 3 ) << codeLocA <<
" "
175 << setw( prec+9 ) << (*itrecA).GetLength() <<
" "
176 << setw( prec+9 ) <<
" " <<
" ";
181 auto codeLocB = (*itrecB).GetLocation();
184 os << setw( 7 ) << eventB <<
" "
185 << setw( 4 ) << (*itrecB).GetIteration() <<
" "
186 << setw( 3 ) << codeLocB <<
" "
188 << setw( prec+9 ) <<
" " <<
" "
189 << setw( prec+9 ) << (*itrecB).GetLength() <<
" " ;
199 G4int nextAct = maxEvent, nextBct = maxEvent;
202 if ( nextA != startA.end() ) { nextAct = (*nextA).GetCount(); }
203 if ( nextB != endB.end() ) { nextBct = (*nextB).GetCount(); }
205 isLastA= ( nextA >= startA.end() );
206 isLastB= ( nextB >= endB.end() );
208 advanceA= ( nextAct <= nextBct ) && !isLastA;
209 advanceB= ( nextBct <= nextAct ) && !isLastB;
214 if( !isLastA ) { ++jA; eventA = (*itrecA).GetCount(); }
215 else { eventA = maxEvent; }
221 if( !isLastB ) { ++jB; eventB = (*itrecB).GetCount(); }
222 else { eventB = maxEvent; }
226 if( isLastA != ( nextA == startA.end() ) )
229 os <<
" Checking isLastA= " << isLastA <<
" vs expected : "
230 << ( itrecA == startA.end() );
231 os <<
" BAD --- ERROR " <<
G4endl;
233 if( isLastB != ( nextB == endB.end() ) )
236 os <<
" Checking isLastB= " << isLastB <<
" vs expected : "
237 << ( itrecB == endB.end() );
238 os <<
" BAD --- ERROR " <<
G4endl;
241 }
while ( ! ( isLastA && isLastB ) );
244 os.precision(oldprc);
261 G4int oldprc = os.precision(16);
262 os <<
" count = " << fEventCount
263 <<
" iter= " << fIteration
264 <<
" Location code = " << fCodeLocation
266 os.precision(oldprc);
274 const std::vector<G4LocatorChangeRecord> & vecR )
std::ostream & operator<<(std::ostream &os, const G4LocatorChangeRecord &e)
static const char * fNameChangeLocation[]
static const char * GetNameChangeLocation(EChangeLocation)
G4double GetLength() const
static std::ostream & ReportEndChanges(std::ostream &os, const std::vector< G4LocatorChangeRecord > &startA, const std::vector< G4LocatorChangeRecord > &endB)
std::ostream & StreamInfo(std::ostream &os) const
static std::ostream & ReportVector(std::ostream &os, const std::string &nameOfRecord, const std::vector< G4LocatorChangeRecord > &lcr)