62 const std::string & name,
63 const std::vector<G4LocatorChangeRecord> & vecRec )
69 os <<
"Locator Change Record for " << name <<
" is empty" <<
G4endl;
73 G4long oldprc = os.precision(prec);
77 = std::vector<G4LocatorChangeRecord>::const_iterator(vecRec.cbegin());
79 os << setw( 7 ) <<
"Change#" <<
" "
80 << setw( 4 ) <<
"Iter" <<
" "
82 << setw( prec+9 ) <<
"Length" <<
" "
83 << setw( 15 ) <<
"Code-Location" <<
" "
85 os <<
"====================================================================="
90 auto locationCode= (*itRec).GetLocation();
92 << setw( 7 ) << (*itRec).GetCount() <<
" "
93 << setw( 4 ) << (*itRec).GetIteration() <<
" "
95 << setw( prec+9 ) << (*itRec).GetLength() <<
" "
96 << setw( 2 ) << locationCode <<
" "
97 << setw( 15 ) << fNameChangeLocation[ locationCode ]
103 }
while ( itRec != vecRec.cend() );
105 os.precision(oldprc);
114 const std::vector<G4LocatorChangeRecord> & startA,
115 const std::vector<G4LocatorChangeRecord> & endB )
119 const G4bool confirm =
true;
120 G4long oldprc = os.precision(prec);
122 std::vector<G4LocatorChangeRecord>::const_iterator itrecA, itrecB;
123 itrecA= startA.begin();
124 itrecB= endB.begin();
126 os <<
"=========================================================================================";
128 os <<
" * endPoints A (start) and B (end): combined changes of AB intervals" <<
G4endl;
129 os <<
" * Sizes of change records: start(A) : " << startA.size()
130 <<
" end(B) : " << endB.size() <<
G4endl;
131 os <<
"========================================================================================="
134 os << setw( 7 ) <<
"Change#" <<
" "
135 << setw( 4 ) <<
"Iter" <<
" "
136 << setw( 20 ) <<
"CodeLocation" <<
" "
137 << setw( prec+9 ) <<
"Length-A (start)" <<
" "
138 << setw( prec+9 ) <<
"Length-B (end)" <<
" "
140 os <<
"=====================================================================";
143 auto eventA = (*itrecA).GetCount();
144 auto eventB = (*itrecB).GetCount();
149 G4int maxEvent = std::max( startA[ startA.size() - 1 ].GetCount() ,
150 endB[ endB.size() - 1 ].GetCount() );
154 G4bool advanceA=
false, advanceB=
false;
160 if( ((
G4int)eventA>prevA) && ((
G4int)eventB>prevB) )
162 auto codeLocA= (*itrecA).GetLocation();
165 os << setw( 7 ) << eventA <<
" "
166 << setw( 4 ) << (*itrecA).GetIteration() <<
" "
167 << setw( 3 ) << codeLocA <<
" "
168 << setw( 15 ) << fNameChangeLocation[ codeLocA ] <<
" "
169 << setw( prec+9 ) << (*itrecA).GetLength() <<
" "
170 << setw( prec+9 ) << (*itrecB).GetLength() <<
" ";
173 os << setw( 4 ) << (*itrecB).GetIteration() <<
" "
174 << setw( 15 ) << (*itrecB).GetLocation();
179 if ( (
G4int)eventA > prevA )
181 auto codeLocA = (*itrecA).GetLocation();
183 os << setw( 7 ) << (*itrecA).GetCount() <<
" "
184 << setw( 4 ) << (*itrecA).GetIteration() <<
" "
185 << setw( 3 ) << codeLocA <<
" "
186 << setw( 15 ) << fNameChangeLocation[ codeLocA ] <<
" "
187 << setw( prec+9 ) << (*itrecA).GetLength() <<
" "
188 << setw( prec+9 ) <<
" " <<
" ";
193 auto codeLocB = (*itrecB).GetLocation();
196 os << setw( 7 ) << eventB <<
" "
197 << setw( 4 ) << (*itrecB).GetIteration() <<
" "
198 << setw( 3 ) << codeLocB <<
" "
199 << setw( 15 ) << fNameChangeLocation[ codeLocB ] <<
" "
200 << setw( prec+9 ) <<
" " <<
" "
201 << setw( prec+9 ) << (*itrecB).GetLength() <<
" " ;
211 G4int nextAct = maxEvent, nextBct = maxEvent;
214 if ( nextA != startA.end() ) { nextAct = (*nextA).GetCount(); }
215 if ( nextB != endB.end() ) { nextBct = (*nextB).GetCount(); }
217 isLastA= ( nextA >= startA.end() );
218 isLastB= ( nextB >= endB.end() );
220 advanceA= ( nextAct <= nextBct ) && !isLastA;
221 advanceB= ( nextBct <= nextAct ) && !isLastB;
226 if( !isLastA ) { eventA = (*itrecA).GetCount(); }
227 else { eventA = maxEvent; }
233 if( !isLastB ) { eventB = (*itrecB).GetCount(); }
234 else { eventB = maxEvent; }
238 if( isLastA != ( nextA == startA.end() ) )
241 os <<
" Checking isLastA= " << isLastA <<
" vs expected : "
242 << ( itrecA == startA.end() );
243 os <<
" BAD --- ERROR " <<
G4endl;
245 if( isLastB != ( nextB == endB.end() ) )
248 os <<
" Checking isLastB= " << isLastB <<
" vs expected : "
249 << ( itrecB == endB.end() );
250 os <<
" BAD --- ERROR " <<
G4endl;
253 }
while ( ! ( isLastA && isLastB ) );
256 os.precision(oldprc);