20 using namespace SurfaceOrientation;
22 using namespace magneticfield;
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;
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)
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);
Surface::LocalVector LocalVector
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
GlobalVector normalVector() const
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
unsigned short copyno
copy number
GlobalPoint vertex() const
Global position of the cone vertex.
GloballyPositioned< float > * refPlane
const Surface & surface(int which_side) const
Get the current surface on specified side.
Scalar radius() const
Radius of the cylinder.
LocalPoint toLocal(const GlobalPoint &gp) const
Cos< T >::type cos(const T &t)
const GlobalPoint & center() const
Return the center of the volume.
void buildPhiZSurf(double startPhi, double deltaPhi, double zhalf, double rCentr)
GlobalPoint toGlobal(const LocalPoint &lp) const
std::string name
Name of the volume.
bool setSurface(const Surface &s1, Sides which_side)
Assign a shared surface perorming sanity checks.
const PositionType & position() const
bool sameSurface(const Surface &s1, Sides which_side, float tolerance=0.01)
Find out if two surfaces are the same physical surface.
virtual ~BaseVolumeHandle()
Geom::Theta< float > openingAngle() const
Angle of the cone.