CMS 3D CMS Logo

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

#include <GeometricDet.h>

Public Types

using ConstGeometricDetContainer = std::vector< GeometricDet const * >
 
enum  GDEnumType {
  unknown = 100, Tracker = 0, PixelBarrel = 1, PixelEndCap = 2,
  TIB = 3, TID = 4, TOB = 5, TEC = 6,
  layer = 8, wheel = 9, strng = 10, rod = 11,
  petal = 12, ring = 13, ladder = 14, mergedDet = 15,
  DetUnit = 16, disk = 17, panel = 18, PixelPhase1Barrel = 101,
  PixelPhase1EndCap = 102, PixelPhase1Disk = 117, OTPhase2EndCap = 204, OTPhase2Barrel = 205,
  OTPhase2Layer = 208, OTPhase2Stack = 215, PixelPhase2Barrel = 201, PixelPhase2EndCap = 202,
  OTPhase2Wheel = 209, PixelPhase2FullDisk = 217, PixelPhase2ReducedDisk = 227, PixelPhase2TDRDisk = 237,
  PixelPhase2DoubleDisk = 347, PixelPhase2SubDisk = 357
}
 
using GeometricDetContainer = std::vector< GeometricDet * >
 
typedef enum GeometricDet::GDEnumType GeometricEnumType
 
using nav_type = std::vector< int >
 
using NavRange = std::pair< int const *, size_t >
 
using Position = Surface::PositionType
 
using Rotation = Surface::RotationType
 
using RotationMatrix = ROOT::Math::Rotation3D
 
using Translation = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > >
 

Public Member Functions

void addComponent (GeometricDet *)
 
void addComponents (GeometricDetContainer const &cont)
 
void addComponents (ConstGeometricDetContainer const &cont)
 
std::unique_ptr< Boundsbounds () const
 
void clearComponents ()
 
GeometricDetcomponent (size_t index)
 
ConstGeometricDetContainercomponents ()
 
const ConstGeometricDetContainercomponents () const
 
ConstGeometricDetContainer deepComponents () const
 
void deepComponents (ConstGeometricDetContainer &cont) const
 
void deleteComponents ()
 
const DetIdgeographicalId () const
 
 GeometricDet (DDFilteredView *fv, GeometricEnumType dd)
 
 GeometricDet (cms::DDFilteredView *fv, GeometricEnumType dd)
 
 GeometricDet (const PGeometricDet::Item &onePGD, GeometricEnumType dd)
 
bool isBricked () const
 
bool isFromDD4hep () const
 
bool isLeaf () const
 
bool isLowerSensor () const
 
bool isUpperSensor () const
 
const std::string & name () const
 
NavRange navpos () const
 
const nav_typenavType () const
 
const std::vector< double > & params () const
 
double phi () const
 
double pixROCCols () const
 
double pixROCRows () const
 
double pixROCx () const
 
double pixROCy () const
 
Position positionBounds () const
 
double radLength () const
 
double rho () const
 
const RotationMatrixrotation () const
 
Rotation rotationBounds () const
 
void setGeographicalID (DetId id)
 
LegacySolidShape shape () const
 
const cms::DDSolidShapeshape_dd4hep () const
 
double siliconAPVNum () const
 
bool stereo () const
 
const Translationtranslation () const
 
const GeometricEnumTypetype () const
 
double xi () const
 
 ~GeometricDet ()
 

Static Public Member Functions

static std::string printNavType (int const *n, size_t sz)
 

Private Member Functions

std::vector< double > computeLegacyShapeParameters (const cms::DDSolidShape &mySolidShape, const dd4hep::Solid &mySolid) const
 

Private Attributes

ConstGeometricDetContainer container_
 
nav_type ddd_
 
std::string ddname_
 
DetId geographicalID_ = 0
 
bool isBricked_ = false
 
bool isFromDD4hep_ = false
 
bool isLowerSensor_ = false
 
bool isUpperSensor_ = false
 
std::vector< double > params_
 
double phi_ = 0.
 
double pixROCCols_ = 0.
 
double pixROCRows_ = 0.
 
double pixROCx_ = 0.
 
double pixROCy_ = 0.
 
double radLength_ = 0.
 
double rho_ = 0.
 
RotationMatrix rot_
 
cms::DDSolidShape shape_
 
double siliconAPVNum_ = 0.
 
bool stereo_ = false
 
Translation trans_
 
GeometricEnumType type_
 
double xi_ = 0.
 

Detailed Description

Composite class GeometricDet. A composite can contain other composites, and so on; You can understand what you are looking at via enum.

Definition at line 31 of file GeometricDet.h.

Member Typedef Documentation

◆ ConstGeometricDetContainer

Definition at line 34 of file GeometricDet.h.

◆ GeometricDetContainer

Definition at line 35 of file GeometricDet.h.

◆ GeometricEnumType

◆ nav_type

using GeometricDet::nav_type = std::vector<int>

Definition at line 42 of file GeometricDet.h.

◆ NavRange

using GeometricDet::NavRange = std::pair<int const*, size_t>

Definition at line 33 of file GeometricDet.h.

◆ Position

Definition at line 45 of file GeometricDet.h.

◆ Rotation

Definition at line 46 of file GeometricDet.h.

◆ RotationMatrix

