15 #include "CLHEP/Units/GlobalPhysicalConstants.h" 16 #include "CLHEP/Units/GlobalSystemOfUnits.h" 22 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::HcalGeomParameters ( const DDCompactView& cpv ) constructor";
35 for (
double i :
etaHO) rHO.emplace_back(
i);
40 std::vector<int> modHalf;
42 modHalf.emplace_back(
nmodHB); modHalf.emplace_back(
nzHB);
44 modHalf.emplace_back(
nmodHE); modHalf.emplace_back(
nzHE);
50 std::vector<int>&
array)
const {
51 unsigned int id = array.size();
52 for (
unsigned int i = 0;
i < array.size();
i++) {
53 if (element == array[
i]) {
64 if (z != 0) tmp = -
log(
tan(0.5*atan(r/z)));
67 << z <<
" ==> " <<
tmp;
76 bool dodet=
true,
hf=
false;
77 std::vector<double> rb(20,0.0), ze(20,0.0), thkb(20,-1.0), thke(20,-1.0);
78 std::vector<int>
ib(20,0), ie(20,0);
79 std::vector<int> izb, phib, ize, phie;
80 std::vector<double> rxb;
82 std::vector<double> rminHE(20,0.0), rmaxHE(20,0.0);
93 int idet = 0, lay = -1;
94 int nsiz = (
int)(copy.size());
95 if (nsiz>0) lay = copy[nsiz-1]/10;
96 if (nsiz>1) idet = copy[nsiz-2]/1000;
97 double dx=0,
dy=0,
dz=0, dx1=0, dx2=0;
110 dx = 0.25*(trp.
x1()+trp.
x2()+trp.
x3()+trp.
x4());
111 dy = 0.5*(trp.
y1()+trp.
y2());
126 << sol.
shape() <<
" Layer " << lay <<
" R " 129 if (lay >=0 && lay < 20) {
132 if (thkb[lay] <= 0) {
133 if (lay < 17) thkb[lay] =
dx;
138 for (
double k : rxb) {
145 rxb.emplace_back(t.Rho());
148 php.
dyHB.emplace_back(2.*
dy);
149 php.
dxHB.emplace_back(2.*
dz);
150 php.
layHB.emplace_back(lay);
155 int iz = copy[nsiz-5];
156 int fi = copy[nsiz-4];
157 unsigned int it1 =
find(iz, izb);
158 if (it1 == izb.size()) izb.emplace_back(iz);
159 unsigned int it2 =
find(fi, phib);
160 if (it2 == phib.size()) phib.emplace_back(fi);
164 if (nsiz>2) ifi = copy[nsiz-3];
165 if (nsiz>3) ich = copy[nsiz-4];
169 if (ifi == 1 && ich == 4) {
176 for (
unsigned int kk=0;
kk<php.
zHO.size();
kk++) {
180 }
else if (z2 < php.
zHO[
kk]) {
181 php.
zHO.resize(php.
zHO.size()+2);
182 for (
unsigned int kz=php.
zHO.size()-1; kz>
kk+1; kz=kz-2) {
183 php.
zHO[kz] = php.
zHO[kz-2];
184 php.
zHO[kz-1] = php.
zHO[kz-3];
193 php.
zHO.emplace_back(z1);
194 php.
zHO.emplace_back(z2);
198 << lay <<
" fi " << ifi <<
" " << ich
199 <<
" z " << z1 <<
" " << z2;
203 }
else if (idet == 4) {
207 << sol.
shape() <<
" Layer " << lay <<
" Z " 210 if (lay >=0 && lay < 20) {
213 if (thke[lay] <= 0) thke[lay] =
dz;
215 double rinHE = t.Rho()*
cos(alp) -
dy;
216 double routHE = t.Rho()*
cos(alp) +
dy;
217 rminHE[lay] += rinHE;
218 rmaxHE[lay] += routHE;
221 for (
double k : php.
zxHE) {
233 php.
dx1HE.emplace_back(-dx1);
234 php.
dx2HE.emplace_back(-dx2);
235 php.
layHE.emplace_back(lay);
238 if (copy[nsiz-1] == 21 || copy[nsiz-1] == 71) {
239 int iz = copy[nsiz-7];
240 int fi = copy[nsiz-5];
241 unsigned int it1 =
find(iz, ize);
242 if (it1 == ize.size()) ize.emplace_back(iz);
243 unsigned int it2 =
find(fi, phie);
244 if (it2 == phie.size()) phie.emplace_back(fi);
246 }
else if (idet == 5) {
249 const std::vector<double> & paras = sol.
parameters();
252 << sol.
shape() <<
" Z " << t.z()
253 <<
" with " << paras.size()
255 for (
unsigned j=0; j<paras.size(); j++)
260 int nz = (
int)(paras.size())-3;
261 dzVcal = 0.5*(paras[nz]-paras[3]);
271 << sol.
name() <<
" Shape " << sol.
shape()
272 <<
" R " << t.Rho() <<
" Z " << t.z();
278 int ibmx = 0, iemx = 0;
279 for (
int i = 0;
i < 20;
i++) {
281 rb[
i] /= (double)(
ib[
i]);
285 ze[
i] /= (double)(ie[
i]);
290 rminHE[
i] /= (double)(ie[
i]);
291 rmaxHE[
i] /= (double)(ie[i]);
294 << rb[
i] <<
" Endcap " << ie[
i] <<
" " 295 << ze[
i] <<
":" << rminHE[
i] <<
":" 299 for (
int i = 4;
i >= 0;
i--) {
300 if (
ib[
i] == 0) {rb[
i] = rb[
i+1]; thkb[
i] = thkb[
i+1];}
301 if (ie[
i] == 0) {ze[
i] = ze[
i+1]; thke[
i] = thke[
i+1];}
303 if (
ib[
i] == 0 || ie[
i] == 0)
305 <<
" " << rb[
i] <<
" Endcap " << ie[
i]
311 for (
unsigned int k=0;
k<php.
layHB.size(); ++
k)
313 <<
" " << php.
rhoxHB[
k] <<
" Z " 315 <<
" DZ " << php.
dxHB[
k];
316 for (
unsigned int k=0;
k<php.
layHE.size(); ++
k)
319 <<
" X1|X2 " << php.
dx1HE[
k] <<
"|" 322 << ibmx <<
" for HE " << iemx <<
" extent " 327 php.
rHB.resize(ibmx);
328 php.
drHB.resize(ibmx);
329 for (
int i=0;
i<ibmx;
i++) {
334 <<
"] = " << php.
rHB[
i] <<
" php.drHB[" 335 <<
i <<
"] = " << php.
drHB[
i];
340 php.
zHE.resize(iemx);
341 php.
dzHE.resize(iemx);
342 for (
int i=0;
i<iemx;
i++) {
347 <<
"] = " << php.
zHE[
i] <<
" php.dzHE[" 348 <<
i <<
"] = " << php.
dzHE[
i];
357 <<
" barrel half-sectors";
362 <<
nmodHB <<
" barrel modules";
372 <<
" endcap half-sectors";
377 <<
nmodHE <<
" endcap modules";
385 for (
unsigned int kk=0;
kk<php.
zHO.size();
kk++)
388 if (ibmx > 17 && php.
zHO.size() > 4) {
404 for (
unsigned int i=0;
i<php.
zHO.size(); ++
i)
std::vector< double > zHO
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
double halfZ(void) const
half of the z-Axis
void loadGeometry(const DDFilteredView &_fv, HcalParameters &php)
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
std::vector< double > rHB
nav_type copyNumbers() const
return the stack of copy numbers
unsigned find(int element, std::vector< int > &array) const
std::vector< double > rhoxHB
std::vector< int > getModHalfHBHE(const int type) const
std::vector< double > dx2HE
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
void getConstRHO(std::vector< double > &) const
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
std::vector< double > rhoxHE
std::vector< double > zxHE
std::vector< double > zHE
std::vector< double > dyHE
std::vector< double > zxHB
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
bool next()
set current node to the next node in the filtered tree
std::vector< double > dx1HE
std::vector< double > dzHE
Cos< T >::type cos(const T &t)
Interface to a Trapezoid.
Tan< T >::type tan(const T &t)
double y1(void) const
Half-length along y of the face at -pDz.
Abs< T >::type abs(const T &t)
DDSolidShape shape(void) const
The type of the solid.
std::vector< double > dyHB
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
double alpha2(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of t...
std::vector< double > dxHB
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
double getEta(double r, double z) const
std::vector< std::vector< double > > tmp
std::vector< double > drHB
double y2(void) const
Half-length along y of the face at +pDz.
const DDTranslation & translation() const
The absolute translation of the current node.
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.