CMS 3D CMS Logo

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

#include <RPCGeometryParsFromDD.h>

Public Member Functions

void build (const cms::DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
void build (const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
 RPCGeometryParsFromDD ()
 
 ~RPCGeometryParsFromDD ()
 

Private Member Functions

void buildGeometry (cms::DDFilteredView &fview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
void buildGeometry (DDFilteredView &fview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 

Detailed Description

Definition at line 27 of file RPCGeometryParsFromDD.h.

Constructor & Destructor Documentation

◆ RPCGeometryParsFromDD()

RPCGeometryParsFromDD::RPCGeometryParsFromDD ( )

Definition at line 27 of file RPCGeometryParsFromDD.cc.

27 {}

◆ ~RPCGeometryParsFromDD()

RPCGeometryParsFromDD::~RPCGeometryParsFromDD ( )

Definition at line 29 of file RPCGeometryParsFromDD.cc.

29 {}

Member Function Documentation

◆ build() [1/2]

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

Definition at line 47 of file RPCGeometryParsFromDD.cc.

49  {
50  const std::string attribute = "ReadOutName";
51  const std::string value = "MuonRPCHits";
52  const cms::DDFilter filter(attribute, value);
53  cms::DDFilteredView fview(*cview, filter);
54  this->buildGeometry(fview, muonConstants, rgeo);
55 }

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

◆ build() [2/2]

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

Definition at line 32 of file RPCGeometryParsFromDD.cc.

34  {
35  const std::string attribute = "ReadOutName";
36  const std::string value = "MuonRPCHits";
37 
38  // Asking only for the MuonRPC's
40  DDFilteredView fview(*cview, filter);
41 
42  this->buildGeometry(fview, muonConstants, rgeo);
43 }

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

Referenced by RPCRecoIdealDBLoader::beginRun().

◆ buildGeometry() [1/2]

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

Definition at line 131 of file RPCGeometryParsFromDD.cc.

133  {
134  while (fview.firstChild()) {
135  MuonGeometryNumbering mdddnum(muonConstants);
136  RPCNumberingScheme rpcnum(muonConstants);
137  int rawidCh = rpcnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fview.history()));
138  RPCDetId rpcid = RPCDetId(rawidCh);
139 
140  auto nStrips = fview.get<double>("nStrips");
141 
142  std::vector<double> dpar = fview.parameters();
143 
144  std::string_view name = fview.name();
145 
146  edm::LogVerbatim("RPCGeometryParsFromDD")
147  << " (1), detid: " << rawidCh << " name: " << std::string(name) << " number of Strips: " << nStrips;
148 
149  const std::vector<std::string> strpars = {std::string(name)};
150 
151  std::vector<double> tran(3);
152  tran[0] = static_cast<double>(fview.translation().X()) / dd4hep::mm;
153  tran[1] = static_cast<double>(fview.translation().Y()) / dd4hep::mm;
154  tran[2] = static_cast<double>(fview.translation().Z()) / dd4hep::mm;
155 
156  DDRotationMatrix rota;
157  fview.rot(rota);
158  DD3Vector x, y, z;
159  rota.GetComponents(x, y, z);
160  const std::vector<double> rot = {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
161 
162  if (dd4hep::isA<dd4hep::Box>(fview.solid())) {
163  const std::vector<double> pars = {
164  dpar[0] / dd4hep::mm, dpar[1] / dd4hep::mm, dpar[2] / dd4hep::mm, double(nStrips)};
165  edm::LogVerbatim("RPCGeometryParsFromDD")
166  << " (2), dd4hep::Box, width: " << dpar[0] / dd4hep::mm << " length: " << dpar[1] / dd4hep::mm
167  << " thickness: " << dpar[2] / dd4hep::mm;
168  rgeo.insert(rpcid, tran, rot, pars, strpars);
169  } else {
170  const double ti = 0.4;
171  const std::vector<double> pars = {
172  dpar[0] / dd4hep::mm, dpar[1] / dd4hep::mm, dpar[3] / dd4hep::mm, ti, double(nStrips)};
173  edm::LogVerbatim("RPCGeometryParsFromDD") << " (3), else, dpar[0] (i.e. dpar[4] for DD): " << dpar[0] / dd4hep::mm
174  << " dpar[1] (i.e. dpar[8] for DD): " << dpar[1] / dd4hep::mm
175  << " dpar[3] (i.e. dpar[0] for DD): " << dpar[3] / dd4hep::mm;
176  rgeo.insert(rpcid, tran, rot, pars, strpars);
177  }
178  edm::LogVerbatim("RPCGeometryParsFromDD")
179  << " (4), tran.x(): " << tran[0] << " tran.y(): " << tran[1] << " tran.z(): " << tran[2];
180  edm::LogVerbatim("RPCGeometryParsFromDD")
181  << " (5), x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z(): " << x.X() << ", " << x.Y() << ", "
182  << x.Z() << ", " << y.X() << ", " << y.Y() << ", " << y.Z() << ", " << z.X() << ", " << z.Y() << ", " << z.Z();
183  }
184 }

References RPCNumberingScheme::baseNumberToUnitNumber(), cms::DDFilteredView::firstChild(), MuonGeometryNumbering::geoHistoryToBaseNumber(), cms::DDFilteredView::get(), cms::DDFilteredView::history(), RecoIdealGeometry::insert(), Skims_PA_cff::name, cms::DDFilteredView::name(), me0TriggerPseudoDigis_cff::nStrips, cms::DDFilteredView::parameters(), cms::DDFilteredView::rot(), makeMuonMisalignmentScenario::rot, cms::DDFilteredView::solid(), AlCaHLTBitMon_QueryRunRegistry::string, cms::DDFilteredView::translation(), x, y, and z.

◆ buildGeometry() [2/2]

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

Definition at line 59 of file RPCGeometryParsFromDD.cc.

61  {
62  for (bool doSubDets = fview.firstChild(); doSubDets == true; doSubDets = fview.nextSibling()) {
63  // Get the Base Muon Number
64  MuonGeometryNumbering mdddnum(muonConstants);
65  MuonBaseNumber mbn = mdddnum.geoHistoryToBaseNumber(fview.geoHistory());
66 
67  // Get the The Rpc det Id
68  RPCNumberingScheme rpcnum(muonConstants);
69  const int detid = rpcnum.baseNumberToUnitNumber(mbn);
70 
71  RPCDetId rpcid(detid);
72 
73  DDValue numbOfStrips("nStrips");
74 
75  std::vector<const DDsvalues_type*> specs(fview.specifics());
76  int nStrips = 0;
77  for (auto& spec : specs) {
78  if (DDfetch(spec, numbOfStrips)) {
79  nStrips = int(numbOfStrips.doubles()[0]);
80  }
81  }
82  if (nStrips == 0)
83  std::cout << "No strip found!!" << std::endl;
84 
85  const std::vector<double> dpar = fview.logicalPart().solid().parameters();
86 
87  const std::string name = fview.logicalPart().name().name();
88 
89  edm::LogVerbatim("RPCGeometryParsFromDD")
90  << " (1) "
91  << "detid: " << detid << " name: " << name << " number of Strips: " << nStrips;
92 
93  const std::vector<std::string> strpars = {name};
94  const DDTranslation& tran = fview.translation();
95 
96  const DDRotationMatrix& rota = fview.rotation(); //.Inverse();
97  DD3Vector x, y, z;
98  rota.GetComponents(x, y, z);
99  std::vector<double> pars;
100  if (dpar.size() == 3) {
101  const double width = dpar[0];
102  const double length = dpar[1];
103  const double thickness = dpar[2];
104  edm::LogVerbatim("RPCGeometryParsFromDD")
105  << " (2) dpar.size() == 3, width: " << width << " length: " << length << " thickness: " << thickness;
106  pars = {width, length, thickness, numbOfStrips.doubles()[0]};
107  } else {
108  const double dpar4 = dpar[4];
109  const double dpar8 = dpar[8];
110  const double dpar0 = dpar[0];
111  pars = {dpar4, dpar8, dpar0, 0.4, numbOfStrips.doubles()[0]};
112  edm::LogVerbatim("RPCGeometryParsFromDD")
113  << " (3), else, dpar[4]: " << dpar4 << " dpar[8]: " << dpar8 << " dpar[0]: " << dpar0;
114  }
115 
116  const std::vector<double> vtra = {tran.x(), tran.y(), tran.z()};
117 
118  edm::LogVerbatim("RPCGeometryParsFromDD")
119  << " (4), tran.x() " << tran.x() << " tran.y(): " << tran.y() << " tran.z(): " << tran.z();
120 
121  const std::vector<double> vrot = {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
122  edm::LogVerbatim("RPCGeometryParsFromDD")
123  << " (5), x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z() " << x.X() << ", " << x.Y() << ", "
124  << x.Z() << ", " << y.X() << ", " << y.Y() << ", " << y.Z() << ", " << z.X() << ", " << z.Y() << ", " << z.Z();
125  rgeo.insert(rpcid.rawId(), vtra, vrot, pars, strpars);
126  }
127 }

References RPCNumberingScheme::baseNumberToUnitNumber(), gather_cfg::cout, DDfetch(), DDValue::doubles(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonGeometryNumbering::geoHistoryToBaseNumber(), RecoIdealGeometry::insert(), createfilelist::int, DDFilteredView::logicalPart(), Skims_PA_cff::name, DDName::name(), DDBase< N, C >::name(), DDFilteredView::nextSibling(), me0TriggerPseudoDigis_cff::nStrips, DDSolid::parameters(), DetId::rawId(), DDFilteredView::rotation(), DDLogicalPart::solid(), DDFilteredView::specifics(), HistogramManager_cfi::specs, AlCaHLTBitMon_QueryRunRegistry::string, Calorimetry_cff::thickness, DDFilteredView::translation(), ApeEstimator_cff::width, x, y, and z.

Referenced by build().

cms::DDFilteredView::rot
const Double_t * rot() const
The absolute rotation of the current node.
Definition: DDFilteredView.cc:120
DDAxes::y
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
cms::DDFilteredView::parameters
const std::vector< double > parameters() const
extract shape parameters
Definition: DDFilteredView.cc:536
DDFilteredView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
Definition: DDFilteredView.cc:16
RPCDetId
Definition: RPCDetId.h:16
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HistogramManager_cfi.specs
specs
Definition: HistogramManager_cfi.py:83
DDAxes::x
cms::DDFilteredView
Definition: DDFilteredView.h:70
RPCNumberingScheme
Definition: RPCNumberingScheme.h:18
cms::DDFilteredView::name
std::string_view name() const
Definition: DDFilteredView.cc:857
cms::DDFilteredView::translation
const Translation translation() const
Definition: DDFilteredView.cc:103
cms::DDFilteredView::get
T get(const std::string &)
extract attribute value
cms::DDFilteredView::solid
dd4hep::Solid solid() const
Definition: DDFilteredView.cc:865
RPCGeometryParsFromDD::buildGeometry
void buildGeometry(DDFilteredView &fview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
Definition: RPCGeometryParsFromDD.cc:59
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
cms::DDFilter
Definition: DDFilteredView.h:59
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:115
DDBase::name
const N & name() const
Definition: DDBase.h:59
DDAxes::z
cms::DDFilteredView::firstChild
bool firstChild()
set the current node to the first child
Definition: DDFilteredView.cc:268
DDFilteredView::nextSibling
bool nextSibling()
set the current node to the next sibling ...
Definition: DDFilteredView.cc:124
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
DD3Vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
Definition: PGeometricDetBuilder.cc:20
cms::DDFilteredView::history
const ExpandedNodes & history()
The numbering history of the current node.
Definition: DDFilteredView.cc:686
createfilelist.int
int
Definition: createfilelist.py:10
value
Definition: value.py:1
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
DDFilteredView::geoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
Definition: DDFilteredView.cc:30
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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
MuonBaseNumber
Definition: MuonBaseNumber.h:21
DDRotationMatrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Definition: DDRotationMatrix.h:8
DDValue
Definition: DDValue.h:22
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
DDFilteredView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:26
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
DDSolid::parameters
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:125
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
DDFilteredView::rotation
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
Definition: DDFilteredView.cc:28
MuonGeometryNumbering
Definition: MuonGeometryNumbering.h:24
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