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, ITPhase2Combined = 180, 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 isFirstSensor () const
 
bool isFromDD4hep () const
 
bool isLeaf () const
 
bool isLowerSensor () const
 
bool isSecondSensor () 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 isFirstSensor_ = false
 
bool isFromDD4hep_ = false
 
bool isLowerSensor_ = false
 
bool isSecondSensor_ = 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 
ITPhase2Combined 
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  ITPhase2Combined = 180,
72  OTPhase2EndCap = 204,
73  OTPhase2Barrel = 205,
74  OTPhase2Layer = 208,
75  OTPhase2Stack = 215,
76  PixelPhase2Barrel = 201,
77  PixelPhase2EndCap = 202,
78  OTPhase2Wheel = 209,
79  PixelPhase2FullDisk = 217,
81  PixelPhase2TDRDisk = 237,
83  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, isFirstSensor_, isLowerSensor_, isSecondSensor_, 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  isFirstSensor_ = (getString("TrackerFirstDetectors", *fv) == strue);
100  isSecondSensor_ = (getString("TrackerSecondDetectors", *fv) == strue);
101  siliconAPVNum_ = getDouble("SiliconAPVNumber", *fv);
102  }
103 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:189
bool isLowerSensor_
Definition: GeometricDet.h:199
double pixROCCols_
Definition: GeometricDet.h:195
std::vector< double > params_
Definition: GeometricDet.h:190
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:200
nav_type ddd_
Definition: GeometricDet.h:181
double pixROCx_
Definition: GeometricDet.h:196
bool isFromDD4hep_
Definition: GeometricDet.h:205
GeometricEnumType type_
Definition: GeometricDet.h:179
double radLength_
Definition: GeometricDet.h:192
bool isFirstSensor_
Definition: GeometricDet.h:201
const std::array< const cms::dd::ValuePair< LegacySolidShape, cms::DDSolidShape >, 21 > LegacySolidShapeMap
int nt
Definition: AMPTWrapper.h:42
double pixROCy_
Definition: GeometricDet.h:197
double pixROCRows_
Definition: GeometricDet.h:194
const DDSolidShape shape() const
bool isSecondSensor_
Definition: GeometricDet.h:202
Translation trans_
Definition: GeometricDet.h:184
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
DDExpandedView::nav_type nav_type
std::string ddname_
Definition: GeometricDet.h:178
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:187
const DDTranslation & translation() const
The absolute translation of the current node.
double siliconAPVNum_
Definition: GeometricDet.h:203

◆ GeometricDet() [2/3]

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

Definition at line 108 of file GeometricDet.cc.

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

