CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
DetGeomDesc Class Reference

#include <DetGeomDesc.h>

Public Types

using Container = std::vector< DetGeomDesc * >
 
enum  CopyMode { cmWithChildren, cmWithoutChildren }
 
using RotationMatrix = ROOT::Math::Rotation3D
 
using Translation = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > >
 

Public Member Functions

void addComponent (DetGeomDesc *)
 
void applyAlignment (const CTPPSRPAlignmentCorrectionData &)
 
const Containercomponents () const
 
int copyno () const
 
 DetGeomDesc (const DDFilteredView &fv, const bool isRun2)
 
 DetGeomDesc (const cms::DDFilteredView &fv, const bool isRun2)
 
 DetGeomDesc (const PDetGeomDesc &gd)
 
 DetGeomDesc (const PDetGeomDesc::Item &item)
 
 DetGeomDesc (const DetGeomDesc &ref, CopyMode cm=cmWithChildren)
 
DetId geographicalID () const
 
const DiamondDimensionsgetDiamondDimensions () const
 
void invertZSign ()
 
bool isABox () const
 
bool isDD4hep () const
 
bool isLeaf () const
 
const std::string & name () const
 
const std::vector< double > & params () const
 
float parentZPosition () const
 
void print () const
 
const RotationMatrixrotation () const
 
const std::string & sensorType () const
 
const Translationtranslation () const
 
virtual ~DetGeomDesc ()
 

Private Member Functions

void clearComponents ()
 
DetId computeDetID (const std::string &name, const std::vector< int > &copyNos, const unsigned int copyNum, const bool isRun2) const
 
DetId computeDetIDFromDD4hep (const std::string &name, const std::vector< int > &copyNos, const unsigned int copyNum, const bool isRun2) const
 
DiamondDimensions computeDiamondDimensions (const bool isABox, const bool isDD4hep, const std::vector< double > &params) const
 
std::string computeNameWithNoNamespace (std::string_view nameFromView) const
 
std::vector< double > computeParameters (const cms::DDFilteredView &fv) const
 
std::string computeSensorType (std::string_view name)
 
void deepDeleteComponents ()
 
void deleteComponents ()
 

Private Attributes

Container m_container
 
int m_copy
 
DiamondDimensions m_diamondBoxParams
 
DetId m_geographicalID
 
bool m_isABox
 
bool m_isDD4hep
 
std::string m_name
 
std::vector< double > m_params
 
RotationMatrix m_rot
 
std::string m_sensorType
 
Translation m_trans
 
float m_z
 

Detailed Description

Definition at line 51 of file DetGeomDesc.h.

Member Typedef Documentation

◆ Container

using DetGeomDesc::Container = std::vector<DetGeomDesc*>

Definition at line 53 of file DetGeomDesc.h.

◆ RotationMatrix

using DetGeomDesc::RotationMatrix = ROOT::Math::Rotation3D

Definition at line 54 of file DetGeomDesc.h.

◆ Translation

using DetGeomDesc::Translation = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double> >

Definition at line 55 of file DetGeomDesc.h.

Member Enumeration Documentation

◆ CopyMode

Enumerator
cmWithChildren 
cmWithoutChildren 

Definition at line 69 of file DetGeomDesc.h.

Constructor & Destructor Documentation

◆ DetGeomDesc() [1/5]

DetGeomDesc::DetGeomDesc ( const DDFilteredView fv,
const bool  isRun2 
)
Parameters
[in]isRun2Switch between legacy run 2-like geometry and 2021+ scenarii

Definition at line 29 of file DetGeomDesc.cc.

References ddbox.

Referenced by DetGeomDesc().

