160 const std::array<std::string,1> sensorTypes{
"SingleChip_RD53"};
161 const std::array<std::string,17> ParamNames{
"circuitsPerEta",
"circuitsPerPhi",
"thickness",
"is3D",
"rows",
"columns",
"pitchEta",
"pitchPhi",
"pitchEtaLong",
"pitchPhiLong",
"pitchEtaEnd",
"pitchPhiEnd",
"nPhiLongPerSide",
"nEtaLongPerSide",
"nPhiEndPerSide",
"nEtaEndPerSide",
"detectorType"};
162 static const std::string
empty;
163 for(
const std::string & sType:sensorTypes){
167 if(PLR_module->
size() != 0){
169 for (
const auto& typeParams : *PLR_module){
170 std::map<std::string,std::string> PLR_moduleMap;
172 for(
const std::string & paramName:ParamNames){
173 std::string paramValue = typeParams->getString(paramName);
174 PLR_moduleMap[paramName] = std::move(paramValue);
176 std::string sensorName = typeParams->getString(
"SensorType");
184 const std::array<std::string,5> fields{
"barrel_endcap",
"layer_wheel",
"phi_module",
"eta_module",
"side"};
187 const std::array<std::string,3> publishers({
"ITk",
"ITkPixel",
"GeoModelXML"});
190 std::map<std::string, GeoFullPhysVol*> mapFPV;
191 for (
auto & iPub : publishers){
193 mapFPV = sqlreader->getPublishedNodes<std::string, GeoFullPhysVol*>(iPub,
true);
194 if (!mapFPV.empty()) {
199 if (mapFPV.empty())
ATH_MSG_ERROR(
"Could not find any FPV tables under the expected names: "<<publishers);
201 for (
const auto&[fullPhysVolInfoString, fullPhysVolPointer] : mapFPV){
203 size_t startRG = fullPhysVolInfoString.find(
"PLR_");
204 if(startRG==std::string::npos){
205 ATH_MSG_DEBUG(
"GeoFullPhysVol "<<fullPhysVolInfoString<<
" does not have the expected format. Skipping");
208 std::string typeName = fullPhysVolInfoString.substr(startRG);
209 std::map<std::string, int>
index;
210 for (
const std::string & field:fields){
211 size_t first = fullPhysVolInfoString.find(field+
"_");
212 size_t last = fullPhysVolInfoString.find(
'_',first+field.size()+1);
213 if(first==std::string::npos || last==std::string::npos){
214 ATH_MSG_WARNING(
"Could not extract "<<field<<
" from "<<fullPhysVolInfoString<<
". Skipping");
217 std::string strNew = fullPhysVolInfoString.substr(first+field.size()+1,last-(first+field.size()+1));
218 index[field] = std::stoi(strNew);
227 const std::map<std::string, std::string> ¶meters)
229 int circuitsPerEta{1};
230 int circuitsPerPhi{1};
231 double thickness{0.150};
234 double pitchEtaLong{};
235 double pitchPhiLong{};
236 double pitchEtaEnd{};
237 double pitchPhiEnd{};
238 int nEtaLongPerSide{};
239 int nPhiLongPerSide{};
240 int nEtaEndPerSide{};
241 int nPhiEndPerSide{};
242 int rowsPerCircuit{};
243 int columnsPerCircuit{};
251 getParameter(typeName, parameters,
"circuitsPerEta", circuitsPerEta);
252 getParameter(typeName, parameters,
"circuitsPerPhi", circuitsPerPhi);
253 getParameter(typeName, parameters,
"thickness", thickness);
254 getParameter(typeName, parameters,
"is3D", is3D);
255 getParameter(typeName, parameters,
"rows", rowsPerCircuit);
256 getParameter(typeName, parameters,
"columns", columnsPerCircuit);
257 getParameter(typeName, parameters,
"pitchEta", pitchEta);
258 getParameter(typeName, parameters,
"pitchPhi", pitchPhi);
259 getParameter(typeName, parameters,
"pitchEtaLong", pitchEtaLong);
260 getParameter(typeName, parameters,
"pitchPhiLong", pitchPhiLong);
261 getParameter(typeName, parameters,
"pitchEtaEnd", pitchEtaEnd);
262 getParameter(typeName, parameters,
"pitchPhiEnd", pitchPhiEnd);
263 getParameter(typeName, parameters,
"nPhiLongPerSide", nPhiLongPerSide);
264 getParameter(typeName, parameters,
"nEtaLongPerSide", nEtaLongPerSide);
265 getParameter(typeName, parameters,
"nPhiEndPerSide", nPhiEndPerSide);
266 getParameter(typeName, parameters,
"nEtaEndPerSide", nEtaEndPerSide);
271 auto computeAttribute = [pitchPhi,
275 ](
const std::array<PixelDiodeTree::IndexType,2> &split_idx,
277 [[maybe_unused]]
const std::array<bool,4> &ganged,
278 [[maybe_unused]]
unsigned int split_i,
281 -> std::tuple<PixelDiodeTree::AttributeType,PixelDiodeTree::AttributeType>
302 assert(split_idx[0]>=0 && split_idx[1]>=0);
303 std::array<int,2> chip_idx{split_idx[0]/rowsPerCircuit, split_idx[1]/columnsPerCircuit};
305 unsigned int n_large_dimensions = ( (std::abs(diode_width[0]-pitchPhi)>pitchPhi*.25)
306 +(std::abs(diode_width[1]-pitchEta)>pitchEta*.25));
307 switch (n_large_dimensions) {
319 return std::make_tuple(current_matrix_attribute, current_diode_attribute);
323 =
createPixelDiodeTree(std::array<unsigned int,2>{
static_cast<unsigned int>(circuitsPerPhi),
static_cast<unsigned int>(circuitsPerEta)},
324 std::array<unsigned int,2>{
static_cast<unsigned int>(rowsPerCircuit),
static_cast<unsigned int>(columnsPerCircuit)},
326 std::array<std::array<unsigned int,2>, 2>{ std::array<unsigned int,2>{
static_cast<unsigned int>(nPhiEndPerSide),
327 static_cast<unsigned int>(nEtaEndPerSide)},
328 std::array<unsigned int,2>{
static_cast<unsigned int>(nPhiLongPerSide),
329 static_cast<unsigned int>(nEtaLongPerSide)}},
333 std::array<std::array<unsigned int,2>, 2>{ std::array<unsigned int,2>{0u,0u},
334 std::array<unsigned int,2>{0u,0u}
343 auto design = std::make_unique<PixelModuleDesign>(thickness,
344 circuitsPerPhi, circuitsPerEta,
345 columnsPerCircuit, rowsPerCircuit,
346 columnsPerCircuit, rowsPerCircuit,
347 std::move(diode_tree), carrier,
348 readoutSide, is3D, detectorType,
351 ATH_MSG_DEBUG(
"readout geo - design " << typeName <<
" " << design->width() <<
"x" << design->length() <<
"x" << design->thickness()
352 <<
" " << design->rows() <<
"x" << design->columns()
353 <<
", " << circuitsPerPhi <<
"x" << circuitsPerEta <<
" "
354 << rowsPerCircuit <<
"x" << columnsPerCircuit
355 <<
" carrier " << carrier <<
" readout side " << readoutSide <<
":\n"
358 [[maybe_unused]]
auto observedPtr =
m_detectorManager->addDesign(std::move(design));
PixelDiodeTree createPixelDiodeTree(const std::array< unsigned int, 2 > &chip_dim, const std::array< unsigned int, 2 > &chip_matrix_dim, const PixelDiodeTree::Vector2D &pitch, const std::array< std::array< unsigned int, 2 >, 2 > &edge_dim, const std::array< PixelDiodeTree::Vector2D, 2 > &edge_pitch, const std::array< std::array< unsigned int, 2 >, 2 > &dead_zone, const AttributeRefiner &func_compute_attribute, std::ostream *debug_out=nullptr)
Create a pixel diode tree.