ATLAS Offline Software
MioctGeometry.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 #include <iostream>
10 
11 using namespace std;
12 
14  m_mioctid(0),
15  m_slot(0),
16  m_Sectors()
17 {}
18 
19 void
20 MioctGeometry::print(const std::string& indent, unsigned int /*detail*/) const {
21  cout << indent << "MioctGeometry: " << endl;
22  cout << indent << "\tid: " << m_mioctid << endl;
23  cout << indent << "\tslot: " << m_slot << endl;
24  for(std::vector<MioctSectorGeometry>::const_iterator isec = m_Sectors.begin(); isec < m_Sectors.end(); ++isec)
25  isec->print(indent+indent);
26  for(std::vector<MioctSectorGeometry>::const_iterator isec = m_Sectors.begin(); isec < m_Sectors.end(); ++isec)
27  isec->print(indent+indent);
28 
29 }
30 
31 void
32 MioctGeometry::writeXML(std::ostream & xmlfile, int indentLevel, int indentWidth) const {
33  mioctIndent(xmlfile, indentLevel, indentWidth) << "<MIOCT "
34  << "id=\"" << m_mioctid
35  << "\" slot=\"" << m_slot
36  << "\">" << endl;
37  std::string xtmp = "<!-- contains sectors ";
38  for(std::vector<MioctSectorGeometry>::const_iterator isec = m_Sectors.begin(); isec < m_Sectors.end(); ++isec)
39  {
40  xtmp.append(isec->name());
41  if (isec+1 != m_Sectors.end())
42  xtmp.append(", ");
43  }
44 
45  mioctIndent(xmlfile, indentLevel+1, indentWidth) <<xtmp << " -->"<<endl;
46  for(std::vector<MioctSectorGeometry>::const_iterator isec = m_Sectors.begin(); isec < m_Sectors.end(); ++isec)
47  isec->writeXML(xmlfile, indentLevel+1, indentWidth);
48 
49  mioctIndent(xmlfile, indentLevel+1, indentWidth) << "<Decode>\n";
50  for(std::vector<MioctTopoCellGeometry>::const_iterator itopo = m_TopoCells.begin(); itopo < m_TopoCells.end(); ++itopo)
51  itopo->writeXML(xmlfile, indentLevel+2, indentWidth);
52  mioctIndent(xmlfile, indentLevel+1, indentWidth) << "</Decode>\n";
53 
54  mioctIndent(xmlfile, indentLevel, indentWidth) << "</MIOCT>" << endl;
55 
56 }
MioctGeometry::m_mioctid
unsigned int m_mioctid
Definition: MioctGeometry.h:36
MioctGeometry.h
MioctTopoCellGeometry.h
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:18
MioctGeometry::writeXML
virtual void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Definition: MioctGeometry.cxx:32
mioctIndent
std::ostream & mioctIndent(std::ostream &o, int lvl, int size)
Definition: MioctROIGeometry.cxx:12
MioctGeometry::MioctGeometry
MioctGeometry()
Definition: MioctGeometry.cxx:13
MioctROIGeometry.h
MioctGeometry::m_Sectors
std::vector< MioctSectorGeometry > m_Sectors
Definition: MioctGeometry.h:38
MioctSectorGeometry.h
MioctGeometry::m_TopoCells
std::vector< MioctTopoCellGeometry > m_TopoCells
Definition: MioctGeometry.h:39
MioctGeometry::print
virtual void print(const std::string &indent="", unsigned int detail=1) const
Definition: MioctGeometry.cxx:20
MioctGeometry::m_slot
unsigned int m_slot
Definition: MioctGeometry.h:37