CMS 3D CMS Logo

DDHCalBarrelAlgo.h
Go to the documentation of this file.
1 #ifndef HcalAlgo_DDHCalBarrelAlgo_h
2 #define HcalAlgo_DDHCalBarrelAlgo_h
3 
4 #include <map>
5 #include <string>
6 #include <vector>
9 
10 class DDHCalBarrelAlgo : public DDAlgorithm {
11  public:
12  //Constructor and Destructor
13  DDHCalBarrelAlgo(); //const std::string & name);
14  ~DDHCalBarrelAlgo() override;
15 
16  //Get Methods
18  int getNsectors() const {return nsectors;}
19  int getNsectortot() const {return nsectortot;}
20  int getNhalf() const {return nhalf;}
21  double getRin() const {return rin;}
22  double getRout() const {return rout;}
23  int getRzones() const {return rzones;}
24  double getTanTheta(unsigned int i) const {return ttheta[i];}
25  double getTheta(unsigned int i) const {return theta[i];}
26  double getRmax(unsigned int i) const {return rmax[i];}
27  double getZoff(unsigned int i) const {return zoff[i];}
28 
29  int getNLayers() const {return nLayers;}
30  int getLayerId(unsigned i) const {return layerId[i];}
31  std::string getLayerLabel(unsigned i) const {return layerLabel[i];}
32  std::string getLayerMaterial(unsigned i) const {return layerMat[i];}
33  double getLayerWidth(unsigned i) const {return layerWidth[i];}
34  double getLayerD1(unsigned i) const {return layerD1[i];}
35  double getLayerD2(unsigned i) const {return layerD2[i];}
36  double getLayerAlpha(unsigned i) const {return layerAlpha[i];}
37  double getLayerT1(unsigned i) const {return layerT1[i];}
38  double getLayerT2(unsigned i) const {return layerT2[i];}
39  int getLayerAbsorb(unsigned int i) const {return layerAbsorb[i];}
40  double getLayerGap(unsigned int i) const {return layerGap[i];}
41 
42  std::string getSideMat(unsigned int i) const {return sideMat[i];}
43  double getSideD(unsigned int i) const {return sideD[i];}
44  double getSideT(unsigned int i) const {return sideT[i];}
45  int getSideAbsorber() const {return nSideAbs;}
46  std::string getSideAbsName(unsigned int i) const {return sideAbsName[i];}
47  std::string getSideAbsMat(unsigned int i) const {return sideAbsMat[i];}
48  double getSideAbsW(unsigned int i) const {return sideAbsW[i];}
49 
50  int getAbsorberN() const {return nAbsorber;}
51  std::string getAbsorbName(unsigned int i) const {return absorbName[i];}
52  std::string getAbsorbMat(unsigned int i) const {return absorbMat[i];}
53  double getAbsorbD(unsigned int i) const {return absorbD[i];}
54  double getAbsorbT(unsigned int i) const {return absorbT[i];}
56  double getMiddleD() const {return middleD;}
57  double getMiddleW() const {return middleW;}
58  int getMidAbsorber() const {return nMidAbs;}
59  std::string getMidAbsName(unsigned int i) const {return midName[i];}
60  std::string getMidAbsMat(unsigned int i) const {return midMat[i];}
61  double getMidAbsW(unsigned int i) const {return midW[i];}
62  double getMidAbsT(unsigned int i) const {return midT[i];}
63 
64  std::string getDetMat() const {return detMat;}
65  std::string getDetMatPl() const {return detMatPl;}
66  std::string getDetMatSc() const {return detMatSc;}
67  int getDetType(unsigned int i) const {return detType[i];}
68  double getDetdP1(unsigned int i) const {return detdP1[i];}
69  double getDetdP2(unsigned int i) const {return detdP2[i];}
70  double getDetT11(unsigned int i) const {return detT11[i];}
71  double getDetT12(unsigned int i) const {return detT12[i];}
72  double getDetTsc(unsigned int i) const {return detTsc[i];}
73  double getDetT21(unsigned int i) const {return detT21[i];}
74  double getDetT22(unsigned int i) const {return detT22[i];}
75  double getDetWidth1(unsigned int i) const {return detWidth1[i];}
76  double getDetWidth2(unsigned int i) const {return detWidth2[i];}
77  int getDetPosY(unsigned int i) const {return detPosY[i];}
78 
79  void initialize(const DDNumericArguments & nArgs,
80  const DDVectorArguments & vArgs,
81  const DDMapArguments & mArgs,
82  const DDStringArguments & sArgs,
83  const DDStringVectorArguments & vsArgs) override;
84 
85  void execute(DDCompactView& cpv) override;
86 
87 protected:
88 
90  void constructInsideSector(const DDLogicalPart& sector, DDCompactView& cpv);
91  void constructInsideLayers(const DDLogicalPart& laylog, const std::string& name, int id,
92  int nAbs, double rin, double d1, double alpha1,
93  double d2, double alpha2, double t1, double t2, DDCompactView& cpv);
95  int nAbs, double rin, double alpha, DDCompactView& cpv);
97  double rin, double alpha, DDCompactView& cpv);
99  const std::string& name, int id, double dx,
100  double dy, double dz, int type, DDCompactView& cpv);
101 
102 private:
103  //General Volume
104  // <----- Zmax ------>
105  // Rout ************************-------
106  // * *Rstep2| Theta angle w.r.t. vertical
107  // * *---------------
108  // * * |
109  // * *Theta[i] Rmax[i]
110  // * *--------------- |
111  // *Theta[0] Rmax[0]| |
112  // Rin *****************----------------------
113 
114  std::string genMaterial; //General material
115  int nsectors; //Number of potenital straight edges
116  int nsectortot; //Number of straight edges (actual)
117  int nhalf; //Number of half modules
118  double rin, rout; //See picture
119  int rzones; // ....
120  std::vector<double> theta; // .... (in degrees)
121  std::vector<double> rmax; // ....
122  std::vector<double> zoff; // ....
123  std::vector<double> ttheta; //tan(theta)
124  std::string rotHalf; //Rotation matrix of the second half
125  std::string rotns; //Name space for Rotation matrices
126 
127  //Upper layers inside general volume
128  // <---- Zout ---->
129  // | **************** |
130  // | * * Wstep
131  // W * ***** |
132  // | * *
133  // | ********************
134  // <------ Zin ------->
135  // Middle layers inside general volume
136  // <------ Zout ------> Zout = Full sector Z at position
137  // | ******************** Zin = Full sector Z at position
138  // | * *
139  // W * * Angle = Theta sector
140  // | * * )
141  // | ****************--------
142  // <------ Zin ------->
143 
144  // Lower layers
145  // <------ Zout ------> Zin(i)=Zout(i-1)
146  // | ******************** Zout(i)=Zin(i)+W(i)/tan(Theta(i))
147  // | * *
148  // W * * Theta
149  // | * *
150  // | ****************--------
151  // <--- Zin ------>
152 
153  int nLayers; //Number of layers
154  std::vector<int> layerId; //Number identification
155  std::vector<std::string> layerLabel; //String identification
156  std::vector<std::string> layerMat; //Material
157  std::vector<double> layerWidth; //W in picture
158  std::vector<double> layerD1; //d1 in front picture
159  std::vector<double> layerD2; //d2 in front picture
160  std::vector<double> layerAlpha; //Angular width of the middle tiles
161  std::vector<double> layerT1; //t in front picture (side)
162  std::vector<double> layerT2; //t in front picture (front)
163  std::vector<int> layerAbsorb; //Absorber flag
164  std::vector<double> layerGap; //Gap at the edge
165 
166  int nAbsorber; //Number of absorber layers in middle
167  std::vector<std::string> absorbName; //Absorber name
168  std::vector<std::string> absorbMat; //Absorber material
169  std::vector<double> absorbD; //Distance from the bottom surface
170  std::vector<double> absorbT; //Thickness
171  std::string middleMat; //Material of the detector layer
172  double middleD; //Distance from the bottom surface
173  double middleW; //Half width
174  int nMidAbs; //Number of absorbers in front part
175  std::vector<std::string> midName; //Absorber names in the front part
176  std::vector<std::string> midMat; //Absorber material
177  std::vector<double> midW; //Half width
178  std::vector<double> midT; //Thickness
179 
180  std::vector<std::string> sideMat; //Material for special side layers
181  std::vector<double> sideD; //Depth from bottom surface
182  std::vector<double> sideT; //Thickness
183  int nSideAbs; //Number of absorbers in special side
184  std::vector<std::string> sideAbsName; //Absorber name
185  std::vector<std::string> sideAbsMat; //Absorber material
186  std::vector<double> sideAbsW; //Half width
187 
188  // Detectors. Each volume inside the layer has the shape:
189  //
190  // ******************************* |
191  // *\\\\\\\Plastic\\\\\\\\\\\\\\\* T2
192  // ******************************* |
193  // *////Scintillator/////////////* Tsc
194  // ******************************* |
195  // *\\\\\\\Plastic\\\\\\\\\\\\\\\* T1
196  // ******************************* | |
197  // * Air * dP1
198  // ******************************* |
199  //
200  std::string detMat; //fill material
201  std::string detRot; //Rotation matrix for the 2nd
202  std::string detMatPl; //Plastic material
203  std::string detMatSc; //Scintillator material
204  std::vector<int> detType;
205  std::vector<double> detdP1; //Air gap (side)
206  std::vector<double> detdP2; //Air gap (centre)
207  std::vector<double> detT11; //Back plastic thickness (side)
208  std::vector<double> detT12; //Back plastic thickness (centre)
209  std::vector<double> detTsc; //Scintillator
210  std::vector<double> detT21; //Front plastic thickness (side)
211  std::vector<double> detT22; //Front plastic thickness (centre)
212  std::vector<double> detWidth1; //Width of phi(1,4) megatiles
213  std::vector<double> detWidth2; //Width of phi(2,3) megatiles
214  std::vector<int> detPosY; //Positioning of phi(1,4) tiles - 0 centre
215 
216  std::string idName; //Name of the "parent" volume.
217  std::string idNameSpace; //Namespace of this and ALL sub-parts
218  int idOffset; // Geant4 ID's... = 3000;
219 };
220 
221 #endif
std::vector< std::string > absorbMat
type
Definition: HCALResponse.h:21
std::string getSideAbsName(unsigned int i) const
int getNsectortot() const
float alpha
Definition: AMPTWrapper.h:95
std::string getLayerLabel(unsigned i) const
double getRin() const
std::string getGenMaterial() const
std::vector< std::string > midMat
double getLayerD1(unsigned i) const
double getAbsorbT(unsigned int i) const
std::vector< double > sideAbsW
int getNhalf() const
std::string getLayerMaterial(unsigned i) const
std::string getMidAbsName(unsigned int i) const
std::vector< std::string > layerLabel
double getRmax(unsigned int i) const
int getDetPosY(unsigned int i) const
double getLayerD2(unsigned i) const
double getSideAbsW(unsigned int i) const
std::string idNameSpace
std::vector< double > layerD2
std::vector< std::string > layerMat
std::string getAbsorbMat(unsigned int i) const
double getLayerAlpha(unsigned i) const
std::vector< int > layerId
std::vector< double > rmax
int getRzones() const
void constructInsideDetectors(const DDLogicalPart &detector, const std::string &name, int id, double dx, double dy, double dz, int type, DDCompactView &cpv)
std::string getDetMatPl() const
double getMidAbsT(unsigned int i) const
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
void constructInsideSector(const DDLogicalPart &sector, DDCompactView &cpv)
std::string getDetMat() const
double getRout() const
std::string detMatSc
double getZoff(unsigned int i) const
std::string genMaterial
std::string getDetMatSc() const
std::vector< double > layerT1
std::vector< double > detdP2
std::vector< double > detWidth2
double getDetT22(unsigned int i) const
int getAbsorberN() const
double getLayerGap(unsigned int i) const
std::vector< std::string > sideAbsName
std::vector< double > detdP1
std::vector< double > absorbT
void execute(DDCompactView &cpv) override
std::vector< double > detWidth1
DDLogicalPart constructSideLayer(const DDLogicalPart &laylog, const std::string &nm, int nAbs, double rin, double alpha, DDCompactView &cpv)
double getDetT11(unsigned int i) const
int getNLayers() const
void constructGeneralVolume(DDCompactView &cpv)
int getLayerAbsorb(unsigned int i) const
double getLayerT2(unsigned i) const
int getDetType(unsigned int i) const
double getDetdP1(unsigned int i) const
double getLayerT1(unsigned i) const
int getSideAbsorber() const
double getSideD(unsigned int i) const
double getMidAbsW(unsigned int i) const
std::string getSideAbsMat(unsigned int i) const
std::vector< double > layerGap
std::string getSideMat(unsigned int i) const
std::vector< double > layerAlpha
void constructInsideLayers(const DDLogicalPart &laylog, const std::string &name, int id, int nAbs, double rin, double d1, double alpha1, double d2, double alpha2, double t1, double t2, DDCompactView &cpv)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
double getTanTheta(unsigned int i) const
std::vector< double > detT22
std::vector< int > layerAbsorb
int getNsectors() const
std::vector< std::string > sideAbsMat
std::vector< double > sideT
std::vector< double > detTsc
~DDHCalBarrelAlgo() override
double getDetTsc(unsigned int i) const
int getLayerId(unsigned i) const
std::string getAbsorbName(unsigned int i) const
double getMiddleW() const
double getTheta(unsigned int i) const
double getDetdP2(unsigned int i) const
std::vector< std::string > midName
std::vector< std::string > sideMat
std::vector< double > detT21
std::vector< int > detPosY
double getLayerWidth(unsigned i) const
std::vector< int > detType
double getAbsorbD(unsigned int i) const
double getDetT21(unsigned int i) const
std::string detMatPl
std::vector< double > zoff
std::vector< double > sideD
std::vector< double > detT11
double getMiddleD() const
std::vector< double > absorbD
std::vector< double > ttheta
double getDetWidth2(unsigned int i) const
std::vector< double > theta
int getMidAbsorber() const
std::string middleMat
std::vector< double > layerWidth
std::vector< std::string > absorbName
double getDetT12(unsigned int i) const
std::vector< double > midW
double getDetWidth1(unsigned int i) const
std::vector< double > layerD1
double getSideT(unsigned int i) const
std::vector< double > detT12
std::string getMiddleMat() const
std::vector< double > midT
std::vector< double > layerT2
DDLogicalPart constructMidLayer(const DDLogicalPart &laylog, const std::string &nm, double rin, double alpha, DDCompactView &cpv)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
std::string getMidAbsMat(unsigned int i) const