21 rHO.emplace_back(rminHO_);
22 for (
double i : etaHO_)
27 std::vector<int> modHalf;
29 modHalf.emplace_back(nmodHB_);
30 modHalf.emplace_back(nzHB_);
32 modHalf.emplace_back(nmodHE_);
33 modHalf.emplace_back(nzHE_);
48 int idet = 0, lay = -1;
49 int nsiz =
static_cast<int>(
copy.size());
51 lay =
copy[nsiz - 1] / 10;
53 idet =
copy[nsiz - 2] / 1000;
55 idet =
copy[nsiz - 3] / 1000;
57 idet =
copy[nsiz - 2] / 1000;
59 std::ostringstream st1;
60 for (
unsigned int k = 0;
k <
copy.size(); ++
k)
61 st1 <<
" " <<
copy[
k];
65 double dx = 0,
dy = 0,
dz = 0, dx1 = 0, dx2 = 0;
89 edm::LogVerbatim(
"HCalGeom") <<
"HB " <<
sol.name() <<
" Shape " <<
sol.shape() <<
" Layer " << lay <<
" R " 92 if (lay >= 0 && lay < maxLayer_) {
95 if (thkb_[lay] <= 0) {
103 for (
double k : rxb_) {
113 php.
dyHB.emplace_back(2. *
dy);
114 php.
dxHB.emplace_back(2. *
dz);
115 php.
layHB.emplace_back(lay);
120 int iz =
copy[nsiz - 5];
121 int fi =
copy[nsiz - 4];
122 unsigned int it1 =
find(iz, izb_);
123 if (it1 == izb_.size())
124 izb_.emplace_back(iz);
125 unsigned int it2 =
find(fi, phib_);
126 if (it2 == phib_.size())
127 phib_.emplace_back(fi);
130 int ifi = -1, ich = -1;
132 ifi =
copy[nsiz - 3];
134 ich =
copy[nsiz - 4];
139 if (ifi == 1 && ich == 4) {
146 for (
unsigned int kk = 0;
kk < php.
zHO.size();
kk++) {
151 php.
zHO.resize(php.
zHO.size() + 2);
152 for (
unsigned int kz = php.
zHO.size() - 1; kz >
kk + 1; kz = kz - 2) {
153 php.
zHO[kz] = php.
zHO[kz - 2];
154 php.
zHO[kz - 1] = php.
zHO[kz - 3];
163 php.
zHO.emplace_back(z1);
164 php.
zHO.emplace_back(
z2);
167 edm::LogVerbatim(
"HCalGeom") <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi <<
" " << ich <<
" z " 172 }
else if (idet == 4) {
175 edm::LogVerbatim(
"HCalGeom") <<
"HE " <<
sol.name() <<
" Shape " <<
sol.shape() <<
" Layer " << lay <<
" Z " 178 if (lay >= 0 && lay < maxLayer_) {
185 rminHE_[lay] += rinHE;
186 rmaxHE_[lay] += routHE;
188 for (
double k : php.
zxHE) {
200 php.
dx1HE.emplace_back(-dx1);
201 php.
dx2HE.emplace_back(-dx2);
202 php.
layHE.emplace_back(lay);
205 if (
copy[nsiz - 1] == kHELayer1_ ||
copy[nsiz - 1] == kHELayer2_) {
206 int iz =
copy[nsiz - 7];
207 int fi =
copy[nsiz - 5];
208 unsigned int it1 =
find(iz, ize_);
209 if (it1 == ize_.size())
210 ize_.emplace_back(iz);
211 unsigned int it2 =
find(fi, phie_);
212 if (it2 == phie_.size())
213 phie_.emplace_back(fi);
215 }
else if (idet == 5) {
218 const std::vector<double>& paras =
sol.parameters();
221 << paras.size() <<
" Parameters";
222 for (
unsigned j = 0;
j < paras.size();
j++)
226 int nz = (
int)(paras.size()) - 3;
237 edm::LogVerbatim(
"HCalGeom") <<
"Sets for Detector " << idet <<
" for " <<
sol.name() <<
" Flag " <<
hf 238 <<
" DZ " << dzVcal_;
243 edm::LogVerbatim(
"HCalGeom") <<
"Unknown Detector " << idet <<
" for " <<
sol.name() <<
" Shape " <<
sol.shape()
244 <<
" R " <<
t.Rho() <<
" Z " <<
t.z();
262 int idet = 0, lay = -1;
263 int nsiz =
static_cast<int>(
copy.size());
267 idet =
copy[1] / 1000;
269 idet =
copy[2] / 1000;
271 idet =
copy[1] / 1000;
273 std::ostringstream st1;
274 for (
unsigned int k = 0;
k <
copy.size(); ++
k)
275 st1 <<
" " <<
copy[
k];
277 for (
unsigned int n = 0;
n <
copy.size(); ++
n)
279 edm::LogVerbatim(
"HCalGeom") <<
"Detector " << idet <<
" Layer " << lay <<
" parameters: " << paras.size();
280 for (
unsigned int n = 0;
n < paras.size(); ++
n)
283 double dx = 0,
dy = 0,
dz = 0, dx1 = 0, dx2 = 0;
285 if (dd4hep::isA<dd4hep::Box>(fv.
solid())) {
289 }
else if (dd4hep::isA<dd4hep::Trap>(fv.
solid())) {
295 alp = 0.5 * (paras[6] + paras[10]);
296 }
else if (dd4hep::isA<dd4hep::Tube>(fv.
solid())) {
305 <<
" Layer " << lay <<
" R " <<
t.Rho();
307 if (lay >= 0 && lay < maxLayer_) {
310 if (thkb_[lay] <= 0) {
318 for (
double k : rxb_) {
328 php.
dyHB.emplace_back(2. *
dy);
329 php.
dxHB.emplace_back(2. *
dz);
330 php.
layHB.emplace_back(lay);
337 unsigned int it1 =
find(iz, izb_);
338 if (it1 == izb_.size())
339 izb_.emplace_back(iz);
340 unsigned int it2 =
find(fi, phib_);
341 if (it2 == phib_.size())
342 phib_.emplace_back(fi);
345 int ifi = -1, ich = -1;
354 if (ifi == 1 && ich == 4) {
361 for (
unsigned int kk = 0;
kk < php.
zHO.size();
kk++) {
366 php.
zHO.resize(php.
zHO.size() + 2);
367 for (
unsigned int kz = php.
zHO.size() - 1; kz >
kk + 1; kz = kz - 2) {
368 php.
zHO[kz] = php.
zHO[kz - 2];
369 php.
zHO[kz - 1] = php.
zHO[kz - 3];
378 php.
zHO.emplace_back(z1);
379 php.
zHO.emplace_back(
z2);
382 edm::LogVerbatim(
"HCalGeom") <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi <<
" " << ich <<
" z " 387 }
else if (idet == 4) {
391 <<
" Layer " << lay <<
" Z " <<
t.z();
393 if (lay >= 0 && lay < maxLayer_) {
400 rminHE_[lay] += rinHE;
401 rmaxHE_[lay] += routHE;
403 for (
double k : php.
zxHE) {
415 php.
dx1HE.emplace_back(-dx1);
416 php.
dx2HE.emplace_back(-dx2);
417 php.
layHE.emplace_back(lay);
420 if (
copy[0] == kHELayer1_ ||
copy[0] == kHELayer2_) {
423 unsigned int it1 =
find(iz, ize_);
424 if (it1 == ize_.size())
425 ize_.emplace_back(iz);
426 unsigned int it2 =
find(fi, phie_);
427 if (it2 == phie_.size())
428 phie_.emplace_back(fi);
430 }
else if (idet == 5) {
438 for (
unsigned j = 0;
j < paras.size();
j++)
441 if (dd4hep::isA<dd4hep::Polycone>(fv.
solid())) {
442 int nz = (
int)(paras.size()) - 3;
445 }
else if (dd4hep::isA<dd4hep::Tube>(fv.
solid()) || dd4hep::isA<dd4hep::ConeSegment>(fv.
solid())) {
448 }
else if (dd4hep::isA<dd4hep::Trap>(fv.
solid())) {
453 edm::LogVerbatim(
"HCalGeom") <<
"Sets for Detector " << idet <<
" for " << fv.
name() <<
" Flag " <<
hf <<
" DZ " 459 edm::LogVerbatim(
"HCalGeom") <<
"Unknown Detector " << idet <<
" for " << fv.
name() <<
" Shape " 470 unsigned int id =
array.size();
471 for (
unsigned int i = 0;
i <
array.size();
i++) {
472 if (element ==
array[
i]) {
485 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::getEta " << r <<
" " << z <<
" ==> " <<
tmp;
506 for (
int i = 0;
i < 4; ++
i)
508 zVcal_ = dzVcal_ = dlShort_ = 0;
509 rminHO_ = dzVcal_ = -1.;
510 for (
int i = 0;
i < maxLayer_; ++
i) {
511 rb_.emplace_back(0.0);
512 ze_.emplace_back(0.0);
513 thkb_.emplace_back(-1.0);
514 thke_.emplace_back(-1.0);
517 rminHE_.emplace_back(0.0);
518 rmaxHE_.emplace_back(0.0);
523 int ibmx = 0, iemx = 0;
524 for (
int i = 0;
i < maxLayer_;
i++) {
526 rb_[
i] /=
static_cast<double>(ib_[
i]);
530 ze_[
i] /=
static_cast<double>(ie_[
i]);
531 rminHE_[
i] /=
static_cast<double>(ie_[
i]);
532 rmaxHE_[
i] /=
static_cast<double>(ie_[
i]);
536 edm::LogVerbatim(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " << ib_[
i] <<
" " << rb_[
i] <<
" Endcap " << ie_[
i]
537 <<
" " << ze_[
i] <<
":" << rminHE_[
i] <<
":" << rmaxHE_[
i];
540 for (
int i = 4;
i >= 0;
i--) {
543 thkb_[
i] = thkb_[
i + 1];
547 thke_[
i] = thke_[
i + 1];
550 if (ib_[
i] == 0 || ie_[
i] == 0)
551 edm::LogVerbatim(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " << ib_[
i] <<
" " << rb_[
i] <<
" Endcap " << ie_[
i]
557 for (
unsigned int k = 0;
k < php.
layHB.size(); ++
k)
560 for (
unsigned int k = 0;
k < php.
layHE.size(); ++
k)
563 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters: Maximum Layer for HB " << ibmx <<
" for HE " << iemx
564 <<
" extent " << dzVcal_;
568 php.
rHB.resize(ibmx);
569 php.
drHB.resize(ibmx);
570 for (
int i = 0;
i < ibmx;
i++) {
574 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters: php.rHB[" <<
i <<
"] = " << php.
rHB[
i] <<
" php.drHB[" <<
i 575 <<
"] = " << php.
drHB[
i];
580 php.
zHE.resize(iemx);
581 php.
dzHE.resize(iemx);
582 for (
int i = 0;
i < iemx;
i++) {
586 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters: php.zHE[" <<
i <<
"] = " << php.
zHE[
i] <<
" php.dzHE[" <<
i 587 <<
"] = " << php.
dzHE[
i];
592 nzHB_ =
static_cast<int>(izb_.size());
593 nmodHB_ =
static_cast<int>(phib_.size());
595 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::loadGeometry: " << nzHB_ <<
" barrel half-sectors";
596 for (
int i = 0;
i < nzHB_;
i++)
598 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::loadGeometry: " << nmodHB_ <<
" barrel modules";
599 for (
int i = 0;
i < nmodHB_;
i++)
603 nzHE_ =
static_cast<int>(ize_.size());
604 nmodHE_ =
static_cast<int>(phie_.size());
606 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::loadGeometry: " << nzHE_ <<
" endcap half-sectors";
607 for (
int i = 0;
i < nzHE_;
i++)
609 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::loadGeometry: " << nmodHE_ <<
" endcap modules";
610 for (
int i = 0;
i < nmodHE_;
i++)
616 for (
unsigned int kk = 0;
kk < php.
zHO.size();
kk++)
619 if (ibmx > 17 && php.
zHO.size() > 4) {
620 rminHO_ = php.
rHB[17] - 100.0;
627 edm::LogVerbatim(
"HCalGeom") <<
"HO Eta boundaries " << etaHO_[0] <<
" " << etaHO_[1] <<
" " << etaHO_[2] <<
" " 630 for (
unsigned int i = 0;
i < php.
zHO.size(); ++
i)
Log< level::Info, true > LogVerbatim
std::vector< double > zHO
void loadGeometry(const DDFilteredView &_fv, HcalParameters &php)
nav_type copyNumbers() const
return the stack of copy numbers
const std::vector< int > copyNos() const
The list of the volume copy numbers.
const cms::DDSolidShape shape() const
std::vector< double > rHB
std::string name(Mapping a, V value)
std::vector< double > rhoxHB
std::vector< int > getModHalfHBHE(const int type) const
double halfZ(void) const
half of the z-Axis
std::vector< double > dx2HE
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
float getEta(float r, float z)
A DDSolid represents the shape of a part.
std::vector< double > rhoxHE
void getConstRHO(std::vector< double > &) const
std::vector< double > zxHE
std::string_view name() const
static constexpr double k_ScaleFromDDDToG4
std::vector< double > zHE
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
std::vector< double > dyHE
std::vector< double > zxHB
bool next()
set current node to the next node in the filtered tree
std::vector< double > dx1HE
std::vector< double > dzHE
unsigned find(int element, std::vector< int > &array) const
Cos< T >::type cos(const T &t)
void loadfinal(HcalParameters &php)
Interface to a Trapezoid.
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
double y2(void) const
Half-length along y of the face at +pDz.
static const double tan10deg
const std::array< const cms::dd::NameValuePair< DDSolidShape >, 21 > DDSolidShapeMap
bool firstChild()
set the current node to the first child
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
std::vector< double > dyHB
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
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...
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
dd4hep::Solid solid() const
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
std::vector< double > drHB
double y1(void) const
Half-length along y of the face at -pDz.
double getEta(double r, double z) const
const DDTranslation & translation() const
The absolute translation of the current node.
const std::vector< double > parameters() const
extract shape parameters
static constexpr double k_ScaleFromDD4hepToG4
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
void clear(HcalParameters &php)
const Translation translation() const
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.