52 G4long oldprc = os.precision(16);
67 const G4bool confirm =
true;
68 G4long oldprc = os.precision(prec);
70 auto itrecA= startA.cbegin();
71 auto itrecB= endB.cbegin();
73 os <<
"====================================================================="
75 os <<
" Size of individual change record: startA : " << startA.size()
76 <<
" endB : " << endB.size() <<
G4endl;
77 os <<
"====================================================================="
80 os << setw( 7 ) <<
"Change#" <<
" "
81 << setw( 4 ) <<
"Iter" <<
" "
82 << setw( 20 ) <<
"CodeLocation" <<
" "
83 << setw( prec+9 ) <<
"Length-A (start)" <<
" "
84 << setw( prec+9 ) <<
"Length-B (end)" <<
" "
86 os <<
"=====================================================================";
88 auto eventA = (*itrecA).GetCount();
89 auto eventB = (*itrecB).GetCount();
94 G4int maxEvent = std::max( startA[ startA.size() - 1 ].GetCount() ,
95 endB[ endB.size() - 1 ].GetCount() );
99 G4bool advanceA=
false, advanceB=
false;
105 if( ((
G4int)eventA>prevA) && ((
G4int)eventB>prevB) )
107 auto codeLocA= (*itrecA).GetLocation();
110 os << setw( 7 ) << eventA <<
" "
111 << setw( 4 ) << (*itrecA).GetIteration() <<
" "
112 << setw( 3 ) << codeLocA <<
" "
115 << setw( prec+9 ) << (*itrecA).GetLength() <<
" "
116 << setw( prec+9 ) << (*itrecB).GetLength() <<
" ";
119 os << setw( 4 ) << (*itrecB).GetIteration() <<
" "
120 << setw( 15 ) << (*itrecB).GetLocation();
125 if ( (
G4int)eventA > prevA )
127 auto codeLocA= (*itrecA).GetLocation();
129 os << setw( 7 ) << (*itrecA).GetCount() <<
" "
130 << setw( 4 ) << (*itrecA).GetIteration() <<
" "
131 << setw( 3 ) << codeLocA <<
" "
134 << setw( prec+9 ) << (*itrecA).GetLength() <<
" "
135 << setw( prec+9 ) <<
" " <<
" ";
140 auto codeLocB= (*itrecB).GetLocation();
143 os << setw( 7 ) << eventB <<
" "
144 << setw( 4 ) << (*itrecB).GetIteration() <<
" "
145 << setw( 3 ) << codeLocB <<
" "
148 << setw( prec+9 ) <<
" " <<
" "
149 << setw( prec+9 ) << (*itrecB).GetLength() <<
" " ;
159 G4int nextAct = maxEvent, nextBct = maxEvent;
162 if ( nextA != startA.end() ) { nextAct = (*nextA).GetCount(); }
163 if ( nextB != endB.end() ) { nextBct = (*nextB).GetCount(); }
165 isLastA= ( nextA >= startA.end() );
166 isLastB= ( nextB >= endB.end() );
168 advanceA= ( nextAct <= nextBct ) && !isLastA;
169 advanceB= ( nextBct <= nextAct ) && !isLastB;
174 eventA = isLastA ? maxEvent : (*itrecA).GetCount();
180 eventB = isLastB ? maxEvent : (*itrecB).GetCount();
184 if( isLastA != ( nextA == startA.end() ) )
187 os <<
" Checking isLastA= " << isLastA
188 <<
" vs expected : " << ( itrecA == startA.end() );
189 os <<
" BAD --- ERROR " <<
G4endl;
191 if( isLastB != ( nextB == endB.end() ) )
194 os <<
" Checking isLastB= " << isLastB
195 <<
" vs expected : " << ( itrecB == endB.end() );
196 os <<
" BAD --- ERROR " <<
G4endl;
198 }
while ( ! ( isLastA && isLastB ) );
201 os.precision(oldprc);
std::ostream & operator<<(std::ostream &os, const G4LocatorChangeLogger &logger)
std::ostream & StreamInfo(std::ostream &os) const
static std::ostream & ReportEndChanges(std::ostream &os, const G4LocatorChangeLogger &startA, const G4LocatorChangeLogger &endB)
static const char * GetNameChangeLocation(EChangeLocation)
static std::ostream & ReportVector(std::ostream &os, const std::string &nameOfRecord, const std::vector< G4LocatorChangeRecord > &lcr)