ATLAS Offline Software
Loading...
Searching...
No Matches
CaloInfo.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#include <iostream>
7
8using namespace std;
9using namespace TrigConf;
10
27
28void
30 m_JetWeights.push_back(jw);
31}
32
33
34void
36 m_CaloSinCos.push_back(csc);
37}
38
39void
41 m_GlobalScale = 1;
42 m_CaloSinCos.clear();
43 m_JetWeights.clear();
44
48
52
53}
54
55
56void
57CaloInfo::setIsolation(const std::string & isothrtype, unsigned int bit, const IsolationParam & isopar) {
58 if(bit<1 || bit>5) {
59 cout << "Isolation bit is outside the range [1,5] : " << bit << " - not being used" << endl;
60 return;
61 }
62 if(isothrtype=="HAIsoForEMthr") {
63 m_IsolationHAIsoForEMthr[bit-1] = isopar;
64 } else if(isothrtype=="EMIsoForEMthr") {
65 m_IsolationEMIsoForEMthr[bit-1] = isopar;
66 } else if(isothrtype=="EMIsoForTAUthr") {
67 m_IsolationEMIsoForTAUthr[bit-1] = isopar;
68 } else {
69 cout << "Isolation threshold " << isothrtype << " is unknown [HAIsoForEMthr, EMIsoForEMthr, EMIsoForTAUthr] - not being used" << endl;
70 }
71}
72
73
74void
75CaloInfo::print(const std::string& indent, unsigned int /*detail*/) const {
76
77 cout << indent << "================================================ " << endl;
78 cout << indent << "CaloInfo: " << endl;
80 cout << indent << " Global em scale : " << globalEmScale() << endl;
81 cout << indent << " Global jet scale: " << globalJetScale() << endl;
82 if(m_JetWeights.size()>0) {
83 cout << indent << " JetWeights: ";
84 for(unsigned int i=0; i<m_JetWeights.size(); ++i) {
85 cout << i << ": " << m_JetWeights[i] << ", ";
86 if((i+1)%6==0) cout << endl;
87 if(i==5) cout << indent << " ";
88 }
89 }
90 m_METSigParam.print(indent);
91 for(const IsolationParam & isop : m_IsolationHAIsoForEMthr) {
92 isop.print(indent);
93 }
94 cout << "================================================ " << endl;
95}
96
97void
98TrigConf::CaloInfo::writeXML(std::ostream & xmlfile, int indentLevel, int indentWidth) const {
99
100 indent(xmlfile, indentLevel, indentWidth)
101 << "<CaloInfo name=\""<< name() <<"\" global_em_scale=\""<< globalEmScale() <<"\" global_jet_scale=\""<< globalJetScale() <<"\">" << endl;
102
103 bool hasJetWeights(false);
104 for(int jw : m_JetWeights) // check if there is a jetweight that is not 0
105 if(jw!=0) hasJetWeights = true;
106
107 if(hasJetWeights) {
108 unsigned int num(1);
109 for(int jw : m_JetWeights)
110 indent(xmlfile, indentLevel+1, indentWidth)
111 << "<JetWeight num=\"" << num++ << "\" weight=\""<< jw <<"\"/>" << endl;
112 }
113
114 metSigParam().writeXML(xmlfile, indentLevel+1, indentWidth);
115
116 // isolation parametrization
117 indent(xmlfile, indentLevel+1, indentWidth)
118 << "<Isolation thrtype=\"HAIsoForEMthr\">" << endl;
119 for(const IsolationParam & isop : m_IsolationHAIsoForEMthr)
120 isop.writeXML(xmlfile, indentLevel+2, indentWidth);
121 indent(xmlfile, indentLevel+1, indentWidth)
122 << "</Isolation>" << endl;
123
124 indent(xmlfile, indentLevel+1, indentWidth)
125 << "<Isolation thrtype=\"EMIsoForEMthr\">" << endl;
126 for(const IsolationParam & isop : m_IsolationEMIsoForEMthr)
127 isop.writeXML(xmlfile, indentLevel+2, indentWidth);
128 indent(xmlfile, indentLevel+1, indentWidth)
129 << "</Isolation>" << endl;
130
131 indent(xmlfile, indentLevel+1, indentWidth)
132 << "<Isolation thrtype=\"EMIsoForTAUthr\">" << endl;
133 for(const IsolationParam & isop : m_IsolationEMIsoForTAUthr)
134 isop.writeXML(xmlfile, indentLevel+2, indentWidth);
135 indent(xmlfile, indentLevel+1, indentWidth)
136 << "</Isolation>" << endl;
137
138
139 indent(xmlfile, indentLevel+1, indentWidth)
140 << "<MinimumTOBPt thrtype=\"EM\" ptmin=\"" << m_tobEM.ptmin << "\" etamin=\"" << m_tobEM.etamin << "\" etamax=\"" << m_tobEM.etamax << "\" priority=\"" << m_tobEM.priority << "\"/>" << endl;
141 indent(xmlfile, indentLevel+1, indentWidth)
142 << "<MinimumTOBPt thrtype=\"TAU\" ptmin=\"" << m_tobTau.ptmin << "\" etamin=\"" << m_tobTau.etamin << "\" etamax=\"" << m_tobTau.etamax << "\" priority=\"" << m_tobTau.priority << "\"/>" << endl;
143 indent(xmlfile, indentLevel+1, indentWidth)
144 << "<MinimumTOBPt thrtype=\"JETS\" window=\"" << m_JetWindowSizeSmall << "\" ptmin=\"" << m_tobJetSmall.ptmin << "\" etamin=\"" << m_tobJetSmall.etamin << "\" etamax=\"" << m_tobJetSmall.etamax << "\" priority=\"" << m_tobJetSmall.priority << "\"/>" << endl;
145 indent(xmlfile, indentLevel+1, indentWidth)
146 << "<MinimumTOBPt thrtype=\"JETL\" window=\"" << m_JetWindowSizeLarge << "\" ptmin=\"" << m_tobJetLarge.ptmin << "\" etamin=\"" << m_tobJetLarge.etamin << "\" etamax=\"" << m_tobJetLarge.etamax << "\" priority=\"" << m_tobJetLarge.priority << "\"/>" << endl;
147
148
149 indent(xmlfile, indentLevel, indentWidth) << "</CaloInfo>" << endl;
150
151}
152
void setIsolation(const std::string &isothrtype, unsigned int bit, const IsolationParam &isopar)
Definition CaloInfo.cxx:57
std::vector< IsolationParam > m_IsolationHAIsoForEMthr
Definition CaloInfo.h:96
virtual void print(const std::string &indent="", unsigned int detail=1) const override
Definition CaloInfo.cxx:75
void addCaloSinCos(const CaloSinCos &)
Definition CaloInfo.cxx:35
std::vector< int > m_JetWeights
Definition CaloInfo.h:92
MinTOBPt m_tobJetSmall
Definition CaloInfo.h:102
std::vector< IsolationParam > m_IsolationEMIsoForEMthr
Definition CaloInfo.h:97
unsigned int m_JetWindowSizeSmall
Definition CaloInfo.h:105
float globalEmScale() const
Definition CaloInfo.h:43
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Definition CaloInfo.cxx:98
unsigned int m_JetWindowSizeLarge
Definition CaloInfo.h:106
MinTOBPt m_tobJetLarge
Definition CaloInfo.h:103
METSigParam & metSigParam()
Definition CaloInfo.h:50
METSigParam m_METSigParam
Definition CaloInfo.h:94
void addJetWeight(int)
Definition CaloInfo.cxx:29
float globalJetScale() const
Definition CaloInfo.h:44
std::vector< CaloSinCos > m_CaloSinCos
Definition CaloInfo.h:93
std::vector< IsolationParam > m_IsolationEMIsoForTAUthr
Definition CaloInfo.h:98
MinTOBPt m_tobTau
Definition CaloInfo.h:101
std::ostream & indent(std::ostream &o, int lvl, int size) const
void printNameIdV(const std::string &indent="") const
static std::vector< std::string > xmlfile
Definition iLumiCalc.h:29
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22
STL namespace.