Skip to content

Commit 75a30b7

Browse files
authored
Merge pull request #45518 from bsunanda/Phase2-hgx359E
Phase2-hgx359E Make a few bug fixes before proceeding with V19 version
2 parents f3dd417 + 912034d commit 75a30b7

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,13 @@ bool HGCalParametersFromDD::build(const DDCompactView* cpv,
195195
(php.mode_ == HGCalGeometryMode::TrapezoidCassette)) {
196196
// Load maximum eta & top level
197197
php.levelT_ = dbl_to_int(getDDDArray("LevelTop", sv));
198+
php.levelZSide_ = static_cast<int>(getDDDValue("LevelZSide", sv));
198199
php.firstLayer_ = (int)(getDDDValue("FirstLayer", sv));
199200
php.firstMixedLayer_ = (int)(getDDDValue("FirstMixedLayer", sv));
200201
php.detectorType_ = (int)(getDDDValue("DetectorType", sv));
201202
php.waferThick_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("WaferThickness", sv);
202203
php.minTileSize_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("MinimumTileSize", sv);
204+
php.nCellsFine_ = php.nCellsCoarse_ = 0;
203205
php.waferSize_ = php.waferR_ = 0;
204206
php.sensorSeparation_ = php.mouseBite_ = 0;
205207
php.sensorSizeOffset_ = php.guardRingOffset_ = php.useOffset_ = 0;
@@ -284,6 +286,10 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv,
284286
php.useSimWt_ = 1; // energy weighting for SimHits
285287
php.layerRotation_ = 0; // default layer rotation angle
286288
php.cassettes_ = 0; // default number of cassettes
289+
php.nphiCassette_ = 0; // default number of phi's per cassette
290+
php.phiOffset_ = 0; // default value of phi offset for cassette
291+
php.calibCellRHD_ = 0; // default value of R of HD calibration cells
292+
php.calibCellRLD_ = 0; // default value of R of LD calibration cells
287293
std::unique_ptr<HGCalGeomParameters> geom = std::make_unique<HGCalGeomParameters>();
288294
if ((php.mode_ == HGCalGeometryMode::Hexagon) || (php.mode_ == HGCalGeometryMode::HexagonFull)) {
289295
tempS = fv.get<std::vector<std::string> >(namet, "WaferMode");
@@ -430,7 +436,6 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv,
430436
php.levelT_ = dbl_to_int(fv.get<std::vector<double> >(name, "LevelTop"));
431437
tempD = fv.get<std::vector<double> >(name, "LevelZSide");
432438
php.levelZSide_ = static_cast<int>(tempD[0]);
433-
php.nCellsFine_ = php.nCellsCoarse_ = 0;
434439
tempD = fv.get<std::vector<double> >(name, "FirstLayer");
435440
php.firstLayer_ = static_cast<int>(tempD[0]);
436441
tempD = fv.get<std::vector<double> >(name, "FirstMixedLayer");
@@ -441,6 +446,7 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv,
441446
php.waferThick_ = HGCalParameters::k_ScaleFromDD4hep * tempD[0];
442447
tempD = fv.get<std::vector<double> >(name, "MinimumTileSize");
443448
php.minTileSize_ = HGCalParameters::k_ScaleFromDD4hep * tempD[0];
449+
php.nCellsFine_ = php.nCellsCoarse_ = 0;
444450
php.waferSize_ = php.waferR_ = 0;
445451
php.sensorSeparation_ = php.mouseBite_ = 0;
446452
php.sensorSizeOffset_ = php.guardRingOffset_ = php.useOffset_ = 0;

Geometry/HGCalCommonData/test/HGCalConvert.cpp

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// of the outputs
2121
//
2222
// HGCalConvert 3 infile outfile1 outfile2 laymin cassette debug
23-
// 4 infile outfile1 outfile2 laymin nlayers cassette debug
23+
// 4 infile outfile1 outfile2 laymin cassette nlayers debug
2424
// infile (const char*) Input file from Katya (modified by Chris)
2525
// containing layer #. ring #, start and end
2626
// of ring radius, SiPM size, 4 hexadecimal
@@ -33,9 +33,9 @@
3333
// the ddAlgorithm part
3434
// laymin (int) First layer number of the HE part
3535
// (28 for versions: V14, V15; 26 for V16, V17)
36-
// nlayers (int) Number of scintillator layers (14 for v19)
3736
// cassette (int) Cassettes are used in geometry definition
3837
// (0 if none, 1 if 12 cassettes are used)
38+
// nlayers (int) Number of scintillator layers (14 for v19)
3939
// debug (int) Two digit integer to set debug for each
4040
// of the outputs
4141
//
@@ -1701,6 +1701,32 @@ void ConvertScintillatorV1::convert(const char* infile, const char* outfile1, co
17011701

17021702
//Now write for the second file
17031703
std::ofstream fout(outfile2);
1704+
// Write the ring specification first
1705+
l1 = 0;
1706+
fout << " <Vector name=" << apost << "NPhiLayer" << apost << " type=" << apost << "numeric" << apost
1707+
<< " nEntries=" << apost << layPhiS.size() << apost << ">";
1708+
for (it0 = layPhiS.begin(); it0 != layPhiS.end(); ++it0) {
1709+
std::string last = ((l1 + 1) == layPhiS.size()) ? " " : ",";
1710+
if (l1 % 10 == 0)
1711+
fout << "\n " << std::setw(6) << std::setprecision(4) << (it0->second).first << last;
1712+
else
1713+
fout << std::setw(6) << std::setprecision(4) << (it0->second).first << last;
1714+
++l1;
1715+
}
1716+
fout << "\n </Vector>\n";
1717+
l2 = 0;
1718+
fout << " <Vector name=" << apost << "ScintRetract" << apost << " type=" << apost << "numeric" << apost
1719+
<< " nEntries=" << apost << layPhiS.size() << apost << ">";
1720+
for (it0 = layPhiS.begin(); it0 != layPhiS.end(); ++it0) {
1721+
std::string last = ((l2 + 1) == layPhiS.size()) ? " " : ",";
1722+
if (l2 % 6 == 0)
1723+
fout << "\n " << std::setw(8) << std::setprecision(6) << (it0->second).second << "*mm" << last;
1724+
else
1725+
fout << std::setw(8) << std::setprecision(6) << (it0->second).second << "*mm" << last;
1726+
++l2;
1727+
}
1728+
fout << "\n </Vector>\n";
1729+
// Now write the remaining parts
17041730
makeTitle(
17051731
fout, "Tile6", module6, ringR6, lmin6, lmax6, HGCalProperty::kHGCalFineTilePhis, 1, (((debug / 10) % 10) > 0));
17061732
makeTitle(fout, "Tile", module, ringR, lmin, lmax, HGCalProperty::kHGCalTilePhis, 0, (((debug / 10) % 10) > 0));

0 commit comments

Comments
 (0)