31  m_copy(fv.copyno()),
32  m_isDD4hep(false),
33  m_trans(fv.translation()), // mm (legacy)
34  m_rot(fv.rotation()),
35  m_params(fv.parameters()), // default unit from old DD (mm)
40  m_z(fv.translation().z()) // mm (legacy)
41 {}
Translation m_trans
Definition: DetGeomDesc.h:140
nav_type copyNumbers() const
return the stack of copy numbers
std::string m_name
Definition: DetGeomDesc.h:137
const std::vector< double > & parameters() const
std::string m_sensorType
Definition: DetGeomDesc.h:145
const std::string & name() const
The name of a logical-part of the current node in the filtered-view.
std::vector< double > m_params
Definition: DetGeomDesc.h:142
DiamondDimensions computeDiamondDimensions(const bool isABox, const bool isDD4hep, const std::vector< double > &params) const
Definition: DetGeomDesc.cc:177
DiamondDimensions m_diamondBoxParams
Definition: DetGeomDesc.h:144
DetId computeDetID(const std::string &name, const std::vector< int > &copyNos, const unsigned int copyNum, const bool isRun2) const
Definition: DetGeomDesc.cc:197
std::string computeSensorType(std::string_view name)
Definition: DetGeomDesc.cc:334
const N & name() const
Definition: DDBase.h:59
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const DDSolidShape shape() const
int copyno() const
Copy number associated with the current node.
const std::string fullname() const
Definition: DDName.h:43
bool m_isDD4hep
Definition: DetGeomDesc.h:139
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
DetId m_geographicalID
Definition: DetGeomDesc.h:146
std::string computeNameWithNoNamespace(std::string_view nameFromView) const
Definition: DetGeomDesc.cc:156
const DDTranslation & translation() const
The absolute translation of the current node.
RotationMatrix m_rot
Definition: DetGeomDesc.h:141

◆ DetGeomDesc() [2/5]

DetGeomDesc::DetGeomDesc ( const cms::DDFilteredView fv,
const bool  isRun2 
)
Parameters
[in]isRun2Switch between legacy run 2-like geometry and 2021+ scenarii

Definition at line 46 of file DetGeomDesc.cc.

48  m_copy(fv.copyNum()),
49  m_isDD4hep(true),
50  m_trans(fv.translation() / dd4hep::mm), // converted from DD4hep unit to mm
51  m_rot(fv.rotation()),
52  m_params(computeParameters(fv)), // default unit from DD4hep
53  m_isABox(dd4hep::isA<dd4hep::Box>(fv.solid())),
54  m_diamondBoxParams(computeDiamondDimensions(m_isABox, m_isDD4hep, m_params)), // converted from DD4hep unit to mm
57  m_z(fv.translation().z() / dd4hep::mm) // converted from DD4hep unit to mm
58 {}
Translation m_trans
Definition: DetGeomDesc.h:140
const std::vector< int > copyNos() const
The list of the volume copy numbers.
std::string m_name
Definition: DetGeomDesc.h:137
std::string m_sensorType
Definition: DetGeomDesc.h:145
std::vector< double > m_params
Definition: DetGeomDesc.h:142
DiamondDimensions computeDiamondDimensions(const bool isABox, const bool isDD4hep, const std::vector< double > &params) const
Definition: DetGeomDesc.cc:177
std::string_view name() const
DiamondDimensions m_diamondBoxParams
Definition: DetGeomDesc.h:144
unsigned short copyNum() const
std::string computeSensorType(std::string_view name)
Definition: DetGeomDesc.cc:334
std::vector< double > computeParameters(const cms::DDFilteredView &fv) const
Definition: DetGeomDesc.cc:165
bool m_isDD4hep
Definition: DetGeomDesc.h:139
dd4hep::Solid solid() const
const RotationMatrix rotation() const
DetId m_geographicalID
Definition: DetGeomDesc.h:146
std::string computeNameWithNoNamespace(std::string_view nameFromView) const
Definition: DetGeomDesc.cc:156
DetId computeDetIDFromDD4hep(const std::string &name, const std::vector< int > &copyNos, const unsigned int copyNum, const bool isRun2) const
Definition: DetGeomDesc.cc:321
RotationMatrix m_rot
Definition: DetGeomDesc.h:141
const Translation translation() const

◆ DetGeomDesc() [3/5]

DetGeomDesc::DetGeomDesc ( const PDetGeomDesc gd)

Definition at line 103 of file DetGeomDesc.cc.

References addComponent(), PDetGeomDesc::container_, DetGeomDesc(), and mps_fire::i.

103  : m_copy(0), m_isDD4hep(false), m_isABox(false), m_z(0) {
104  for (const auto& i : pd.container_) {
105  DetGeomDesc* gd = new DetGeomDesc(i);
106  this->addComponent(gd);
107  }
108 }
bool m_isDD4hep
Definition: DetGeomDesc.h:139
void addComponent(DetGeomDesc *)
Definition: DetGeomDesc.cc:112
DetGeomDesc(const DDFilteredView &fv, const bool isRun2)
Definition: DetGeomDesc.cc:29

