21 #include "CLHEP/Units/GlobalSystemOfUnits.h" 29 #include <boost/lexical_cast.hpp> 48 solid(fv.logicalPart().solid()),
50 fv.translation().
y()/cm,
51 fv.translation().
z()/cm)),
56 string volName =
name;
57 volName.erase(0,volName.rfind(
'_')+1);
58 volumeno =boost::lexical_cast<
unsigned short>(volName);
60 for (
int i=0;
i<6; ++
i) {
161 cout <<
" Orientation of surfaces:";
162 std::string sideName[3] = {
"positiveSide",
"negativeSide",
"onSurface"};
163 for (
int i=0;
i<6; ++
i) {
211 if (x.Cross(y).Dot(z) < 0.5) {
212 cout <<
"*** WARNING: Rotation is not RH "<< endl;
218 rotResult(
float(x.X()),
float(x.Y()),
float(x.Z()),
219 float(y.X()),
float(y.Y()),
float(y.Z()),
220 float(z.X()),
float(z.Y()),
float(z.Z()));
235 globalZdir=-globalZdir;
239 if (chk < .999)
cout <<
"*** WARNING RefPlane check failed!***" 258 sin(startPhi+deltaPhi),0.));
272 rCentr*
sin(startPhi),
276 surfaces[
phiplus] =
new Plane(pos_phiplus, rot_phiplus);
284 cout <<
"pos_zplus " << pos_zplus <<
" " 285 << pos_zplus.perp() <<
" " << pos_zplus.phi() << endl
286 <<
"pos_zminus " << pos_zminus <<
" " 287 << pos_zminus.perp() <<
" " << pos_zminus.phi() << endl
288 <<
"pos_phiplus " << pos_phiplus <<
" " 289 << pos_phiplus.perp() <<
" " << pos_phiplus.phi() <<endl
290 <<
"pos_phiminus " << pos_phiminus <<
" " 291 << pos_phiminus.perp() <<
" " << pos_phiminus.phi() <<endl;
293 cout <<
"y_phiplus " << y_phiplus << endl;
294 cout <<
"y_phiminus " << y_phiminus << endl;
307 if (pos_zplus.z() < pos_zminus.z()) {
308 cout <<
"*** WARNING: pos_zplus < pos_zminus " << endl;
311 cout <<
"*** WARNING: pos_phiplus < pos_phiminus " << endl;
321 if (&s1==(
surfaces[which_side]).
get()){
326 const float maxtilt = 0.999;
372 const Cone * co1 =
dynamic_cast<const Cone*
>(&s1);
374 const Cone * co2 =
dynamic_cast<const Cone*
>(&
s2);
397 if (&s1==(
surfaces[which_side]).
get()){
403 cout <<
"***ERROR: setSurface: trying to assign a surface that does not match destination surface. Skipping." << endl;
408 if (p1!=
nullptr && p2 !=
nullptr)
416 if (&s1!=(
surfaces[which_side]).
get()){
417 cout <<
"*** WARNING volumeHandle::setSurface: trying to reassign a surface to a different surface instance" << endl;
441 assert(which_side >=0 && which_side <6);
446 std::vector<VolumeSide>
448 std::vector<VolumeSide>
result;
449 for (
int i=0;
i<6; ++
i){
465 std::vector<std::string>
names;
466 for (handles::const_iterator
i = begin;
468 if (uniq) names.push_back((*i)->name);
469 else names.push_back((*i)->name+
":"+std::to_string((*i)->copyno));
472 sort(names.begin(),names.end());
474 std::vector<std::string>::iterator
i =
unique(names.begin(),names.end());
475 int nvols =
int(i - names.begin());
476 cout << nvols <<
" ";
477 copy(names.begin(),
i, ostream_iterator<std::string>(
cout,
" "));
479 cout << names.size() <<
" ";
480 copy(names.begin(), names.end(), ostream_iterator<std::string>(
cout,
" "));
486 #include "MagneticField/GeomBuilder/src/buildBox.icc" 487 #include "MagneticField/GeomBuilder/src/buildTrap.icc" 488 #include "MagneticField/GeomBuilder/src/buildTubs.icc" 489 #include "MagneticField/GeomBuilder/src/buildCons.icc" 490 #include "MagneticField/GeomBuilder/src/buildPseudoTrap.icc" 491 #include "MagneticField/GeomBuilder/src/buildTruncTubs.icc" unsigned short copyno
copy number
void buildBox(const DDExpandedView &fv)
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
void buildPhiZSurf(double startPhi, double deltaPhi, double zhalf, double rCentr)
static const HistoName names[]
GloballyPositioned< float > * refPlane
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
void buildTubs(const DDExpandedView &fv)
GlobalVector normalVector() const
std::vector< VolumeSide > sides() const
The surfaces and they orientation, as required to build a MagVolume.
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
void buildPseudoTrap(const DDExpandedView &fv)
const GlobalPoint & center() const
Return the center of the volume.
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
std::string name
Name of the volume.
DDSolidShape shape() const
Shape of the solid.
GlobalPoint vertex() const
Global position of the cone vertex.
static const char *const name(DDSolidShape s)
Scalar radius() const
Radius of the cylinder.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
LocalPoint toLocal(const GlobalPoint &gp) const
def unique(seq, keepstr=True)
Cos< T >::type cos(const T &t)
std::string magFile
Name of magnetic field table file.
DDSolidShape shape(void) const
The type of the solid.
void buildCons(const DDExpandedView &fv)
void referencePlane(const DDExpandedView &fv)
volumeHandle(const DDExpandedView &fv, bool expand2Pi=false)
Surface::LocalVector LocalVector
unsigned short volumeno
volume number
GlobalPoint toGlobal(const LocalPoint &lp) const
static void printUniqueNames(handles::const_iterator begin, handles::const_iterator end, bool uniq=true)
Just for debugging...
const Surface & surface(int which_side) const
Get the current surface on specified side.
void buildTrap(const DDExpandedView &fv)
int masterSector
The sector for which an interpolator for this class of volumes should be built.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
const PositionType & position() const
Provides an exploded view of the detector (tree-view)
bool setSurface(const Surface &s1, Sides which_side)
Assign a shared surface perorming sanity checks.
bool sameSurface(const Surface &s1, Sides which_side, float tolerance=0.01)
Find out if two surfaces are the same physical surface.
const std::string & name() const
Returns the name.
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
Global3DVector GlobalVector
Geom::Theta< float > openingAngle() const
Angle of the cone.
void buildTruncTubs(const DDExpandedView &fv)