test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
DTGeometryParserFromDDD Class Reference

#include <DTGeometryParserFromDDD.h>

Public Member Functions

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

Private Member Functions

void buildLayer (DDFilteredView &fv, const MuonDDDConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)
 
void parseGeometry (DDFilteredView &fv, const MuonDDDConstants &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 ( const DDCompactView cview,
const MuonDDDConstants muonConstants,
std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &  theLayerIdWiresMap 
)

Constructor.

Definition at line 12 of file DTGeometryParserFromDDD.cc.

References DDFilteredView::addFilter(), AND, ecal_dqm_sourceclient-live_cfg::cerr, alignCSCRings::e, cppFunctionSkipper::exception, alcazmumu_cfi::filter, matches, DDSpecificsFilter::setCriteria(), AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

12  {
13 
14  try {
15  std::string attribute = "MuStructure";
16  std::string value = "MuonBarrelDT";
17  DDValue val(attribute, value, 0.0);
18 
19  // Asking only for the Muon DTs
21  filter.setCriteria(val, // name & value of a variable
23  DDLogOp::AND,
24  true, // compare strings otherwise doubles
25  true // use merged-specifics or simple-specifics
26  );
27  DDFilteredView fview(*cview);
28  fview.addFilter(filter);
29 
30  parseGeometry(fview, muonConstants, theLayerIdWiresMap);
31  }
32  catch (const cms::Exception & e ) {
33  std::cerr << "DTGeometryParserFromDDD::build() : DDD Exception: something went wrong during XML parsing!" << std::endl
34  << " Message: " << e << std::endl
35  << " Terminating execution ... " << std::endl;
36  throw;
37  }
38  catch (const exception & e) {
39  std::cerr << "DTGeometryParserFromDDD::build() : an unexpected exception occured: " << e.what() << std::endl;
40  throw;
41  }
42  catch (...) {
43  std::cerr << "DTGeometryParserFromDDD::build() : An unexpected exception occured!" << std::endl
44  << " Terminating execution ... " << std::endl;
45  std::unexpected();
46  }
47 }
void parseGeometry(DDFilteredView &fv, const MuonDDDConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:245
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:32
DTGeometryParserFromDDD::~DTGeometryParserFromDDD ( )

Destructor.

Definition at line 49 of file DTGeometryParserFromDDD.cc.

49  {
50 }

Member Function Documentation

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

Definition at line 90 of file DTGeometryParserFromDDD.cc.

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

91  {
92  MuonDDDNumbering mdddnum(muonConstants);
93  DTNumberingScheme dtnum(muonConstants);
94  int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
95  DTLayerId layId(rawid);
96 
97  // Loop on wires
98  bool doWire = fv.firstChild();
99  int WCounter=0;
100  int firstWire=fv.copyno();
101  while (doWire) {
102  WCounter++;
103  doWire = fv.nextSibling(); // next wire
104  }
105  theLayerIdWiresMap[layId] = (make_pair(firstWire,WCounter));
106 }
bool nextSibling()
set the current node to the next sibling ...
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
int copyno() const
Copy number associated with the current node.
bool firstChild()
set the current node to the first child ...
void DTGeometryParserFromDDD::parseGeometry ( DDFilteredView fv,
const MuonDDDConstants muonConstants,
std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &  theLayerIdWiresMap 
)
private

Definition at line 52 of file DTGeometryParserFromDDD.cc.

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

52  {
53 
54  bool doChamber = fv.firstChild();
55 
56  // Loop on chambers
57  int ChamCounter=0;
58  while (doChamber){
59  ChamCounter++;
60 
61  // Loop on SLs
62  bool doSL = fv.firstChild();
63  int SLCounter=0;
64  while (doSL) {
65  SLCounter++;
66 
67  bool doL = fv.firstChild();
68  int LCounter=0;
69  // Loop on SLs
70  while (doL) {
71  LCounter++;
72  //DTLayer* layer =
73  buildLayer(fv, muonConstants, theLayerIdWiresMap);
74 
75  fv.parent();
76  doL = fv.nextSibling(); // go to next layer
77  } // layers
78 
79  fv.parent();
80  doSL = fv.nextSibling(); // go to next SL
81  } // sls
82 
83  fv.parent();
84  doChamber = fv.nextSibling(); // go to next chamber
85  } // chambers
86 
87 }
bool parent()
set the current node to the parent node ...
bool nextSibling()
set the current node to the next sibling ...
bool firstChild()
set the current node to the first child ...
void buildLayer(DDFilteredView &fv, const MuonDDDConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)