◆ DetGeomDesc() [4/5]

DetGeomDesc::DetGeomDesc ( const PDetGeomDesc::Item item)

Definition at line 79 of file DetGeomDesc.cc.

References computeDiamondDimensions(), DDD_CTPPS_DIAMONDS_SEGMENT_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME_2x2, DDD_CTPPS_UFSD_SEGMENT_NAME, DDD_TOTEM_TIMING_SENSOR_TMPL, B2GTnPMonitor_cfi::item, m_diamondBoxParams, m_isABox, m_isDD4hep, m_name, m_params, m_rot, m_trans, and makeMuonMisalignmentScenario::rot.

80  : m_name(item.name_),
81  m_copy(item.copy_),
82  m_isDD4hep(true),
83  m_params(item.params_), // default unit from DD4hep
84  m_sensorType(item.sensorType_),
85  m_geographicalID(item.geographicalID_),
86  m_z(item.z_) // converted from DD4hep to mm
87 {
88  Translation trans(item.dx_, item.dy_, item.dz_);
89  m_trans = trans;
90  RotationMatrix rot(item.axx_, item.axy_, item.axz_, item.ayx_, item.ayy_, item.ayz_, item.azx_, item.azy_, item.azz_);
91  m_rot = rot;
92  // Set the m_isABox flag for the box shaped sensors, so that m_params are properly set
95  m_name.substr(0, 7) == DDD_TOTEM_TIMING_SENSOR_TMPL.substr(0, 7)) &&
96  m_params.size() > 2)
97  m_isABox = true;
98  else
99  m_isABox = false;
101 }
Translation m_trans
Definition: DetGeomDesc.h:140
std::string m_name
Definition: DetGeomDesc.h:137
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > Translation
std::string m_sensorType
Definition: DetGeomDesc.h:145
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME_2x2
Definition: CTPPSDDDNames.h:16
std::vector< double > m_params
Definition: DetGeomDesc.h:142
DiamondDimensions computeDiamondDimensions(const bool isABox, const bool isDD4hep, const std::vector< double > &params) const
Definition: DetGeomDesc.cc:177
const std::string DDD_CTPPS_DIAMONDS_SEGMENT_NAME
Definition: CTPPSDDDNames.h:18
DiamondDimensions m_diamondBoxParams
Definition: DetGeomDesc.h:144
const std::string DDD_TOTEM_TIMING_SENSOR_TMPL
Definition: CTPPSDDDNames.h:20
ROOT::Math::Rotation3D RotationMatrix
bool m_isDD4hep
Definition: DetGeomDesc.h:139
DetId m_geographicalID
Definition: DetGeomDesc.h:146
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:15
RotationMatrix m_rot
Definition: DetGeomDesc.h:141
const std::string DDD_CTPPS_UFSD_SEGMENT_NAME
Definition: CTPPSDDDNames.h:19

◆ ~DetGeomDesc()

DetGeomDesc::~DetGeomDesc ( )
virtual

Definition at line 110 of file DetGeomDesc.cc.

References deepDeleteComponents().

void deepDeleteComponents()
Definition: DetGeomDesc.cc:149

◆ DetGeomDesc() [5/5]

DetGeomDesc::DetGeomDesc ( const DetGeomDesc ref,
CopyMode  cm = cmWithChildren 
)

Definition at line 60 of file DetGeomDesc.cc.

References cmWithChildren, m_container, m_copy, m_diamondBoxParams, m_geographicalID, m_isABox, m_isDD4hep, m_name, m_params, m_rot, m_sensorType, m_trans, and m_z.

60  {
61  m_name = ref.m_name;
62  m_copy = ref.m_copy;
63  m_isDD4hep = ref.m_isDD4hep;
64  m_trans = ref.m_trans;
65  m_rot = ref.m_rot;
66  m_params = ref.m_params;
67  m_isABox = ref.m_isABox;
71 
72  if (cm == cmWithChildren)
74 
75  m_z = ref.m_z;
76 }
Translation m_trans
Definition: DetGeomDesc.h:140
Container m_container
Definition: DetGeomDesc.h:148
std::string m_name
Definition: DetGeomDesc.h:137
std::string m_sensorType
Definition: DetGeomDesc.h:145
std::vector< double > m_params
Definition: DetGeomDesc.h:142
DiamondDimensions m_diamondBoxParams
Definition: DetGeomDesc.h:144
bool m_isDD4hep
Definition: DetGeomDesc.h:139
DetId m_geographicalID
Definition: DetGeomDesc.h:146
RotationMatrix m_rot
Definition: DetGeomDesc.h:141

