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;
80 std::vector<double> rxb;
90 int idet = 0, lay = -1;
91 int nsiz = (int)(copy.size());
92 if (nsiz>0) lay = copy[nsiz-1]/10;
93 if (nsiz>1) idet = copy[nsiz-2]/1000;
94 double dx=0, dy=0, dz=0, dx1=0, dx2=0;
95 if (sol.
shape() == 1) {
100 }
else if (sol.
shape() == 3) {
104 dx = 0.25*(trp.
x1()+trp.
x2()+trp.
x3()+trp.
x4());
105 dy = 0.5*(trp.
y1()+trp.
y2());
107 }
else if (sol.
shape() == 2) {
117 <<
" Layer " << lay <<
" R " << t.Rho() << std::endl;
119 if (lay >=0 && lay < 20) {
122 if (thkb[lay] <= 0) {
123 if (lay < 17) thkb[lay] = dx;
128 for (
unsigned int k=0;
k<rxb.size();
k++) {
135 rxb.push_back(t.Rho());
138 php.
dyHB.push_back(2.*dy);
139 php.
dxHB.push_back(2.*dz);
140 php.
layHB.push_back(lay);
145 int iz = copy[nsiz-5];
146 int fi = copy[nsiz-4];
147 unsigned int it1 =
find(iz, izb);
148 if (it1 == izb.size()) izb.push_back(iz);
149 unsigned int it2 =
find(fi, phib);
150 if (it2 == phib.size()) phib.push_back(fi);
154 if (nsiz>2) ifi = copy[nsiz-3];
155 if (nsiz>3) ich = copy[nsiz-4];
159 if (ifi == 1 && ich == 4) {
166 for (
unsigned int kk=0;
kk<php.
zHO.size();
kk++) {
170 }
else if (z2 < php.
zHO[
kk]) {
171 php.
zHO.resize(php.
zHO.size()+2);
172 for (
unsigned int kz=php.
zHO.size()-1; kz>
kk+1; kz=kz-2) {
173 php.
zHO[kz] = php.
zHO[kz-2];
174 php.
zHO[kz-1] = php.
zHO[kz-3];
183 php.
zHO.push_back(z1);
184 php.
zHO.push_back(z2);
187 std::cout <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi
188 <<
" " << ich <<
" z " << z1 <<
" " << z2 << std::endl;
192 }
else if (idet == 4) {
196 <<
" Layer " << lay <<
" Z " << t.z() << std::endl;
198 if (lay >=0 && lay < 20) {
201 if (thke[lay] <= 0) thke[lay] = dz;
203 for (
unsigned int k=0;
k<php.
zxHE.size();
k++) {
215 php.
dx1HE.push_back(-dx1);
216 php.
dx2HE.push_back(-dx2);
217 php.
layHE.push_back(lay);
220 if (copy[nsiz-1] == 21 || copy[nsiz-1] == 71) {
221 int iz = copy[nsiz-7];
222 int fi = copy[nsiz-5];
223 unsigned int it1 =
find(iz, ize);
224 if (it1 == ize.size()) ize.push_back(iz);
225 unsigned int it2 =
find(fi, phie);
226 if (it2 == phie.size()) phie.push_back(fi);
228 }
else if (idet == 5) {
231 const std::vector<double> & paras = sol.
parameters();
234 <<
" Z " << t.z() <<
" with " << paras.size()
235 <<
" Parameters" << std::endl;
236 for (
unsigned j=0;
j<paras.size();
j++)
237 std::cout <<
"HF Parameter[" <<
j <<
"] = " << paras[
j] << std::endl;
240 int nz = (int)(paras.size())-3;
241 dzVcal = 0.5*(paras[nz]-paras[3]);
250 std::cout <<
"Unknown Detector " << idet <<
" for " << sol.
name()
251 <<
" Shape " << sol.
shape() <<
" R " << t.Rho() <<
" Z "
252 << t.z() << std::endl;
258 int ibmx = 0, iemx = 0;
259 for (
int i = 0;
i < 20;
i++) {
261 rb[
i] /= (double)(
ib[
i]);
265 ze[
i] /= (double)(ie[
i]);
270 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i] << std::endl;
273 for (
int i = 4;
i >= 0;
i--) {
274 if (
ib[
i] == 0) {rb[
i] = rb[
i+1]; thkb[
i] = thkb[
i+1];}
275 if (ie[
i] == 0) {ze[
i] = ze[
i+1]; thke[
i] = thke[
i+1];}
277 if (
ib[
i] == 0 || ie[
i] == 0)
279 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i] << std::endl;
284 for (
unsigned int k=0;
k<php.
layHB.size(); ++
k)
288 std::cout <<
"HcalGeomParameters: Maximum Layer for HB " << ibmx <<
" for HE "
289 << iemx <<
" extent " <<
dzVcal << std::endl;
293 php.
rHB.resize(ibmx);
294 php.
drHB.resize(ibmx);
295 for (
int i=0;
i<ibmx;
i++) {
299 std::cout <<
"HcalGeomParameters: php.rHB[" <<
i <<
"] = " << php.
rHB[
i]
300 <<
" php.drHB[" <<
i <<
"] = " << php.
drHB[
i] << std::endl;
305 php.
zHE.resize(iemx);
306 php.
dzHE.resize(iemx);
307 for (
int i=0;
i<iemx;
i++) {
311 std::cout <<
"HcalGeomParameters: php.zHE[" <<
i <<
"] = " << php.
zHE[
i]
312 <<
" php.dzHE[" <<
i <<
"] = " << php.
dzHE[
i] << std::endl;
317 nzHB = (int)(izb.size());
318 nmodHB = (int)(phib.size());
321 <<
" barrel half-sectors" << std::endl;
323 std::cout <<
"Section " <<
i <<
" Copy number " << izb[
i] << std::endl;
325 <<
" barrel modules" << std::endl;
327 std::cout <<
"Module " <<
i <<
" Copy number " << phib[
i] << std::endl;
330 nzHE = (int)(ize.size());
331 nmodHE = (int)(phie.size());
334 <<
" endcap half-sectors" << std::endl;
336 std::cout <<
"Section " <<
i <<
" Copy number " << ize[
i] << std::endl;
338 <<
" endcap modules" << std::endl;
340 std::cout <<
"Module " <<
i <<
" Copy number " << phie[
i] << std::endl;
344 std::cout <<
"HO has Z of size " << php.
zHO.size() << std::endl;
345 for (
unsigned int kk=0;
kk<php.
zHO.size();
kk++)
348 if (ibmx > 17 && php.
zHO.size() > 4) {
360 <<
" " <<
etaHO[2] <<
" " <<
etaHO[3] << std::endl;
363 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)
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.