Skip to content

Commit

Permalink
Merge pull request #45724 from bsunanda/Phase2-hgx359N
Browse files Browse the repository at this point in the history
Phase2-hgx359N Correct the conversion code for fine scintillator tiles of HGCal V19 geometry in the assignment of cassette number
  • Loading branch information
cmsbuild authored Aug 17, 2024
2 parents 5b93e63 + 16b974f commit 9f8ff8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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
13 changes: 7 additions & 6 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 @@ -1744,10 +1744,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 +1784,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 9f8ff8e

Please sign in to comment.