Member Function Documentation

◆ addComponent()

void DetGeomDesc::addComponent ( DetGeomDesc det)

Definition at line 112 of file DetGeomDesc.cc.

References m_container.

Referenced by CTPPSGeometryESCommon::applyAlignments(), detgeomdescbuilder::buildDetGeomDescDescendants(), and DetGeomDesc().

112 { m_container.emplace_back(det); }
Container m_container
Definition: DetGeomDesc.h:148

◆ applyAlignment()

void DetGeomDesc::applyAlignment ( const CTPPSRPAlignmentCorrectionData t)

Definition at line 114 of file DetGeomDesc.cc.

References m_rot, m_trans, and submitPVValidationJobs::t.

Referenced by CTPPSGeometryESCommon::applyAlignments().

114  {
115  m_rot = t.getRotationMatrix() * m_rot;
116  m_trans = t.getTranslation() + m_trans;
117 }
Translation m_trans
Definition: DetGeomDesc.h:140
RotationMatrix m_rot
Definition: DetGeomDesc.h:141

◆ clearComponents()

void DetGeomDesc::clearComponents ( )
inlineprivate

Definition at line 120 of file DetGeomDesc.h.

References m_container.

Referenced by deepDeleteComponents().

120 { m_container.resize(0); }
Container m_container
Definition: DetGeomDesc.h:148

◆ components()

const Container& DetGeomDesc::components ( ) const
inline

Definition at line 105 of file DetGeomDesc.h.

References m_container.

Referenced by CTPPSGeometryESCommon::applyAlignments(), and PPSGeometryBuilder::buildSerializableDataFromGeoInfo().

105 { return m_container; }
Container m_container
Definition: DetGeomDesc.h:148

◆ computeDetID()

DetId DetGeomDesc::computeDetID ( const std::string &  name,
const std::vector< int > &  copyNos,
const unsigned int  copyNum,
const bool  isRun2 
) const
private

Definition at line 197 of file DetGeomDesc.cc.

References protons_cff::arm, DDD_CTPPS_DIAMONDS_RP_NAME, DDD_CTPPS_DIAMONDS_SEGMENT_NAME, DDD_CTPPS_PIXELS_RP_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME_2x2, DDD_CTPPS_UFSD_SEGMENT_NAME, DDD_TOTEM_RP_RP_NAME, DDD_TOTEM_RP_SENSOR_NAME, DDD_TOTEM_TIMING_RP_NAME, DDD_TOTEM_TIMING_SENSOR_TMPL, protons_cff::decRPId, hgcalTestNeighbor_cfi::detector, geometryPPS_CMSxz_fromDD_2016_cfi::isRun2, name(), and relativeConstraints::station.

Referenced by computeDetIDFromDD4hep().

