CMS 3D CMS Logo

DTGeometryParserFromDDD.cc
Go to the documentation of this file.
1 
8 
9 using namespace std;
10 
12  const DDCompactView* cview,
13  const MuonGeometryConstants& muonConstants,
14  map<DTLayerId, std::pair<unsigned int, unsigned int> >& theLayerIdWiresMap) {
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  << " Terminating execution ... " << std::endl;
29  throw;
30  } catch (const exception& e) {
31  std::cerr << "DTGeometryParserFromDDD::build() : an unexpected exception occured: " << e.what() << std::endl;
32  throw;
33  } catch (...) {
34  std::cerr << "DTGeometryParserFromDDD::build() : An unexpected exception occured!" << std::endl
35  << " Terminating execution ... " << std::endl;
36  std::unexpected();
37  }
38 }
39 
41 
43  const MuonGeometryConstants& muonConstants,
44  map<DTLayerId, std::pair<unsigned int, unsigned int> >& theLayerIdWiresMap) {
45  bool doChamber = fv.firstChild();
46 
47  // Loop on chambers
48  int ChamCounter = 0;
49  while (doChamber) {
50  ChamCounter++;
51 
52  // Loop on SLs
53  bool doSL = fv.firstChild();
54  int SLCounter = 0;
55  while (doSL) {
56  SLCounter++;
57 
58  bool doL = fv.firstChild();
59  int LCounter = 0;
60  // Loop on SLs
61  while (doL) {
62  LCounter++;
63  //DTLayer* layer =
64  buildLayer(fv, muonConstants, theLayerIdWiresMap);
65 
66  fv.parent();
67  doL = fv.nextSibling(); // go to next layer
68  } // layers
69 
70  fv.parent();
71  doSL = fv.nextSibling(); // go to next SL
72  } // sls
73 
74  fv.parent();
75  doChamber = fv.nextSibling(); // go to next chamber
76  } // chambers
77 }
78 
80  const MuonGeometryConstants& muonConstants,
81  map<DTLayerId, std::pair<unsigned int, unsigned int> >& theLayerIdWiresMap) {
82  MuonDDDNumbering mdddnum(muonConstants);
83  DTNumberingScheme dtnum(muonConstants);
84  int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
85  DTLayerId layId(rawid);
86 
87  // Loop on wires
88  bool doWire = fv.firstChild();
89  int WCounter = 0;
90  int firstWire = fv.copyno();
91  while (doWire) {
92  WCounter++;
93  doWire = fv.nextSibling(); // next wire
94  }
95  theLayerIdWiresMap[layId] = (make_pair(firstWire, WCounter));
96 }
DTGeometryParserFromDDD.h
MuonDDDNumbering
Definition: MuonDDDNumbering.h:24
MuonGeometryConstants
Definition: MuonGeometryConstants.h:20
MuonDDDNumbering::geoHistoryToBaseNumber
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history) const
Definition: MuonDDDNumbering.cc:37
DTLayerId.h
DDFilteredView::parent
bool parent()
set the current node to the parent node ...
Definition: DDFilteredView.cc:161
DTNumberingScheme::getDetId
int getDetId(const MuonBaseNumber &num) const
Definition: DTNumberingScheme.cc:65
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
DDFilteredView::nextSibling
bool nextSibling()
set the current node to the next sibling ...
Definition: DDFilteredView.cc:124
DTGeometryParserFromDDD::parseGeometry
void parseGeometry(DDFilteredView &fv, const MuonGeometryConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)
Definition: DTGeometryParserFromDDD.cc:42
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
DTLayerId
Definition: DTLayerId.h:12
DTGeometryParserFromDDD::buildLayer
void buildLayer(DDFilteredView &fv, const MuonGeometryConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)
Definition: DTGeometryParserFromDDD.cc:79
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
value
Definition: value.py:1
DDFilteredView::geoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
Definition: DDFilteredView.cc:30
std
Definition: JetResolutionObject.h:76
DTGeometryParserFromDDD::DTGeometryParserFromDDD
DTGeometryParserFromDDD(const DDCompactView *cview, const MuonGeometryConstants &muonConstants, std::map< DTLayerId, std::pair< unsigned int, unsigned int > > &theLayerIdWiresMap)
Constructor.
Definition: DTGeometryParserFromDDD.cc:11
DDValue
Definition: DDValue.h:21
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
DDFilteredView
Definition: DDFilteredView.h:20
cms::Exception
Definition: Exception.h:70
genParticles_cff.map
map
Definition: genParticles_cff.py:11
DTGeometryParserFromDDD::~DTGeometryParserFromDDD
~DTGeometryParserFromDDD()
Destructor.
Definition: DTGeometryParserFromDDD.cc:40
DDFilteredView::copyno
int copyno() const
Copy number associated with the current node.
Definition: DDFilteredView.cc:48
DTNumberingScheme
Definition: DTNumberingScheme.h:19
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37