#include <SiHitIdHelper.h>
|
| static void | Print (int id) |
| static void | SetBit (int &i, int bitpos) |
| static void | UnsetBit (int &i, int bitpos) |
| static void | Store (int &id, int value, int first, int field) |
| static int | Retrieve (int id, int first, int field) |
Definition at line 25 of file SiHitIdHelper.h.
◆ SiHitIdHelper()
| SiHitIdHelper::SiHitIdHelper |
( |
| ) |
|
|
private |
◆ buildHitId()
| int SiHitIdHelper::buildHitId |
( |
const int | Part, |
|
|
const int | BrlECap, |
|
|
const int | LayerDisk, |
|
|
const int | etaM, |
|
|
const int | phiM, |
|
|
const int | side ) const |
Definition at line 118 of file SiHitIdHelper.cxx.
120{
121 int theID(0);
128 return theID;
129}
void SetFieldValue(const std::string &name, int n, HitID &targetID) const
◆ buildHitIdFromStringHGTD()
| int SiHitIdHelper::buildHitIdFromStringHGTD |
( |
int | part, |
|
|
const std::string & | physVolName ) const |
Definition at line 149 of file SiHitIdHelper.cxx.
150{
151 int endcap = 0;
153 int moduleInLayer = 0;
154
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);
161 }
162 return buildHitId(part,endcap,layer,0,moduleInLayer,0);
163}
int buildHitId(const int, const int, const int, const int, const int, const int) const
std::string find(const std::string &s)
return a remapped string
◆ buildHitIdFromStringITk()
| int SiHitIdHelper::buildHitIdFromStringITk |
( |
int | part, |
|
|
const std::string & | physVolName ) const |
Definition at line 131 of file SiHitIdHelper.cxx.
132{
133 int brlEcap = 0;
134 int layerDisk = 0;
136 int phiMod = 0;
138
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);
145 }
146 return buildHitId(part,brlEcap,layerDisk,etaMod,phiMod,side);
147}
◆ getBarrelEndcap()
| int SiHitIdHelper::getBarrelEndcap |
( |
const int & | hid | ) |
const |
Definition at line 86 of file SiHitIdHelper.cxx.
87{
89}
int GetFieldValue(const std::string &name, HitID targetID) const
◆ getEtaModule()
| int SiHitIdHelper::getEtaModule |
( |
const int & | hid | ) |
const |
◆ GetFieldValue()
| int HitIdHelper::GetFieldValue |
( |
const std::string & | name, |
|
|
HitID | targetID ) const |
|
inherited |
Definition at line 47 of file HitIdHelper.cxx.
48{
49 for (
unsigned int i=0;
i<
m_IDs.size();
i++)
50 {
51 if (
m_IDs[i].fieldName==name)
52 {
55 }
56 }
57 std::cout<<
"HitIdHelper: field "<<
name<<
" not found: returning 0"<<
58 std::endl;
59 return 0;
60}
static int Retrieve(int id, int first, int field)
◆ GetHelper()
◆ getLayerDisk()
| int SiHitIdHelper::getLayerDisk |
( |
const int & | hid | ) |
const |
◆ getPhiModule()
| int SiHitIdHelper::getPhiModule |
( |
const int & | hid | ) |
const |
◆ getSide()
| int SiHitIdHelper::getSide |
( |
const int & | hid | ) |
const |
◆ Initialize()
| void SiHitIdHelper::Initialize |
( |
| ) |
|
|
private |
Definition at line 24 of file SiHitIdHelper.cxx.
24 {
25
26 const PixelID* pix = nullptr;
27 ServiceHandle<StoreGateSvc>
detStore (
"DetectorStore",
"SiHitIdHelper");
28 if (
detStore.retrieve().isSuccess()) {
29 if (
detStore->retrieve(pix,
"PixelID").isFailure()) { pix =
nullptr; }
30 }
31
33
35
37
38 bool isITk_HGTD_NewID_PLR = (pix !=
nullptr && pix->
dictionaryVersion() ==
"P2-RUN4");
39
40 m_isITkHGTD = isITkHGTD || isITkHGTDPLR || isITk_HGTD_NewID_PLR;
41
43 else if (isITkHGTDPLR || isITk_HGTD_NewID_PLR)
InitializeField(
"Part",0,3);
53
54}
bool isDBM(uint32_t robId)
virtual std::string dictionaryVersion(void) const override
void InitializeField(const std::string &n, int vmn, int vmx)
◆ InitializeField() [1/2]
| void HitIdHelper::InitializeField |
( |
const std::string & | n, |
|
|
int | nb ) |
|
inherited |
Definition at line 20 of file HitIdHelper.cxx.
21{
22 int vmn=0;
23 int vmx = (1 <<
nb) - 1;
25 m_IDs.push_back(std::move(
id));
28}
◆ InitializeField() [2/2]
| void HitIdHelper::InitializeField |
( |
const std::string & | n, |
|
|
int | vmn, |
|
|
int | vmx ) |
|
inherited |
Definition at line 10 of file HitIdHelper.cxx.
11{
12 int field = vmx - vmn + 1;
13 int nb = std::bit_width(
static_cast<unsigned>(field - 1));
15 m_IDs.push_back(std::move(
id));
18}
◆ isHGTD()
| bool SiHitIdHelper::isHGTD |
( |
const int & | hid | ) |
const |
◆ isPixel()
| bool SiHitIdHelper::isPixel |
( |
const int & | hid | ) |
const |
◆ isPLR()
| bool SiHitIdHelper::isPLR |
( |
const int & | hid | ) |
const |
◆ isSCT()
| bool SiHitIdHelper::isSCT |
( |
const int & | hid | ) |
const |
◆ Print()
| void HitIdHelper::Print |
( |
int | id | ) |
|
|
staticinherited |
Definition at line 72 of file HitIdHelper.cxx.
73{
74 for (
unsigned int i=0;
i<8*
sizeof(
int);
i++)
75 {
76 if ((id & (1u<<i))) std::cout<<"1";
77 else std::cout<<"0";
78 }
79 std::cout<<std::endl;
80}
◆ PrintFields()
| void HitIdHelper::PrintFields |
( |
| ) |
|
|
inherited |
Definition at line 62 of file HitIdHelper.cxx.
63{
64 for (
unsigned int i=0;
i<
m_IDs.size();
i++)
65 {
66 std::cout<<
"-- Field "<<
m_IDs[
i].fieldName<<
"\t["<<
m_IDs[
i].vMin
68 <<
"\tfirst Bit "<<
m_IDs[
i].firstBit<<std::endl;
69 }
70}
◆ Retrieve()
| int HitIdHelper::Retrieve |
( |
int | id, |
|
|
int | first, |
|
|
int | field ) |
|
staticprotectedinherited |
Definition at line 105 of file HitIdHelper.cxx.
106{
107 int j=0;
112}
static void SetBit(int &i, int bitpos)
l
Printing final latex table to .tex output file.
◆ SetBit()
| void HitIdHelper::SetBit |
( |
int & | i, |
|
|
int | bitpos ) |
|
staticprotectedinherited |
◆ SetFieldValue()
| void HitIdHelper::SetFieldValue |
( |
const std::string & | name, |
|
|
int | n, |
|
|
HitID & | targetID ) const |
|
inherited |
Definition at line 30 of file HitIdHelper.cxx.
31{
32 for (
unsigned int i=0;
i<
m_IDs.size();
i++)
33 {
34 if (
m_IDs[i].fieldName==name)
35 {
37 std::cout<<
"HitIdHelper: field "<<
name<<
": supplied value "<<
n<<
38 " is not within the allowed range ["<<
m_IDs[
i].vMin<<
","<<
m_IDs[
i].vMax
39 <<"] : the result of this action is unpredictable "<<std::endl;
42 break;
43 }
44 }
45}
static void Store(int &id, int value, int first, int field)
◆ Store()
| void HitIdHelper::Store |
( |
int & | id, |
|
|
int | value, |
|
|
int | first, |
|
|
int | field ) |
|
staticprotectedinherited |
Definition at line 96 of file HitIdHelper.cxx.
97{
103}
static void UnsetBit(int &i, int bitpos)
◆ UnsetBit()
| void HitIdHelper::UnsetBit |
( |
int & | i, |
|
|
int | bitpos ) |
|
staticprotectedinherited |
◆ m_currentStorage
| int HitIdHelper::m_currentStorage |
|
protectedinherited |
◆ m_IDs
◆ m_isITkHGTD
| bool SiHitIdHelper::m_isITkHGTD {} |
|
private |
The documentation for this class was generated from the following files: