Skip to content

Commit

Permalink
Merge pull request #44478 from bsunanda/Phase2-hgx354B
Browse files Browse the repository at this point in the history
Phase2-hgx354B First attempt to prepare components of XML file for the scintillator components in the mixed layers of HGCal
  • Loading branch information
cmsbuild authored Mar 22, 2024
2 parents 15928d6 + 9a2dbf6 commit e4255f6
Show file tree
Hide file tree
Showing 4 changed files with 623 additions and 13 deletions.
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

0 comments on commit e4255f6

Please sign in to comment.