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;
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 {
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];
214 const unsigned int rp =
decRPId % 10;
215 const unsigned int detector = copyNos[copyNos.size() - 1];
221 unsigned int decRPId = copyNum;
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];
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;
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];
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];
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()};
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::string DDD_CTPPS_PIXELS_RP_NAME
void applyAlignment(const CTPPSRPAlignmentCorrectionData &)
const std::string DDD_TOTEM_TIMING_RP_NAME
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME_2x2
const std::string DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2
void deepDeleteComponents()
std::vector< double > m_params
DiamondDimensions computeDiamondDimensions(const bool isABox, const bool isDD4hep, const std::vector< double > ¶ms) const
const std::string DDD_CTPPS_DIAMONDS_SEGMENT_NAME
DiamondDimensions m_diamondBoxParams
const std::string & sensorType() const
Geometrical description of a sensor.
DetId computeDetID(const std::string &name, const std::vector< int > ©Nos, const unsigned int copyNum, const bool isRun2) const
const std::string DDD_TOTEM_TIMING_SENSOR_TMPL
std::vector< Item > container_
const DiamondDimensions & getDiamondDimensions() const
std::string computeSensorType(std::string_view name)
const std::string DDD_TOTEM_RP_RP_NAME
DDD names of RP volumes.
std::vector< double > computeParameters(const cms::DDFilteredView &fv) const
const std::string DDD_CTPPS_DIAMONDS_RP_NAME
dd4hep::Solid solid() const
const std::string & name() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > Translation
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
std::string computeNameWithNoNamespace(std::string_view nameFromView) const
const std::string DDD_TOTEM_RP_SENSOR_NAME
DDD names of sensors.
DetId computeDetIDFromDD4hep(const std::string &name, const std::vector< int > ©Nos, const unsigned int copyNum, const bool isRun2) const
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
void addComponent(DetGeomDesc *)
DetGeomDesc(const DDFilteredView &fv, const bool isRun2)
ROOT::Math::Rotation3D RotationMatrix
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::vector< double > & params() const
const std::string DDD_CTPPS_UFSD_SEGMENT_NAME
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...