ATLAS Offline Software
L1MuonPtEncoding.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include <iostream>
8 
9 using namespace std;
10 
11 
12 void
13 L1MuonPtEncoding::setCodingInfo(unsigned int idx, unsigned int ptCode, unsigned int thresholdValue ) {
14  auto & x = m_encoding[idx];
15  x.ptCode = ptCode;
16  x.thresholdValue = thresholdValue;
17 }
18 
19 void
20 L1MuonPtEncoding::getCodingInfo(unsigned int idx, unsigned int & ptCode, unsigned int & thresholdValue ) const {
21  auto & x = m_encoding[idx];
22  ptCode = x.ptCode;
23  thresholdValue = x.thresholdValue;
24 }
25 
26 void
27 L1MuonPtEncoding::print(const std::string& indent, unsigned int /*detail*/) const {
28  uint idx = 1;
29  for(auto & x : m_encoding) {
30  cout << indent << "pt " << idx++
31  << ", thr " << x.thresholdValue
32  << " -> code = " << x.ptCode << endl;
33  }
34 }
35 
36 void
37 L1MuonPtEncoding::writeXML(std::ostream & xmlfile, int indentLevel, int indentWidth) const {
38  uint idx = 1;
39  mioctIndent(xmlfile, indentLevel, indentWidth) << "<PtEncoding>" << endl;
40  for(auto & x : m_encoding) {
41  mioctIndent(xmlfile, indentLevel+1, indentWidth)
42  << "<PtCodeElement pt=\"" << idx++
43  << "\" code=\"" << x.ptCode
44  << "\" value=\"" << x.thresholdValue
45  << "\"/>\n";
46  }
47  mioctIndent(xmlfile, indentLevel, indentWidth) << "</PtEncoding>" << endl;
48 }
L1MuonPtEncoding::setCodingInfo
void setCodingInfo(unsigned int idx, unsigned int ptCode, unsigned int thresholdValue)
Definition: L1MuonPtEncoding.cxx:13
L1MuonPtEncoding::print
void print(const std::string &indent="", unsigned int detail=1) const
Definition: L1MuonPtEncoding.cxx:27
x
#define x
L1MuonPtEncoding::writeXML
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Definition: L1MuonPtEncoding.cxx:37
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:36
mioctIndent
std::ostream & mioctIndent(std::ostream &o, int lvl, int size)
Definition: MioctROIGeometry.cxx:12
MioctROIGeometry.h
L1MuonPtEncoding.h
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
L1MuonPtEncoding::getCodingInfo
void getCodingInfo(unsigned int idx, unsigned int &ptCode, unsigned int &thresholdValue) const
Definition: L1MuonPtEncoding.cxx:20