ATLAS Offline Software
METSigParam.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <iostream>
8 #include <iomanip>
9 #include <sstream>
10 #include <stdexcept>
11 
12 TrigConf::METSigParam::METSigParam( int XSSigmaScale, int XSSigmaOffset,
13  int XEmin, int XEmax,
14  int TESqrtMin, int TESqrtMax )
15  : m_xsSigmaScale(XSSigmaScale),
16  m_xsSigmaOffset(XSSigmaOffset),
17  m_XEmin(XEmin),
18  m_XEmax(XEmax),
19  m_TESqrtMin(TESqrtMin),
20  m_TESqrtMax(TESqrtMax)
21 {
22  checkValueRange(XEmin, XEmax, TESqrtMin, TESqrtMax);
23 }
24 
26  : m_xsSigmaScale(0),
27  m_xsSigmaOffset(0),
28  m_XEmin(0),
29  m_XEmax(0),
30  m_TESqrtMin(0),
31  m_TESqrtMax(0)
32 {}
33 
34 void
35 TrigConf::METSigParam::setValues( int XSSigmaScale, int XSSigmaOffset,
36  int XEmin, int XEmax,
37  int TESqrtMin, int TESqrtMax) {
38 
39  checkValueRange(XEmin, XEmax, TESqrtMin, TESqrtMax);
40 
41  m_xsSigmaScale = XSSigmaScale;
42  m_xsSigmaOffset = XSSigmaOffset;
43  m_XEmin = XEmin;
44  m_XEmax = XEmax;
45  m_TESqrtMin = TESqrtMin;
46  m_TESqrtMax = TESqrtMax;
47 }
48 
49 void
50 TrigConf::METSigParam::getValues( int & XSSigmaScale, int & XSSigmaOffset,
51  int & XEmin, int & XEmax,
52  int & TESqrtMin, int & TESqrtMax) const {
53 
54  XSSigmaScale = m_xsSigmaScale;
55  XSSigmaOffset = m_xsSigmaOffset;
56  XEmin = m_XEmin;
57  XEmax = m_XEmax;
58  TESqrtMin = m_TESqrtMin;
59  TESqrtMax = m_TESqrtMax;
60 }
61 
62 
63 void
64 TrigConf::METSigParam::print(const std::string& indent, unsigned int /*detail*/) const {
65  std::cout << indent << " METSigParam:" << std::endl;
66  std::cout << indent << " xsSigmaScale : " << m_xsSigmaScale << std::endl
67  << indent << " xsSigmaOffset: " << m_xsSigmaOffset << std::endl
68  << indent << " xeMin : " << m_XEmin << std::endl
69  << indent << " xeMax : " << m_XEmax << std::endl
70  << indent << " teSqrtMin : " << m_TESqrtMin << std::endl
71  << indent << " teSqrtMax : " << m_TESqrtMax << std::endl;
72 }
73 
74 void
75 TrigConf::METSigParam::writeXML(std::ostream & xmlfile, int indentLevel, int indentWidth) const {
76 
77  int width = indentLevel*indentWidth;
78  if(width!=0) xmlfile << std::setw(width) << " ";
79 
80  xmlfile << "<METSignificance"
81  << " xeMin=\"" << m_XEmin << "\""
82  << " xeMax=\"" << m_XEmax << "\""
83  << " teSqrtMin=\"" << m_TESqrtMin << "\""
84  << " teSqrtMax=\"" << m_TESqrtMax << "\""
85  << " xsSigmaScale=\"" << m_xsSigmaScale << "\""
86  << " xsSigmaOffset=\"" << m_xsSigmaOffset << "\""
87  << "/>" << std::endl;
88 }
89 
90 void
91 TrigConf::METSigParam::checkValueRange(int XEmin, int XEmax, int TESqrtMin, int TESqrtMax) const {
92  std::stringstream outsideValues;
93  bool error = false;
94  outsideValues << "METSigParam: the following values are out of range [0:63]:";
95  if( XEmin<0 || XEmin>63) {
96  outsideValues << " XEmin (" << XEmin << ")";
97  error = true;
98  }
99  if( XEmax<0 || XEmax>63) {
100  outsideValues << " XEmax (" << XEmax << ")";
101  error = true;
102  }
103  if( TESqrtMin<0 || TESqrtMin>63) {
104  outsideValues << " TESqrtMin (" << TESqrtMin << ")";
105  error = true;
106  }
107  if( TESqrtMax<0 || TESqrtMax>63) {
108  outsideValues << " TESqrtMax (" << TESqrtMax << ")";
109  error = true;
110  }
111 
112  if(error)
113  throw std::range_error("");
114 
115 }
116 
117 
TrigConf::METSigParam::writeXML
virtual void writeXML(std::ostream &xmlfile, int indentLevel, int indentWidth) const
Definition: METSigParam.cxx:75
TrigConf::METSigParam::setValues
void setValues(int XSSigmaScale, int XSSigmaOffset, int XEmin, int XEmax, int TESqrtMin, int TESqrtMax)
Definition: METSigParam.cxx:35
TrigConf::METSigParam::getValues
void getValues(int &XSSigmaScale, int &XSSigmaOffset, int &XEmin, int &XEmax, int &TESqrtMin, int &TESqrtMax) const
Definition: METSigParam.cxx:50
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:36
TrigConf::METSigParam::checkValueRange
void checkValueRange(int XEmin, int XEmax, int TESqrtMin, int TESqrtMax) const
Definition: METSigParam.cxx:91
TrigConf::METSigParam::METSigParam
METSigParam()
Definition: METSigParam.cxx:25
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
METSigParam.h
TrigConf::METSigParam::print
virtual void print(const std::string &indent="", unsigned int detail=1) const
Definition: METSigParam.cxx:64
error
Definition: IImpactPoint3dEstimator.h:70