Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:22

0001 #ifndef volumeHandle_H
0002 #define volumeHandle_H
0003 
0004 /** \class MagGeoBuilderFromDDD::volumeHandle
0005  * A temporary container to cache info on a six-surface volume during
0006  * the processing. Used to sort, organise, and build shared planes.
0007  * One instance is created for each DDVolume. The parameters of the 
0008  * boundary surfaces are calculated during construction.
0009  *
0010  *  \author N. Amapane - INFN Torino (original developer)
0011  */
0012 
0013 #include "BaseVolumeHandle.h"
0014 #include "MagGeoBuilderFromDDD.h"
0015 
0016 #include "DetectorDescription/Core/interface/DDSolid.h"
0017 #include "DataFormats/GeometrySurface/interface/Surface.h"
0018 #include "MagneticField/VolumeGeometry/interface/VolumeSide.h"
0019 
0020 class DDExpandedView;
0021 class MagVolume6Faces;
0022 
0023 class MagGeoBuilderFromDDD::volumeHandle : public magneticfield::BaseVolumeHandle {
0024 public:
0025   volumeHandle(const DDExpandedView& fv, bool expand2Pi = false, bool debugVal = false);
0026 
0027   // Disallow Default/copy ctor & assignment op.
0028   // (we want to handle only pointers!!!)
0029   volumeHandle(const volumeHandle& v) = delete;
0030   volumeHandle operator=(const volumeHandle& v) = delete;
0031 
0032   DDSolidShape shape() const override { return solid.shape(); }
0033 
0034   /// The surfaces and they orientation, as required to build a MagVolume.
0035   std::vector<VolumeSide> sides() const override;
0036 
0037 private:
0038   // initialise the refPlane
0039   void referencePlane(const DDExpandedView& fv);
0040 
0041   // Build the surfaces for a box
0042   void buildBox(double halfX, double halfY, double halfZ);
0043   // Build the surfaces for a trapezoid
0044   void buildTrap(double x1,
0045                  double x2,
0046                  double x3,
0047                  double x4,
0048                  double y1,
0049                  double y2,
0050                  double theta,
0051                  double phi,
0052                  double halfZ,
0053                  double alpha1,
0054                  double alpha2);
0055   // Build the surfaces for a ddtubs shape
0056   void buildTubs(double zhalf, double rIn, double rOut, double startPhi, double deltaPhi);
0057   // Build the surfaces for a ddcons shape
0058   void buildCons(double zhalf,
0059                  double rInMinusZ,
0060                  double rOutMinusZ,
0061                  double rInPlusZ,
0062                  double rOutPlusZ,
0063                  double startPhi,
0064                  double deltaPhi);
0065   // Build the surfaces for a ddpseudotrap shape
0066   void buildPseudoTrap(double x1, double x2, double y1, double y2, double halfZ, double radius, bool atMinusZ);
0067   // Build the surfaces for a ddtrunctubs shape
0068   void buildTruncTubs(double zhalf,
0069                       double rIn,
0070                       double rOut,
0071                       double startPhi,
0072                       double deltaPhi,
0073                       double cutAtStart,
0074                       double cutAtDelta,
0075                       bool cutInside);
0076 
0077   // the DDSolid.
0078   DDSolid solid;
0079 };
0080 
0081 #endif