CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/Geometry/HcalAlgo/plugins/DDHCalBarrelAlgo.h

Go to the documentation of this file.
00001 #ifndef HcalAlgo_DDHCalBarrelAlgo_h
00002 #define HcalAlgo_DDHCalBarrelAlgo_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 DDHCalBarrelAlgo : public DDAlgorithm {
00011  public:
00012   //Constructor and Destructor
00013   DDHCalBarrelAlgo(); //const std::string & name);
00014   virtual ~DDHCalBarrelAlgo();
00015   
00016   //Get Methods
00017   std::string getGenMaterial()                const {return genMaterial;}
00018   int         getNsectors()                   const {return nsectors;}
00019   int         getNsectortot()                 const {return nsectortot;}
00020   int         getNhalf()                      const {return nhalf;}
00021   double      getRin()                        const {return rin;}
00022   double      getRout()                       const {return rout;}
00023   int         getRzones()                     const {return rzones;}
00024   double      getTanTheta(unsigned int i)     const {return ttheta[i];}
00025   double      getTheta(unsigned int i)        const {return theta[i];}
00026   double      getRmax(unsigned int i)         const {return rmax[i];}
00027   double      getZoff(unsigned int i)         const {return zoff[i];}
00028   
00029   int         getNLayers()                    const {return nLayers;}
00030   int         getLayerId(unsigned i)          const {return layerId[i];}
00031   std::string getLayerLabel(unsigned i)       const {return layerLabel[i];}
00032   std::string getLayerMaterial(unsigned i)    const {return layerMat[i];}
00033   double      getLayerWidth(unsigned i)       const {return layerWidth[i];}
00034   double      getLayerD1(unsigned i)          const {return layerD1[i];}
00035   double      getLayerD2(unsigned i)          const {return layerD2[i];}
00036   double      getLayerAlpha(unsigned i)       const {return layerAlpha[i];}
00037   double      getLayerT1(unsigned i)          const {return layerT1[i];}
00038   double      getLayerT2(unsigned i)          const {return layerT2[i];}
00039   int         getLayerAbsorb(unsigned int i)  const {return layerAbsorb[i];}
00040   double      getLayerGap(unsigned int i)     const {return layerGap[i];}
00041 
00042   std::string getSideMat(unsigned int i)      const {return sideMat[i];}
00043   double      getSideD(unsigned int i)        const {return sideD[i];}
00044   double      getSideT(unsigned int i)        const {return sideT[i];}
00045   int         getSideAbsorber()               const {return nSideAbs;}
00046   std::string getSideAbsName(unsigned int i)  const {return sideAbsName[i];}
00047   std::string getSideAbsMat(unsigned int i)   const {return sideAbsMat[i];}
00048   double      getSideAbsW(unsigned int i)     const {return sideAbsW[i];}
00049 
00050   int         getAbsorberN()                  const {return nAbsorber;}
00051   std::string getAbsorbName(unsigned int i)   const {return absorbName[i];}
00052   std::string getAbsorbMat(unsigned int i)    const {return absorbMat[i];}
00053   double      getAbsorbD(unsigned int i)      const {return absorbD[i];}
00054   double      getAbsorbT(unsigned int i)      const {return absorbT[i];}
00055   std::string getMiddleMat()                  const {return middleMat;}
00056   double      getMiddleD()                    const {return middleD;}
00057   double      getMiddleW()                    const {return middleW;}
00058   int         getMidAbsorber()                const {return nMidAbs;}
00059   std::string getMidAbsName(unsigned int i)   const {return midName[i];}
00060   std::string getMidAbsMat(unsigned int i)    const {return midMat[i];}
00061   double      getMidAbsW(unsigned int i)      const {return midW[i];}
00062   double      getMidAbsT(unsigned int i)      const {return midT[i];}
00063 
00064   std::string getDetMat()                     const {return detMat;}
00065   std::string getDetMatPl()                   const {return detMatPl;}
00066   std::string getDetMatSc()                   const {return detMatSc;}
00067   int         getDetType(unsigned int i)      const {return detType[i];}
00068   double      getDetdP1(unsigned int i)       const {return detdP1[i];}
00069   double      getDetdP2(unsigned int i)       const {return detdP2[i];}
00070   double      getDetT11(unsigned int i)       const {return detT11[i];}
00071   double      getDetT12(unsigned int i)       const {return detT12[i];}
00072   double      getDetTsc(unsigned int i)       const {return detTsc[i];}
00073   double      getDetT21(unsigned int i)       const {return detT21[i];}
00074   double      getDetT22(unsigned int i)       const {return detT22[i];}
00075   double      getDetWidth1(unsigned int i)    const {return detWidth1[i];}
00076   double      getDetWidth2(unsigned int i)    const {return detWidth2[i];}
00077   int         getDetPosY(unsigned int i)      const {return detPosY[i];}
00078 
00079   void initialize(const DDNumericArguments & nArgs,
00080                   const DDVectorArguments & vArgs,
00081                   const DDMapArguments & mArgs,
00082                   const DDStringArguments & sArgs,
00083                   const DDStringVectorArguments & vsArgs);
00084 
00085   void execute(DDCompactView& cpv);
00086 
00087 protected:
00088 
00089   void constructGeneralVolume(DDCompactView& cpv);
00090   void constructInsideSector(DDLogicalPart sector, DDCompactView& cpv);
00091   void constructInsideLayers(DDLogicalPart laylog, std::string name, int id, 
00092                              int nAbs, double rin, double d1, double alpha1, 
00093                              double d2, double alpha2, double t1, double t2, DDCompactView& cpv);
00094   DDLogicalPart constructSideLayer(DDLogicalPart laylog, std::string nm,
00095                                    int nAbs, double rin, double alpha, DDCompactView& cpv);
00096   DDLogicalPart constructMidLayer(DDLogicalPart laylog, std::string nm,
00097                                   double rin, double alpha, DDCompactView& cpv);
00098   void constructInsideDetectors(DDLogicalPart detector,
00099                                 std::string name, int id, double dx, 
00100                                 double dy, double dz, int type, DDCompactView& cpv);
00101 
00102 private:
00103   //General Volume
00104   //      <----- Zmax ------>
00105   // Rout ************************-------
00106   //      *                      *Rstep2|        Theta angle w.r.t. vertical
00107   //      *                      *---------------
00108   //      *                     *               |
00109   //      *                    *Theta[i]        Rmax[i]
00110   //      *                   *---------------  |
00111   //                        *Theta[0] Rmax[0]|  |
00112   // Rin  *****************----------------------
00113 
00114   std::string  genMaterial;         //General material
00115   int       nsectors;               //Number of potenital straight edges
00116   int       nsectortot;             //Number of straight edges (actual)
00117   int       nhalf;                  //Number of half modules
00118   double    rin, rout;              //See picture
00119   int       rzones;                 //  ....
00120   std::vector<double>   theta;      //  .... (in degrees)
00121   std::vector<double>   rmax;       //  .... 
00122   std::vector<double>   zoff;       //  ....
00123   std::vector<double>   ttheta;     //tan(theta)
00124   std::string rotHalf;              //Rotation matrix of the second half
00125   std::string rotns;                //Name space for Rotation matrices
00126 
00127   //Upper layers inside general volume
00128   //     <---- Zout ---->
00129   //  |  ****************     |
00130   //  |  *              *     Wstep
00131   //  W  *              ***** |
00132   //  |  *                  *
00133   //  |  ********************
00134   //     <------ Zin ------->
00135   // Middle layers inside general volume
00136   //     <------ Zout ------>         Zout = Full sector Z at position
00137   //  |  ********************         Zin  = Full sector Z at position
00138   //  |  *                 *
00139   //  W  *                * Angle = Theta sector
00140   //  |  *               *  )
00141   //  |  ****************--------
00142   //     <------ Zin ------->
00143 
00144   // Lower layers
00145   //     <------ Zout ------>         Zin(i)=Zout(i-1)
00146   //  |  ********************         Zout(i)=Zin(i)+W(i)/tan(Theta(i))
00147   //  |  *                 *
00148   //  W  *                *  Theta
00149   //  |  *               *
00150   //  |  ****************--------
00151   //     <--- Zin ------>
00152 
00153   int                      nLayers;     //Number of layers
00154   std::vector<int>         layerId;     //Number identification
00155   std::vector<std::string> layerLabel;  //String identification
00156   std::vector<std::string> layerMat;    //Material
00157   std::vector<double>      layerWidth;  //W in picture
00158   std::vector<double>      layerD1;     //d1 in front picture
00159   std::vector<double>      layerD2;     //d2 in front picture
00160   std::vector<double>      layerAlpha;  //Angular width of the middle tiles
00161   std::vector<double>      layerT1;     //t in front picture (side)
00162   std::vector<double>      layerT2;     //t in front picture (front)
00163   std::vector<int>         layerAbsorb; //Absorber flag
00164   std::vector<double>      layerGap;    //Gap at the edge
00165 
00166   int                      nAbsorber;   //Number of absorber layers in middle
00167   std::vector<std::string> absorbName;  //Absorber name
00168   std::vector<std::string> absorbMat;   //Absorber material
00169   std::vector<double>      absorbD;     //Distance from the bottom surface
00170   std::vector<double>      absorbT;     //Thickness
00171   std::string              middleMat;   //Material of the detector layer
00172   double                   middleD;     //Distance from the bottom surface
00173   double                   middleW;     //Half width
00174   int                      nMidAbs;     //Number of absorbers in front part
00175   std::vector<std::string> midName;     //Absorber names in the front part
00176   std::vector<std::string> midMat;      //Absorber material
00177   std::vector<double>      midW;        //Half width
00178   std::vector<double>      midT;        //Thickness
00179 
00180   std::vector<std::string> sideMat;     //Material for special side layers
00181   std::vector<double>      sideD;       //Depth from bottom surface
00182   std::vector<double>      sideT;       //Thickness
00183   int                      nSideAbs;    //Number of absorbers in special side
00184   std::vector<std::string> sideAbsName; //Absorber name
00185   std::vector<std::string> sideAbsMat;  //Absorber material
00186   std::vector<double>      sideAbsW;    //Half width
00187 
00188   // Detectors. Each volume inside the layer has the shape:
00189   //
00190   // ******************************* |
00191   // *\\\\\\\Plastic\\\\\\\\\\\\\\\* T2
00192   // ******************************* |        
00193   // *////Scintillator/////////////* Tsc      
00194   // ******************************* |        
00195   // *\\\\\\\Plastic\\\\\\\\\\\\\\\* T1       
00196   // ******************************* |   |    
00197   // *         Air                 *     dP1  
00198   // *******************************     |    
00199   // 
00200   std::string         detMat;                 //fill material
00201   std::string         detRot;                 //Rotation matrix for the 2nd
00202   std::string         detMatPl;               //Plastic material
00203   std::string         detMatSc;               //Scintillator material
00204   std::vector<int>    detType;       
00205   std::vector<double> detdP1;                 //Air gap (side)
00206   std::vector<double> detdP2;                 //Air gap (centre)
00207   std::vector<double> detT11;                 //Back plastic thickness (side)
00208   std::vector<double> detT12;                 //Back plastic thickness (centre)
00209   std::vector<double> detTsc;                 //Scintillator
00210   std::vector<double> detT21;                 //Front plastic thickness (side)
00211   std::vector<double> detT22;                 //Front plastic thickness (centre)
00212   std::vector<double> detWidth1;              //Width of phi(1,4) megatiles
00213   std::vector<double> detWidth2;              //Width of phi(2,3) megatiles
00214   std::vector<int>    detPosY;                //Positioning of phi(1,4) tiles - 0 centre
00215 
00216   std::string         idName;                 //Name of the "parent" volume.  
00217   std::string         idNameSpace;            //Namespace of this and ALL sub-parts
00218   int                 idOffset;               // Geant4 ID's...    = 3000;
00219 };
00220 
00221 #endif