Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase2-hgx359N Correct the conversion code for fine scintillator tiles of HGCal V19 geometry in the assignment of cassette number #45724

Merged
merged 2 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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