24 BaseVolumeHandle::BaseVolumeHandle(
bool expand2Pi,
bool debugVal)
75 cout <<
"pos_zplus " << pos_zplus <<
" " << pos_zplus.perp() <<
" " << pos_zplus.phi() << endl
76 <<
"pos_zminus " << pos_zminus <<
" " << pos_zminus.perp() <<
" " << pos_zminus.phi() << endl
77 <<
"pos_phiplus " << pos_phiplus <<
" " << pos_phiplus.perp() <<
" " << pos_phiplus.phi() << endl
78 <<
"pos_phiminus " << pos_phiminus <<
" " << pos_phiminus.perp() <<
" " << pos_phiminus.phi() << endl;
80 cout <<
"y_phiplus " << y_phiplus << endl;
81 cout <<
"y_phiminus " << y_phiminus << endl;
92 if (pos_zplus.z() < pos_zminus.z()) {
93 cout <<
"*** WARNING: pos_zplus < pos_zminus " << endl;
96 cout <<
"*** WARNING: pos_phiplus < pos_phiminus " << endl;
105 cout <<
" sameSurface: OK (same ptr)" << endl;
109 const float maxtilt = 0.999;
113 const Plane *
p1 = dynamic_cast<const Plane *>(&s1);
115 const Plane *
p2 = dynamic_cast<const Plane *>(&
s2);
118 cout <<
" sameSurface: different types" << endl;
122 if ((fabs(
p1->normalVector().dot(
p2->normalVector())) > maxtilt) &&
125 cout <<
" sameSurface: OK " << fabs(
p1->normalVector().dot(
p2->normalVector())) <<
" "
126 << fabs((
p1->toLocal(
p2->position())).z()) << endl;
130 cout <<
" sameSurface: not the same: " <<
p1->normalVector() <<
p1->position() << endl
131 <<
" " <<
p2->normalVector() <<
p2->position() << endl
132 << fabs(
p1->normalVector().dot(
p2->normalVector())) <<
" " << (
p1->toLocal(
p2->position())).z() << endl;
138 const Cylinder *cy1 = dynamic_cast<const Cylinder *>(&s1);
139 if (cy1 !=
nullptr) {
140 const Cylinder *cy2 = dynamic_cast<const Cylinder *>(&
s2);
141 if (cy2 ==
nullptr) {
143 cout <<
" sameSurface: different types" << endl;
155 const Cone *co1 = dynamic_cast<const Cone *>(&s1);
156 if (co1 !=
nullptr) {
157 const Cone *co2 = dynamic_cast<const Cone *>(&
s2);
158 if (co2 ==
nullptr) {
160 cout <<
" sameSurface: different types" << endl;
173 cout <<
" sameSurface: unknown surfaces..." << endl;
185 cout <<
"***ERROR: setSurface: trying to assign a surface that does not match destination surface. Skipping."
189 const Plane *
p1 = dynamic_cast<const Plane *>(&s1);
190 const Plane *
p2 = dynamic_cast<const Plane *>(&
s2);
191 if (
p1 !=
nullptr &&
p2 !=
nullptr)
192 cout <<
p1->normalVector() <<
p1->position() << endl <<
p2->normalVector() <<
p2->position() << endl;
198 cout <<
"*** WARNING BaseVolumeHandle::setSurface: trying to reassign a surface to a different surface instance"
206 cout <<
" Volume " <<
name <<
" # " <<
copyno <<
" Assigned: " << (
int)which_side << endl;
216 assert(which_side >= 0 && which_side < 6);