|
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include <boost/container/flat_set.hpp>
11 template<
typename Key>
using flat_set = boost::container::flat_set<Key>;
26 template<
class CPTool>
29 for(
auto&
tool : suppliedTools)
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;
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;
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