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-hgx354B First attempt to prepare components of XML file for the scintillator components in the mixed layers of HGCal #44478

Merged
merged 2 commits into from
Mar 22, 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
5 changes: 4 additions & 1 deletion Geometry/HGCalCommonData/interface/HGCalProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ namespace HGCalProperty {
constexpr int32_t kHGCalTilePack = 1000;

constexpr int32_t kHGCalTilePhis = 288;
constexpr int32_t kHGCalFineTilePhis = 432;
constexpr int32_t kHGCalTilePhisWord = 24;
constexpr int32_t kHGCalTilePhisBy2 = kHGCalTilePhis / 2;
constexpr int32_t kHGCalTilePhisBy3 = kHGCalTilePhis / 3;
constexpr int32_t kHGCalTilePhisBy12 = kHGCalTilePhis / 12;
constexpr int32_t kHGCalFineTilePhisBy2 = kHGCalFineTilePhis / 2;
constexpr int32_t kHGCalFineTilePhisBy3 = kHGCalFineTilePhis / 3;

}; // namespace HGCalProperty

Expand Down
1 change: 1 addition & 0 deletions Geometry/HGCalCommonData/interface/HGCalTileIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace HGCalTileIndex {
std::tuple<int32_t, int32_t, int32_t> tileUnpack(int32_t index);
// Sees if the tile exists or not depending the HEX information in flat file
bool tileExist(const int32_t* hex, int32_t zside, int32_t phi);
bool tileFineExist(const int32_t* hex, int32_t zside, int32_t phi);
}; // namespace HGCalTileIndex

#endif
18 changes: 16 additions & 2 deletions Geometry/HGCalCommonData/src/HGCalTileIndex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,22 @@ bool HGCalTileIndex::tileExist(const int32_t* hex, int32_t zside, int32_t iphi)
phi -= HGCalProperty::kHGCalTilePhis;
}
int32_t jj = phi % HGCalProperty::kHGCalTilePhisBy3;
int32_t iw = jj / HGCalProperty::kHGCalTilePhisBy12;
int32_t ibit = HGCalProperty::kHGCalTilePhisBy12 - (jj % HGCalProperty::kHGCalTilePhisBy12) - 1;
int32_t iw = jj / HGCalProperty::kHGCalTilePhisWord;
int32_t ibit = HGCalProperty::kHGCalTilePhisWord - (jj % HGCalProperty::kHGCalTilePhisWord) - 1;
bool ok = (hex[iw] & (1 << ibit));
return ok;
}

bool HGCalTileIndex::tileFineExist(const int32_t* hex, int32_t zside, int32_t iphi) {
int32_t phi(iphi - 1);
if (zside > 0) {
phi += HGCalProperty::kHGCalFineTilePhisBy2;
if (phi >= HGCalProperty::kHGCalFineTilePhis)
phi -= HGCalProperty::kHGCalFineTilePhis;
}
int32_t jj = phi % HGCalProperty::kHGCalFineTilePhisBy3;
int32_t iw = jj / HGCalProperty::kHGCalTilePhisWord;
int32_t ibit = HGCalProperty::kHGCalTilePhisWord - (jj % HGCalProperty::kHGCalTilePhisWord) - 1;
bool ok = (hex[iw] & (1 << ibit));
return ok;
}
Loading