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 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 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, 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  pixROCRows_ = getDouble("PixelROCRows", *fv);
93  pixROCCols_ = getDouble("PixelROCCols", *fv);
94  pixROCx_ = getDouble("PixelROC_X", *fv);
95  pixROCy_ = getDouble("PixelROC_Y", *fv);
96  stereo_ = (getString("TrackerStereoDetectors", *fv) == strue);
97  isLowerSensor_ = (getString("TrackerLowerDetectors", *fv) == strue);
98  isUpperSensor_ = (getString("TrackerUpperDetectors", *fv) == strue);
99  siliconAPVNum_ = getDouble("SiliconAPVNumber", *fv);
100  }
101 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:186
bool isLowerSensor_
Definition: GeometricDet.h:196
double pixROCCols_
Definition: GeometricDet.h:192
std::vector< double > params_
Definition: GeometricDet.h:187
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:197
nav_type ddd_
Definition: GeometricDet.h:178
double pixROCx_
Definition: GeometricDet.h:193
bool isFromDD4hep_
Definition: GeometricDet.h:200
GeometricEnumType type_
Definition: GeometricDet.h:176
double radLength_
Definition: GeometricDet.h:189
const std::array< const cms::dd::ValuePair< LegacySolidShape, cms::DDSolidShape >, 21 > LegacySolidShapeMap
int nt
Definition: AMPTWrapper.h:42
double pixROCy_
Definition: GeometricDet.h:194
double pixROCRows_
Definition: GeometricDet.h:191
const DDSolidShape shape() const
Translation trans_
Definition: GeometricDet.h:181
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
DDExpandedView::nav_type nav_type
std::string ddname_
Definition: GeometricDet.h:175
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:184
const DDTranslation & translation() const
The absolute translation of the current node.
double siliconAPVNum_
Definition: GeometricDet.h:198

◆ GeometricDet() [2/3]

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

Definition at line 106 of file GeometricDet.cc.

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