200  {
201  DetId geoID;
202 
203  // strip sensors
205  // check size of copy numbers vector
206  if (copyNos.size() < 3)
207  throw cms::Exception("DDDTotemRPConstruction")
208  << "size of copyNumbers for strip sensor is " << copyNos.size() << ". It must be >= 3.";
209 
210  // extract information
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];
216  geoID = TotemRPDetId(arm, station, rp, detector);
217  }
218 
219  // strip and pixels RPs
221  unsigned int decRPId = copyNum;
222 
223  // check if it is a pixel RP
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;
229  geoID = CTPPSPixelDetId(armIdx, stIdx, rpIdx);
230  } else {
231  const unsigned int armIdx = (decRPId / 100) % 10;
232  const unsigned int stIdx = (decRPId / 10) % 10;
233  const unsigned int rpIdx = decRPId % 10;
234  geoID = TotemRPDetId(armIdx, stIdx, rpIdx);
235  }
236  }
237 
238  else if (std::regex_match(name, std::regex(DDD_TOTEM_TIMING_SENSOR_TMPL))) {
239  // check size of copy numbers vector
240  if (copyNos.size() < 4)
241  throw cms::Exception("DDDTotemRPConstruction")
242  << "size of copyNumbers for TOTEM timing sensor is " << copyNos.size() << ". It must be >= 4.";
243 
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];
247  geoID = TotemTimingDetId(arm, station, rp, plane, channel);
248  }
249 
250  else if (name == DDD_TOTEM_TIMING_RP_NAME) {
251  const unsigned int arm = copyNum / 100, station = (copyNum % 100) / 10, rp = copyNum % 10;
252  geoID = TotemTimingDetId(arm, station, rp);
253  }
254 
255  // pixel sensors
257  // check size of copy numbers vector
258  if (copyNos.size() < 4)
259  throw cms::Exception("DDDTotemRPConstruction")
260  << "size of copyNumbers for pixel sensor is " << copyNos.size() << ". It must be >= 4.";
261 
262  // extract information
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;
268  geoID = CTPPSPixelDetId(arm, station, rp, detector);
269  }
270 
271  // diamond/UFSD sensors
273  // check size of copy numbers vector
274  if (copyNos.size() < 2)
275  throw cms::Exception("DDDTotemRPConstruction")
276  << "size of copyNumbers for diamond segments is " << copyNos.size() << ". It must be >= 2.";
277  const unsigned int decRPId = copyNos[1];
278  unsigned int arm, station, rp;
279  if (isRun2) {
280  arm = decRPId - 1;
281  station = 1;
282  rp = 6;
283  } else {
284  arm = (decRPId % 1000) / 100;
285  station = (decRPId % 100) / 10;
286  rp = decRPId % 10;
287  }
288  const unsigned int id = copyNos[copyNos.size() - 1];
289  const unsigned int plane = id / 100;
290  const unsigned int channel = id % 100;
291  geoID = CTPPSDiamondDetId(arm, station, rp, plane, channel);
292  }
293 
294  // diamond/UFSD RPs
295  else if (name == DDD_CTPPS_DIAMONDS_RP_NAME) {
296  // check size of copy numbers vector
297  if (copyNos.size() < 2)
298  throw cms::Exception("DDDTotemRPConstruction")
299  << "size of copyNumbers for diamond RP is " << copyNos.size() << ". It must be >= 2.";
300 
301  const unsigned int decRPId = copyNos[1];
302  unsigned int arm, station, rp;
303  if (isRun2) {
304  arm = decRPId - 1;
305  station = 1;
306  rp = 6;
307  } else {
308  arm = (decRPId % 1000) / 100;
309  station = (decRPId % 100) / 10;
310  rp = decRPId % 10;
311  }
312  geoID = CTPPSDiamondDetId(arm, station, rp);
313  }
314 
315  return geoID;
316 }
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
const std::string DDD_CTPPS_PIXELS_RP_NAME
Definition: CTPPSDDDNames.h:24
const std::string DDD_TOTEM_TIMING_RP_NAME
Definition: CTPPSDDDNames.h:27
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME_2x2
Definition: CTPPSDDDNames.h:16
const std::string DDD_CTPPS_DIAMONDS_SEGMENT_NAME
Definition: CTPPSDDDNames.h:18
const std::string DDD_TOTEM_TIMING_SENSOR_TMPL
Definition: CTPPSDDDNames.h:20
Definition: DetId.h:17
const std::string DDD_TOTEM_RP_RP_NAME
DDD names of RP volumes.
Definition: CTPPSDDDNames.h:23
const std::string DDD_CTPPS_DIAMONDS_RP_NAME
Definition: CTPPSDDDNames.h:26
const std::string & name() const
Definition: DetGeomDesc.h:73
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.
Definition: CTPPSDDDNames.h:14
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:15
const std::string DDD_CTPPS_UFSD_SEGMENT_NAME
Definition: CTPPSDDDNames.h:19
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...

◆ computeDetIDFromDD4hep()

DetId DetGeomDesc::computeDetIDFromDD4hep ( const std::string &  name,
const std::vector< int > &  copyNos,
const unsigned int  copyNum,
const bool  isRun2 
) const
private

Definition at line 321 of file DetGeomDesc.cc.

