 |
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include <boost/container/flat_set.hpp>
13 template <
typename Key>
14 using flat_set = boost::container::flat_set<Key>;
26 template <
class CPTool>
28 ToolHandleArray<CPTool>& suppliedTools,
const std::string&
name) {
29 for (
auto&
tool : suppliedTools) {
45 "The numbers of electron tools supplied via the "
46 "'ElectronEfficiencyTools' and 'ElectronScaleFactorTools' properties "
47 "should be identical");
54 "The numbers of photon tools supplied via the 'PhotonEfficiencyTools' "
55 "and 'PhotonScaleFactorTools' properties should be identical");
63 auto&
name = kv.first;
76 <<
" mentioned in property 'ListOfLegsPerTool', which is "
77 "only aimed at electron and photon tools");
79 std::string known_tools =
"; the known tools are";
81 known_tools +=
" " +
tool.name();
83 known_tools +=
" " +
tool.name();
85 known_tools +=
" " +
tool.name();
87 known_tools +=
" " +
tool.name();
89 <<
name <<
" mentioned in property 'ListOfLegsPerTool'"
98 auto toolsHaveLegInfo = [
this](
auto& effTools,
auto& sfTools,
100 if (effTools.size() < 2)
103 for (
int i = 0;
i < 2; ++
i) {
104 for (
auto&
tool : (
i ? effTools : sfTools)) {
105 const std::string&
name =
tool.name();
109 <<
" associated trigger legs are not indicated in "
110 "'ListOfLegsPerTool', "
111 "doing so is mandatory when several tools are used");
136 "the property 'LeptonTagDecorations' must be filled when any of "
137 "'ListOfTagsPerTool'"
138 " / 'ListOfLegsPerTag' / 'MuonLegsPerTag' / 'ElectronLegsPerTag' "
146 unsigned nElectronToolsWithTags = 0, nMuonToolsWithTags = 0,
147 nPhotonToolsWithTags = 0;
149 auto&
name = kv.first;
152 ++nElectronToolsWithTags;
154 ++nMuonToolsWithTags;
157 ++nPhotonToolsWithTags;
160 std::string all_tools =
"; the known tools are";
162 all_tools +=
" " +
tool.name();
164 all_tools +=
" " +
tool.name();
166 all_tools +=
" " +
tool.name();
168 all_tools +=
" " +
tool.name();
170 <<
name <<
" mentioned in property 'ListOfTagsPerTool'");
174 if (nMuonToolsWithTags &&
177 "Not all muon tools have been associated with tags in the "
178 "'ListOfTagsPerTool' property");
184 if (nElectronToolsWithTags && (nElectronToolsWithTags != nSupplied)) {
186 "Not all electron tools have been associated with tags in the "
187 "'ListOfTagsPerTool' property");
195 if (nPhotonToolsWithTags && (nPhotonToolsWithTags != nSupplied)) {
197 "Not all photon tools have been associated with tags in the "
198 "'ListOfTagsPerTool' property");
255 auto checkConsistency = [
this](
auto& effToolIndex,
auto& sfToolIndex,
257 bool mismatch = (effToolIndex.size() != sfToolIndex.size());
259 for (
auto& kv : sfToolIndex) {
260 auto itr = effToolIndex.find(kv.first);
261 if (itr != effToolIndex.end()) {
264 for (
auto& kv : sfToolIndex)
266 pairs1.insert(kv.first);
267 for (
auto& kv : effToolIndex)
269 pairs2.insert(kv.first);
270 if (pairs1 != pairs2)
278 "There must be a one-to-one correspondence between the "
280 <<
" efficiency and scale factor tools "
281 "(including their associated trigger legs and selection tags)");
296 for (std::size_t
leg :
304 "No electron tool provided for the combination of trigger leg '"
306 << kv.first <<
"' mentioned in the property 'ListOfLegsPerTag'");
313 "No muon tool provided for the combination of trigger leg '"
315 << kv.first <<
"' mentioned in the property 'ListOfLegsPerTag'");
322 "No photon tool provided for the combination of trigger leg '"
324 << kv.first <<
"' mentioned in the property 'ListOfLegsPerTag'");
329 "Unable to determine which lepton flavour is associated to the "
332 <<
"' in the property 'ListOfLegsPerTag'");
342 const auto periods_end = periods.end();
343 for (
auto itr1 = periods.begin(); itr1 != periods_end; ++itr1) {
344 auto&
x = itr1->m_boundaries;
345 if (
x.second <
x.first) {
347 "One of the periods specified in TriggerCombination has runMin ("
348 <<
x.first <<
") > runMax (" <<
x.second <<
")");
351 for (
auto itr2 = itr1 + 1; itr2 != periods_end; ++itr2) {
352 auto&
y = itr2->m_boundaries;
353 if ((
x.first >=
y.first &&
x.first <=
y.second) ||
354 (
x.second >=
y.first &&
x.second <=
y.second)) {
355 ATH_MSG_ERROR(
"The periods specified in TriggerCombination overlap");
Electron_v1 Electron
Definition of the current "egamma version".
TrigGlobEffCorr::ImportData ImportData
static ToolHandle< CPTool > * findToolByName(ToolHandleArray< CPTool > &suppliedTools, const std::string &name)
TrigGlobalEfficiencyCorrectionTool & m_parent
boost::container::flat_set< Key > flat_set
xAOD::Type::ObjectType associatedLeptonFlavour(std::size_t leg, bool &success)
MsgStream & msg() const
The standard message stream.
CheckConfig(TrigGlobalEfficiencyCorrectionTool &parent)
bool advancedConfigChecks()
Photon_v1 Photon
Definition of the current "egamma version".
struct TBPatternUnitContext Muon
TrigGlobEffCorr::CheckConfig CheckConfig