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