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;
103 if (&s1 == (
surfaces[which_side]).
get()) {
105 cout <<
" sameSurface: OK (same ptr)" << endl;
109 const float maxtilt = 0.999;
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;
139 if (cy1 !=
nullptr) {
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;
179 if (&s1 == (
surfaces[which_side]).
get()) {
185 cout <<
"***ERROR: setSurface: trying to assign a surface that does not match destination surface. Skipping." 191 if (
p1 !=
nullptr &&
p2 !=
nullptr)
192 cout <<
p1->normalVector() <<
p1->position() << endl <<
p2->normalVector() <<
p2->position() << endl;
197 if (&s1 != (
surfaces[which_side]).
get()) {
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);
GlobalPoint toGlobal(const LocalPoint &lp) const
Surface::LocalVector LocalVector
Geom::Phi< T > phi() const
Sin< T >::type sin(const T &t)
const GlobalPoint & center() const
Return the center of the volume.
unsigned short copyno
copy number
Geom::Theta< float > openingAngle() const
Angle of the cone.
GloballyPositioned< float > * refPlane
Cos< T >::type cos(const T &t)
const Surface & surface(int which_side) const
Get the current surface on specified side.
void buildPhiZSurf(double startPhi, double deltaPhi, double zhalf, double rCentr)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
std::string name
Name of the volume.
Scalar radius() const
Radius of the cylinder.
bool setSurface(const Surface &s1, Sides which_side)
Assign a shared surface perorming sanity checks.
GlobalPoint vertex() const
Global position of the cone vertex.
bool sameSurface(const Surface &s1, Sides which_side, float tolerance=0.01)
Find out if two surfaces are the same physical surface.
virtual ~BaseVolumeHandle()