CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/DetectorDescription/Core/interface/DDDivision.h

Go to the documentation of this file.
00001 #ifndef DDDivision_h
00002 #define DDDivision_h
00003 
00004 // The following is based on G4PVDivision of Gean4 as of 4/2004
00005 //
00006 // The elements' positions are calculated by means of a simple
00007 // linear formula.
00008 // 
00009 // G4PVDivision(const G4String& pName,
00010 //                    G4LogicalVolume* pLogical,
00011 //                    G4LogicalVolume* pMother,
00012 //              const EAxis pAxis,
00013 //              const G4int nReplicas,
00014 //              const G4double width,
00015 //              const G4double offset=0)
00016 //
00017 // Division may occur along:
00018 //
00019 // o Cartesian axes (kXAxis,kYAxis,kZAxis)
00020 //
00021 //   The divisions, of specified width have coordinates of
00022 //   form (-width*(nReplicas-1)*0.5+n*width,0,0) where n=0.. nReplicas-1
00023 //   for the case of kXAxis, and are unrotated.
00024 //
00025 // o Radial axis (cylindrical polar) (kRho)
00026 //
00027 //   The divisions are cons/tubs sections, centred on the origin
00028 //   and are unrotated.
00029 //   They have radii of width*n+offset to width*(n+1)+offset
00030 //                      where n=0..nReplicas-1
00031 //
00032 // o Phi axis (cylindrical polar) (kPhi)
00033 //   The divisions are `phi sections' or wedges, and of cons/tubs form
00034 //   They have phi of offset+n*width to offset+(n+1)*width where
00035 //   n=0..nReplicas-1
00036 
00037 // GEANT4 History:
00038 // 09.05.01 - P.Arce Initial version
00039 //
00040 // DDD History:
00041 // 13.04.04 - M. Case Initial DDD version.
00042 // ********************************************************************
00043 
00044 
00046 
00056 #include "DetectorDescription/Core/interface/DDName.h"
00057 #include "DetectorDescription/Core/interface/DDLogicalPart.h"
00058 #include "DetectorDescription/Core/interface/DDBase.h"
00059 #include "DetectorDescription/Core/interface/DDAxes.h"
00060 #include "DetectorDescription/Base/interface/Singleton.h"
00061 
00062 namespace DDI { class Division; }
00063 
00064 class DDMaterial;
00065 class DDSolid;
00066 class DDDivision;
00067 class DDPartSelection;
00068 
00069 std::ostream & operator<<( std::ostream &, const DDDivision &);
00070 
00071 class DDDivision : public DDBase<DDName, DDI::Division*>
00072 {
00073   friend std::ostream & operator<<( std::ostream &, const DDDivision &);
00074   
00075  public:      
00076   
00078   DDDivision();
00079 
00081   DDDivision(const DDName & name);
00082   
00084 
00086   DDDivision(const DDName & name,
00087              const DDLogicalPart & parent,
00088              const DDAxes axis,
00089              const int nReplicas,
00090              const double width,
00091              const double offset );
00092 
00093 
00095 
00097   DDDivision(const DDName & name,
00098              const DDLogicalPart & parent,
00099              const DDAxes axis,
00100              const int nReplicas,
00101              const double offset );
00102 
00104 
00106   DDDivision(const DDName & name,
00107              const DDLogicalPart & parent,
00108              const DDAxes axis,
00109              const double width,
00110              const double offset );
00111   
00112   //  virtual ~G4PVDivision();
00113 
00114   DDAxes axis() const;
00115   int nReplicas() const;
00116   double width() const;
00117   double offset() const;
00118   const DDLogicalPart & parent() const;
00119  
00120 
00121 };
00122 
00123 // mike copied from DDLogicalPart
00124 // some helpers .... (not very clean, redesign!! according to martin :-))
00125 // left this analogy out for now (mec) : pair<bool,std::string> DDIsValid(const std::string & ns, const std::string & name, std::vector<DDDivision> & result,bool doRegex=true);
00126 // std::maps name to std::vector of namespaces
00127 typedef DDI::Singleton<std::map<std::string,std::vector<DDName> > > DIVNAMES;
00128 //void DD_NDC(const DDName &);
00129 #endif