using GeometricDet::RotationMatrix = ROOT::Math::Rotation3D

Definition at line 36 of file GeometricDet.h.

◆ Translation

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

Definition at line 37 of file GeometricDet.h.

Member Enumeration Documentation

◆ GDEnumType

Enumerator
unknown 
Tracker 
PixelBarrel 
PixelEndCap 
TIB 
TID 
TOB 
TEC 
layer 
wheel 
strng 
rod 
petal 
ring 
ladder 
mergedDet 
DetUnit 
disk 
panel 
PixelPhase1Barrel 
PixelPhase1EndCap 
PixelPhase1Disk 
OTPhase2EndCap 
OTPhase2Barrel 
OTPhase2Layer 
OTPhase2Stack 
PixelPhase2Barrel 
PixelPhase2EndCap 
OTPhase2Wheel 
PixelPhase2FullDisk 
PixelPhase2ReducedDisk 
PixelPhase2TDRDisk 
PixelPhase2DoubleDisk 
PixelPhase2SubDisk 

Definition at line 48 of file GeometricDet.h.

48  {
49  unknown = 100,
50  Tracker = 0,
51  PixelBarrel = 1,
52  PixelEndCap = 2,
53  TIB = 3,
54  TID = 4,
55  TOB = 5,
56  TEC = 6,
57  layer = 8,
58  wheel = 9,
59  strng = 10,
60  rod = 11,
61  petal = 12,
62  ring = 13,
63  ladder = 14,
64  mergedDet = 15,
65  DetUnit = 16,
66  disk = 17,
67  panel = 18,
68  PixelPhase1Barrel = 101,
69  PixelPhase1EndCap = 102,
70  PixelPhase1Disk = 117,
71  OTPhase2EndCap = 204,
72  OTPhase2Barrel = 205,
73  OTPhase2Layer = 208,
74  OTPhase2Stack = 215,
75  PixelPhase2Barrel = 201,
76  PixelPhase2EndCap = 202,
77  OTPhase2Wheel = 209,
78  PixelPhase2FullDisk = 217,
80  PixelPhase2TDRDisk = 237,
82  PixelPhase2SubDisk = 357
enum GeometricDet::GDEnumType GeometricEnumType

Constructor & Destructor Documentation

◆ GeometricDet() [1/3]

GeometricDet::GeometricDet ( DDFilteredView fv,
GeometricEnumType  dd 
)

Definition at line 73 of file GeometricDet.cc.

References ddd_, DetUnit, isBricked_, isLowerSensor_, isUpperSensor_, DDFilteredView::navPos(), nt, pixROCCols_, pixROCRows_, pixROCx_, pixROCy_, radLength_, siliconAPVNum_, stereo_, type_, and xi_.

74  : ddname_(fv->name()),
75  type_(type),
76  ddd_(), // To remove after DetExtra is removed (not used)
77  trans_(fv->translation()),
78  rho_(trans_.Rho()),
79  phi_(trans_.Phi()),
80  rot_(fv->rotation()),
82  params_(fv->parameters()),
83  isFromDD4hep_(false) {
84  // workaround instead of this at initialization
85  const DDFilteredView::nav_type& nt = fv->navPos();
86  ddd_ = nav_type(nt.begin(), nt.end());
87 
88  // Only look for sensor-related info on sensor volumes!
89  if (type_ == DetUnit) {
90  radLength_ = getDouble("TrackerRadLength", *fv);
91  xi_ = getDouble("TrackerXi", *fv);
92  isBricked_ = (getString("isBricked", *fv) == strue);
93  pixROCRows_ = getDouble("PixelROCRows", *fv);
94  pixROCCols_ = getDouble("PixelROCCols", *fv);
95  pixROCx_ = getDouble("PixelROC_X", *fv);
96  pixROCy_ = getDouble("PixelROC_Y", *fv);
97  stereo_ = (getString("TrackerStereoDetectors", *fv) == strue);
98  isLowerSensor_ = (getString("TrackerLowerDetectors", *fv) == strue);
99  isUpperSensor_ = (getString("TrackerUpperDetectors", *fv) == strue);
100  siliconAPVNum_ = getDouble("SiliconAPVNumber", *fv);
101  }
102 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:187
bool isLowerSensor_
Definition: GeometricDet.h:198
double pixROCCols_
Definition: GeometricDet.h:194
std::vector< double > params_
Definition: GeometricDet.h:188
const std::vector< double > & parameters() const
const std::string & name() const
The name of a logical-part of the current node in the filtered-view.
std::vector< int > nav_type
Definition: GeometricDet.h:42
bool isUpperSensor_
Definition: GeometricDet.h:199
nav_type ddd_
Definition: GeometricDet.h:179
double pixROCx_
Definition: GeometricDet.h:195
bool isFromDD4hep_
Definition: GeometricDet.h:202
GeometricEnumType type_
Definition: GeometricDet.h:177
double radLength_
Definition: GeometricDet.h:190
const std::array< const cms::dd::ValuePair< LegacySolidShape, cms::DDSolidShape >, 21 > LegacySolidShapeMap
int nt
Definition: AMPTWrapper.h:42
double pixROCy_
Definition: GeometricDet.h:196
double pixROCRows_
Definition: GeometricDet.h:193
const DDSolidShape shape() const
Translation trans_
Definition: GeometricDet.h:182
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
DDExpandedView::nav_type nav_type
std::string ddname_
Definition: GeometricDet.h:176
nav_type navPos() const
return the stack of sibling numbers
Mapping::value_type::name_type name_from_value(Mapping a, V value)
Definition: DDSolidShapes.h:62
RotationMatrix rot_
Definition: GeometricDet.h:185
const DDTranslation & translation() const
The absolute translation of the current node.
double siliconAPVNum_
Definition: GeometricDet.h:200

◆ GeometricDet() [2/3]

GeometricDet::GeometricDet ( cms::DDFilteredView fv,
GeometricEnumType  dd 
)

Definition at line 107 of file GeometricDet.cc.

References angle_units::operators::almostEqual(), DetUnit, cms::DDFilteredView::findSpecPar(), cms::DDFilteredView::get(), cms::DDFilteredView::getNextValue(), isBricked_, isLowerSensor_, isUpperSensor_, phi_, pixROCCols_, pixROCRows_, pixROCx_, pixROCy_, radLength_, siliconAPVNum_, stereo_, type_, and xi_.

108  : ddname_(dd4hep::dd::noNamespace(fv->name())),
109  type_(type),
110  ddd_(fv->navPos()), // To remove after DetExtra is removed (not used)
111  trans_((fv->translation()) / dd4hep::mm),
112  rho_(trans_.Rho()),
113  phi_(trans_.Phi()),
114  rot_(fv->rotation()),
115  shape_(fv->shape()),
117  isFromDD4hep_(true) {
118  using namespace angle_units::operators;
119  if (almostEqual(phi_, -1._pi, 10)) {
120  phi_ = 1._pi;
121  // Standardize phi values of |pi| to be always +pi instead of sometimes -pi.
122  }
123 
124  // Only look for sensor-related info on sensor volumes!
125  if (type_ == DetUnit) {
126  // IT sensors only (NB: hence could add a branch here, but not a critical part on perf)
127  isBricked_ = (fv->get<std::string_view>("isBricked") == strue);
128  pixROCRows_ = fv->get<double>("PixelROCRows");
129  pixROCCols_ = fv->get<double>("PixelROCCols");
130  pixROCx_ = fv->get<double>("PixelROC_X");
131  pixROCy_ = fv->get<double>("PixelROC_Y");
132 
133  // Phase 1 OT sensors only (NB: hence could add a branch here, but not a critical part on perf)
134  stereo_ = (fv->get<std::string_view>("TrackerStereoDetectors") == strue);
135  siliconAPVNum_ = fv->get<double>("SiliconAPVNumber");
136 
137  // Phase 2 OT sensors only (NB: hence could add a branch here, but not a critical part on perf)
138  isLowerSensor_ = (fv->get<std::string_view>("TrackerLowerDetectors") == strue);
139  isUpperSensor_ = (fv->get<std::string_view>("TrackerUpperDetectors") == strue);
140 
141  // All sensors: IT or OT, Phase 1 or Phase 2 (NB: critical part on perf)
142  fv->findSpecPar("TrackerRadLength", "TrackerXi");
143  radLength_ = fv->getNextValue("TrackerRadLength");
144  xi_ = fv->getNextValue("TrackerXi");
145  }
146 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:187
bool isLowerSensor_
Definition: GeometricDet.h:198
double pixROCCols_
Definition: GeometricDet.h:194
const cms::DDSolidShape shape() const
std::vector< double > params_
Definition: GeometricDet.h:188
std::enable_if<!std::numeric_limits< NumType >::is_integer, bool >::type almostEqual(NumType x, NumType y, int ulp)
Definition: angle_units.h:33
bool isUpperSensor_
Definition: GeometricDet.h:199
nav_type ddd_
Definition: GeometricDet.h:179
std::string_view name() const
double pixROCx_
Definition: GeometricDet.h:195
bool isFromDD4hep_
Definition: GeometricDet.h:202
double getNextValue(const std::string &) const
extract another value from the same SpecPar
GeometricEnumType type_
Definition: GeometricDet.h:177
double radLength_
Definition: GeometricDet.h:190
double pixROCy_
Definition: GeometricDet.h:196
std::vector< double > computeLegacyShapeParameters(const cms::DDSolidShape &mySolidShape, const dd4hep::Solid &mySolid) const
double pixROCRows_
Definition: GeometricDet.h:193
T get(const std::string &)
extract attribute value
Translation trans_
Definition: GeometricDet.h:182
dd4hep::Solid solid() const
const RotationMatrix rotation() const
std::string ddname_
Definition: GeometricDet.h:176
nav_type navPos() const
return the stack of sibling numbers which indicates
RotationMatrix rot_
Definition: GeometricDet.h:185
double siliconAPVNum_
Definition: GeometricDet.h:200
void findSpecPar(T const &first, Ts const &... rest)
find a current Node SpecPar that has at least
const Translation translation() const

◆ GeometricDet() [3/3]

GeometricDet::GeometricDet ( const PGeometricDet::Item onePGD,
GeometricEnumType  dd 
)

Definition at line 151 of file GeometricDet.cc.

References PGeometricDet::Item::_nt0, PGeometricDet::Item::_nt1, PGeometricDet::Item::_nt10, PGeometricDet::Item::_nt2, PGeometricDet::Item::_nt3, PGeometricDet::Item::_nt4, PGeometricDet::Item::_nt5, PGeometricDet::Item::_nt6, PGeometricDet::Item::_nt7, PGeometricDet::Item::_nt8, PGeometricDet::Item::_nt9, PGeometricDet::Item::_numnt, PGeometricDet::Item::_params0, PGeometricDet::Item::_params1, PGeometricDet::Item::_params10, PGeometricDet::Item::_params2, PGeometricDet::Item::_params3, PGeometricDet::Item::_params4, PGeometricDet::Item::_params5, PGeometricDet::Item::_params6, PGeometricDet::Item::_params7, PGeometricDet::Item::_params8, PGeometricDet::Item::_params9, PGeometricDet::Item::_shape, ddd_, and params_.

152  : ddname_(onePGD._name),
153  type_(type),
154  ddd_(),
156  trans_(onePGD._x, onePGD._y, onePGD._z),
157  rho_(onePGD._rho),
158  phi_(onePGD._phi),
159  rot_(onePGD._a11,
160  onePGD._a12,
161  onePGD._a13,
162  onePGD._a21,
163  onePGD._a22,
164  onePGD._a23,
165  onePGD._a31,
166  onePGD._a32,
167  onePGD._a33),
168  shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, static_cast<LegacySolidShape>(onePGD._shape))),
169  params_(),
170  radLength_(onePGD._radLength),
171  xi_(onePGD._xi),
172  pixROCRows_(onePGD._pixROCRows),
173  pixROCCols_(onePGD._pixROCCols),
174  pixROCx_(onePGD._pixROCx),
175  pixROCy_(onePGD._pixROCy),
176  stereo_(onePGD._stereo),
178 // NB: what about new data members isLowerSensor_, isUpperSensor_, isFromDD4hep_?
179 // They are presently not added to PGeometricDet (no change in info stored into DB).
180 {
181  // Solid shape parameters: only for box (1) and trapezoid (3)
182  if (onePGD._shape == 1 || onePGD._shape == 3) {
183  params_.reserve(11);
184  params_.emplace_back(onePGD._params0);
185  params_.emplace_back(onePGD._params1);
186  params_.emplace_back(onePGD._params2);
187  params_.emplace_back(onePGD._params3);
188  params_.emplace_back(onePGD._params4);
189  params_.emplace_back(onePGD._params5);
190  params_.emplace_back(onePGD._params6);
191  params_.emplace_back(onePGD._params7);
192  params_.emplace_back(onePGD._params8);
193  params_.emplace_back(onePGD._params9);
194  params_.emplace_back(onePGD._params10);
195  }
196 
197  ddd_.reserve(onePGD._numnt);
198  ddd_.emplace_back(onePGD._nt0);
199  ddd_.emplace_back(onePGD._nt1);
200  ddd_.emplace_back(onePGD._nt2);
201  ddd_.emplace_back(onePGD._nt3);
202  if (onePGD._numnt > 4) {
203  ddd_.emplace_back(onePGD._nt4);
204  if (onePGD._numnt > 5) {
205  ddd_.emplace_back(onePGD._nt5);
206  if (onePGD._numnt > 6) {
207  ddd_.emplace_back(onePGD._nt6);
208  if (onePGD._numnt > 7) {
209  ddd_.emplace_back(onePGD._nt7);
210  if (onePGD._numnt > 8) {
211  ddd_.emplace_back(onePGD._nt8);
212  if (onePGD._numnt > 9) {
213  ddd_.emplace_back(onePGD._nt9);
214  if (onePGD._numnt > 10) {
215  ddd_.emplace_back(onePGD._nt10);
216  }
217  }
218  }
219  }
220  }
221  }
222  }
223 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:187
double pixROCCols_
Definition: GeometricDet.h:194
std::vector< double > params_
Definition: GeometricDet.h:188
DetId geographicalID_
Definition: GeometricDet.h:180
nav_type ddd_
Definition: GeometricDet.h:179
double pixROCx_
Definition: GeometricDet.h:195
GeometricEnumType type_
Definition: GeometricDet.h:177
double radLength_
Definition: GeometricDet.h:190
const std::array< const cms::dd::ValuePair< LegacySolidShape, cms::DDSolidShape >, 21 > LegacySolidShapeMap
double pixROCy_
Definition: GeometricDet.h:196
double pixROCRows_
Definition: GeometricDet.h:193
Translation trans_
Definition: GeometricDet.h:182
std::string ddname_
Definition: GeometricDet.h:176
Mapping::value_type::name_type name_from_value(Mapping a, V value)
Definition: DDSolidShapes.h:62
RotationMatrix rot_
Definition: GeometricDet.h:185
double siliconAPVNum_
Definition: GeometricDet.h:200

◆ ~GeometricDet()

GeometricDet::~GeometricDet ( )

What to do in the destructor? destroy all the daughters!

Definition at line 68 of file GeometricDet.cc.

References deleteComponents().

68 { deleteComponents(); }
void deleteComponents()

Member Function Documentation

◆ addComponent()

void GeometricDet::addComponent ( GeometricDet det)

◆ addComponents() [1/2]

void GeometricDet::addComponents ( GeometricDetContainer const &  cont)

◆ addComponents() [2/2]

void GeometricDet::addComponents ( ConstGeometricDetContainer const &  cont)

Definition at line 271 of file GeometricDet.cc.

References generateEDF::cont, container_, and filterCSVwithJSON::copy.

271  {
272  container_.reserve(container_.size() + cont.size());
273  std::copy(cont.begin(), cont.end(), back_inserter(container_));
274 }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:204
cont
load Luminosity info ##
Definition: generateEDF.py:628

◆ bounds()

std::unique_ptr< Bounds > GeometricDet::bounds ( ) const

Definition at line 225 of file GeometricDet.cc.

References TrackerShapeToBounds::buildBounds(), params_, and shape_.

Referenced by TrackerGeometry::fillTestMap(), and PlaneBuilderFromGeometricDet::plane().

225  {
226  TrackerShapeToBounds shapeToBounds;
227  return std::unique_ptr<Bounds>(shapeToBounds.buildBounds(shape_, params_));
228 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:187
std::vector< double > params_
Definition: GeometricDet.h:188
Bounds * buildBounds(const cms::DDSolidShape &, const std::vector< double > &) const

◆ clearComponents()

void GeometricDet::clearComponents ( )
inline

◆ component()

GeometricDet* GeometricDet::component ( size_t  index)
inline

Definition at line 148 of file GeometricDet.h.

References container_.

Referenced by CmsTrackerDiskBuilder< FilteredView >::sortNS(), CmsTrackerWheelBuilder< FilteredView >::sortNS(), CmsTrackerLayerBuilder< FilteredView >::sortNS(), CmsTrackerStringBuilder< FilteredView >::sortNS(), CmsTrackerRodBuilder< FilteredView >::sortNS(), CmsTrackerRingBuilder< FilteredView >::sortNS(), CmsTrackerPanelBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2RingBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2SubDiskBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2DoubleDiskBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2DiskBuilder< FilteredView >::sortNS(), CmsTrackerPetalBuilder< FilteredView >::sortNS(), CmsTrackerPhase2TPDiskBuilder< FilteredView >::sortNS(), CmsTrackerOTDiscBuilder< FilteredView >::sortNS(), CmsTrackerPhase1DiskBuilder< FilteredView >::sortNS(), CmsTrackerLadderBuilder< FilteredView >::sortNS(), CmsTrackerOTRingBuilder< FilteredView >::sortNS(), CmsTrackerOTLayerBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase1EndcapBuilder< FilteredView >::sortNS(), CmsTrackerSubStrctBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2EndcapBuilder< FilteredView >::sortNS(), and CmsTrackerBuilder< FilteredView >::sortNS().

148 { return const_cast<GeometricDet*>(container_[index]); }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:204

◆ components() [1/2]

ConstGeometricDetContainer& GeometricDet::components ( )
inline

Definition at line 152 of file GeometricDet.h.

References container_.

Referenced by Phase2EndcapLayerBuilder::build(), Phase2EndcapSubDiskBuilder::build(), Phase2OTBarrelLayerBuilder::build(), Phase2OTBarrelRodBuilder::build(), TIDLayerBuilder::build(), PixelBarrelLayerBuilder::build(), PixelRodBuilder::build(), TECLayerBuilder::build(), TECPetalBuilder::build(), TECWedgeBuilder::build(), TIBLayerBuilder::build(), TIDRingBuilder::build(), TOBLayerBuilder::build(), TOBRodBuilder::build(), Phase2EndcapLayerDoubleDiskBuilder::build(), Phase2EndcapRingBuilder::build(), Phase2EndcapSingleRingBuilder::build(), GeometricSearchTrackerBuilder::build(), TrackerGeomBuilderFromGeometricDet::build(), PixelForwardLayerBuilder< T1, T2 >::build(), PixelBladeBuilder< T >::build(), CmsTrackerDetIdBuilder::iterate(), DDDCmsTrackerContruction::printAllTrackerGeometricDets(), CmsTrackerPhase1DiskBuilder< FilteredView >::sortNS(), CmsTrackerOTLayerBuilder< FilteredView >::sortNS(), CmsTrackerPetalBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2SubDiskBuilder< FilteredView >::sortNS(), CmsTrackerDiskBuilder< FilteredView >::sortNS(), CmsTrackerOTRingBuilder< FilteredView >::sortNS(), CmsTrackerRingBuilder< FilteredView >::sortNS(), CmsTrackerOTDiscBuilder< FilteredView >::sortNS(), CmsTrackerPanelBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2DiskBuilder< FilteredView >::sortNS(), CmsTrackerLayerBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2DoubleDiskBuilder< FilteredView >::sortNS(), CmsTrackerStringBuilder< FilteredView >::sortNS(), CmsTrackerRodBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2RingBuilder< FilteredView >::sortNS(), CmsTrackerWheelBuilder< FilteredView >::sortNS(), CmsTrackerLadderBuilder< FilteredView >::sortNS(), CmsTrackerPhase2TPDiskBuilder< FilteredView >::sortNS(), CmsTrackerSubStrctBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase1EndcapBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2EndcapBuilder< FilteredView >::sortNS(), CmsTrackerBuilder< FilteredView >::sortNS(), and TrackerGeometry::TrackerGeometry().

152 { return container_; }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:204

◆ components() [2/2]

const ConstGeometricDetContainer& GeometricDet::components ( ) const
inline

Definition at line 153 of file GeometricDet.h.

References container_.

153 { return container_; }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:204

◆ computeLegacyShapeParameters()

std::vector< double > GeometricDet::computeLegacyShapeParameters ( const cms::DDSolidShape mySolidShape,
const dd4hep::Solid &  mySolid 
) const
private

Definition at line 300 of file GeometricDet.cc.

References angle_units::operators::convertDegToRad(), cms::ddbox, cms::ddtrap, cms::ddtubs, angle0to2pi::make0To2pi(), and cms_rounding::roundIfNear0().

301  {
302  std::vector<double> myOldDDShapeParameters;
303 
304  // Box
305  if (mySolidShape == cms::DDSolidShape::ddbox) {
306  const dd4hep::Box& myBox = dd4hep::Box(mySolid);
307  myOldDDShapeParameters = {(myBox.x()) / dd4hep::mm, (myBox.y()) / dd4hep::mm, (myBox.z()) / dd4hep::mm};
308  }
309 
310  // Trapezoid
311  else if (mySolidShape == cms::DDSolidShape::ddtrap) {
312  const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid);
313  myOldDDShapeParameters = {(myTrap->GetDZ()) / dd4hep::mm,
314  static_cast<double>(angle_units::operators::convertDegToRad(myTrap->GetTheta())),
315  static_cast<double>(angle_units::operators::convertDegToRad(myTrap->GetPhi())),
316  (myTrap->GetH1()) / dd4hep::mm,
317  (myTrap->GetBl1()) / dd4hep::mm,
318  (myTrap->GetTl1()) / dd4hep::mm,
319  static_cast<double>(angle_units::operators::convertDegToRad(myTrap->GetAlpha1())),
320  (myTrap->GetH2()) / dd4hep::mm,
321  (myTrap->GetBl2()) / dd4hep::mm,
322  (myTrap->GetTl2()) / dd4hep::mm,
323  static_cast<double>(angle_units::operators::convertDegToRad(myTrap->GetAlpha2()))};
324  }
325 
326  // Tub
327  else if (mySolidShape == cms::DDSolidShape::ddtubs) {
328  const dd4hep::Tube& myTube = dd4hep::Tube(mySolid);
329  double phi1 = static_cast<double>(angle_units::operators::convertDegToRad(myTube->GetPhi1()));
330  phi1 = cms_rounding::roundIfNear0(phi1);
331  if (phi1 != 0.0) {
332  using namespace angle0to2pi;
333  phi1 = make0To2pi(phi1) - 2._pi;
334  // Turn positive angle to negative
335  }
336  myOldDDShapeParameters = {
337  (myTube->GetDz()) / dd4hep::mm,
338  (myTube->GetRmin()) / dd4hep::mm,
339  (myTube->GetRmax()) / dd4hep::mm,
340  phi1,
341  static_cast<double>(angle_units::operators::convertDegToRad(myTube->GetPhi2() - myTube->GetPhi1()))};
342  }
343 
344  return myOldDDShapeParameters;
345 }
constexpr double convertDegToRad(NumType degrees)
Definition: angle_units.h:27
constexpr valType roundIfNear0(valType value, double tolerance=1.e-7)
Definition: Rounding.h:11
constexpr valType make0To2pi(valType angle)
Definition: deltaPhi.h:67

◆ deepComponents() [1/2]

GeometricDet::ConstGeometricDetContainer GeometricDet::deepComponents ( ) const

Definition at line 252 of file GeometricDet.cc.

Referenced by PTrackerAdditionalParametersPerDetDBBuilder::beginRun(), TrackerGeomBuilderFromGeometricDet::build(), TrackerG4SimHitNumberingScheme::buildAll(), TrackerGeometryUtils::getOuterTrackerDetIds(), TrackerGeometryUtils::getSiStripDetIds(), and TrackerGeometry::TrackerGeometry().

252  {
253  // iterate on all the DESCENDANTS!!
255  deepComponents(temp_);
256  return temp_;
257 }
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:34
ConstGeometricDetContainer deepComponents() const

◆ deepComponents() [2/2]

void GeometricDet::deepComponents ( ConstGeometricDetContainer cont) const

Definition at line 259 of file GeometricDet.cc.

References generateEDF::cont, container_, and isLeaf().

259  {
260  if (isLeaf())
261  cont.emplace_back(this);
262  else
263  std::for_each(container_.begin(), container_.end(), [&](const GeometricDet* iDet) { iDet->deepComponents(cont); });
264 }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:204
bool isLeaf() const
Definition: GeometricDet.h:149
cont
load Luminosity info ##
Definition: generateEDF.py:628

◆ deleteComponents()

void GeometricDet::deleteComponents ( )

Definition at line 284 of file GeometricDet.cc.

References container_.

Referenced by ~GeometricDet().

284  {
285  std::for_each(container_.begin(), container_.end(), Deleter());
286  container_.clear();
287 }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:204

◆ geographicalId()

const DetId& GeometricDet::geographicalId ( ) const
inline

◆ isBricked()

bool GeometricDet::isBricked ( ) const
inline

Definition at line 133 of file GeometricDet.h.

References isBricked_.

133 { return isBricked_; }

◆ isFromDD4hep()

bool GeometricDet::isFromDD4hep ( ) const
inline

Definition at line 145 of file GeometricDet.h.

References isFromDD4hep_.

145 { return isFromDD4hep_; }
bool isFromDD4hep_
Definition: GeometricDet.h:202

◆ isLeaf()

bool GeometricDet::isLeaf ( ) const
inline

Definition at line 149 of file GeometricDet.h.

References container_.

Referenced by deepComponents().

149 { return container_.empty(); }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:204

◆ isLowerSensor()

bool GeometricDet::isLowerSensor ( ) const
inline

◆ isUpperSensor()

bool GeometricDet::isUpperSensor ( ) const
inline

◆ name()

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

◆ navpos()

NavRange GeometricDet::navpos ( ) const
inline

Definition at line 97 of file GeometricDet.h.

References ddd_.

97 { return NavRange(&ddd_.front(), ddd_.size()); }
nav_type ddd_
Definition: GeometricDet.h:179
std::pair< int const *, size_t > NavRange
Definition: GeometricDet.h:33

◆ navType()

const nav_type& GeometricDet::navType ( ) const
inline

Definition at line 96 of file GeometricDet.h.

References ddd_.

Referenced by PGeometricDetBuilder::putOne().

96 { return ddd_; }
nav_type ddd_
Definition: GeometricDet.h:179

◆ params()

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

Definition at line 118 of file GeometricDet.h.

References cms::ddbox, cms::ddtrap, cms::ddtubs, params_, and shape_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), PGeometricDetBuilder::putOne(), and CmsTrackerLayerBuilder< FilteredView >::sortNS().

118  {
121  edm::LogError("GeometricDet::params()")
122  << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!";
123  }
124  return params_;
125  } // in mm
cms::DDSolidShape shape_
Definition: GeometricDet.h:187
std::vector< double > params_
Definition: GeometricDet.h:188
Log< level::Error, false > LogError