109  : ddname_(dd4hep::dd::noNamespace(fv->name())),
110  type_(type),
111  ddd_(fv->navPos()), // To remove after DetExtra is removed (not used)
112  trans_((fv->translation()) / dd4hep::mm),
113  rho_(trans_.Rho()),
114  phi_(trans_.Phi()),
115  rot_(fv->rotation()),
116  shape_(fv->shape()),
118  isFromDD4hep_(true) {
119  using namespace angle_units::operators;
120  if (almostEqual(phi_, -1._pi, 10)) {
121  phi_ = 1._pi;
122  // Standardize phi values of |pi| to be always +pi instead of sometimes -pi.
123  }
124 
125  // Only look for sensor-related info on sensor volumes!
126  if (type_ == DetUnit) {
127  // IT sensors only (NB: hence could add a branch here, but not a critical part on perf)
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  isFirstSensor_ = (fv->get<std::string_view>("TrackerFirstDetectors") == strue);
141  isSecondSensor_ = (fv->get<std::string_view>("TrackerSecondDetectors") == strue);
142 
143  // All sensors: IT or OT, Phase 1 or Phase 2 (NB: critical part on perf)
144  fv->findSpecPar("TrackerRadLength", "TrackerXi");
145  radLength_ = fv->getNextValue("TrackerRadLength");
146  xi_ = fv->getNextValue("TrackerXi");
147  }
148 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:189
bool isLowerSensor_
Definition: GeometricDet.h:199
double pixROCCols_
Definition: GeometricDet.h:195
const cms::DDSolidShape shape() const
std::vector< double > params_
Definition: GeometricDet.h:190
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:200
nav_type ddd_
Definition: GeometricDet.h:181
std::string_view name() const
double pixROCx_
Definition: GeometricDet.h:196
bool isFromDD4hep_
Definition: GeometricDet.h:205
double getNextValue(const std::string &) const
extract another value from the same SpecPar
GeometricEnumType type_
Definition: GeometricDet.h:179
double radLength_
Definition: GeometricDet.h:192
bool isFirstSensor_
Definition: GeometricDet.h:201
double pixROCy_
Definition: GeometricDet.h:197
std::vector< double > computeLegacyShapeParameters(const cms::DDSolidShape &mySolidShape, const dd4hep::Solid &mySolid) const
double pixROCRows_
Definition: GeometricDet.h:194
T get(const std::string &)
extract attribute value
bool isSecondSensor_
Definition: GeometricDet.h:202
Translation trans_
Definition: GeometricDet.h:184
dd4hep::Solid solid() const
const RotationMatrix rotation() const
std::string ddname_
Definition: GeometricDet.h:178
nav_type navPos() const
return the stack of sibling numbers which indicates
RotationMatrix rot_
Definition: GeometricDet.h:187
double siliconAPVNum_
Definition: GeometricDet.h:203
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 153 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_.

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

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

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

273  {
274  container_.reserve(container_.size() + cont.size());
275  std::copy(cont.begin(), cont.end(), back_inserter(container_));
276 }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:207
cont
load Luminosity info ##
Definition: generateEDF.py:620

◆ bounds()

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

Definition at line 227 of file GeometricDet.cc.

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

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

227  {
228  TrackerShapeToBounds shapeToBounds;
229  return std::unique_ptr<Bounds>(shapeToBounds.buildBounds(shape_, params_));
230 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:189
std::vector< double > params_
Definition: GeometricDet.h:190
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 150 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().

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

◆ components() [1/2]

ConstGeometricDetContainer& GeometricDet::components ( )
inline

Definition at line 154 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().

154 { return container_; }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:207

◆ components() [2/2]

const ConstGeometricDetContainer& GeometricDet::components ( ) const
inline

Definition at line 155 of file GeometricDet.h.

References container_.

155 { return container_; }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:207

◆ computeLegacyShapeParameters()

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

Definition at line 302 of file GeometricDet.cc.

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

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

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

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

◆ deepComponents() [2/2]

void GeometricDet::deepComponents ( ConstGeometricDetContainer cont) const

Definition at line 261 of file GeometricDet.cc.

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

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

◆ deleteComponents()

void GeometricDet::deleteComponents ( )

Definition at line 286 of file GeometricDet.cc.

References container_.

Referenced by ~GeometricDet().

286  {
287  std::for_each(container_.begin(), container_.end(), Deleter());
288  container_.clear();
289 }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:207

◆ geographicalId()

const DetId& GeometricDet::geographicalId ( ) const
inline

◆ isFirstSensor()

bool GeometricDet::isFirstSensor ( ) const
inline

◆ isFromDD4hep()

bool GeometricDet::isFromDD4hep ( ) const
inline

Definition at line 147 of file GeometricDet.h.

References isFromDD4hep_.

147 { return isFromDD4hep_; }
bool isFromDD4hep_
Definition: GeometricDet.h:205

◆ isLeaf()

bool GeometricDet::isLeaf ( ) const
inline

Definition at line 151 of file GeometricDet.h.

References container_.

Referenced by deepComponents().

151 { return container_.empty(); }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:207

◆ isLowerSensor()

bool GeometricDet::isLowerSensor ( ) const
inline

◆ isSecondSensor()

bool GeometricDet::isSecondSensor ( ) 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 98 of file GeometricDet.h.

References ddd_.

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

◆ navType()

const nav_type& GeometricDet::navType ( ) const
inline

Definition at line 97 of file GeometricDet.h.

References ddd_.

Referenced by PGeometricDetBuilder::putOne().

97 { return ddd_; }
nav_type ddd_
Definition: GeometricDet.h:181

◆ params()

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

Definition at line 119 of file GeometricDet.h.

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

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

119  {
122  edm::LogError("GeometricDet::params()")
123  << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!";
124  }
125  return params_;
126  } // in mm
cms::DDSolidShape shape_
Definition: GeometricDet.h:189
std::vector< double > params_
Definition: GeometricDet.h:190
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:195

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

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

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

◆ positionBounds()

GeometricDet::Position GeometricDet::positionBounds ( ) const

Definition at line 232 of file GeometricDet.cc.

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

Referenced by PlaneBuilderFromGeometricDet::plane().

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

◆ printNavType()

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

Definition at line 349 of file GeometricDet.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and dqmiodumpmetadata::n.

Referenced by geometric_det_ns::operator<<().

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

◆ radLength()

double GeometricDet::radLength ( ) const
inline

◆ rho()

double GeometricDet::rho ( ) const
inline

◆ rotation()

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

Definition at line 106 of file GeometricDet.h.

References rot_.

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

106 { return rot_; }
RotationMatrix rot_
Definition: GeometricDet.h:187

◆ rotationBounds()

GeometricDet::Rotation GeometricDet::rotationBounds ( ) const

Definition at line 239 of file GeometricDet.cc.

References rot_, x, y, and z.

Referenced by PlaneBuilderFromGeometricDet::plane().

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

◆ setGeographicalID()

void GeometricDet::setGeographicalID ( DetId  id)
inline

◆ shape()

LegacySolidShape GeometricDet::shape ( void  ) const
inline

Definition at line 115 of file GeometricDet.h.

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

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets().

cms::DDSolidShape shape_
Definition: GeometricDet.h:189
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 117 of file GeometricDet.h.

References shape_.

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

117 { return shape_; }
cms::DDSolidShape shape_
Definition: GeometricDet.h:189

◆ 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 94 of file GeometricDet.h.

References type_.

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

94 { return type_; }
GeometricEnumType type_
Definition: GeometricDet.h:179

◆ xi()

double GeometricDet::xi ( ) const
inline

Member Data Documentation

◆ container_

ConstGeometricDetContainer GeometricDet::container_
private

◆ ddd_

nav_type GeometricDet::ddd_
private

Definition at line 181 of file GeometricDet.h.

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

◆ ddname_

std::string GeometricDet::ddname_
private

Definition at line 178 of file GeometricDet.h.

Referenced by name().

◆ geographicalID_

DetId GeometricDet::geographicalID_ = 0
private

Definition at line 182 of file GeometricDet.h.

Referenced by geographicalId(), and setGeographicalID().

◆ isFirstSensor_

bool GeometricDet::isFirstSensor_ = false
private

Definition at line 201 of file GeometricDet.h.

Referenced by GeometricDet(), and isFirstSensor().

◆ isFromDD4hep_

bool GeometricDet::isFromDD4hep_ = false
private

Definition at line 205 of file GeometricDet.h.

Referenced by isFromDD4hep().

◆ isLowerSensor_

bool GeometricDet::isLowerSensor_ = false
private

Definition at line 199 of file GeometricDet.h.

Referenced by GeometricDet(), and isLowerSensor().

◆ isSecondSensor_

bool GeometricDet::isSecondSensor_ = false
private

Definition at line 202 of file GeometricDet.h.

Referenced by GeometricDet(), and isSecondSensor().

◆ isUpperSensor_

bool GeometricDet::isUpperSensor_ = false
private

Definition at line 200 of file GeometricDet.h.

Referenced by GeometricDet(), and isUpperSensor().

◆ params_

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

Definition at line 190 of file GeometricDet.h.

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

◆ phi_

double GeometricDet::phi_ = 0.
private

Definition at line 186 of file GeometricDet.h.

Referenced by GeometricDet(), and phi().

◆ pixROCCols_

double GeometricDet::pixROCCols_ = 0.
private

Definition at line 195 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCCols().

◆ pixROCRows_

double GeometricDet::pixROCRows_ = 0.
private

Definition at line 194 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCRows().

◆ pixROCx_

double GeometricDet::pixROCx_ = 0.
private

Definition at line 196 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCx().

◆ pixROCy_

double GeometricDet::pixROCy_ = 0.
private

Definition at line 197 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCy().

◆ radLength_

double GeometricDet::radLength_ = 0.
private

Definition at line 192 of file GeometricDet.h.

Referenced by GeometricDet(), and radLength().

◆ rho_

double GeometricDet::rho_ = 0.
private

Definition at line 185 of file GeometricDet.h.

Referenced by rho().

◆ rot_

RotationMatrix GeometricDet::rot_
private

Definition at line 187 of file GeometricDet.h.

Referenced by rotation(), and rotationBounds().

◆ shape_

cms::DDSolidShape GeometricDet::shape_
private

Definition at line 189 of file GeometricDet.h.

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

◆ siliconAPVNum_

double GeometricDet::siliconAPVNum_ = 0.
private

Definition at line 203 of file GeometricDet.h.

Referenced by GeometricDet(), and siliconAPVNum().

◆ stereo_

bool GeometricDet::stereo_ = false
private

Definition at line 198 of file GeometricDet.h.

Referenced by GeometricDet(), and stereo().

◆ trans_

Translation GeometricDet::trans_
private

Definition at line 184 of file GeometricDet.h.

Referenced by positionBounds(), and translation().

◆ type_

GeometricEnumType GeometricDet::type_
private

◆ xi_

double GeometricDet::xi_ = 0.
private

Definition at line 193 of file GeometricDet.h.

Referenced by GeometricDet(), and xi().