10#include "GaudiKernel/ServiceHandle.h"
28 if (detStore.retrieve().isSuccess()) {
29 if (detStore->retrieve(
pix,
"PixelID").isFailure()) {
pix =
nullptr; }
32 bool isDBM = (
pix !=
nullptr &&
pix->dictionaryVersion() ==
"IBL-DBM");
34 bool isITkHGTD = (
pix !=
nullptr &&
pix->dictionaryVersion() ==
"ITkHGTD");
36 bool isITkHGTDPLR = (
pix !=
nullptr &&
pix->dictionaryVersion() ==
"ITkHGTDPLR");
38 bool isITk_HGTD_NewID_PLR = (
pix !=
nullptr &&
pix->dictionaryVersion() ==
"P2-RUN4");
40 m_isITkHGTD = isITkHGTD || isITkHGTDPLR || isITk_HGTD_NewID_PLR;
43 else if (isITkHGTDPLR || isITk_HGTD_NewID_PLR)
InitializeField(
"Part",0,3);
81 return std::abs(psh) == 4;
119 const int etaM,
const int phiM,
const int side)
const
139 std::map<std::string, int&> fields{{
"barrel_endcap",brlEcap},{
"layer_wheel",layerDisk},{
"phi_module",phiMod},{
"eta_module",etaMod},{
"side",side}};
140 for(
const auto & field:fields){
141 size_t pos1 = (physVolName).
find(field.first+
"_");
142 size_t pos2 = (physVolName).
find(
"_",pos1+field.first.size()+1);
143 std::string strNew = (physVolName).substr(pos1+field.first.size()+1,pos2-(pos1+field.first.size()+1));
144 field.second = std::stoi(strNew);
146 return buildHitId(part,brlEcap,layerDisk,etaMod,phiMod,side);
153 int moduleInLayer = 0;
155 std::map<std::string, int&> fields{{
"endcap",endcap},{
"layer",layer},{
"moduleInLayer",moduleInLayer}};
156 for(
const auto & field:fields){
157 size_t pos1 = (physVolName).
find(field.first+
"_");
158 size_t pos2 = (physVolName).
find(
"_",pos1+field.first.size()+1);
159 std::string strNew = (physVolName).substr(pos1+field.first.size()+1,pos2-(pos1+field.first.size()+1));
160 field.second = std::stoi(strNew);
162 return buildHitId(part,endcap,layer,0,moduleInLayer,0);
This is an Identifier helper class for the Pixel subdetector.
bool isDBM(uint32_t robId)
int GetFieldValue(const std::string &name, HitID targetID) const
void InitializeField(const std::string &n, int vmn, int vmx)
void SetFieldValue(const std::string &name, int n, HitID &targetID) const
This is an Identifier helper class for the Pixel subdetector.
int buildHitIdFromStringHGTD(int part, const std::string &) const
int getBarrelEndcap(const int &hid) const
int buildHitId(const int, const int, const int, const int, const int, const int) const
int buildHitIdFromStringITk(int part, const std::string &) const
bool isPixel(const int &hid) const
int getEtaModule(const int &hid) const
bool isPLR(const int &hid) const
int getLayerDisk(const int &hid) const
int getPhiModule(const int &hid) const
bool isHGTD(const int &hid) const
bool isSCT(const int &hid) const
int getSide(const int &hid) const
static const SiHitIdHelper * GetHelper()
std::string find(const std::string &s)
return a remapped string