Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:56:54

0001 inline void volumeHandle::buildTubs(double zhalf, double rIn, double rOut, double startPhi, double deltaPhi) {
0002   LogTrace("MagGeoBuilder") << "Building tubs surfaces...: ";
0003   LogTrace("MagGeoBuilder") << "zhalf    " << zhalf << newln << "rIn      " << rIn << newln << "rOut     " << rOut
0004                             << newln << "startPhi " << startPhi << newln << "deltaPhi " << deltaPhi;
0005 
0006   // recalculate center: (for a DDTubs, DDD gives 0,0,Z)
0007   double rCentr = (rIn + rOut) / 2.;
0008   Geom::Phi<double> phiCenter(startPhi + deltaPhi / 2.);
0009   center_ = refPlane->toGlobal(LocalPoint(rCentr * cos(phiCenter), rCentr * sin(phiCenter), 0.));
0010   // For cons and tubs RN = R.
0011   theRN = rCentr;
0012 
0013   // FIXME: use builder
0014   surfaces[outer] = new Cylinder(rOut, Surface::PositionType(0, 0, center_.z()), Surface::RotationType());
0015 
0016   // The inner cylider may be degenreate. Not easy to have a null surface
0017   // in the current implementation (surfaces[inner] is a RCP!)
0018 
0019   surfaces[inner] = new Cylinder(rIn, Surface::PositionType(0, 0, center_.z()), Surface::RotationType());
0020 
0021   // All other surfaces
0022   buildPhiZSurf(startPhi, deltaPhi, zhalf, rCentr);
0023 
0024   // Check ordering.
0025   if (debug) {
0026     if (dynamic_cast<const Cylinder*>(&(*surfaces[outer]))->radius() <
0027         dynamic_cast<const Cylinder*>(&(*surfaces[inner]))->radius()) {
0028       LogTrace("MagGeometry") << "*** WARNING: pos_outer < pos_inner ";
0029     }
0030   }
0031   // Save volume boundaries
0032   theRMin = rIn;
0033   theRMax = rOut;
0034   thePhiMin = surfaces[phiminus]->position().phi();
0035 }