23 #include <DD4hep/DD4hepUnits.h>
30 : m_name(computeNameWithNoNamespace(fv.
name())),
33 m_trans(fv.translation()),
37 m_diamondBoxParams(computeDiamondDimensions(m_isABox, m_isDD4hep, m_params)),
38 m_sensorType(computeSensorType(fv.logicalPart().
name().fullname())),
39 m_geographicalID(computeDetID(m_name, fv.copyNumbers(), fv.copyno(),
isRun2)),
40 m_z(fv.translation().
z())
47 : m_name(computeNameWithNoNamespace(fv.
name())),
50 m_trans(fv.translation() /
dd4hep::mm),
52 m_params(computeParameters(fv)),
54 m_diamondBoxParams(computeDiamondDimensions(m_isABox, m_isDD4hep, m_params)),
55 m_sensorType(computeSensorType(fv.
name())),
56 m_geographicalID(computeDetIDFromDD4hep(m_name, fv.copyNos(), fv.copyNum(),
isRun2)),
57 m_z(fv.translation().
z() /
dd4hep::mm)
88 edm::LogVerbatim(
"DetGeomDesc::print") <<
"............................." << std::endl;
125 const auto& semiColonPos = nameFromView.find(
":");
126 const std::string name{(semiColonPos != std::string::npos ? nameFromView.substr(semiColonPos + 1) : nameFromView)};
134 auto myShape = fv.
solid();
135 const std::vector<double>&
parameters = myShape.dimensions();
147 const std::vector<double>&
params)
const {
155 boxShapeParameters = {
params.at(0) / dd4hep::mm,
params.at(1) / dd4hep::mm,
params.at(2) / dd4hep::mm};
158 return boxShapeParameters;
166 const std::vector<int>& copyNos,
167 const unsigned int copyNum,
168 const bool isRun2)
const {
174 if (copyNos.size() < 3)
176 <<
"size of copyNumbers for strip sensor is " << copyNos.size() <<
". It must be >= 3.";
179 const unsigned int decRPId = copyNos[copyNos.size() - 3];
182 const unsigned int rp =
decRPId % 10;
183 const unsigned int detector = copyNos[copyNos.size() - 1];
189 unsigned int decRPId = copyNum;
194 const unsigned int armIdx = (
decRPId / 100) % 10;
195 const unsigned int stIdx = (
decRPId / 10) % 10;
196 const unsigned int rpIdx =
decRPId % 10;
199 const unsigned int armIdx = (
decRPId / 100) % 10;
200 const unsigned int stIdx = (
decRPId / 10) % 10;
201 const unsigned int rpIdx =
decRPId % 10;
208 if (copyNos.size() < 4)
210 <<
"size of copyNumbers for TOTEM timing sensor is " << copyNos.size() <<
". It must be >= 4.";
212 const unsigned int decRPId = copyNos[copyNos.size() - 4];
214 const unsigned int plane = copyNos[copyNos.size() - 2], channel = copyNos[copyNos.size() - 1];
219 const unsigned int arm = copyNum / 100,
station = (copyNum % 100) / 10, rp = copyNum % 10;
226 if (copyNos.size() < 4)
228 <<
"size of copyNumbers for pixel sensor is " << copyNos.size() <<
". It must be >= 4.";
231 const unsigned int decRPId = copyNos[copyNos.size() - 4] % 10000;
234 const unsigned int rp =
decRPId % 10;
235 const unsigned int detector = copyNos[copyNos.size() - 2] - 1;
242 if (copyNos.size() < 2)
244 <<
"size of copyNumbers for diamond segments is " << copyNos.size() <<
". It must be >= 2.";
245 const unsigned int decRPId = copyNos[1];
256 const unsigned int id = copyNos[copyNos.size() - 1];
257 const unsigned int plane =
id / 100;
258 const unsigned int channel =
id % 100;
265 if (copyNos.size() < 2)
267 <<
"size of copyNumbers for diamond RP is " << copyNos.size() <<
". It must be >= 2.";
269 const unsigned int decRPId = copyNos[1];
290 const std::vector<int>& copyNos,
291 const unsigned int copyNum,
292 const bool isRun2)
const {
293 std::vector<int> copyNosOldDD = {copyNos.rbegin() + 1, copyNos.rend()};
308 if (foundFromDB != std::string::npos) {
315 if (foundFromXML != std::string::npos) {