References computeDetID(), geometryPPS_CMSxz_fromDD_2016_cfi::isRun2, and name().

324  {
325  std::vector<int> copyNosOldDD = {copyNos.rbegin() + 1, copyNos.rend()};
326 
327  return computeDetID(name, copyNosOldDD, copyNum, isRun2);
328 }
DetId computeDetID(const std::string &name, const std::vector< int > &copyNos, const unsigned int copyNum, const bool isRun2) const
Definition: DetGeomDesc.cc:197
const std::string & name() const
Definition: DetGeomDesc.h:73

◆ computeDiamondDimensions()

DiamondDimensions DetGeomDesc::computeDiamondDimensions ( const bool  isABox,
const bool  isDD4hep,
const std::vector< double > &  params 
) const
private

Definition at line 177 of file DetGeomDesc.cc.

References isABox(), isDD4hep(), and params().

Referenced by DetGeomDesc().

179  {
180  DiamondDimensions boxShapeParameters{};
181  if (isABox) {
182  if (!isDD4hep) {
183  // mm (old DD)
184  boxShapeParameters = {params.at(0), params.at(1), params.at(2)};
185  } else {
186  // convert from DD4hep unit to mm (mm is legacy expected by PPS reco software)
187  boxShapeParameters = {params.at(0) / dd4hep::mm, params.at(1) / dd4hep::mm, params.at(2) / dd4hep::mm};
188  }
189  }
190  return boxShapeParameters;
191 }
Geometrical description of a sensor.
Definition: DetGeomDesc.h:45
bool isABox() const
Definition: DetGeomDesc.h:89
bool isDD4hep() const
Definition: DetGeomDesc.h:77
const std::vector< double > & params() const
Definition: DetGeomDesc.h:88

◆ computeNameWithNoNamespace()

std::string DetGeomDesc::computeNameWithNoNamespace ( std::string_view  nameFromView) const
private

Definition at line 156 of file DetGeomDesc.cc.

References name(), and AlCaHLTBitMon_QueryRunRegistry::string.

156  {
157  const auto& semiColonPos = nameFromView.find(':');
158  const std::string name{(semiColonPos != std::string::npos ? nameFromView.substr(semiColonPos + 1) : nameFromView)};
159  return name;
160 }
const std::string & name() const
Definition: DetGeomDesc.h:73

◆ computeParameters()

std::vector< double > DetGeomDesc::computeParameters ( const cms::DDFilteredView fv) const
private

Definition at line 165 of file DetGeomDesc.cc.

References cms::DDFilteredView::solid().

165  {
166  auto myShape = fv.solid();
167  const std::vector<double>& parameters = myShape.dimensions(); // default unit from DD4hep (cm)
168  return parameters;
169 }
dd4hep::Solid solid() const

◆ computeSensorType()

std::string DetGeomDesc::computeSensorType ( std::string_view  name)
private

Definition at line 334 of file DetGeomDesc.cc.

References DDD_CTPPS_PIXELS_SENSOR_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME_2x2, DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2, name(), sensorType(), and AlCaHLTBitMon_QueryRunRegistry::string.

334  {
336 
337  // Case A: Construction from DB.
338  // Namespace is present, and allow identification of 2x2 sensor type: just look for "2x2:RPixWafer" in name.
339  const auto& foundFromDB = name.find(DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2 + ":" + DDD_CTPPS_PIXELS_SENSOR_NAME);
340  if (foundFromDB != std::string::npos) {
342  }
343 
344  // Case B: Construction from XMLs.
345  // Volume name allows identification of 2x2 sensor type: just look whether name is "RPixWafer2x2".
346  const auto& foundFromXML = name.find(DDD_CTPPS_PIXELS_SENSOR_NAME_2x2);
347  if (foundFromXML != std::string::npos) {
349  }
350 
351  return sensorType;
352 }
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME_2x2
Definition: CTPPSDDDNames.h:16
const std::string DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2
Definition: CTPPSDDDNames.h:17
const std::string & sensorType() const
Definition: DetGeomDesc.h:99
const std::string & name() const
Definition: DetGeomDesc.h:73
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:15

◆ copyno()

int DetGeomDesc::copyno ( ) const
inline

Definition at line 74 of file DetGeomDesc.h.

References m_copy.

Referenced by PPSGeometryBuilder::buildItemFromDetGeomDesc().