◆ phi()

double GeometricDet::phi ( void  ) const
inline

◆ pixROCCols()

double GeometricDet::pixROCCols ( ) const
inline

Definition at line 135 of file GeometricDet.h.

References pixROCCols_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

135 { return pixROCCols_; }
double pixROCCols_
Definition: GeometricDet.h:194

◆ pixROCRows()

double GeometricDet::pixROCRows ( ) const
inline

Definition at line 134 of file GeometricDet.h.

References pixROCRows_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

134 { return pixROCRows_; }
double pixROCRows_
Definition: GeometricDet.h:193

◆ pixROCx()

double GeometricDet::pixROCx ( ) const
inline

Definition at line 136 of file GeometricDet.h.

References pixROCx_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

136 { return pixROCx_; }
double pixROCx_
Definition: GeometricDet.h:195

◆ pixROCy()

double GeometricDet::pixROCy ( ) const
inline

Definition at line 137 of file GeometricDet.h.

References pixROCy_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

137 { return pixROCy_; }
double pixROCy_
Definition: GeometricDet.h:196

◆ positionBounds()

GeometricDet::Position GeometricDet::positionBounds ( ) const

Definition at line 230 of file GeometricDet.cc.

References angle_units::operators::convertMmToCm(), and trans_.

Referenced by PlaneBuilderFromGeometricDet::plane().

