|
ATLAS Offline Software
|
#include <CheckConfig.h>
|
template<class CPTool > |
static ToolHandle< CPTool > * | findToolByName (ToolHandleArray< CPTool > &suppliedTools, const std::string &name) |
|
Definition at line 19 of file CheckConfig.h.
◆ CheckConfig()
◆ advancedConfigChecks()
bool CheckConfig::advancedConfigChecks |
( |
| ) |
|
This method requires all (most) of TrigGlobalEfficiencyCorrectionTool internal variables to have been properly initialized already -> to be called as the last step of TrigGlobalEfficiencyCorrectionTool::initialize()
Check that for each electron/photon efficiency tool there is an associated scale factor tool with the same associated legs and tags. And vice versa.
A suitable CP tool must be available for each entry of 'ListOfLegsPerTag'
Periods don't overlap
Definition at line 188 of file CheckConfig.cxx.
198 auto checkConsistency = [
this](
auto& effToolIndex,
auto& sfToolIndex,
const char*
type)
200 bool mismatch = (effToolIndex.size() != sfToolIndex.size());
203 for(
auto& kv : sfToolIndex)
205 auto itr = effToolIndex.find(kv.first);
206 if(itr != effToolIndex.end())
210 for(
auto& kv : sfToolIndex)
if(kv.second==
index1) pairs1.insert(kv.first);
211 for(
auto& kv : effToolIndex)
if(kv.second==
index2) pairs2.insert(kv.first);
212 if(pairs1 != pairs2) mismatch =
true;
214 else mismatch =
true;
219 ATH_MSG_ERROR(
"There must be a one-to-one correspondence between the " <<
type <<
" efficiency and scale factor tools "
220 "(including their associated trigger legs and selection tags)");
240 <<
"' and selection tag '" << kv.first <<
"' mentioned in the property 'ListOfLegsPerTag'");
249 <<
"' and selection tag '" << kv.first <<
"' mentioned in the property 'ListOfLegsPerTag'");
258 <<
"' and selection tag '" << kv.first <<
"' mentioned in the property 'ListOfLegsPerTag'");
269 if(!success)
return false;
273 const auto periods_end = periods.end();
274 for(
auto itr1=periods.begin(); itr1!=periods_end; ++itr1)
276 auto&
x = itr1->m_boundaries;
277 if(
x.second <
x.first)
279 ATH_MSG_ERROR(
"One of the periods specified in TriggerCombination has runMin (" <<
x.first <<
") > runMax (" <<
x.second <<
")");
282 for(
auto itr2=itr1+1; itr2!=periods_end; ++itr2)
284 auto&
y = itr2->m_boundaries;
285 if((
x.first>=
y.first &&
x.first<=
y.second) || (
x.second>=
y.first &&
x.second<=
y.second))
287 ATH_MSG_ERROR(
"The periods specified in TriggerCombination overlap");
292 if(!success)
return false;
◆ basicConfigChecks()
bool CheckConfig::basicConfigChecks |
( |
| ) |
|
All tools mentioned in 'ListOfLegsPerTool' must be in 'ElectronEfficiencyTools' or 'ElectronScaleFactorTools' (or equivalent photon tools)
All electron/photon tools must be associated to trigger legs (except when there's only one tool)
Additional checks when tags are used
All tools mentioned in 'ListOfTagsPerTool' must be known
Either all muon tools are associated to tags, either none
Either all electron tools are associated to tags, either none
Either all photon tools are associated to tags, either none
Definition at line 39 of file CheckConfig.cxx.
45 ATH_MSG_ERROR(
"The numbers of electron tools supplied via the 'ElectronEfficiencyTools' and 'ElectronScaleFactorTools' properties should be identical");
51 ATH_MSG_ERROR(
"The numbers of photon tools supplied via the 'PhotonEfficiencyTools' and 'PhotonScaleFactorTools' properties should be identical");
58 auto&
name = kv.first;
68 ATH_MSG_ERROR(
"Muon tool " <<
name <<
" mentioned in property 'ListOfLegsPerTool', which is only aimed at electron and photon tools");
72 std::string known_tools =
"; the known tools are";
77 ATH_MSG_ERROR(
"Unknown tool " <<
name <<
" mentioned in property 'ListOfLegsPerTool'" << known_tools);
80 if(!success)
return false;
83 auto toolsHaveLegInfo = [
this](
auto& effTools,
auto& sfTools,
const char*
type)
85 if(effTools.size() < 2)
return true;
89 for(
auto&
tool : (
i? effTools: sfTools))
91 const std::string&
name =
tool.name();
94 ATH_MSG_ERROR(
type <<
" tool " <<
name <<
" associated trigger legs are not indicated in 'ListOfLegsPerTool', "
95 "doing so is mandatory when several tools are used");
104 if(!success)
return false;
115 ATH_MSG_ERROR(
"the property 'LeptonTagDecorations' must be filled when any of 'ListOfTagsPerTool'"
116 " / 'ListOfLegsPerTag' / 'MuonLegsPerTag' / 'ElectronLegsPerTag' is.");
123 unsigned nElectronToolsWithTags = 0, nMuonToolsWithTags = 0, nPhotonToolsWithTags = 0;
126 auto&
name = kv.first;
135 std::string all_tools =
"; the known tools are";
140 ATH_MSG_ERROR(
"Unknown tool " <<
name <<
" mentioned in property 'ListOfTagsPerTool'");
146 ATH_MSG_ERROR(
"Not all muon tools have been associated with tags in the 'ListOfTagsPerTool' property");
151 if(nElectronToolsWithTags && (nElectronToolsWithTags!=nSupplied))
153 ATH_MSG_ERROR(
"Not all electron tools have been associated with tags in the 'ListOfTagsPerTool' property");
156 if(!success)
return false;
159 if(nPhotonToolsWithTags && (nPhotonToolsWithTags!=nSupplied))
161 ATH_MSG_ERROR(
"Not all photon tools have been associated with tags in the 'ListOfTagsPerTool' property");
164 if(!success)
return false;
◆ findToolByName()
template<class CPTool >
ToolHandle< CPTool > * CheckConfig::findToolByName |
( |
ToolHandleArray< CPTool > & |
suppliedTools, |
|
|
const std::string & |
name |
|
) |
| |
|
staticprivate |
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ msg() [1/2]
MsgStream & asg::AsgMessaging::msg |
( |
| ) |
const |
|
inherited |
The standard message stream.
- Returns
- A reference to the default message stream of this object.
Definition at line 49 of file AsgMessaging.cxx.
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
54 #endif // not XAOD_STANDALONE
◆ msg() [2/2]
MsgStream & asg::AsgMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
The standard message stream.
- Parameters
-
lvl | The message level to set the stream to |
- Returns
- A reference to the default message stream, set to level "lvl"
Definition at line 57 of file AsgMessaging.cxx.
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
63 #endif // not XAOD_STANDALONE
◆ msgLvl()
bool asg::AsgMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
Test the output level of the object.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicting if messages at given level will be printed
-
true
If messages at level "lvl" will be printed
Definition at line 41 of file AsgMessaging.cxx.
42 #ifndef XAOD_STANDALONE
43 return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45 return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_parent
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
Electron_v1 Electron
Definition of the current "egamma version".
static ToolHandle< CPTool > * findToolByName(ToolHandleArray< CPTool > &suppliedTools, const std::string &name)
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
TrigGlobalEfficiencyCorrectionTool & m_parent
IMessageSvc * getMessageSvc(bool quiet=false)
boost::container::flat_set< Key > flat_set
xAOD::Type::ObjectType associatedLeptonFlavour(std::size_t leg, bool &success)
MsgStream & msg() const
The standard message stream.
Class mimicking the AthMessaging class from the offline software.
Photon_v1 Photon
Definition of the current "egamma version".
struct TBPatternUnitContext Muon
std::string m_nm
Message source name.