ATLAS Offline Software
Loading...
Searching...
No Matches
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
9using namespace std;
10
11
12void
13L1MuonPtEncoding::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
19void
20L1MuonPtEncoding::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
26void
27L1MuonPtEncoding::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
36void
37L1MuonPtEncoding::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}
unsigned int uint
std::ostream & mioctIndent(std::ostream &o, int lvl, int size)
#define x
void setCodingInfo(unsigned int idx, unsigned int ptCode, unsigned int thresholdValue)
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
void getCodingInfo(unsigned int idx, unsigned int &ptCode, unsigned int &thresholdValue) const
void print(const std::string &indent="", unsigned int detail=1) const
static std::vector< std::string > xmlfile
Definition iLumiCalc.h:29
STL namespace.