77 for(
int hash = 0; hash<static_cast<int>(
m_pixelId->wafer_hash_max()); hash++) {
81 if(offlineId==0)
continue;
83 short barrel_ec =
m_pixelId->barrel_ec(offlineId);
84 if(std::abs(barrel_ec)>2)
continue;
86 short phi_index =
m_pixelId->phi_module(offlineId);
87 short eta_index =
m_pixelId->eta_module(offlineId);
88 int lay_id =
m_pixelId->layer_disk(offlineId);
89 int eta_mod =
m_pixelId->eta_module(offlineId);
92 if(barrel_ec== 0) vol_id = 8;
93 if(barrel_ec==-2) vol_id = 7;
94 if(barrel_ec== 2) vol_id = 9;
96 int new_vol=0, new_lay=0;
98 if(vol_id == 7 || vol_id == 9) {
99 new_vol = 10*vol_id + lay_id;
102 else if(vol_id == 8) {
104 new_vol = 10*vol_id + lay_id;
107 auto t = std::make_tuple(barrel_ec==0 ? -100 : barrel_ec, subdetid, new_vol, new_lay);
109 std::map<std::tuple<int, int, short, short>,std::vector<PhiEtaHashITk> >
::iterator it = hashMap.find(t);
110 if(it==hashMap.end())
111 hashMap.insert(std::pair<std::tuple<int, int, short, short>,std::vector<PhiEtaHashITk> >(t,std::vector<PhiEtaHashITk>(1,
PhiEtaHashITk(phi_index, eta_index, hash) )));
112 else (*it).second.push_back(
PhiEtaHashITk(phi_index, eta_index, hash));
117 for(
int hash = 0; hash<static_cast<int>(
m_sctId->wafer_hash_max()); hash++) {
121 if(offlineId==0)
continue;
123 short barrel_ec =
m_sctId->barrel_ec(offlineId);
124 short phi_index =
m_sctId->phi_module(offlineId);
125 short eta_index =
m_sctId->eta_module(offlineId);
129 if(barrel_ec) vol_id = 12;
130 if(barrel_ec>0) vol_id = 14;
132 int lay_id =
m_sctId->layer_disk(offlineId);
134 auto t = std::make_tuple(barrel_ec==0 ? -100 : barrel_ec, subdetid, vol_id, lay_id);
136 std::map<std::tuple<int, int, short, short>,std::vector<PhiEtaHashITk> >
::iterator it = hashMap.find(t);
137 if(it==hashMap.end())
138 hashMap.insert(std::pair<std::tuple<int, int, short, short>,std::vector<PhiEtaHashITk> >(t,std::vector<PhiEtaHashITk>(1,
PhiEtaHashITk(phi_index, eta_index, hash))));
139 else (*it).second.push_back(
PhiEtaHashITk(phi_index, eta_index, hash));
153 std::ofstream geometryStream;
158 for(std::map<std::tuple<int, int, short, short>,std::vector<PhiEtaHashITk> >
::iterator it = hashMap.begin();it!=hashMap.end();++it, layerId++) {
160 short vol_id = std::get<2>((*it).first);
161 short lay_id = std::get<3>((*it).first);
162 int combinedId =
static_cast<int>(vol_id)*1000 + lay_id;
164 short subdetId = std::get<1>((*it).first);
165 short barrel_ec = std::get<0>((*it).first);
167 if(barrel_ec == -100) barrel_ec = 0;
179 double minZ = 100000.0;
180 double maxZ = -100000.0;
181 double minR = 100000.0;
182 double maxR = -100000.0;
184 for(std::vector<PhiEtaHashITk>::iterator hIt = (*it).second.begin();hIt != (*it).second.end();++hIt) {
203 minZ = std::min(minZ, p->zMin());
204 maxZ = std::max(maxZ, p->zMax());
205 minR = std::min(minR, p->rMin());
206 maxR = std::max(maxR, p->rMax());
210 rc += sqrt(
C(0)*
C(0)+
C(1)*
C(1));
220 throw std::runtime_error(
"TrigL2LayerNumberToolITk::createModuleHashMap: nModules is zero.");
238 geometryStream << minR <<
" "
242 << combinedId <<
"\n";
247 for(
int l=0;l<layerId;l++) {