230  {
231  Position pos_(static_cast<float>(geant_units::operators::convertMmToCm(trans_.x())),
232  static_cast<float>(geant_units::operators::convertMmToCm(trans_.y())),
233  static_cast<float>(geant_units::operators::convertMmToCm(trans_.z())));
234  return pos_;
235 }
constexpr NumType convertMmToCm(NumType millimeters)
Definition: angle_units.h:44
Translation trans_
Definition: GeometricDet.h:182
Surface::PositionType Position
Definition: GeometricDet.h:45

◆ printNavType()

std::string GeometricDet::printNavType ( int const *  n,
size_t  sz 
)
static

Definition at line 347 of file GeometricDet.cc.

References dqmiodumpmetadata::n.

Referenced by geometric_det_ns::operator<<().

347  {
348  std::ostringstream oss;
349  oss << '(';
350  for (int const* it = n; it != n + sz; ++it) {
351  oss << *it << ',';
352  }
353  oss << ')';
354  return oss.str();
355 }

◆ radLength()

double GeometricDet::radLength ( ) const
inline

◆ rho()

double GeometricDet::rho ( ) const
inline

◆ rotation()

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

Definition at line 105 of file GeometricDet.h.

References rot_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

105 { return rot_; }
RotationMatrix rot_
Definition: GeometricDet.h:185