107  : ddname_(dd4hep::dd::noNamespace(fv->name())),
108  type_(type),
109  ddd_(fv->navPos()), // To remove after DetExtra is removed (not used)
110  trans_((fv->translation()) / dd4hep::mm),
111  rho_(trans_.Rho()),
112  phi_(trans_.Phi()),
113  rot_(fv->rotation()),
114  shape_(fv->shape()),
116  isFromDD4hep_(true) {
117  using namespace angle_units::operators;
118  if (almostEqual(phi_, -1._pi, 10)) {
119  phi_ = 1._pi;
120  // Standardize phi values of |pi| to be always +pi instead of sometimes -pi.
121  }
122 
123  // Only look for sensor-related info on sensor volumes!
124  if (type_ == DetUnit) {
125  // IT sensors only (NB: hence could add a branch here, but not a critical part on perf)
126  pixROCRows_ = fv->get<double>("PixelROCRows");
127  pixROCCols_ = fv->get<double>("PixelROCCols");
128  pixROCx_ = fv->get<double>("PixelROC_X");
129  pixROCy_ = fv->get<double>("PixelROC_Y");
130 
131  // Phase 1 OT sensors only (NB: hence could add a branch here, but not a critical part on perf)
132  stereo_ = (fv->get<std::string_view>("TrackerStereoDetectors") == strue);
133  siliconAPVNum_ = fv->get<double>("SiliconAPVNumber");
134 
135  // Phase 2 OT sensors only (NB: hence could add a branch here, but not a critical part on perf)
136  isLowerSensor_ = (fv->get<std::string_view>("TrackerLowerDetectors") == strue);
137  isUpperSensor_ = (fv->get<std::string_view>("TrackerUpperDetectors") == strue);
138 
139  // All sensors: IT or OT, Phase 1 or Phase 2 (NB: critical part on perf)
140  fv->findSpecPar("TrackerRadLength", "TrackerXi");
141  radLength_ = fv->getNextValue("TrackerRadLength");
142  xi_ = fv->getNextValue("TrackerXi");
143  }
144 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:186
bool isLowerSensor_
Definition: GeometricDet.h:196
double pixROCCols_
Definition: GeometricDet.h:192
const cms::DDSolidShape shape() const
std::vector< double > params_
Definition: GeometricDet.h:187
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:197
nav_type ddd_
Definition: GeometricDet.h:178
std::string_view name() const
double pixROCx_
Definition: GeometricDet.h:193
bool isFromDD4hep_
Definition: GeometricDet.h:200
double getNextValue(const std::string &) const
extract another value from the same SpecPar
GeometricEnumType type_
Definition: GeometricDet.h:176
double radLength_
Definition: GeometricDet.h:189
double pixROCy_
Definition: GeometricDet.h:194
std::vector< double > computeLegacyShapeParameters(const cms::DDSolidShape &mySolidShape, const dd4hep::Solid &mySolid) const
double pixROCRows_
Definition: GeometricDet.h:191
T get(const std::string &)
extract attribute value
Translation trans_
Definition: GeometricDet.h:181
dd4hep::Solid solid() const
const RotationMatrix rotation() const
std::string ddname_
Definition: GeometricDet.h:175
nav_type navPos() const
return the stack of sibling numbers which indicates
RotationMatrix rot_
Definition: GeometricDet.h:184
double siliconAPVNum_
Definition: GeometricDet.h:198
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 149 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_.

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

◆ ~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 269 of file GeometricDet.cc.

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

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

◆ bounds()

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

Definition at line 223 of file GeometricDet.cc.

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

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

223  {
224  TrackerShapeToBounds shapeToBounds;
225  return std::unique_ptr<Bounds>(shapeToBounds.buildBounds(shape_, params_));
226 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:186
std::vector< double > params_
Definition: GeometricDet.h:187
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 147 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().

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

◆ components() [1/2]

ConstGeometricDetContainer& GeometricDet::components ( )
inline

Definition at line 151 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(), TrackerGeomBuilderFromGeometricDet::build(), GeometricSearchTrackerBuilder::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().

151 { return container_; }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:202

◆ components() [2/2]

const ConstGeometricDetContainer& GeometricDet::components ( ) const
inline

Definition at line 152 of file GeometricDet.h.

References container_.

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

◆ computeLegacyShapeParameters()

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

Definition at line 298 of file GeometricDet.cc.

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

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

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

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

◆ deepComponents() [2/2]

void GeometricDet::deepComponents ( ConstGeometricDetContainer cont) const

Definition at line 257 of file GeometricDet.cc.

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

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

◆ deleteComponents()

void GeometricDet::deleteComponents ( )

Definition at line 282 of file GeometricDet.cc.

References container_.

Referenced by ~GeometricDet().

282  {
283  std::for_each(container_.begin(), container_.end(), Deleter());
284  container_.clear();
285 }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:202

◆ geographicalId()

const DetId& GeometricDet::geographicalId ( ) const
inline

◆ isFromDD4hep()

bool GeometricDet::isFromDD4hep ( ) const
inline

Definition at line 144 of file GeometricDet.h.

References isFromDD4hep_.

144 { return isFromDD4hep_; }
bool isFromDD4hep_
Definition: GeometricDet.h:200

◆ isLeaf()

bool GeometricDet::isLeaf ( ) const
inline

Definition at line 148 of file GeometricDet.h.

References container_.

Referenced by deepComponents().

148 { return container_.empty(); }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:202

◆ 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:178
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:178

◆ 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:186
std::vector< double > params_
Definition: GeometricDet.h:187
Log< level::Error, false > LogError

◆ phi()

double GeometricDet::phi ( void  ) const
inline

◆ pixROCCols()

double GeometricDet::pixROCCols ( ) const
inline

Definition at line 134 of file GeometricDet.h.

References pixROCCols_.

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

134 { return pixROCCols_; }
double pixROCCols_
Definition: GeometricDet.h:192

◆ pixROCRows()

double GeometricDet::pixROCRows ( ) const
inline

Definition at line 133 of file GeometricDet.h.

References pixROCRows_.

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

133 { return pixROCRows_; }
double pixROCRows_
Definition: GeometricDet.h:191

◆ pixROCx()

double GeometricDet::pixROCx ( ) const
inline

Definition at line 135 of file GeometricDet.h.

References pixROCx_.

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

135 { return pixROCx_; }
double pixROCx_
Definition: GeometricDet.h:193

◆ pixROCy()

double GeometricDet::pixROCy ( ) const
inline

Definition at line 136 of file GeometricDet.h.

References pixROCy_.

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

136 { return pixROCy_; }
double pixROCy_
Definition: GeometricDet.h:194

◆ positionBounds()

GeometricDet::Position GeometricDet::positionBounds ( ) const

Definition at line 228 of file GeometricDet.cc.

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

Referenced by PlaneBuilderFromGeometricDet::plane().

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

◆ printNavType()

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

Definition at line 345 of file GeometricDet.cc.

References dqmiodumpmetadata::n.

Referenced by geometric_det_ns::operator<<().

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

◆ 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:184

◆ rotationBounds()

GeometricDet::Rotation GeometricDet::rotationBounds ( ) const

Definition at line 235 of file GeometricDet.cc.

References rot_, x, y, and z.

Referenced by PlaneBuilderFromGeometricDet::plane().

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

◆ 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:186
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:186

◆ 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:176

◆ xi()

double GeometricDet::xi ( ) const
inline

Member Data Documentation

◆ container_

ConstGeometricDetContainer GeometricDet::container_
private

◆ ddd_

nav_type GeometricDet::ddd_
private

Definition at line 178 of file GeometricDet.h.

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

◆ ddname_

std::string GeometricDet::ddname_
private

Definition at line 175 of file GeometricDet.h.

Referenced by name().

◆ geographicalID_

DetId GeometricDet::geographicalID_ = 0
private

Definition at line 179 of file GeometricDet.h.

Referenced by geographicalId(), and setGeographicalID().

◆ isFromDD4hep_

bool GeometricDet::isFromDD4hep_ = false
private

Definition at line 200 of file GeometricDet.h.

Referenced by isFromDD4hep().

◆ isLowerSensor_

bool GeometricDet::isLowerSensor_ = false
private

Definition at line 196 of file GeometricDet.h.

Referenced by GeometricDet(), and isLowerSensor().

◆ isUpperSensor_

bool GeometricDet::isUpperSensor_ = false
private

Definition at line 197 of file GeometricDet.h.

Referenced by GeometricDet(), and isUpperSensor().

◆ params_

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

Definition at line 187 of file GeometricDet.h.

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

◆ phi_

double GeometricDet::phi_ = 0.
private

Definition at line 183 of file GeometricDet.h.

Referenced by GeometricDet(), and phi().

◆ pixROCCols_

double GeometricDet::pixROCCols_ = 0.
private

Definition at line 192 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCCols().

◆ pixROCRows_

double GeometricDet::pixROCRows_ = 0.
private

Definition at line 191 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCRows().

◆ pixROCx_

double GeometricDet::pixROCx_ = 0.
private

Definition at line 193 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCx().

◆ pixROCy_

double GeometricDet::pixROCy_ = 0.
private

Definition at line 194 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCy().

◆ radLength_

double GeometricDet::radLength_ = 0.
private

Definition at line 189 of file GeometricDet.h.

Referenced by GeometricDet(), and radLength().

◆ rho_

double GeometricDet::rho_ = 0.
private

Definition at line 182 of file GeometricDet.h.

Referenced by rho().

◆ rot_

RotationMatrix GeometricDet::rot_
private

Definition at line 184 of file GeometricDet.h.

Referenced by rotation(), and rotationBounds().

◆ shape_

cms::DDSolidShape GeometricDet::shape_
private

Definition at line 186 of file GeometricDet.h.

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

◆ siliconAPVNum_

double GeometricDet::siliconAPVNum_ = 0.
private

Definition at line 198 of file GeometricDet.h.

Referenced by GeometricDet(), and siliconAPVNum().

◆ stereo_

bool GeometricDet::stereo_ = false
private

Definition at line 195 of file GeometricDet.h.

Referenced by GeometricDet(), and stereo().

◆ trans_

Translation GeometricDet::trans_
private

Definition at line 181 of file GeometricDet.h.

Referenced by positionBounds(), and translation().

◆ type_

GeometricEnumType GeometricDet::type_
private

◆ xi_

double GeometricDet::xi_ = 0.
private

Definition at line 190 of file GeometricDet.h.

Referenced by GeometricDet(), and xi().