/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Geometry/HGCalMapping/src/HGCalMappingTools.cc
67 строк
2 KB
kerstinlovisa
Updates for new HGCal SiPM electronics mapping
19 авг 2025, 19:18
19 авг 2025, 19:18
b1d2732
Код
Авторство
О чём код?
#include "Geometry/HGCalMapping/interface/HGCalMappingTools.h" #include <iostream> #include <fstream> #include <sstream> namespace hgcal { namespace mappingtools { // void HGCalEntityList::buildFrom(std::string url) { std::string line; std::ifstream file(url); //parse the lines to build the list of entities size_t iline(0); while (std::getline(file, line)) { HGCalEntityRow row; std::stringstream s; s << line; HGCalEntityAttr attr; while (s >> attr) row.push_back(attr); if (iline == 0) setHeader(row); else addRow(row); iline += 1; } } // uint16_t getEcondErx(uint16_t chip, uint16_t half) { return chip * 2 + half; } // uint32_t getElectronicsId( bool zside, uint16_t fedid, uint16_t captureblock, uint16_t econdidx, int cellchip, int cellhalf, int cellseq) { uint16_t econderx = getEcondErx(cellchip, cellhalf); return HGCalElectronicsId(zside, fedid, captureblock, econdidx, econderx, cellseq).raw(); } // uint32_t getSiDetId(bool zside, int moduleplane, int moduleu, int modulev, int celltype, int celliu, int celliv) { DetId::Detector det = moduleplane <= 26 ? DetId::Detector::HGCalEE : DetId::Detector::HGCalHSi; int zp(zside ? 1 : -1); return HGCSiliconDetId(det, zp, celltype, moduleplane, moduleu, modulev, celliu, celliv).rawId(); } // uint32_t getSiPMDetId(bool zside, int moduleplane, int modulev, int celltype, int celliu, int celliv, bool isHD) { int layer = moduleplane - 25; int type = 0; // depends on SiPM size to be updated with new geometry int ring = (zside ? celliu : (-1) * celliu); int iphi_casette_offset = isHD ? 36 : 24; int iphi = modulev * iphi_casette_offset + celliv + 1; int granularity = isHD ? 1 : 0; return HGCScintillatorDetId(type, layer, ring, iphi, false, celltype, granularity).rawId(); } } // namespace mappingtools } // namespace hgcal