CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/Geometry/HcalAlgo/plugins/DDHCalEndcapAlgo.h

Go to the documentation of this file.
00001 #ifndef HcalAlgo_DDHCalEndcapAlgo_h
00002 #define HcalAlgo_DDHCalEndcapAlgo_h
00003 
00004 #include <map>
00005 #include <string>
00006 #include <vector>
00007 #include "DetectorDescription/Base/interface/DDTypes.h"
00008 #include "DetectorDescription/Algorithm/interface/DDAlgorithm.h"
00009 
00010 class DDHCalEndcapAlgo : public DDAlgorithm {
00011  public:
00012   //Constructor and Destructor
00013   DDHCalEndcapAlgo(); //const std::string & name);
00014   virtual ~DDHCalEndcapAlgo();
00015   
00016   //Get Methods
00017   std::string getGenMat()                  const {return genMaterial;}
00018   std::string getRotation()                const {return rotation;}
00019   int         getNsectors()                const {return nsectors;}
00020   int         getNsectortot()              const {return nsectortot;}
00021   int         getEndcaps()                 const {return nEndcap;}
00022   int         equipModule(unsigned int i)  const {return eModule[i];}
00023   double      getZShift()                  const {return zShift;}
00024 
00025   double      getZFront()                  const {return zFront;}
00026   double      getZEnd()                    const {return zEnd;}
00027   double      getZiNose()                  const {return ziNose;}
00028   double      getZiL0Nose()                const {return ziL0Nose;}
00029   double      getZiBody()                  const {return ziBody;}
00030   double      getZiL0Body()                const {return ziL0Body;}
00031   double      getZiKink()                  const {return ziKink;}
00032   double      getZ0Beam()                  const {return z0Beam;}
00033   double      getZ1Beam()                  const {return z1Beam;}
00034   double      getZiDip()                   const {return ziDip;}
00035   double      getDzStep()                  const {return dzStep;}
00036   double      getDzShift()                 const {return dzShift;}
00037   double      getZShiftHac2()              const {return zShiftHac2;}
00038 
00039   double      getRout()                    const {return rout;}
00040   double      getRinKink()                 const {return riKink;}
00041   double      getRinDip()                  const {return riDip;}
00042   double      getRoutDip()                 const {return roDip;}
00043   double      getHeboxDepth()              const {return heboxDepth;}
00044   double      getDrEnd()                   const {return drEnd;}
00045   double      getAngTop()                  const {return angTop;}
00046   double      getAngBot()                  const {return angBot;}
00047   double      getAngGap()                  const {return angGap;}
00048   double      getSlope()                   const {return slope;}
00049 
00050   std::string getAbsMat()                  const {return absMat;}
00051   int         getModules()                 const {return modules;}
00052   std::string getModName(unsigned int i)   const {return modName[i];}
00053   std::string getModMat(unsigned int i)    const {return modMat[i];}
00054   int         getModType(unsigned int i)   const {return modType[i];}
00055   int         getSectionModule(unsigned i) const {return sectionModule[i];}
00056   int         getLayerN(unsigned int i)    const {return layerN[i];}
00057   int         getLayer(unsigned int i, unsigned int j) const;
00058   double      getThick(unsigned int i)     const {return thick[i];}
00059   double      getTrim(unsigned int i, unsigned int j) const;
00060   double      getZminBlock(unsigned i)     const {return zminBlock[i];}
00061   double      getZmaxBlock(unsigned i)     const {return zmaxBlock[i];}
00062   double      getRinBlock1(unsigned i)     const {return rinBlock1[i];}
00063   double      getRinBlock2(unsigned i)     const {return rinBlock2[i];}
00064   double      getRoutBlock1(unsigned i)    const {return routBlock1[i];}
00065   double      getRoutBlock2(unsigned i)    const {return routBlock2[i];}
00066 
00067   int         getPhi()                     const {return phiSections;}
00068   std::string getPhiName(unsigned int i)   const {return phiName[i];}
00069   int         getLayers()                  const {return layers;}
00070   std::string getLayerName(unsigned int i) const {return layerName[i];}
00071   int         getLayerType(unsigned int i) const {return layerType[i];}
00072   double      getLayerT(unsigned int i)    const {return layerT[i];}
00073   double      getScintT(unsigned int i)    const {return scintT[i];}
00074   std::string getPlastMat()                const {return plastMat;}
00075   std::string getScintMat()                const {return scintMat;}
00076   std::string getRotMat()                  const {return rotmat;}
00077   double      getTolPos()                  const {return tolPos;}
00078   double      getTolAbs()                  const {return tolAbs;}
00079 
00080   void initialize(const DDNumericArguments & nArgs,
00081                   const DDVectorArguments & vArgs,
00082                   const DDMapArguments & mArgs,
00083                   const DDStringArguments & sArgs,
00084                   const DDStringVectorArguments & vsArgs);
00085 
00086   void execute(DDCompactView& cpv);
00087 
00088 protected:
00089 
00090   void constructGeneralVolume(DDCompactView& cpv);
00091   void constructInsideSector(DDLogicalPart sector, DDCompactView& cpv);
00092   void parameterLayer (int iphi, double rinF, double routF, double rinB, 
00093                        double routB, double zi, double zo, double& yh1, 
00094                        double& bl1, double& tl1, double& yh2, double& bl2,
00095                        double& tl2, double& alp, double& theta, double& phi,
00096                        double& xpos, double& ypos, double& zcpv);
00097   void parameterLayer0(int mod, int layer, int iphi, double& yh, double& bl, 
00098                        double& tl, double& alp, double& xpos, double& ypos, 
00099                        double& zcpv);
00100   void constructInsideModule0(DDLogicalPart module, int mod, DDCompactView& cpv);
00101   void constructInsideModule (DDLogicalPart module, int mod, DDCompactView& cpv);
00102   void constructScintLayer   (DDLogicalPart glog, double pDz, double yh, 
00103                               double bl, double tl, double alp, 
00104                               std::string name, int id, DDCompactView& cpv);
00105 
00106 private:
00107 
00108   std::string              genMaterial;   //General material
00109   int                      nsectors;      //Number of potenital straight edges
00110   int                      nsectortot;    //Number of straight edges (actual)
00111   int                      nEndcap;       //Number of endcaps
00112   std::vector<int>         eModule;       //Modules to be present in part i (?)
00113   std::string              rotHalf;       //Rotation matrix for half
00114   std::string              rotns;         //Name space for rotation
00115   std::string              rotation;      //Rotation matrix to place in mother
00116   double                   zShift;        //needed for TB setup (move HE)
00117 
00118   double                   zFront;        //Z of the front section
00119   double                   zEnd;          //Outer Z of the HE
00120   double                   ziNose;        //Starting Z of the nose
00121   double                   ziL0Nose;      //Starting Z of layer 0 at nose
00122   double                   ziBody;        //Starting Z of the body
00123   double                   ziL0Body;      //Starting Z of layer 0 at body
00124   double                   ziKink;        //Position of the kink point
00125   double                   z0Beam;        //Position of gap front along z-axis
00126   double                   z1Beam;        //Position of gap end   along z-axis
00127   double                   ziDip;         //Starting Z of dipped part of body
00128   double                   dzStep;        //Width in Z of a layer
00129   double                   dzShift;       //Shift in Z for HE
00130   double                   zShiftHac2;    //needed for TB (remove part Hac2)
00131 
00132   double                   rout;          //Outer R of the HE
00133   double                   riKink;        //Inner radius at kink point
00134   double                   riDip;         //Inner radius at the dip point
00135   double                   roDip;         //Outer radius at the dip point
00136   double                   heboxDepth;    //Depth of the HE box
00137   double                   drEnd;         //Shift in R for the end absorber
00138 
00139   double                   angTop;        //Angle of top end of HE
00140   double                   angBot;        //Angle of the bottom end of HE
00141   double                   angGap;        //Gap angle (in degrees)
00142   double                   slope;         //Slope of the gap on HE side
00143 
00144   std::string              absMat;        //Absorber     material
00145   int                      modules;       //Number of modules
00146   std::vector<std::string> modName;       //Name
00147   std::vector<std::string> modMat;        //Material
00148   std::vector<int>         modType;       //Type (0/1 for front/standard)
00149   std::vector<int>         sectionModule; //Number of sections in a module
00150   std::vector<int>         layerN;        //Number of layers
00151   std::vector<int>         layerN0;       //Layer numbers in section 0
00152   std::vector<int>         layerN1;       //Layer numbers in section 1
00153   std::vector<int>         layerN2;       //Layer numbers in section 2
00154   std::vector<int>         layerN3;       //Layer numbers in section 3
00155   std::vector<int>         layerN4;       //Layer numbers in section 4
00156   std::vector<int>         layerN5;       //Layer numbers in section 5
00157   std::vector<double>      thick;         //Thickness of absorber/air
00158   std::vector<double>      trimLeft;      //Trimming of left  layers in module
00159   std::vector<double>      trimRight;     //Trimming of right layers in module
00160   std::vector<double>      zminBlock;     //Minimum Z
00161   std::vector<double>      zmaxBlock;     //Maximum Z
00162   std::vector<double>      rinBlock1;     //Inner Radius
00163   std::vector<double>      routBlock1;    //Outer Radius at zmin
00164   std::vector<double>      rinBlock2;     //Inner Radius
00165   std::vector<double>      routBlock2;    //Outer Radius at zmax
00166   
00167   int                      phiSections;   //Number of phi sections
00168   std::vector<std::string> phiName;       //Name of Phi sections
00169   int                      layers;        //Number of layers
00170   std::vector<std::string> layerName;     //Layer Names
00171   std::vector<int>         layerType;     //Detector type in each layer
00172   std::vector<double>      layerT;        //Layer thickness (plastic + scint.)
00173   std::vector<double>      scintT;        //Scintillator thickness
00174   std::string              plastMat;      //Plastic      material
00175   std::string              scintMat;      //Scintillator material
00176   std::string              rotmat;        //Rotation matrix for positioning
00177 
00178   std::string              idName;        //Name of the "parent" volume.  
00179   std::string              idNameSpace;   //Namespace of this and ALL sub-parts
00180   int                      idOffset;      // Geant4 ID's...    = 4000;
00181 
00182   double                   tolPos, tolAbs; //Tolerances
00183 };
00184 
00185 #endif