|
|
Go to the documentation of this file.
22 rHO.emplace_back(rminHO_);
23 for (
double i : etaHO_)
28 std::vector<int> modHalf;
30 modHalf.emplace_back(nmodHB_);
31 modHalf.emplace_back(nzHB_);
33 modHalf.emplace_back(nmodHE_);
34 modHalf.emplace_back(nzHE_);
49 int idet = 0, lay = -1;
50 int nsiz = static_cast<int>(
copy.size());
52 lay =
copy[nsiz - 1] / 10;
54 idet =
copy[nsiz - 2] / 1000;
58 double dx = 0,
dy = 0,
dz = 0, dx1 = 0, dx2 = 0;
61 const DDBox& box = static_cast<DDBox>(sol);
66 const DDTrap& trp = static_cast<DDTrap>(sol);
74 const DDTubs& tub = static_cast<DDTubs>(sol);
85 if (lay >= 0 && lay < maxLayer_) {
88 if (thkb_[lay] <= 0) {
96 for (
double k : rxb_) {
106 php.
dyHB.emplace_back(2. *
dy);
107 php.
dxHB.emplace_back(2. *
dz);
108 php.
layHB.emplace_back(lay);
113 int iz =
copy[nsiz - 5];
114 int fi =
copy[nsiz - 4];
115 unsigned int it1 =
find(iz, izb_);
116 if (it1 == izb_.size())
117 izb_.emplace_back(iz);
118 unsigned int it2 =
find(fi, phib_);
119 if (it2 == phib_.size())
120 phib_.emplace_back(fi);
123 int ifi = -1, ich = -1;
125 ifi =
copy[nsiz - 3];
127 ich =
copy[nsiz - 4];
132 if (ifi == 1 && ich == 4) {
139 for (
unsigned int kk = 0;
kk < php.
zHO.size();
kk++) {
144 php.
zHO.resize(php.
zHO.size() + 2);
145 for (
unsigned int kz = php.
zHO.size() - 1; kz >
kk + 1; kz = kz - 2) {
146 php.
zHO[kz] = php.
zHO[kz - 2];
147 php.
zHO[kz - 1] = php.
zHO[kz - 3];
156 php.
zHO.emplace_back(z1);
157 php.
zHO.emplace_back(
z2);
160 edm::LogVerbatim(
"HCalGeom") <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi <<
" " << ich <<
" z "
165 }
else if (idet == 4) {
171 if (lay >= 0 && lay < maxLayer_) {
178 rminHE_[lay] += rinHE;
179 rmaxHE_[lay] += routHE;
181 for (
double k : php.
zxHE) {
193 php.
dx1HE.emplace_back(-dx1);
194 php.
dx2HE.emplace_back(-dx2);
195 php.
layHE.emplace_back(lay);
198 if (
copy[nsiz - 1] == kHELayer1_ ||
copy[nsiz - 1] == kHELayer2_) {
199 int iz =
copy[nsiz - 7];
200 int fi =
copy[nsiz - 5];
201 unsigned int it1 =
find(iz, ize_);
202 if (it1 == ize_.size())
203 ize_.emplace_back(iz);
204 unsigned int it2 =
find(fi, phie_);
205 if (it2 == phie_.size())
206 phie_.emplace_back(fi);
208 }
else if (idet == 5) {
211 const std::vector<double>& paras = sol.
parameters();
214 << paras.size() <<
" Parameters";
215 for (
unsigned j = 0;
j < paras.size();
j++)
219 int nz = (
int)(paras.size()) - 3;
230 <<
" R " <<
t.Rho() <<
" Z " <<
t.z();
248 int idet = 0, lay = -1;
249 int nsiz = static_cast<int>(
copy.size());
253 idet =
copy[1] / 1000;
256 for (
unsigned int n = 0;
n <
copy.size(); ++
n)
258 edm::LogVerbatim(
"HCalGeom") <<
"Detector " << idet <<
" Layer " << lay <<
" parameters: " << paras.size();
259 for (
unsigned int n = 0;
n < paras.size(); ++
n)
262 double dx = 0,
dy = 0,
dz = 0, dx1 = 0, dx2 = 0;
274 alp = 0.5 * (paras[6] + paras[10]);
284 <<
" Layer " << lay <<
" R " <<
t.Rho();
286 if (lay >= 0 && lay < maxLayer_) {
289 if (thkb_[lay] <= 0) {
297 for (
double k : rxb_) {
307 php.
dyHB.emplace_back(2. *
dy);
308 php.
dxHB.emplace_back(2. *
dz);
309 php.
layHB.emplace_back(lay);
316 unsigned int it1 =
find(iz, izb_);
317 if (it1 == izb_.size())
318 izb_.emplace_back(iz);
319 unsigned int it2 =
find(fi, phib_);
320 if (it2 == phib_.size())
321 phib_.emplace_back(fi);
324 int ifi = -1, ich = -1;
333 if (ifi == 1 && ich == 4) {
340 for (
unsigned int kk = 0;
kk < php.
zHO.size();
kk++) {
345 php.
zHO.resize(php.
zHO.size() + 2);
346 for (
unsigned int kz = php.
zHO.size() - 1; kz >
kk + 1; kz = kz - 2) {
347 php.
zHO[kz] = php.
zHO[kz - 2];
348 php.
zHO[kz - 1] = php.
zHO[kz - 3];
357 php.
zHO.emplace_back(z1);
358 php.
zHO.emplace_back(
z2);
361 edm::LogVerbatim(
"HCalGeom") <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi <<
" " << ich <<
" z "
366 }
else if (idet == 4) {
370 <<
" Layer " << lay <<
" Z " <<
t.z();
372 if (lay >= 0 && lay < maxLayer_) {
379 rminHE_[lay] += rinHE;
380 rmaxHE_[lay] += routHE;
382 for (
double k : php.
zxHE) {
394 php.
dx1HE.emplace_back(-dx1);
395 php.
dx2HE.emplace_back(-dx2);
396 php.
layHE.emplace_back(lay);
399 if (
copy[0] == kHELayer1_ ||
copy[0] == kHELayer2_) {
402 unsigned int it1 =
find(iz, ize_);
403 if (it1 == ize_.size())
404 ize_.emplace_back(iz);
405 unsigned int it2 =
find(fi, phie_);
406 if (it2 == phie_.size())
407 phie_.emplace_back(fi);
409 }
else if (idet == 5) {
417 for (
unsigned j = 0;
j < paras.size();
j++)
420 if (fv.
isA<dd4hep::Polycone>()) {
421 int nz = (
int)(paras.size()) - 3;
431 edm::LogVerbatim(
"HCalGeom") <<
"Unknown Detector " << idet <<
" for " << fv.
name() <<
" Shape "
442 unsigned int id =
array.size();
443 for (
unsigned int i = 0;
i <
array.size();
i++) {
444 if (element ==
array[
i]) {
457 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::getEta " <<
r <<
" " << z <<
" ==> " <<
tmp;
478 for (
int i = 0;
i < 4; ++
i)
480 zVcal_ = dzVcal_ = dlShort_ = 0;
481 rminHO_ = dzVcal_ = -1.;
482 for (
int i = 0;
i < maxLayer_; ++
i) {
483 rb_.emplace_back(0.0);
484 ze_.emplace_back(0.0);
485 thkb_.emplace_back(-1.0);
486 thke_.emplace_back(-1.0);
489 rminHE_.emplace_back(0.0);
490 rmaxHE_.emplace_back(0.0);
495 int ibmx = 0, iemx = 0;
496 for (
int i = 0;
i < maxLayer_;
i++) {
498 rb_[
i] /= static_cast<double>(ib_[
i]);
502 ze_[
i] /= static_cast<double>(ie_[
i]);
503 rminHE_[
i] /= static_cast<double>(ie_[
i]);
504 rmaxHE_[
i] /= static_cast<double>(ie_[
i]);
508 edm::LogVerbatim(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " << ib_[
i] <<
" " << rb_[
i] <<
" Endcap " << ie_[
i]
509 <<
" " << ze_[
i] <<
":" << rminHE_[
i] <<
":" << rmaxHE_[
i];
512 for (
int i = 4;
i >= 0;
i--) {
515 thkb_[
i] = thkb_[
i + 1];
519 thke_[
i] = thke_[
i + 1];
522 if (ib_[
i] == 0 || ie_[
i] == 0)
523 edm::LogVerbatim(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " << ib_[
i] <<
" " << rb_[
i] <<
" Endcap " << ie_[
i]
529 for (
unsigned int k = 0;
k < php.
layHB.size(); ++
k)
532 for (
unsigned int k = 0;
k < php.
layHE.size(); ++
k)
535 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters: Maximum Layer for HB " << ibmx <<
" for HE " << iemx
536 <<
" extent " << dzVcal_;
540 php.
rHB.resize(ibmx);
541 php.
drHB.resize(ibmx);
542 for (
int i = 0;
i < ibmx;
i++) {
546 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters: php.rHB[" <<
i <<
"] = " << php.
rHB[
i] <<
" php.drHB[" <<
i
547 <<
"] = " << php.
drHB[
i];
552 php.
zHE.resize(iemx);
553 php.
dzHE.resize(iemx);
554 for (
int i = 0;
i < iemx;
i++) {
558 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters: php.zHE[" <<
i <<
"] = " << php.
zHE[
i] <<
" php.dzHE[" <<
i
559 <<
"] = " << php.
dzHE[
i];
564 nzHB_ = static_cast<int>(izb_.size());
565 nmodHB_ = static_cast<int>(phib_.size());
567 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::loadGeometry: " << nzHB_ <<
" barrel half-sectors";
568 for (
int i = 0;
i < nzHB_;
i++)
570 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::loadGeometry: " << nmodHB_ <<
" barrel modules";
571 for (
int i = 0;
i < nmodHB_;
i++)
575 nzHE_ = static_cast<int>(ize_.size());
576 nmodHE_ = static_cast<int>(phie_.size());
578 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::loadGeometry: " << nzHE_ <<
" endcap half-sectors";
579 for (
int i = 0;
i < nzHE_;
i++)
581 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::loadGeometry: " << nmodHE_ <<
" endcap modules";
582 for (
int i = 0;
i < nmodHE_;
i++)
588 for (
unsigned int kk = 0;
kk < php.
zHO.size();
kk++)
591 if (ibmx > 17 && php.
zHO.size() > 4) {
592 rminHO_ = php.
rHB[17] - 100.0;
593 etaHO_[0] = getEta(0.5 * (php.
rHB[17] + php.
rHB[18]), php.
zHO[1]);
594 etaHO_[1] = getEta(php.
rHB[18] + php.
drHB[18], php.
zHO[2]);
595 etaHO_[2] = getEta(php.
rHB[18] - php.
drHB[18], php.
zHO[3]);
596 etaHO_[3] = getEta(php.
rHB[18] + php.
drHB[18], php.
zHO[4]);
599 edm::LogVerbatim(
"HCalGeom") <<
"HO Eta boundaries " << etaHO_[0] <<
" " << etaHO_[1] <<
" " << etaHO_[2] <<
" "
602 for (
unsigned int i = 0;
i < php.
zHO.size(); ++
i)
double getEta(double r, double z) const
const std::vector< double > parameters() const
extract shape parameters
double halfZ(void) const
half of the z-Axis
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
auto isAConeSeg(Ts &&... ts) const -> decltype(isA< dd4hep::ConeSegment >(std::forward< Ts >(ts)...))
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
nav_type copyNumbers() const
return the stack of copy numbers
auto isATubeSeg(Ts &&... ts) const -> decltype(isA< dd4hep::Tube >(std::forward< Ts >(ts)...))
std::vector< double > zxHB
std::vector< double > zHO
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::string_view name() const
const Translation translation() const
DDSolidShape shape(void) const
The type of the solid.
Cos< T >::type cos(const T &t)
std::vector< double > dx1HE
std::vector< double > rhoxHE
unsigned find(int element, std::vector< int > &array) const
std::string name(Mapping a, V value)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
double y1(void) const
Half-length along y of the face at -pDz.
std::vector< double > dxHB
bool next()
set current node to the next node in the filtered tree
std::vector< double > dx2HE
const std::vector< int > copyNos() const
The list of the volume copy numbers.
std::vector< int > getModHalfHBHE(const int type) const
static const double tan10deg
bool firstChild()
set the current node to the first child
const cms::DDSolidShape shape() const
std::vector< double > dzHE
std::vector< double > rHB
Interface to a Trapezoid.
void clear(HadCaloObj &c)
const std::array< const cms::dd::NameValuePair< DDSolidShape >, 19 > DDSolidShapeMap
void getConstRHO(std::vector< double > &) const
static constexpr double k_ScaleFromDDDToG4
static constexpr double k_ScaleFromDD4HepToG4
std::vector< double > zxHE
void loadfinal(HcalParameters &php)
Tan< T >::type tan(const T &t)
std::vector< double > zHE
std::vector< double > dyHE
void clear(HcalParameters &php)
auto isABox(Ts &&... ts) const -> decltype(isA< dd4hep::Box >(std::forward< Ts >(ts)...))
std::vector< double > dyHB
double y2(void) const
Half-length along y of the face at +pDz.
const DDTranslation & translation() const
The absolute translation of the current node.
void loadGeometry(const DDFilteredView &_fv, HcalParameters &php)
std::vector< double > drHB
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
A DDSolid represents the shape of a part.
double x1(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...
Abs< T >::type abs(const T &t)
auto isATrapezoid(Ts &&... ts) const -> decltype(isA< dd4hep::Trap >(std::forward< Ts >(ts)...))
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...
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< double > rhoxHB
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.