|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #include <GaudiKernel/StatusCode.h>
16 std::set<std::set<const xAOD::IParticle *>> vectorToSet(
17 const std::vector<std::vector<const xAOD::IParticle *>>&
vec)
19 std::set<std::set<const xAOD::IParticle *>> ret;
20 for (
const std::vector<const xAOD::IParticle *> &combination :
vec)
21 ret.emplace(combination.begin(), combination.end());
31 <<
"type = " <<
p->type() <<
", "
32 <<
"pt = " <<
p->pt() <<
", "
33 <<
"eta = " <<
p->eta() <<
", "
34 <<
"phi = " <<
p->phi() <<
", "
35 <<
"ptr = " <<
reinterpret_cast<const void*
>(
p)
47 for (
auto itr =
s.begin(); itr !=
s.end(); ++itr)
73 return StatusCode::SUCCESS;
80 ATH_MSG_DEBUG(
"Begin testing chain " <<
chain << (
m_tdt->isPassed(
chain) ?
" and will dive into details as the chain passed " :
" but will not do anything as the chain did not pass"));
84 bool isExcluded =
false;
86 if (
chain == excludedChain) {
105 auto combsRun2 = vectorToSet(vecCombinationsRun2);
108 if (combsRun2.size() == 0)
110 ATH_MSG_DEBUG(
"Chain " <<
chain <<
" testing discarded due to detected Run 2 size == 0");
113 for (
auto&
c : combsRun2 ) {
118 auto combsRun3 = vectorToSet(vecCombinationsRun3);
122 ATH_MSG_DEBUG(
"Both, Run2 and Run3 combinations are effectively empty");
127 for (
auto&
c : combsRun3 ) {
143 return StatusCode::SUCCESS;
148 std::set<const xAOD::IParticle*> particlesRun3;
149 for (
auto l:
run3) {
150 if (
l.link.isValid() )
151 particlesRun3.
insert(*(
l.link));
156 std::set<const xAOD::IParticle*> particlesRun2;
157 for (
auto& comb: vecCombinationsRun2) {
158 for (
auto el: comb) {
159 particlesRun2.insert(
el);
163 for (
auto f2: particlesRun2 ) {
165 for (
auto f3: particlesRun3 ) {
171 ATH_MSG_ERROR(
"Missing feature in Run 3 that is present in Run 2 " <<
f2 <<
" chain " <<
chain <<
" enable DEBUG to see more details" );
173 return StatusCode::FAILURE;
177 return StatusCode::SUCCESS;
184 <<
" using Run 2 navigation " <<
run2.size()
185 <<
" Run 3 navigation " <<
run3.size());
186 ATH_MSG_ERROR(
"Mismatched sizes of combinations for chain " <<
chain <<
" (enable WARNING messages for more details), this may be a false positive if chain is incorrectly decoded");
188 return StatusCode::FAILURE;
191 return StatusCode::SUCCESS;
199 auto isSubsetPresent = [](
const std::set<xAODParticle*>& subset,
const CombinationsSet&
run2) {
200 for (
const auto& setInRun2 :
run2) {
202 bool allFound =
true;
204 if (setInRun2.find(
particle) == setInRun2.end()) {
209 if (allFound)
return true;
216 for (
const auto& subset :
run3) {
217 if (isSubsetPresent(subset,
run2)) {
250 return StatusCode::FAILURE;
254 return StatusCode::SUCCESS;
259 for (
const std::vector<const xAOD::IParticle*>& outerc: combs )
const std::regex mu2MunoL1Special
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
PublicToolHandle< Trig::TrigDecisionTool > m_tdtRun3
const std::regex specialEchain
Gaudi::Property< bool > m_verifyCombinations
std::vector< std::vector< const xAOD::IParticle * > > CombinationsVector
StatusCode initialize() override
The common trigger namespace for trigger analysis tools.
NavigationTesterAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode verifyCombinationsContent(const CombinationsSet &run2, const CombinationsSet &run3, const std::string &chain) const
ToolHandle< Trig::IIParticleRetrievalTool > m_toolRun3
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Gaudi::Property< bool > m_verifyCombinationsSize
std::set< std::set< const xAOD::IParticle * > > CombinationsSet
std::vector< size_t > vec
bool combinationsEmpty(const CombinationsVector &combs) const
Class providing the definition of the 4-vector interface.
const std::regex gammaXeChain
An algorithm that can be simultaneously executed in multiple threads.
@ f3
fraction of energy reconstructed in 3rd sampling
StatusCode verifyFlatContent(const std::string &chain) const
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode verifyCombinationsSize(const CombinationsVector &run2, const CombinationsVector &run3, const std::string &chain) const
StatusCode execute(const EventContext &context) const override
iterator insert(iterator position, value_type pElem)
Add a new element to the collection.
const std::vector< std::string > excludedChains
PublicToolHandle< Trig::TrigDecisionTool > m_tdtRun2
Gaudi::Property< std::vector< std::string > > m_chains
std::vector< int > multiplicities(const std::string &chain)
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
Gaudi::Property< bool > m_failOnDifference
#define ATH_MSG_WARNING(x)
PublicToolHandle< Trig::TrigDecisionTool > m_tdt
const std::regex specialElMuChain
ToolHandle< Trig::IIParticleRetrievalTool > m_toolRun2
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.