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.

Date:
2007/11/02 10:47:48
Revision:
1.1
Author
S. Bolognesi - INFN Torino

Definition at line 23 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 14 of file DTGeometryParserFromDDD.cc.

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

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

Destructor.

Definition at line 51 of file DTGeometryParserFromDDD.cc.

51  {
52 }

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 92 of file DTGeometryParserFromDDD.cc.

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

93  {
94  MuonDDDNumbering mdddnum(muonConstants);
95  DTNumberingScheme dtnum(muonConstants);
96  int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
97  DTLayerId layId(rawid);
98 
99  // Loop on wires
100  bool doWire = fv.firstChild();
101  int WCounter=0;
102  int firstWire=fv.copyno();
103  while (doWire) {
104  WCounter++;
105  doWire = fv.nextSibling(); // next wire
106  }
107  theLayerIdWiresMap[layId] = (make_pair(firstWire,WCounter));
108 }
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 54 of file DTGeometryParserFromDDD.cc.

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

54  {
55 
56  bool doChamber = fv.firstChild();
57 
58  // Loop on chambers
59  int ChamCounter=0;
60  while (doChamber){
61  ChamCounter++;
62 
63  // Loop on SLs
64  bool doSL = fv.firstChild();
65  int SLCounter=0;
66  while (doSL) {
67  SLCounter++;
68 
69  bool doL = fv.firstChild();
70  int LCounter=0;
71  // Loop on SLs
72  while (doL) {
73  LCounter++;
74  //DTLayer* layer =
75  buildLayer(fv, muonConstants, theLayerIdWiresMap);
76 
77  fv.parent();
78  doL = fv.nextSibling(); // go to next layer
79  } // layers
80 
81  fv.parent();
82  doSL = fv.nextSibling(); // go to next SL
83  } // sls
84 
85  fv.parent();
86  doChamber = fv.nextSibling(); // go to next chamber
87  } // chambers
88 
89 }
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)