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 DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
 RPCGeometryParsFromDD ()
 
 ~RPCGeometryParsFromDD ()
 

Private Member Functions

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

Detailed Description

Build the RPCGeometry ftom the DDD description

Author
Port of: MuDDDRPCBuilder, MuonRPCGeometryBuilder (ORCA)
M. Maggi - INFN Bari

Definition at line 22 of file RPCGeometryParsFromDD.h.

Constructor & Destructor Documentation

◆ RPCGeometryParsFromDD()

RPCGeometryParsFromDD::RPCGeometryParsFromDD ( )

Implementation of the RPC Geometry Builder from DDD

Author
Port of: MuDDDRPCBuilder (ORCA)
M. Maggi - INFN Bari

Definition at line 25 of file RPCGeometryParsFromDD.cc.

25 {}

◆ ~RPCGeometryParsFromDD()

RPCGeometryParsFromDD::~RPCGeometryParsFromDD ( )

Definition at line 27 of file RPCGeometryParsFromDD.cc.

27 {}

Member Function Documentation

◆ build()

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

Definition at line 29 of file RPCGeometryParsFromDD.cc.

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

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

Referenced by RPCRecoIdealDBLoader::beginRun().

◆ buildGeometry()

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

Definition at line 42 of file RPCGeometryParsFromDD.cc.

44  {
45  for (bool doSubDets = fview.firstChild(); doSubDets == true; doSubDets = fview.nextSibling()) {
46  // Get the Base Muon Number
47  MuonDDDNumbering mdddnum(muonConstants);
48  MuonBaseNumber mbn = mdddnum.geoHistoryToBaseNumber(fview.geoHistory());
49 
50  // Get the The Rpc det Id
51  RPCNumberingScheme rpcnum(muonConstants);
52  const int detid = rpcnum.baseNumberToUnitNumber(mbn);
53  RPCDetId rpcid(detid);
54 
55  DDValue numbOfStrips("nStrips");
56 
57  std::vector<const DDsvalues_type*> specs(fview.specifics());
58  int nStrips = 0;
59  for (auto& spec : specs) {
60  if (DDfetch(spec, numbOfStrips)) {
61  nStrips = int(numbOfStrips.doubles()[0]);
62  }
63  }
64  if (nStrips == 0)
65  std::cout << "No strip found!!" << std::endl;
66 
67  const std::vector<double> dpar = fview.logicalPart().solid().parameters();
68 
69  const std::string name = fview.logicalPart().name().name();
70  const std::vector<std::string> strpars = {name};
71  const DDTranslation& tran = fview.translation();
72 
73  const DDRotationMatrix& rota = fview.rotation(); //.Inverse();
74  DD3Vector x, y, z;
75  rota.GetComponents(x, y, z);
76  std::vector<double> pars;
77  if (dpar.size() == 3) {
78  const double width = dpar[0];
79  const double length = dpar[1];
80  const double thickness = dpar[2];
81  pars = {width, length, thickness, numbOfStrips.doubles()[0]};
82  } else {
83  pars = {
84  dpar[4] /*b/2*/, dpar[8] /*B/2*/, dpar[0] /*h/2*/, 0.4, numbOfStrips.doubles()[0] /*h/2*/
85  };
86  }
87 
88  const std::vector<double> vtra = {tran.x(), tran.y(), tran.z()};
89  const std::vector<double> vrot = {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
90  rgeo.insert(rpcid.rawId(), vtra, vrot, pars, strpars);
91  }
92 }

References RPCNumberingScheme::baseNumberToUnitNumber(), gather_cfg::cout, DDfetch(), DDValue::doubles(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonDDDNumbering::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().

MuonDDDNumbering
Definition: MuonDDDNumbering.h:24
DDAxes::y
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
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:80
DDAxes::x
DDRotationMatrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Definition: DDRotationMatrix.h:8
RPCNumberingScheme
Definition: RPCNumberingScheme.h:18
DD3Vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
RPCGeometryParsFromDD::buildGeometry
void buildGeometry(DDFilteredView &fview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
Definition: RPCGeometryParsFromDD.cc:42
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
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
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:40
DDFilteredView::geoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
Definition: DDFilteredView.cc:30
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
DDValue
Definition: DDValue.h:21
DDFilteredView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:26
DDSolid::parameters
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:121
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
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