CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
GEMGeometryParsFromDD Class Reference

#include <GEMGeometryParsFromDD.h>

Public Member Functions

void build (const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
 GEMGeometryParsFromDD ()
 
 ~GEMGeometryParsFromDD ()
 

Private Member Functions

void buildChamber (DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
 
void buildEtaPartition (DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
 
void buildGeometry (DDFilteredView &fview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
void buildSuperChamber (DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
 
std::vector< double > getRotation (DDFilteredView &fv)
 
std::vector< double > getTranslation (DDFilteredView &fv)
 

Detailed Description

Build the GEMGeometry ftom the DDD description

Author
M. Maggi - INFN Bari

Definition at line 22 of file GEMGeometryParsFromDD.h.

Constructor & Destructor Documentation

◆ GEMGeometryParsFromDD()

GEMGeometryParsFromDD::GEMGeometryParsFromDD ( )

Implementation of the GEM Geometry Builder from DDD

Author
M. Maggi - INFN Bari

Definition at line 24 of file GEMGeometryParsFromDD.cc.

24 {}

◆ ~GEMGeometryParsFromDD()

GEMGeometryParsFromDD::~GEMGeometryParsFromDD ( )

Definition at line 26 of file GEMGeometryParsFromDD.cc.

26 {}

Member Function Documentation

◆ build()

void GEMGeometryParsFromDD::build ( const DDCompactView cview,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rgeo 
)

Definition at line 28 of file GEMGeometryParsFromDD.cc.

30  {
31  std::string attribute = "MuStructure";
32  std::string value = "MuonEndCapGEM";
33 
34  // Asking only for the MuonGEM's
36  DDFilteredView fv(*cview, filter);
37 
38  this->buildGeometry(fv, muonConstants, rgeo);
39 }

References buildGeometry(), ALCARECOTkAlBeamHalo_cff::filter, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by GEMRecoIdealDBLoader::beginRun().

◆ buildChamber()

void GEMGeometryParsFromDD::buildChamber ( DDFilteredView fv,
GEMDetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 119 of file GEMGeometryParsFromDD.cc.

119  {
120  LogDebug("GEMGeometryParsFromDD") << "buildChamber " << fv.logicalPart().name().name() << " " << detId << std::endl;
121 
123  std::vector<double> dpar = solid.solidA().parameters();
124 
125  double dy = dpar[0]; //length is along local Y
126  double dz = dpar[3]; // thickness is long local Z
127  double dx1 = dpar[4]; // bottom width is along local X
128  double dx2 = dpar[8]; // top width is along local X
129  dpar = solid.solidB().parameters();
130  dz += dpar[3]; // chamber thickness
131 
132  GEMDetId gemid = detId.chamberId();
133 
134  std::vector<double> pars{dx1, dx2, dy, dz};
135  std::vector<double> vtra = getTranslation(fv);
136  std::vector<double> vrot = getRotation(fv);
137 
138  LogDebug("GEMGeometryParsFromDD") << "dimension dx1 " << dx1 << ", dx2 " << dx2 << ", dy " << dy << ", dz " << dz;
139  rgeo.insert(gemid.rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
140 }

References GEMDetId::chamberId(), PVValHelper::dy, PVValHelper::dz, getRotation(), getTranslation(), RecoIdealGeometry::insert(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), DDSolid::parameters(), DetId::rawId(), DDLogicalPart::solid(), DDBooleanSolid::solidA(), and DDBooleanSolid::solidB().

Referenced by buildGeometry().

◆ buildEtaPartition()

void GEMGeometryParsFromDD::buildEtaPartition ( DDFilteredView fv,
GEMDetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 142 of file GEMGeometryParsFromDD.cc.

142  {
143  LogDebug("GEMGeometryParsFromDD") << "buildEtaPartition " << fv.logicalPart().name().name() << " " << detId
144  << std::endl;
145 
146  // EtaPartition specific parameter (nstrips and npads)
147  DDValue numbOfStrips("nStrips");
148  DDValue numbOfPads("nPads");
149  const std::vector<const DDsvalues_type*>& specs = fv.specifics();
150  double nStrips = 0., nPads = 0.;
151  for (auto const& is : specs) {
152  if (DDfetch(is, numbOfStrips))
153  nStrips = numbOfStrips.doubles()[0];
154  if (DDfetch(is, numbOfPads))
155  nPads = numbOfPads.doubles()[0];
156  }
157  LogDebug("GEMGeometryParsFromDD") << ((nStrips == 0.) ? ("No nStrips found!!")
158  : ("Number of strips: " + std::to_string(nStrips)));
159  LogDebug("GEMGeometryParsFromDD") << ((nPads == 0.) ? ("No nPads found!!")
160  : ("Number of pads: " + std::to_string(nPads)));
161 
162  // EtaPartition specific parameter (size)
163  std::vector<double> dpar = fv.logicalPart().solid().parameters();
164 
165  double dy = dpar[0]; //length is along local Y
166  double dz = dpar[3]; //0.4;// thickness is long local Z
167  double dx1 = dpar[4]; // bottom width is along local X
168  double dx2 = dpar[8]; // top width is along local X
169 
170  std::vector<double> pars{dx1, dx2, dy, dz, nStrips, nPads};
171  std::vector<double> vtra = getTranslation(fv);
172  std::vector<double> vrot = getRotation(fv);
173 
174  LogDebug("GEMGeometryParsFromDD") << "dimension dx1 " << dx1 << ", dx2 " << dx2 << ", dy " << dy << ", dz " << dz;
175  rgeo.insert(detId.rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
176 }

References DDfetch(), DDValue::doubles(), PVValHelper::dy, PVValHelper::dz, getRotation(), getTranslation(), RecoIdealGeometry::insert(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), me0TriggerPseudoDigis_cff::nStrips, DDSolid::parameters(), DetId::rawId(), DDLogicalPart::solid(), DDFilteredView::specifics(), and HistogramManager_cfi::specs.

Referenced by buildGeometry().

◆ buildGeometry()

void GEMGeometryParsFromDD::buildGeometry ( DDFilteredView fview,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rgeo 
)
private

Definition at line 41 of file GEMGeometryParsFromDD.cc.

43  {
44  LogDebug("GEMGeometryParsFromDD") << "Building the geometry service";
45  LogDebug("GEMGeometryParsFromDD") << "About to run through the GEM structure\n"
46  << " First logical part " << fv.logicalPart().name().name();
47 
48  MuonDDDNumbering muonDDDNumbering(muonConstants);
49  GEMNumberingScheme gemNumbering(muonConstants);
50 
51  bool doSuper = fv.firstChild();
52  LogDebug("GEMGeometryParsFromDD") << "doSuperChamber = " << doSuper;
53  // loop over superchambers
54  while (doSuper) {
55  // getting chamber id from eta partitions
56  fv.firstChild();
57  fv.firstChild();
58  GEMDetId detIdCh =
59  GEMDetId(gemNumbering.baseNumberToUnitNumber(muonDDDNumbering.geoHistoryToBaseNumber(fv.geoHistory())));
60  // back to chambers
61  fv.parent();
62  fv.parent();
63 
64  // currently there is no superchamber in the geometry
65  // only 2 chambers are present separated by a gap.
66  // making superchamber out of the first chamber layer including the gap between chambers
67  if (detIdCh.layer() == 1) { // only make superChambers when doing layer 1
68  buildSuperChamber(fv, detIdCh, rgeo);
69  }
70  buildChamber(fv, detIdCh, rgeo);
71 
72  // loop over chambers
73  // only 1 chamber
74  bool doChambers = fv.firstChild();
75  while (doChambers) {
76  // loop over GEMEtaPartitions
77  bool doEtaPart = fv.firstChild();
78  while (doEtaPart) {
79  GEMDetId detId =
80  GEMDetId(gemNumbering.baseNumberToUnitNumber(muonDDDNumbering.geoHistoryToBaseNumber(fv.geoHistory())));
81  buildEtaPartition(fv, detId, rgeo);
82 
83  doEtaPart = fv.nextSibling();
84  }
85  fv.parent();
86  doChambers = fv.nextSibling();
87  }
88  fv.parent();
89  doSuper = fv.nextSibling();
90  }
91 }

References GEMNumberingScheme::baseNumberToUnitNumber(), buildChamber(), buildEtaPartition(), buildSuperChamber(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonDDDNumbering::geoHistoryToBaseNumber(), GEMDetId::layer(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), DDFilteredView::nextSibling(), and DDFilteredView::parent().

Referenced by build().

◆ buildSuperChamber()

void GEMGeometryParsFromDD::buildSuperChamber ( DDFilteredView fv,
GEMDetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 93 of file GEMGeometryParsFromDD.cc.

93  {
94  LogDebug("GEMGeometryParsFromDD") << "buildSuperChamber " << fv.logicalPart().name().name() << " " << detId
95  << std::endl;
96 
98  std::vector<double> dpar = solid.solidA().parameters();
99 
100  double dy = dpar[0]; //length is along local Y
101  double dz = dpar[3]; // thickness is long local Z
102  double dx1 = dpar[4]; // bottom width is along local X
103  double dx2 = dpar[8]; // top width is along local X
104  dpar = solid.solidB().parameters();
105  dz += dpar[3]; // chamber thickness
106  dz *= 2; // 2 chambers in superchamber
107  dz += 2.105; // gap between chambers
108 
109  GEMDetId gemid = detId.superChamberId();
110 
111  std::vector<double> pars{dx1, dx2, dy, dz};
112  std::vector<double> vtra = getTranslation(fv);
113  std::vector<double> vrot = getRotation(fv);
114 
115  LogDebug("GEMGeometryParsFromDD") << "dimension dx1 " << dx1 << ", dx2 " << dx2 << ", dy " << dy << ", dz " << dz;
116  rgeo.insert(gemid.rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
117 }

References PVValHelper::dy, PVValHelper::dz, getRotation(), getTranslation(), RecoIdealGeometry::insert(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), DDSolid::parameters(), DetId::rawId(), DDLogicalPart::solid(), DDBooleanSolid::solidA(), DDBooleanSolid::solidB(), and GEMDetId::superChamberId().

Referenced by buildGeometry().

◆ getRotation()

std::vector< double > GEMGeometryParsFromDD::getRotation ( DDFilteredView fv)
private

Definition at line 183 of file GEMGeometryParsFromDD.cc.

183  {
184  const DDRotationMatrix& rota = fv.rotation(); //.Inverse();
185  DD3Vector x, y, z;
186  rota.GetComponents(x, y, z);
187  return {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
188 }

References DDFilteredView::rotation(), x, y, and z.

Referenced by buildChamber(), buildEtaPartition(), and buildSuperChamber().

◆ getTranslation()

std::vector< double > GEMGeometryParsFromDD::getTranslation ( DDFilteredView fv)
private

Definition at line 178 of file GEMGeometryParsFromDD.cc.

178  {
179  const DDTranslation& tran = fv.translation();
180  return {tran.x(), tran.y(), tran.z()};
181 }

References DDFilteredView::translation().

Referenced by buildChamber(), buildEtaPartition(), and buildSuperChamber().

DDBooleanSolid::solidB
DDSolid solidB(void) const
Definition: DDSolid.cc:468
MuonDDDNumbering
Definition: MuonDDDNumbering.h:24
DDAxes::y
GEMNumberingScheme
Definition: GEMNumberingScheme.h:9
GEMDetId::layer
constexpr int layer() const
Definition: GEMDetId.h:184
GEMGeometryParsFromDD::getRotation
std::vector< double > getRotation(DDFilteredView &fv)
Definition: GEMGeometryParsFromDD.cc:183
DDFilteredView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
Definition: DDFilteredView.cc:16
HistogramManager_cfi.specs
specs
Definition: HistogramManager_cfi.py:80
GEMDetId::superChamberId
constexpr GEMDetId superChamberId() const
Definition: GEMDetId.h:196
DDAxes::x
DDRotationMatrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Definition: DDRotationMatrix.h:8
DD3Vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
DDBooleanSolid
Definition: DDSolid.h:173
GEMGeometryParsFromDD::buildSuperChamber
void buildSuperChamber(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
Definition: GEMGeometryParsFromDD.cc:93
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDBase::name
const N & name() const
Definition: DDBase.h:59
DDAxes::z
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
GEMDetId
Definition: GEMDetId.h:17
value
Definition: value.py:1
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:40
PVValHelper::dy
Definition: PVValidationHelpers.h:49
DDFilteredView::specifics
std::vector< const DDsvalues_type * > specifics() const
Definition: DDFilteredView.cc:32
me0TriggerPseudoDigis_cff.nStrips
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
Definition: me0TriggerPseudoDigis_cff.py:26
GEMGeometryParsFromDD::buildEtaPartition
void buildEtaPartition(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
Definition: GEMGeometryParsFromDD.cc:142
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
GEMGeometryParsFromDD::buildChamber
void buildChamber(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
Definition: GEMGeometryParsFromDD.cc:119
PVValHelper::dz
Definition: PVValidationHelpers.h:50
DDValue
Definition: DDValue.h:21
DDFilteredView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:26
GEMDetId::chamberId
constexpr GEMDetId chamberId() const
Definition: GEMDetId.h:193
GEMGeometryParsFromDD::getTranslation
std::vector< double > getTranslation(DDFilteredView &fv)
Definition: GEMGeometryParsFromDD.cc:178
DDSolid::parameters
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:121
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
DDFilteredView::rotation
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
Definition: DDFilteredView.cc:28
GEMGeometryParsFromDD::buildGeometry
void buildGeometry(DDFilteredView &fview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
Definition: GEMGeometryParsFromDD.cc:41
DDBooleanSolid::solidA
DDSolid solidA(void) const
Definition: DDSolid.cc:466
DDFilteredView
Definition: DDFilteredView.h:20
RecoIdealGeometry::insert
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
Definition: RecoIdealGeometry.h:33
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120