Skip to content

Commit 60d4338

Browse files
author
Sunanda
committed
Correct the conversion code for fine scintillator tiles in assignment of cassette number
1 parent 7320a6b commit 60d4338

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Geometry/HGCalCommonData/interface/HGCalProperty.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ namespace HGCalProperty {
4848
constexpr int32_t kHGCalTilePhis = 288;
4949
constexpr int32_t kHGCalFineTilePhis = 432;
5050
constexpr int32_t kHGCalTilePhisWord = 24;
51+
constexpr int32_t kHGCalFineTilePhisWord = 36;
5152
constexpr int32_t kHGCalTilePhisBy2 = kHGCalTilePhis / 2;
5253
constexpr int32_t kHGCalTilePhisBy3 = kHGCalTilePhis / 3;
5354
constexpr int32_t kHGCalFineTilePhisBy2 = kHGCalFineTilePhis / 2;

Geometry/HGCalCommonData/test/HGCalConvert.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ void ConvertScintillator::makeTitle(const char* outfile,
11511151
int lmax,
11521152
bool debug) {
11531153
const int zside = 1;
1154-
const int phiCassette = 24;
1154+
const int phiCassette = HGCalProperty::kHGCalTilePhisWord;
11551155
std::vector<tileZone> zones;
11561156
for (int layer = lmin; layer <= lmax; ++layer) {
11571157
tileZone tile0;
@@ -1727,8 +1727,7 @@ void ConvertScintillatorV1::convert(const char* infile, const char* outfile1, co
17271727
}
17281728
fout << "\n </Vector>\n";
17291729
// Now write the remaining parts
1730-
makeTitle(
1731-
fout, "Tile6", module6, ringR6, lmin6, lmax6, HGCalProperty::kHGCalFineTilePhis, 1, (((debug / 10) % 10) > 0));
1730+
makeTitle(fout, "Tile6", module6, ringR6, lmin6, lmax6, HGCalProperty::kHGCalFineTilePhis, 1, (((debug / 10) % 10) > 0));
17321731
makeTitle(fout, "Tile", module, ringR, lmin, lmax, HGCalProperty::kHGCalTilePhis, 0, (((debug / 10) % 10) > 0));
17331732
fout.close();
17341733
}
@@ -1744,10 +1743,11 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
17441743
int mode,
17451744
bool debug) {
17461745
const int zside = 1;
1746+
int tilePhisWord = (mode > 0) ? HGCalProperty::kHGCalFineTilePhisWord : HGCalProperty::kHGCalTilePhisWord;
17471747
std::vector<tileZone> zones;
17481748
if ((debug % 10) > 0)
17491749
std::cout << "makeTile called with Layer:" << lmin << ":" << lmax << " nphi " << nphis << " mode " << mode
1750-
<< " nmodules " << module.size() << std::endl;
1750+
<< " nmodules " << module.size() << " tilePhisWord " << tilePhisWord << std::endl;
17511751
for (int layer = lmin; layer <= lmax; ++layer) {
17521752
tileZone tile0;
17531753
int kk, irmin, irmax;
@@ -1783,19 +1783,19 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
17831783
tile0.cassette = (cassette_ == 0) ? 0 : 1;
17841784
} else if ((tile0.rmin != irmin) || (tile0.rmax != irmax)) {
17851785
if (cassette_ != 0) {
1786-
if (tile0.cassette * HGCalProperty::kHGCalTilePhisWord < tile0.phimax) {
1786+
if (tile0.cassette * tilePhisWord < tile0.phimax) {
17871787
do {
17881788
int phimax = tile0.phimax;
1789-
tile0.phimax = tile0.cassette * HGCalProperty::kHGCalTilePhisWord;
1789+
tile0.phimax = tile0.cassette * tilePhisWord;
17901790
zones.push_back(tile0);
17911791
tile0.phimin = tile0.phimax + 1;
17921792
tile0.phimax = phimax;
17931793
++tile0.cassette;
1794-
} while (tile0.cassette * HGCalProperty::kHGCalTilePhisWord < tile0.phimax);
1794+
} while (tile0.cassette * tilePhisWord < tile0.phimax);
17951795
}
17961796
}
17971797
zones.push_back(tile0);
1798-
int cassette = (cassette_ == 0) ? 0 : (1 + ((phi - 1) / HGCalProperty::kHGCalTilePhisWord));
1798+
int cassette = (cassette_ == 0) ? 0 : (1 + ((phi - 1) / tilePhisWord));
17991799
tile0.layer = layer;
18001800
tile0.rmin = irmin;
18011801
tile0.rmax = irmax;

0 commit comments

Comments
 (0)