15 #include "CLHEP/Units/GlobalPhysicalConstants.h"
16 #include "CLHEP/Units/GlobalSystemOfUnits.h"
22 std::cout <<
"HcalGeomParameters::HcalGeomParameters ( const DDCompactView& cpv ) constructor" << std::endl;
28 std::cout <<
"HcalGeomParameters::destructed!!!" << std::endl;
35 for (
int i=0;
i<4; ++
i) rHO.push_back(
etaHO[
i]);
40 std::vector<int> modHalf;
42 modHalf.push_back(
nmodHB); modHalf.push_back(
nzHB);
44 modHalf.push_back(
nmodHE); modHalf.push_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)));
66 std::cout <<
"HcalGeomParameters::getEta " << r <<
" " << z <<
" ==> "
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, izf, phif;
80 std::vector<double> rxb;
91 int idet = 0, lay = -1;
92 int nsiz = (int)(copy.size());
93 if (nsiz>0) lay = copy[nsiz-1]/10;
94 if (nsiz>1) idet = copy[nsiz-2]/1000;
95 double dx=0, dy=0, dz=0, dx1=0, dx2=0;
96 if (sol.
shape() == 1) {
101 }
else if (sol.
shape() == 3) {
105 dx = 0.25*(trp.
x1()+trp.
x2()+trp.
x3()+trp.
x4());
106 dy = 0.5*(trp.
y1()+trp.
y2());
108 }
else if (sol.
shape() == 2) {
118 <<
" Layer " << lay <<
" R " << t.Rho() << std::endl;
120 if (lay >=0 && lay < 20) {
123 if (thkb[lay] <= 0) {
124 if (lay < 17) thkb[lay] = dx;
129 for (
unsigned int k=0;
k<rxb.size();
k++) {
136 rxb.push_back(t.Rho());
139 php.
dyHB.push_back(2.*dy);
140 php.
dxHB.push_back(2.*dz);
141 php.
layHB.push_back(lay);
146 int iz = copy[nsiz-5];
147 int fi = copy[nsiz-4];
148 unsigned int it1 =
find(iz, izb);
149 if (it1 == izb.size()) izb.push_back(iz);
150 unsigned int it2 =
find(fi, phib);
151 if (it2 == phib.size()) phib.push_back(fi);
155 if (nsiz>2) ifi = copy[nsiz-3];
156 if (nsiz>3) ich = copy[nsiz-4];
160 if (ifi == 1 && ich == 4) {
167 for (
unsigned int kk=0;
kk<php.
zHO.size();
kk++) {
171 }
else if (z2 < php.
zHO[
kk]) {
172 php.
zHO.resize(php.
zHO.size()+2);
173 for (
unsigned int kz=php.
zHO.size()-1; kz>
kk+1; kz=kz-2) {
174 php.
zHO[kz] = php.
zHO[kz-2];
175 php.
zHO[kz-1] = php.
zHO[kz-3];
184 php.
zHO.push_back(z1);
185 php.
zHO.push_back(z2);
188 std::cout <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi
189 <<
" " << ich <<
" z " << z1 <<
" " << z2 << std::endl;
193 }
else if (idet == 4) {
197 <<
" Layer " << lay <<
" Z " << t.z() << std::endl;
199 if (lay >=0 && lay < 20) {
202 if (thke[lay] <= 0) thke[lay] = dz;
204 for (
unsigned int k=0;
k<php.
zxHE.size();
k++) {
216 php.
dx1HE.push_back(-dx1);
217 php.
dx2HE.push_back(-dx2);
218 php.
layHE.push_back(lay);
221 if (copy[nsiz-1] == 21 || copy[nsiz-1] == 71) {
222 int iz = copy[nsiz-7];
223 int fi = copy[nsiz-5];
224 unsigned int it1 =
find(iz, ize);
225 if (it1 == ize.size()) ize.push_back(iz);
226 unsigned int it2 =
find(fi, phie);
227 if (it2 == phie.size()) phie.push_back(fi);
229 }
else if (idet == 5) {
232 const std::vector<double> & paras = sol.
parameters();
235 <<
" Z " << t.z() <<
" with " << paras.size()
236 <<
" Parameters" << std::endl;
237 for (
unsigned j=0;
j<paras.size();
j++)
238 std::cout <<
"HF Parameter[" <<
j <<
"] = " << paras[
j] << std::endl;
242 int nz = (int)(paras.size())-3;
244 dzVcal = 0.5*(paras[nz]-paras[3]);
254 std::cout <<
"Unknown Detector " << idet <<
" for " << sol.
name()
255 <<
" Shape " << sol.
shape() <<
" R " << t.Rho() <<
" Z "
256 << t.z() << std::endl;
262 int ibmx = 0, iemx = 0;
263 for (
int i = 0;
i < 20;
i++) {
265 rb[
i] /= (double)(
ib[
i]);
269 ze[
i] /= (double)(ie[
i]);
274 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i] << std::endl;
277 for (
int i = 4;
i >= 0;
i--) {
278 if (
ib[
i] == 0) {rb[
i] = rb[
i+1]; thkb[
i] = thkb[
i+1];}
279 if (ie[
i] == 0) {ze[
i] = ze[
i+1]; thke[
i] = thke[
i+1];}
281 if (
ib[
i] == 0 || ie[
i] == 0)
283 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i] << std::endl;
288 for (
unsigned int k=0;
k<php.
layHB.size(); ++
k)
292 std::cout <<
"HcalGeomParameters: Maximum Layer for HB " << ibmx <<
" for HE "
293 << iemx <<
" Z for HF " << zf <<
" extent " <<
dzVcal << std::endl;
297 php.
rHB.resize(ibmx);
298 php.
drHB.resize(ibmx);
299 for (
int i=0;
i<ibmx;
i++) {
303 std::cout <<
"HcalGeomParameters: php.rHB[" <<
i <<
"] = " << php.
rHB[
i]
304 <<
" php.drHB[" <<
i <<
"] = " << php.
drHB[
i] << std::endl;
309 php.
zHE.resize(iemx);
310 php.
dzHE.resize(iemx);
311 for (
int i=0;
i<iemx;
i++) {
315 std::cout <<
"HcalGeomParameters: php.zHE[" <<
i <<
"] = " << php.
zHE[
i]
316 <<
" php.dzHE[" <<
i <<
"] = " << php.
dzHE[
i] << std::endl;
321 nzHB = (int)(izb.size());
322 nmodHB = (int)(phib.size());
325 <<
" barrel half-sectors" << std::endl;
327 std::cout <<
"Section " <<
i <<
" Copy number " << izb[
i] << std::endl;
329 <<
" barrel modules" << std::endl;
331 std::cout <<
"Module " <<
i <<
" Copy number " << phib[
i] << std::endl;
334 nzHE = (int)(ize.size());
335 nmodHE = (int)(phie.size());
338 <<
" endcap half-sectors" << std::endl;
340 std::cout <<
"Section " <<
i <<
" Copy number " << ize[
i] << std::endl;
342 <<
" endcap modules" << std::endl;
344 std::cout <<
"Module " <<
i <<
" Copy number " << phie[
i] << std::endl;
348 std::cout <<
"HO has Z of size " << php.
zHO.size() << std::endl;
349 for (
unsigned int kk=0;
kk<php.
zHO.size();
kk++)
352 if (ibmx > 17 && php.
zHO.size() > 4) {
364 <<
" " <<
etaHO[2] <<
" " <<
etaHO[3] << std::endl;
367 for (
unsigned int i=0;
i<php.
zHO.size(); ++
i)
std::cout <<
" zho[" <<
i <<
"] = " << php.
zHO[
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)
if(c.getParameter< edm::InputTag >("puppiValueMap").label().size()!=0)
DDSolidShape shape(void) const
The type of the solid.
std::vector< double > dyHB
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.
for(const auto &isodef:isoDefs)
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.