Skip to content

Commit 02022f9

Browse files
author
Sunanda
committed
Fix the overlaps in the V19 version of HGCal
1 parent 81b5102 commit 02022f9

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

Geometry/HGCalCommonData/data/hgcalHEmix/v19/hgcalHEmix.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@
958958
288, 288, 288, 288
959959
</Vector>
960960
<Vector name="ScintRetract" type="numeric" nEntries="14">
961-
4*mm, 4*mm, 4*mm, 4*mm, 8*mm, 8*mm,
961+
8*mm, 8*mm, 8*mm, 8*mm, 8*mm, 8*mm,
962962
8*mm, 8*mm, 8*mm, 8*mm, 8*mm, 8*mm,
963963
8*mm, 8*mm
964964
</Vector>

Geometry/HGCalCommonData/plugins/DDHGCalMixRotatedFineCassette.cc

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class DDHGCalMixRotatedFineCassette : public DDAlgorithm {
124124
std::vector<int> tileCoarseIndex_; // Index of tile (layer/start|end coarse ring)
125125
std::vector<int> tileCoarsePhis_; // Tile phi range for each index in coarse ring
126126
std::vector<int> tileCoarseLayerStart_; // Start index of tiles in each coarse layer
127+
std::vector<double> retract_; // Radial retraction of he tiles
127128
std::vector<double> cassetteShiftScnt_; // Shifts of the cassetes for scintillators
128129
std::string nameSpace_; // Namespace of this and ALL sub-parts
129130
std::unordered_set<int> copies_; // List of copy #'s
@@ -379,13 +380,13 @@ void DDHGCalMixRotatedFineCassette::initialize(const DDNumericArguments& nArgs,
379380
<< std::get<1>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[k])) << ":"
380381
<< std::get<2>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[k]));
381382
#endif
382-
std::vector<double> retract = vArgs["ScintRetract"];
383+
retract_ = vArgs["ScintRetract"];
383384
double dphi = M_PI / cassettes_;
384385
for (unsigned int k = 0; k < layers_.size(); ++k) {
385386
for (int j = 0; j < cassettes_; ++j) {
386387
double phi = (2 * j + 1) * dphi;
387-
cassetteShiftScnt_.emplace_back(retract[k] * cos(phi));
388-
cassetteShiftScnt_.emplace_back(retract[k] * sin(phi));
388+
cassetteShiftScnt_.emplace_back(retract_[k] * cos(phi));
389+
cassetteShiftScnt_.emplace_back(retract_[k] * sin(phi));
389390
}
390391
}
391392
#ifdef EDM_ML_DEBUG
@@ -404,7 +405,7 @@ void DDHGCalMixRotatedFineCassette::initialize(const DDNumericArguments& nArgs,
404405
#endif
405406
cassette_.setParameter(cassettes_, cassetteShift_, false);
406407
cassette_.setParameterScint(cassetteShiftScnt_);
407-
cassette_.setParameterRetract(retract);
408+
cassette_.setParameterRetract(retract_);
408409

409410
int testCassette = static_cast<int>(nArgs["TestCassetteShift"]);
410411
if (testCassette != 0)
@@ -621,13 +622,14 @@ void DDHGCalMixRotatedFineCassette::positionMix(const DDLogicalPart& glog,
621622
edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Casstee|Fimin|Fimax " << cassette << ":"
622623
<< fimin << ":" << fimax;
623624
#endif
624-
double phi1 = dphi * (fimin - 1) + 0.5 * tol0_;
625-
double phi2 = dphi * (fimax - fimin + 1) - tol0_;
626-
double phi = phi1 + 0.5 * phi2;
627-
auto cshift = cassette_.getShiftScnt(layer0, -1, phi);
625+
double phi1 = dphi * (fimin - 1);
626+
double phi2 = dphi * (fimax - fimin + 1);
627+
r1 += retract_[layer0 - 1];
628+
r2 += retract_[layer0 - 1];
628629
#ifdef EDM_ML_DEBUG
630+
double phi = phi1 + 0.5 * phi2;
629631
edm::LogVerbatim("HGCalGeom") << "1Layer " << ly << ":" << ii << ":" << copy << ":" << layer0 << " phi " << phi
630-
<< " shift " << cshift.first << ":" << cshift.second;
632+
<< " shift " << retract_[layer0 - 1];
631633
int cassette0 = HGCalCassette::cassetteType(2, 1, cassette); //
632634
int ir1 = (fine) ? std::get<1>(HGCalTileIndex::tileUnpack(tileFineIndex_[ti]))
633635
: std::get<1>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[ti]));
@@ -637,7 +639,7 @@ void DDHGCalMixRotatedFineCassette::positionMix(const DDLogicalPart& glog,
637639
<< ir1 << ":" << ir2 << " R " << r1 << ":" << r2 << " Thick " << (2.0 * hthickl)
638640
<< " phi " << fimin << ":" << fimax << ":" << convertRadToDeg(phi1) << ":"
639641
<< convertRadToDeg(phi2) << " cassette " << cassette << ":" << cassette0
640-
<< " Shift " << cshift.first << ":" << cshift.second;
642+
<< " Shift " << retract_[layer0 - 1];
641643
#endif
642644
std::string name = namesTop_[ii] + "L" + std::to_string(copy) + "F" + std::to_string(k);
643645
++k;
@@ -648,7 +650,7 @@ void DDHGCalMixRotatedFineCassette::positionMix(const DDLogicalPart& glog,
648650
<< matName << " of dimensions " << r1 << ", " << r2 << ", " << hthickl << ", "
649651
<< convertRadToDeg(phi1) << ", " << convertRadToDeg(phi2);
650652
#endif
651-
DDTranslation tran(-cshift.first, cshift.second, zpos);
653+
DDTranslation tran(0, 0, zpos);
652654
cpv.position(glog1, glog, copy, tran, rot);
653655
#ifdef EDM_ML_DEBUG
654656
edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Position " << glog1.name() << " number "
@@ -721,13 +723,14 @@ void DDHGCalMixRotatedFineCassette::positionMix(const DDLogicalPart& glog,
721723
edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Casstee|Fimin|Fimax " << cassette << ":" << fimin
722724
<< ":" << fimax;
723725
#endif
724-
double phi1 = dphi * (fimin - 1) + 0.5 * tol0_;
725-
double phi2 = dphi * (fimax - fimin + 1) - tol0_;
726-
double phi = phi1 + 0.5 * phi2;
727-
auto cshift = cassette_.getShiftScnt(layer0, -1, phi);
726+
double phi1 = dphi * (fimin - 1);
727+
double phi2 = dphi * (fimax - fimin + 1);
728+
r1 += retract_[layer0 - 1];
729+
r2 += retract_[layer0 - 1];
728730
#ifdef EDM_ML_DEBUG
731+
double phi = phi1 + 0.5 * phi2;
729732
edm::LogVerbatim("HGCalGeom") << "2Layer " << ii << ":" << copy << ":" << layer << ":" << layer0 << " phi " << phi
730-
<< " shift " << cshift.first << ":" << cshift.second;
733+
<< " shift " << retract_[layer0 - 1];
731734
int cassette0 = HGCalCassette::cassetteType(2, 1, cassette); //
732735
int ir1 = (fine) ? std::get<1>(HGCalTileIndex::tileUnpack(tileFineIndex_[ti]))
733736
: std::get<1>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[ti]));
@@ -737,7 +740,7 @@ void DDHGCalMixRotatedFineCassette::positionMix(const DDLogicalPart& glog,
737740
<< layer0 << " iR " << ir1 << ":" << ir2 << " R " << r1 << ":" << r2 << " Thick "
738741
<< (2.0 * hthickl) << " phi " << fimin << ":" << fimax << ":"
739742
<< convertRadToDeg(phi1) << ":" << convertRadToDeg(phi2) << " cassette " << cassette
740-
<< ":" << cassette0 << " Shift " << cshift.first << ":" << cshift.second;
743+
<< ":" << cassette0 << " Shift " << retract_[layer0 - 1];
741744
#endif
742745
std::string name = namesTop_[ii] + "L" + std::to_string(copy) + "F" + std::to_string(k);
743746
++k;
@@ -748,7 +751,7 @@ void DDHGCalMixRotatedFineCassette::positionMix(const DDLogicalPart& glog,
748751
<< " of dimensions " << r1 << ", " << r2 << ", " << hthickl << ", "
749752
<< convertRadToDeg(phi1) << ", " << convertRadToDeg(phi2);
750753
#endif
751-
DDTranslation tran(-cshift.first, cshift.second, zpos);
754+
DDTranslation tran(0, 0, zpos);
752755
cpv.position(glog1, glog, copy, tran, rot);
753756
#ifdef EDM_ML_DEBUG
754757
edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Position " << glog1.name() << " number " << copy

0 commit comments

Comments
 (0)