Skip to content

Commit

Permalink
Correct the conversion code for fine scintillator tiles in assignment…
Browse files Browse the repository at this point in the history
… of cassette number
  • Loading branch information
Sunanda committed Aug 16, 2024
1 parent 7320a6b commit 60d4338
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions Geometry/HGCalCommonData/interface/HGCalProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace HGCalProperty {
constexpr int32_t kHGCalTilePhis = 288;
constexpr int32_t kHGCalFineTilePhis = 432;
constexpr int32_t kHGCalTilePhisWord = 24;
constexpr int32_t kHGCalFineTilePhisWord = 36;
constexpr int32_t kHGCalTilePhisBy2 = kHGCalTilePhis / 2;
constexpr int32_t kHGCalTilePhisBy3 = kHGCalTilePhis / 3;
constexpr int32_t kHGCalFineTilePhisBy2 = kHGCalFineTilePhis / 2;
Expand Down
16 changes: 8 additions & 8 deletions Geometry/HGCalCommonData/test/HGCalConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ void ConvertScintillator::makeTitle(const char* outfile,
int lmax,
bool debug) {
const int zside = 1;
const int phiCassette = 24;
const int phiCassette = HGCalProperty::kHGCalTilePhisWord;
std::vector<tileZone> zones;
for (int layer = lmin; layer <= lmax; ++layer) {
tileZone tile0;
Expand Down Expand Up @@ -1727,8 +1727,7 @@ void ConvertScintillatorV1::convert(const char* infile, const char* outfile1, co
}
fout << "\n </Vector>\n";
// Now write the remaining parts
makeTitle(
fout, "Tile6", module6, ringR6, lmin6, lmax6, HGCalProperty::kHGCalFineTilePhis, 1, (((debug / 10) % 10) > 0));
makeTitle(fout, "Tile6", module6, ringR6, lmin6, lmax6, HGCalProperty::kHGCalFineTilePhis, 1, (((debug / 10) % 10) > 0));
makeTitle(fout, "Tile", module, ringR, lmin, lmax, HGCalProperty::kHGCalTilePhis, 0, (((debug / 10) % 10) > 0));
fout.close();
}
Expand All @@ -1744,10 +1743,11 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
int mode,
bool debug) {
const int zside = 1;
int tilePhisWord = (mode > 0) ? HGCalProperty::kHGCalFineTilePhisWord : HGCalProperty::kHGCalTilePhisWord;
std::vector<tileZone> zones;
if ((debug % 10) > 0)
std::cout << "makeTile called with Layer:" << lmin << ":" << lmax << " nphi " << nphis << " mode " << mode
<< " nmodules " << module.size() << std::endl;
<< " nmodules " << module.size() << " tilePhisWord " << tilePhisWord << std::endl;
for (int layer = lmin; layer <= lmax; ++layer) {
tileZone tile0;
int kk, irmin, irmax;
Expand Down Expand Up @@ -1783,19 +1783,19 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
tile0.cassette = (cassette_ == 0) ? 0 : 1;
} else if ((tile0.rmin != irmin) || (tile0.rmax != irmax)) {
if (cassette_ != 0) {
if (tile0.cassette * HGCalProperty::kHGCalTilePhisWord < tile0.phimax) {
if (tile0.cassette * tilePhisWord < tile0.phimax) {
do {
int phimax = tile0.phimax;
tile0.phimax = tile0.cassette * HGCalProperty::kHGCalTilePhisWord;
tile0.phimax = tile0.cassette * tilePhisWord;
zones.push_back(tile0);
tile0.phimin = tile0.phimax + 1;
tile0.phimax = phimax;
++tile0.cassette;
} while (tile0.cassette * HGCalProperty::kHGCalTilePhisWord < tile0.phimax);
} while (tile0.cassette * tilePhisWord < tile0.phimax);
}
}
zones.push_back(tile0);
int cassette = (cassette_ == 0) ? 0 : (1 + ((phi - 1) / HGCalProperty::kHGCalTilePhisWord));
int cassette = (cassette_ == 0) ? 0 : (1 + ((phi - 1) / tilePhisWord));
tile0.layer = layer;
tile0.rmin = irmin;
tile0.rmax = irmax;
Expand Down

0 comments on commit 60d4338

Please sign in to comment.