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
00013 DDHCalEndcapAlgo();
00014 virtual ~DDHCalEndcapAlgo();
00015
00016
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;
00109 int nsectors;
00110 int nsectortot;
00111 int nEndcap;
00112 std::vector<int> eModule;
00113 std::string rotHalf;
00114 std::string rotns;
00115 std::string rotation;
00116 double zShift;
00117
00118 double zFront;
00119 double zEnd;
00120 double ziNose;
00121 double ziL0Nose;
00122 double ziBody;
00123 double ziL0Body;
00124 double ziKink;
00125 double z0Beam;
00126 double z1Beam;
00127 double ziDip;
00128 double dzStep;
00129 double dzShift;
00130 double zShiftHac2;
00131
00132 double rout;
00133 double riKink;
00134 double riDip;
00135 double roDip;
00136 double heboxDepth;
00137 double drEnd;
00138
00139 double angTop;
00140 double angBot;
00141 double angGap;
00142 double slope;
00143
00144 std::string absMat;
00145 int modules;
00146 std::vector<std::string> modName;
00147 std::vector<std::string> modMat;
00148 std::vector<int> modType;
00149 std::vector<int> sectionModule;
00150 std::vector<int> layerN;
00151 std::vector<int> layerN0;
00152 std::vector<int> layerN1;
00153 std::vector<int> layerN2;
00154 std::vector<int> layerN3;
00155 std::vector<int> layerN4;
00156 std::vector<int> layerN5;
00157 std::vector<double> thick;
00158 std::vector<double> trimLeft;
00159 std::vector<double> trimRight;
00160 std::vector<double> zminBlock;
00161 std::vector<double> zmaxBlock;
00162 std::vector<double> rinBlock1;
00163 std::vector<double> routBlock1;
00164 std::vector<double> rinBlock2;
00165 std::vector<double> routBlock2;
00166
00167 int phiSections;
00168 std::vector<std::string> phiName;
00169 int layers;
00170 std::vector<std::string> layerName;
00171 std::vector<int> layerType;
00172 std::vector<double> layerT;
00173 std::vector<double> scintT;
00174 std::string plastMat;
00175 std::string scintMat;
00176 std::string rotmat;
00177
00178 std::string idName;
00179 std::string idNameSpace;
00180 int idOffset;
00181
00182 double tolPos, tolAbs;
00183 };
00184
00185 #endif