◆ rotationBounds()

GeometricDet::Rotation GeometricDet::rotationBounds ( ) const

Definition at line 237 of file GeometricDet.cc.

References rot_, x, y, and z.

Referenced by PlaneBuilderFromGeometricDet::plane().

237  {
238  Translation x, y, z;
239  rot_.GetComponents(x, y, z);
240  Rotation rotation_(float(x.X()),
241  float(x.Y()),
242  float(x.Z()),
243  float(y.X()),
244  float(y.Y()),
245  float(y.Z()),
246  float(z.X()),
247  float(z.Y()),
248  float(z.Z()));
249  return rotation_;
250 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > Translation
Surface::RotationType Rotation
Definition: GeometricDet.h:46
RotationMatrix rot_
Definition: GeometricDet.h:185

◆ setGeographicalID()

void GeometricDet::setGeographicalID ( DetId  id)
inline

◆ shape()

LegacySolidShape GeometricDet::shape ( void  ) const
inline

Definition at line 114 of file GeometricDet.h.

References cms::LegacySolidShapeMap, shape_, and cms::dd::value().

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets().

cms::DDSolidShape shape_
Definition: GeometricDet.h:187
Mapping::value_type::value_type value(Mapping a, const std::string &name)
Definition: DDSolidShapes.h:42
const std::array< const cms::dd::ValuePair< LegacySolidShape, cms::DDSolidShape >, 21 > LegacySolidShapeMap

◆ shape_dd4hep()

const cms::DDSolidShape& GeometricDet::shape_dd4hep ( ) const
inline

Definition at line 116 of file GeometricDet.h.

References shape_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

116 { return shape_; }
cms::DDSolidShape shape_
Definition: GeometricDet.h:187

◆ siliconAPVNum()

double GeometricDet::siliconAPVNum ( ) const
inline

◆ stereo()

bool GeometricDet::stereo ( ) const
inline

◆ translation()

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

◆ type()

const GeometricEnumType& GeometricDet::type ( ) const
inline

Definition at line 93 of file GeometricDet.h.

References type_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

93 { return type_; }
GeometricEnumType type_
Definition: GeometricDet.h:177

◆ xi()

double GeometricDet::xi ( ) const
inline

Member Data Documentation

◆ container_

ConstGeometricDetContainer GeometricDet::container_
private

◆ ddd_

nav_type GeometricDet::ddd_
private

Definition at line 179 of file GeometricDet.h.

Referenced by GeometricDet(), navpos(), and navType().

◆ ddname_

std::string GeometricDet::ddname_
private

Definition at line 176 of file GeometricDet.h.

Referenced by name().

◆ geographicalID_

DetId GeometricDet::geographicalID_ = 0
private

Definition at line 180 of file GeometricDet.h.

Referenced by geographicalId(), and setGeographicalID().

◆ isBricked_

bool GeometricDet::isBricked_ = false
private

Definition at line 192 of file GeometricDet.h.

Referenced by GeometricDet(), and isBricked().

◆ isFromDD4hep_

bool GeometricDet::isFromDD4hep_ = false
private

Definition at line 202 of file GeometricDet.h.

Referenced by isFromDD4hep().

◆ isLowerSensor_

bool GeometricDet::isLowerSensor_ = false
private

Definition at line 198 of file GeometricDet.h.

Referenced by GeometricDet(), and isLowerSensor().

◆ isUpperSensor_

bool GeometricDet::isUpperSensor_ = false
private

Definition at line 199 of file GeometricDet.h.

Referenced by GeometricDet(), and isUpperSensor().

◆ params_

std::vector<double> GeometricDet::params_
private

Definition at line 188 of file GeometricDet.h.

Referenced by bounds(), GeometricDet(), and params().

◆ phi_

double GeometricDet::phi_ = 0.
private

Definition at line 184 of file GeometricDet.h.

Referenced by GeometricDet(), and phi().

◆ pixROCCols_

double GeometricDet::pixROCCols_ = 0.
private

Definition at line 194 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCCols().

◆ pixROCRows_

double GeometricDet::pixROCRows_ = 0.
private

Definition at line 193 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCRows().

◆ pixROCx_

double GeometricDet::pixROCx_ = 0.
private

Definition at line 195 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCx().

◆ pixROCy_

double GeometricDet::pixROCy_ = 0.
private

Definition at line 196 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCy().

◆ radLength_

double GeometricDet::radLength_ = 0.
private

Definition at line 190 of file GeometricDet.h.

Referenced by GeometricDet(), and radLength().

◆ rho_

double GeometricDet::rho_ = 0.
private

Definition at line 183 of file GeometricDet.h.

Referenced by rho().

◆ rot_

RotationMatrix GeometricDet::rot_
private

Definition at line 185 of file GeometricDet.h.

Referenced by rotation(), and rotationBounds().

◆ shape_

cms::DDSolidShape GeometricDet::shape_
private

Definition at line 187 of file GeometricDet.h.

Referenced by bounds(), params(), shape(), and shape_dd4hep().

◆ siliconAPVNum_

double GeometricDet::siliconAPVNum_ = 0.
private

Definition at line 200 of file GeometricDet.h.

Referenced by GeometricDet(), and siliconAPVNum().

◆ stereo_

bool GeometricDet::stereo_ = false
private

Definition at line 197 of file GeometricDet.h.

Referenced by GeometricDet(), and stereo().

◆ trans_

Translation GeometricDet::trans_
private

Definition at line 182 of file GeometricDet.h.

Referenced by positionBounds(), and translation().

◆ type_

GeometricEnumType GeometricDet::type_
private

◆ xi_

double GeometricDet::xi_ = 0.
private

Definition at line 191 of file GeometricDet.h.

Referenced by GeometricDet(), and xi().