49 const std::string & name,
50 const std::vector<G4LocatorChangeRecord> & vecRec )
56 os <<
"Locator Change Record for " << name <<
" is empty" <<
G4endl;
60 G4long 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 G4long oldprc = os.precision(prec);
109 std::vector<G4LocatorChangeRecord>::const_iterator itrecA, itrecB;
110 itrecA= startA.begin();
111 itrecB= endB.begin();
113 os <<
"=========================================================================================";
115 os <<
" * endPoints A (start) and B (end): combined changes of AB intervals" <<
G4endl;
116 os <<
" * Sizes of change records: start(A) : " << startA.size()
117 <<
" end(B) : " << endB.size() <<
G4endl;
118 os <<
"========================================================================================="
121 os << setw( 7 ) <<
"Change#" <<
" "
122 << setw( 4 ) <<
"Iter" <<
" "
123 << setw( 20 ) <<
"CodeLocation" <<
" "
124 << setw( prec+9 ) <<
"Length-A (start)" <<
" "
125 << setw( prec+9 ) <<
"Length-B (end)" <<
" "
127 os <<
"=====================================================================";
130 auto eventA = (*itrecA).GetCount();
131 auto eventB = (*itrecB).GetCount();
136 G4int maxEvent = std::max( startA[ startA.size() - 1 ].GetCount() ,
137 endB[ endB.size() - 1 ].GetCount() );
141 G4bool advanceA=
false, advanceB=
false;
147 if( ((
G4int)eventA>prevA) && ((
G4int)eventB>prevB) )
149 auto codeLocA= (*itrecA).GetLocation();
152 os << setw( 7 ) << eventA <<
" "
153 << setw( 4 ) << (*itrecA).GetIteration() <<
" "
154 << setw( 3 ) << codeLocA <<
" "
156 << setw( prec+9 ) << (*itrecA).GetLength() <<
" "
157 << setw( prec+9 ) << (*itrecB).GetLength() <<
" ";
160 os << setw( 4 ) << (*itrecB).GetIteration() <<
" "
161 << setw( 15 ) << (*itrecB).GetLocation();
166 if ( (
G4int)eventA > prevA )
168 auto codeLocA = (*itrecA).GetLocation();
170 os << setw( 7 ) << (*itrecA).GetCount() <<
" "
171 << setw( 4 ) << (*itrecA).GetIteration() <<
" "
172 << setw( 3 ) << codeLocA <<
" "
174 << setw( prec+9 ) << (*itrecA).GetLength() <<
" "
175 << setw( prec+9 ) <<
" " <<
" ";
180 auto codeLocB = (*itrecB).GetLocation();
183 os << setw( 7 ) << eventB <<
" "
184 << setw( 4 ) << (*itrecB).GetIteration() <<
" "
185 << setw( 3 ) << codeLocB <<
" "
187 << setw( prec+9 ) <<
" " <<
" "
188 << setw( prec+9 ) << (*itrecB).GetLength() <<
" " ;
198 G4int nextAct = maxEvent, nextBct = maxEvent;
201 if ( nextA != startA.end() ) { nextAct = (*nextA).GetCount(); }
202 if ( nextB != endB.end() ) { nextBct = (*nextB).GetCount(); }
204 isLastA= ( nextA >= startA.end() );
205 isLastB= ( nextB >= endB.end() );
207 advanceA= ( nextAct <= nextBct ) && !isLastA;
208 advanceB= ( nextBct <= nextAct ) && !isLastB;
213 if( !isLastA ) { eventA = (*itrecA).GetCount(); }
214 else { eventA = maxEvent; }
220 if( !isLastB ) { eventB = (*itrecB).GetCount(); }
221 else { eventB = maxEvent; }
225 if( isLastA != ( nextA == startA.end() ) )
228 os <<
" Checking isLastA= " << isLastA <<
" vs expected : "
229 << ( itrecA == startA.end() );
230 os <<
" BAD --- ERROR " <<
G4endl;
232 if( isLastB != ( nextB == endB.end() ) )
235 os <<
" Checking isLastB= " << isLastB <<
" vs expected : "
236 << ( itrecB == endB.end() );
237 os <<
" BAD --- ERROR " <<
G4endl;
240 }
while ( ! ( isLastA && isLastB ) );
243 os.precision(oldprc);