Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:22

0001 #ifndef SimG4Core_DDG4SolidConverter_h
0002 #define SimG4Core_DDG4SolidConverter_h
0003 
0004 #include "DetectorDescription/Core/interface/DDSolidShapes.h"
0005 
0006 #include "G4RotationMatrix.hh"
0007 
0008 #include <map>
0009 #include <vector>
0010 
0011 class G4VSolid;
0012 class DDSolid;
0013 
0014 class DDG4SolidConverter {
0015 public:
0016   DDG4SolidConverter();
0017   ~DDG4SolidConverter();
0018   typedef G4VSolid *(*FNPTR)(const DDSolid &);  // pointer to function
0019   G4VSolid *convert(const DDSolid &);
0020 
0021 private:
0022   /* foreach supported solid add a static conversion routine ,
0023      register this method in the convDispatch_-map */
0024   static G4VSolid *box(const DDSolid &);
0025   static G4VSolid *tubs(const DDSolid &);
0026   static G4VSolid *cuttubs(const DDSolid &);
0027   static G4VSolid *trap(const DDSolid &);
0028   static G4VSolid *cons(const DDSolid &);
0029   static G4VSolid *unionsolid(const DDSolid &);
0030   static G4VSolid *subtraction(const DDSolid &);
0031   static G4VSolid *intersection(const DDSolid &);
0032   static G4VSolid *shapeless(const DDSolid &);
0033   static G4VSolid *polycone_rz(const DDSolid &);
0034   static G4VSolid *polycone_rrz(const DDSolid &);
0035   static G4VSolid *polyhedra_rz(const DDSolid &);
0036   static G4VSolid *polyhedra_rrz(const DDSolid &);
0037   static G4VSolid *extrudedpolygon(const DDSolid &);
0038   static G4VSolid *pseudotrap(const DDSolid &s);
0039   static G4VSolid *torus(const DDSolid &);
0040   static G4VSolid *trunctubs(const DDSolid &);
0041   static G4VSolid *sphere(const DDSolid &);
0042   static G4VSolid *ellipticaltube(const DDSolid &);
0043   static const std::vector<double> *par_;
0044   std::map<DDSolidShape, FNPTR> convDispatch_;
0045 
0046   static G4RotationMatrix *rot;
0047 
0048   friend class testTruncTubs;
0049   friend class testPseudoTrap;
0050 };
0051 
0052 #endif