74 { return m_copy; }

◆ deepDeleteComponents()

void DetGeomDesc::deepDeleteComponents ( )
private

Definition at line 149 of file DetGeomDesc.cc.

References clearComponents(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and m_container.

Referenced by ~DetGeomDesc().

149  {
150  for (auto& it : m_container) {
151  delete it; // the destructor calls deepDeleteComponents
152  }
153  clearComponents();
154 }
Container m_container
Definition: DetGeomDesc.h:148
void clearComponents()
Definition: DetGeomDesc.h:120

◆ deleteComponents()

void DetGeomDesc::deleteComponents ( )
private

Definition at line 147 of file DetGeomDesc.cc.

References m_container.

147 { m_container.erase(m_container.begin(), m_container.end()); }
Container m_container
Definition: DetGeomDesc.h:148

◆ geographicalID()

DetId DetGeomDesc::geographicalID ( ) const
inline

◆ getDiamondDimensions()

const DiamondDimensions& DetGeomDesc::getDiamondDimensions ( ) const
inline

Definition at line 90 of file DetGeomDesc.h.

References geographicalID(), isABox(), m_diamondBoxParams, and name().

Referenced by CTPPSDiamondRecHitProducerAlgorithm::build(), TotemTimingRecHitProducerAlgorithm::build(), channelAlignedWithTrack(), TotemTimingDQMSource::dqmBeginRun(), DiamondSampicDQMSource::dqmBeginRun(), DiamondSampicCalibrationDQMSource::dqmBeginRun(), and print().

90  {
91  if (!isABox()) {
92  edm::LogError("DetGeomDesc::getDiamondDimensions is not called on a box, for solid ")
93  << name() << ", Id = " << geographicalID();
94  }
95  return m_diamondBoxParams;
96  } // in mm
DetId geographicalID() const
Definition: DetGeomDesc.h:102
Log< level::Error, false > LogError
DiamondDimensions m_diamondBoxParams
Definition: DetGeomDesc.h:144
bool isABox() const
Definition: DetGeomDesc.h:89
const std::string & name() const
Definition: DetGeomDesc.h:73

◆ invertZSign()

void DetGeomDesc::invertZSign ( )
inline

Definition at line 115 of file DetGeomDesc.h.

References m_trans.

115 { m_trans.SetZ(-m_trans.z()); }
Translation m_trans
Definition: DetGeomDesc.h:140

◆ isABox()

bool DetGeomDesc::isABox ( ) const
inline

Definition at line 89 of file DetGeomDesc.h.

References m_isABox.

Referenced by computeDiamondDimensions(), and getDiamondDimensions().

89 { return m_isABox; }

◆ isDD4hep()

bool DetGeomDesc::isDD4hep ( ) const
inline

Definition at line 77 of file DetGeomDesc.h.

References m_isDD4hep.

Referenced by computeDiamondDimensions().

77 { return m_isDD4hep; }
bool m_isDD4hep
Definition: DetGeomDesc.h:139

◆ isLeaf()

bool DetGeomDesc::isLeaf ( ) const
inline

Definition at line 108 of file DetGeomDesc.h.

References m_container.

108 { return m_container.empty(); }
Container m_container
Definition: DetGeomDesc.h:148

◆ name()

const std::string& DetGeomDesc::name ( void  ) const
inline

◆ params()

const std::vector<double>& DetGeomDesc::params ( ) const
inline

Definition at line 88 of file DetGeomDesc.h.

References m_params.

Referenced by PPSGeometryBuilder::buildItemFromDetGeomDesc(), computeDiamondDimensions(), and TotemT2Tile::TotemT2Tile().

88 { return m_params; } // default unit: mm for oldDD, DD4hep unit for DD4hep
std::vector< double > m_params
Definition: DetGeomDesc.h:142

◆ parentZPosition()

float DetGeomDesc::parentZPosition ( ) const
inline

◆ print()

void DetGeomDesc::print ( void  ) const

Definition at line 119 of file DetGeomDesc.cc.

References alignBH_cfg::fixed, getDiamondDimensions(), m_copy, m_geographicalID, m_isABox, m_name, m_rot, m_sensorType, m_trans, m_z, DiamondDimensions::xHalfWidth, DiamondDimensions::yHalfWidth, and DiamondDimensions::zHalfWidth.

119  {
120  edm::LogVerbatim("DetGeomDesc::print") << "............................." << std::endl;
121  edm::LogVerbatim("DetGeomDesc::print") << "name = " << m_name << std::endl;
122  edm::LogVerbatim("DetGeomDesc::print") << "copy = " << m_copy << std::endl;
123  edm::LogVerbatim("DetGeomDesc::print") << "translation = " << std::fixed << std::setprecision(7) << m_trans
124  << std::endl;
125  edm::LogVerbatim("DetGeomDesc::print") << "rotation = " << std::fixed << std::setprecision(7) << m_rot << std::endl;
126 
127  if (m_isABox) {
128  edm::LogVerbatim("DetGeomDesc::print")
129  << "getDiamondDimensions() = " << std::fixed << std::setprecision(7) << getDiamondDimensions().xHalfWidth << " "
130  << getDiamondDimensions().yHalfWidth << " " << getDiamondDimensions().zHalfWidth << std::endl;
131  }
132 
133  edm::LogVerbatim("DetGeomDesc::print") << "sensorType = " << m_sensorType << std::endl;
134 
135  if (m_geographicalID() != 0) {
136  edm::LogVerbatim("DetGeomDesc::print") << "geographicalID() = " << m_geographicalID << std::endl;
137  }
138 
139  edm::LogVerbatim("DetGeomDesc::print") << "parentZPosition() = " << std::fixed << std::setprecision(7) << m_z
140  << std::endl;
141 }
Log< level::Info, true > LogVerbatim
Translation m_trans
Definition: DetGeomDesc.h:140
std::string m_name
Definition: DetGeomDesc.h:137
std::string m_sensorType
Definition: DetGeomDesc.h:145
const DiamondDimensions & getDiamondDimensions() const
Definition: DetGeomDesc.h:90
DetId m_geographicalID
Definition: DetGeomDesc.h:146
RotationMatrix m_rot
Definition: DetGeomDesc.h:141

◆ rotation()

const RotationMatrix& DetGeomDesc::rotation ( void  ) const
inline

◆ sensorType()

const std::string& DetGeomDesc::sensorType ( ) const
inline

Definition at line 99 of file DetGeomDesc.h.

References m_sensorType.

Referenced by PPSGeometryBuilder::buildItemFromDetGeomDesc(), and computeSensorType().

99 { return m_sensorType; }
std::string m_sensorType
Definition: DetGeomDesc.h:145

◆ translation()

const Translation& DetGeomDesc::translation ( void  ) const
inline

Member Data Documentation

◆ m_container

Container DetGeomDesc::m_container
private

◆ m_copy

int DetGeomDesc::m_copy
private

Definition at line 138 of file DetGeomDesc.h.

Referenced by copyno(), DetGeomDesc(), and print().

◆ m_diamondBoxParams

DiamondDimensions DetGeomDesc::m_diamondBoxParams
private

Definition at line 144 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), and getDiamondDimensions().

◆ m_geographicalID

DetId DetGeomDesc::m_geographicalID
private

Definition at line 146 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), geographicalID(), and print().

◆ m_isABox

bool DetGeomDesc::m_isABox
private

Definition at line 143 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), isABox(), and print().

◆ m_isDD4hep

bool DetGeomDesc::m_isDD4hep
private

Definition at line 139 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), and isDD4hep().

◆ m_name

std::string DetGeomDesc::m_name
private

Definition at line 137 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), name(), and print().

◆ m_params

std::vector<double> DetGeomDesc::m_params
private

Definition at line 142 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), and params().

◆ m_rot

RotationMatrix DetGeomDesc::m_rot
private

Definition at line 141 of file DetGeomDesc.h.

Referenced by applyAlignment(), DetGeomDesc(), print(), and rotation().

◆ m_sensorType

std::string DetGeomDesc::m_sensorType
private

Definition at line 145 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), print(), and sensorType().

◆ m_trans

Translation DetGeomDesc::m_trans
private

Definition at line 140 of file DetGeomDesc.h.

Referenced by applyAlignment(), DetGeomDesc(), invertZSign(), print(), and translation().

◆ m_z

float DetGeomDesc::m_z
private

Definition at line 149 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), parentZPosition(), and print().