CMS 3D CMS Logo

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

#include <DTGeometryParserFromDDD.h>

Public Member Functions

 DTGeometryParserFromDDD (const DDCompactView *cview, const MuonGeometryConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)
 Constructor. More...
 
 ~DTGeometryParserFromDDD ()
 Destructor. More...
 

Private Member Functions

void buildLayer (DDFilteredView &fv, const MuonGeometryConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)
 
void parseGeometry (DDFilteredView &fv, const MuonGeometryConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)
 

Detailed Description

Class which read the geometry from DDD to provide a map between layerId and pairs with first wire number, total number of wires.

Author
S. Bolognesi - INFN Torino

Definition at line 21 of file DTGeometryParserFromDDD.h.

Constructor & Destructor Documentation

◆ DTGeometryParserFromDDD()

DTGeometryParserFromDDD::DTGeometryParserFromDDD ( const DDCompactView cview,
const MuonGeometryConstants muonConstants,
std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &  theLayerIdWiresMap 
)

Constructor.

Definition at line 11 of file DTGeometryParserFromDDD.cc.

References DMR_cfg::cerr, MillePedeFileConverter_cfg::e, cppFunctionSkipper::exception, ALCARECOTkAlBeamHalo_cff::filter, and AlCaHLTBitMon_QueryRunRegistry::string.

14  {
15  try {
16  std::string attribute = "MuStructure";
17  std::string value = "MuonBarrelDT";
18 
19  // Asking only for the Muon DTs
21  DDFilteredView fview(*cview, filter);
22 
23  parseGeometry(fview, muonConstants, theLayerIdWiresMap);
24  } catch (const cms::Exception& e) {
25  std::cerr << "DTGeometryParserFromDDD::build() : DDD Exception: something went wrong during XML parsing!"
26  << std::endl
27  << " Message: " << e << std::endl;
28  throw;
29  } catch (const exception& e) {
30  std::cerr << "DTGeometryParserFromDDD::build() : an unexpected exception occured: " << e.what() << std::endl;
31  throw;
32  } catch (...) {
33  std::cerr << "DTGeometryParserFromDDD::build() : An unexpected exception occured!" << std::endl;
34  throw;
35  }
36 }
void parseGeometry(DDFilteredView &fv, const MuonGeometryConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)
Definition: value.py:1

◆ ~DTGeometryParserFromDDD()

DTGeometryParserFromDDD::~DTGeometryParserFromDDD ( )

Destructor.

Definition at line 38 of file DTGeometryParserFromDDD.cc.

38 {}

Member Function Documentation

◆ buildLayer()

void DTGeometryParserFromDDD::buildLayer ( DDFilteredView fv,
const MuonGeometryConstants muonConstants,
std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &  theLayerIdWiresMap 
)
private

Definition at line 69 of file DTGeometryParserFromDDD.cc.

References DDFilteredView::copyno(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonGeometryNumbering::geoHistoryToBaseNumber(), DTNumberingScheme::getDetId(), and DDFilteredView::nextSibling().

71  {
72  MuonGeometryNumbering mdddnum(muonConstants);
73  DTNumberingScheme dtnum(muonConstants);
74  int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
75  DTLayerId layId(rawid);
76 
77  // Loop on wires
78  bool doWire = fv.firstChild();
79  int WCounter = 0;
80  int firstWire = fv.copyno();
81  while (doWire) {
82  WCounter++;
83  doWire = fv.nextSibling(); // next wire
84  }
85  theLayerIdWiresMap[layId] = (make_pair(firstWire, WCounter));
86 }
bool nextSibling()
set the current node to the next sibling ...
int copyno() const
Copy number associated with the current node.
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
bool firstChild()
set the current node to the first child ...

◆ parseGeometry()

void DTGeometryParserFromDDD::parseGeometry ( DDFilteredView fv,
const MuonGeometryConstants muonConstants,
std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &  theLayerIdWiresMap 
)
private

Definition at line 40 of file DTGeometryParserFromDDD.cc.

References DDFilteredView::firstChild(), DDFilteredView::nextSibling(), and DDFilteredView::parent().

42  {
43  bool doChamber = fv.firstChild();
44 
45  // Loop on chambers
46  while (doChamber) {
47  // Loop on SLs
48  bool doSL = fv.firstChild();
49  while (doSL) {
50  bool doL = fv.firstChild();
51  // Loop on SLs
52  while (doL) {
53  //DTLayer* layer =
54  buildLayer(fv, muonConstants, theLayerIdWiresMap);
55 
56  fv.parent();
57  doL = fv.nextSibling(); // go to next layer
58  } // layers
59 
60  fv.parent();
61  doSL = fv.nextSibling(); // go to next SL
62  } // sls
63 
64  fv.parent();
65  doChamber = fv.nextSibling(); // go to next chamber
66  } // chambers
67 }
bool parent()
set the current node to the parent node ...
bool nextSibling()
set the current node to the next sibling ...
void buildLayer(DDFilteredView &fv, const MuonGeometryConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)
bool firstChild()
set the current node to the first child ...