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)
83 m_params(item.params_),
84 m_sensorType(item.sensorType_),
85 m_geographicalID(item.geographicalID_),
120 edm::LogVerbatim(
"DetGeomDesc::print") <<
"............................." << std::endl;
125 edm::LogVerbatim(
"DetGeomDesc::print") <<
"rotation = " << std::fixed << std::setprecision(7) <<
m_rot << std::endl;
139 edm::LogVerbatim(
"DetGeomDesc::print") <<
"parentZPosition() = " << std::fixed << std::setprecision(7) <<
m_z
157 const auto& semiColonPos = nameFromView.find(
':');
158 const std::string name{(semiColonPos != std::string::npos ? nameFromView.substr(semiColonPos + 1) : nameFromView)};
166 auto myShape = fv.
solid();
167 const std::vector<double>&
parameters = myShape.dimensions();
179 const std::vector<double>&
params)
const {
184 boxShapeParameters = {params.at(0), params.at(1), params.at(2)};
187 boxShapeParameters = {params.at(0) / dd4hep::mm, params.at(1) / dd4hep::mm, params.at(2) / dd4hep::mm};
190 return boxShapeParameters;
198 const std::vector<int>& copyNos,
199 const unsigned int copyNum,
200 const bool isRun2)
const {
206 if (copyNos.size() < 3)
208 <<
"size of copyNumbers for strip sensor is " << copyNos.size() <<
". It must be >= 3.";
211 const unsigned int decRPId = copyNos[copyNos.size() - 3];
212 const unsigned int arm = decRPId / 100;
213 const unsigned int station = (decRPId % 100) / 10;
214 const unsigned int rp = decRPId % 10;
215 const unsigned int detector = copyNos[copyNos.size() - 1];
221 unsigned int decRPId = copyNum;
224 if (decRPId >= 10000) {
225 decRPId = decRPId % 10000;
226 const unsigned int armIdx = (decRPId / 100) % 10;
227 const unsigned int stIdx = (decRPId / 10) % 10;
228 const unsigned int rpIdx = decRPId % 10;
231 const unsigned int armIdx = (decRPId / 100) % 10;
232 const unsigned int stIdx = (decRPId / 10) % 10;
233 const unsigned int rpIdx = decRPId % 10;
240 if (copyNos.size() < 4)
242 <<
"size of copyNumbers for TOTEM timing sensor is " << copyNos.size() <<
". It must be >= 4.";
244 const unsigned int decRPId = copyNos[copyNos.size() - 4];
245 const unsigned int arm = decRPId / 100,
station = (decRPId % 100) / 10, rp = decRPId % 10;
246 const unsigned int plane = copyNos[copyNos.size() - 2], channel = copyNos[copyNos.size() - 1];
251 const unsigned int arm = copyNum / 100,
station = (copyNum % 100) / 10, rp = copyNum % 10;
258 if (copyNos.size() < 4)
260 <<
"size of copyNumbers for pixel sensor is " << copyNos.size() <<
". It must be >= 4.";
263 const unsigned int decRPId = copyNos[copyNos.size() - 4] % 10000;
264 const unsigned int arm = decRPId / 100;
265 const unsigned int station = (decRPId % 100) / 10;
266 const unsigned int rp = decRPId % 10;
267 const unsigned int detector = copyNos[copyNos.size() - 2] - 1;
274 if (copyNos.size() < 2)
276 <<
"size of copyNumbers for diamond segments is " << copyNos.size() <<
". It must be >= 2.";
277 const unsigned int decRPId = copyNos[1];
284 arm = (decRPId % 1000) / 100;
285 station = (decRPId % 100) / 10;
288 const unsigned int id = copyNos[copyNos.size() - 1];
289 const unsigned int plane =
id / 100;
290 const unsigned int channel =
id % 100;
297 if (copyNos.size() < 2)
299 <<
"size of copyNumbers for diamond RP is " << copyNos.size() <<
". It must be >= 2.";
301 const unsigned int decRPId = copyNos[1];
308 arm = (decRPId % 1000) / 100;
309 station = (decRPId % 100) / 10;
322 const std::vector<int>& copyNos,
323 const unsigned int copyNum,
324 const bool isRun2)
const {
325 std::vector<int> copyNosOldDD = {copyNos.rbegin() + 1, copyNos.rend()};
327 return computeDetID(name, copyNosOldDD, copyNum, isRun2);
340 if (foundFromDB != std::string::npos) {
347 if (foundFromXML != std::string::npos) {
Detector ID class for TOTEM Si strip detectors.
Log< level::Info, true > LogVerbatim
const std::vector< double > & params() const
const std::string DDD_CTPPS_PIXELS_RP_NAME
const std::string & sensorType() const
const DiamondDimensions & getDiamondDimensions() const
void applyAlignment(const CTPPSRPAlignmentCorrectionData &)
std::string computeNameWithNoNamespace(std::string_view nameFromView) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> Translation
ROOT::Math::Rotation3D getRotationMatrix() const
const std::string DDD_TOTEM_TIMING_RP_NAME
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME_2x2
math::XYZVectorD getTranslation() const
const std::string DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2
void deepDeleteComponents()
std::vector< double > m_params
const std::string DDD_CTPPS_DIAMONDS_SEGMENT_NAME
DiamondDimensions m_diamondBoxParams
DiamondDimensions computeDiamondDimensions(const bool isABox, const bool isDD4hep, const std::vector< double > ¶ms) const
Geometrical description of a sensor.
const std::string DDD_TOTEM_TIMING_SENSOR_TMPL
std::vector< Item > container_
DetId computeDetIDFromDD4hep(const std::string &name, const std::vector< int > ©Nos, const unsigned int copyNum, const bool isRun2) const
std::string computeSensorType(std::string_view name)
const std::string & name() const
const std::string DDD_TOTEM_RP_RP_NAME
DDD names of RP volumes.
DetId computeDetID(const std::string &name, const std::vector< int > ©Nos, const unsigned int copyNum, const bool isRun2) const
const std::string DDD_CTPPS_DIAMONDS_RP_NAME
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
const std::string DDD_TOTEM_RP_SENSOR_NAME
DDD names of sensors.
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
std::vector< double > computeParameters(const cms::DDFilteredView &fv) const
void addComponent(DetGeomDesc *)
DetGeomDesc(const DDFilteredView &fv, const bool isRun2)
ROOT::Math::Rotation3D RotationMatrix
dd4hep::Solid solid() const
Alignment correction for an element of the CT-PPS detector. Within the geometry description, every sensor (more generally every element) is given its translation and rotation. These two quantities shall be understood in local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then it holds.
const std::string DDD_CTPPS_UFSD_SEGMENT_NAME
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...