49 const GeoVPhysVol* gv2,
56 if (gv1->getLogVol()->getName() != gv2->getLogVol()->getName()) {
57 diff = 1000 * level + 1;
59 std::cout <<
"CASE 1: names differ at level:" << level <<
":"
60 << gv1->getLogVol()->getName() <<
":"
61 << gv2->getLogVol()->getName() << std::endl;
67 if (GeoMaterialSorter{}.compare(gv1->getLogVol()->getMaterial(),
68 gv2->getLogVol()->getMaterial()) != 0) {
69 diff = 1000 * level + 2;
71 std::cout <<
"CASE 2: material types differ for volume:"
72 << gv1->getLogVol()->getName() <<
":at level:" << level
73 <<
":" << gv1->getLogVol()->getMaterial()->getName()
75 << gv2->getLogVol()->getMaterial()->getName()
82 gv2->getLogVol()->getShape(),
tolerance)) {
83 diff = 1000 * level + 3;
85 std::cout <<
"CASE 4: shape definition differ at level:" << level
90 unsigned int nChild1 = gv1->getNChildVols();
92 if (nChild1 != gv2->getNChildVols()) {
93 diff = 1000 * level + 4;
95 std::cout <<
"CASE 5: number of child vols differ at level:"
96 << level <<
":volume name:" << gv1->getLogVol()->getName()
97 <<
":nChildVols:" << gv1->getNChildVols()
98 <<
":nChildVols ref:" << gv2->getNChildVols()
121 const auto children1 = getChildrenWithRef(gv1);
122 const auto children2 = getChildrenWithRef(gv2);
124 if (children1.size() != children2.size()) {
125 diff = 1000 * level + 5;
127 std::cout <<
"CASE 5: number of child vols differ at level:"
128 << level <<
":volume name:" << gv1->getLogVol()->getName()
129 <<
":nChildVols:" << gv1->getNChildVols()
130 <<
":nChildVols ref:" << gv2->getNChildVols()
136 for (std::size_t ic = 0; ic < children1.size(); ++ic) {
137 const auto& child1 = children1.at(ic);
138 const auto& child2 = children2.at(ic);
140 if (child1.nCopies != child2.nCopies) {
141 diff = 1000 * level + 6;
143 std::cout <<
"CASE 5: number of child vols differ at level:"
144 << level <<
":volume name:" << child1.volume->getLogVol()->getName()
149 if (child1.nCopies > 1 &&
150 GeoTrf::TransformSorter{}.compare(child1.inductionRule, child2.inductionRule) !=0) {
151 diff = 1000 * level + 7;
153 std::cout <<
"CASE 7: Replication rule is different at level:"
154 << level <<
":volume name:" << child1.volume->getLogVol()->getName()
159 if (GeoTrf::TransformSorter{}.compare(child1.transform, child2.transform) != 0) {
160 diff = 1000 * level + 7;
162 std::cout <<
"CASE 7: Volume transform is different:"
163 << level <<
":volume name:" << child1.volume->getLogVol()->getName()
169 if (child_comp != 0) {
244 if (std::abs(rotation(0, 1)) > tol)
246 if (std::abs(rotation(0, 2)) > tol)
248 if (std::abs(rotation(1, 2)) > tol)
255 GeoTrf::Transform3D tr_ref,
257 std::ios oldState(
nullptr);
258 oldState.copyfmt(std::cout);
260 std::cout << std::fixed << std::setprecision(4);
261 std::cout <<
"test translation:x:y:z:" << tr_test.translation().x() <<
":"
262 << tr_test.translation().y() <<
":" << tr_test.translation().z()
264 std::cout <<
" ref translation:x:y:z:" << tr_ref.translation().x() <<
":"
265 << tr_ref.translation().y() <<
":" << tr_ref.translation().z()
267 std::cout <<
" absolute shift :"
268 << (tr_test.translation() - tr_ref.translation()).norm()
269 <<
": to be compared with the tolerance limit:" <<
tolerance
271 std::cout.copyfmt(oldState);
275 const GeoTrf::Transform3D& tr_ref,
278 GeoTrf::RotationMatrix3D rotest = tr_test.rotation();
279 GeoTrf::RotationMatrix3D rotref = tr_ref.rotation();
280 GeoTrf::RotationMatrix3D rotid = rotest * rotref.inverse();
281 std::ios oldState(
nullptr);
282 oldState.copyfmt(std::cout);
284 std::cout << std::fixed << std::setprecision(4);
285 std::cout <<
"test rotation:" << rotest(0, 0) <<
":" << rotest(0, 1) <<
":"
286 << rotest(0, 2) << std::endl;
287 std::cout <<
" " << rotest(1, 0) <<
":" << rotest(1, 1)
288 <<
":" << rotest(1, 2) << std::endl;
289 std::cout <<
" " << rotest(2, 0) <<
":" << rotest(2, 1)
290 <<
":" << rotest(2, 2) << std::endl;
291 std::cout <<
" ref rotation:" << rotref(0, 0) <<
":" << rotref(0, 1) <<
":"
292 << rotref(0, 2) << std::endl;
293 std::cout <<
" " << rotref(1, 0) <<
":" << rotref(1, 1)
294 <<
":" << rotref(1, 2) << std::endl;
295 std::cout <<
" " << rotref(2, 0) <<
":" << rotref(2, 1)
296 <<
":" << rotref(2, 2) << std::endl;
297 std::cout <<
"test*inv(ref):" << rotid(0, 0) <<
":" << rotid(0, 1) <<
":"
298 << rotid(0, 2) << std::endl;
299 std::cout <<
" " << rotid(1, 0) <<
":" << rotid(1, 1)
300 <<
":" << rotid(1, 2) << std::endl;
301 std::cout <<
" " << rotid(2, 0) <<
":" << rotid(2, 1)
302 <<
":" << rotid(2, 2) << std::endl;
303 std::cout <<
" identity check fails within the tolerance limit:"
305 std::cout.copyfmt(oldState);
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
int compareGeoVolumes(const GeoVPhysVol *gv1, const GeoVPhysVol *gv2, double tolerance, bool printFullInfo=false, int level=0) const
Recursive comparison of trees/branches/volumes : in quiet mode (printFullInfo=False) ,...