|
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"));
93 auto combsRun2 = vectorToSet(vecCombinationsRun2);
95 for (
auto&
c : combsRun2 ) {
100 auto combsRun3 = vectorToSet(vecCombinationsRun3);
104 ATH_MSG_DEBUG(
"Both, Run2 and Run3 combinations are effectively empty");
109 for (
auto&
c : combsRun3 ) {
125 return StatusCode::SUCCESS;
130 std::set<const xAOD::IParticle*> particlesRun3;
131 for (
auto l:
run3) {
132 if (
l.link.isValid() )
133 particlesRun3.
insert(*(
l.link));
138 std::set<const xAOD::IParticle*> particlesRun2;
139 for (
auto& comb: vecCombinationsRun2) {
140 for (
auto el: comb) {
141 particlesRun2.insert(
el);
145 for (
auto f2: particlesRun2 ) {
147 for (
auto f3: particlesRun3 ) {
153 ATH_MSG_ERROR(
"Missing feature in Run 3 that is present in Run 2 " <<
f2 <<
" chain " <<
chain <<
" enable DEBUG to see more details" );
155 return StatusCode::FAILURE;
159 return StatusCode::SUCCESS;
166 <<
" using Run 2 navigation " <<
run2.size()
167 <<
" Run 3 navigation " <<
run3.size());
168 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");
170 return StatusCode::FAILURE;
173 return StatusCode::SUCCESS;
178 bool isSubset = std::includes(
run3.begin(),
run3.end(),
run2.begin(),
run2.end());
191 return StatusCode::FAILURE;
195 for (
auto& combRun2:
run2 ) {
196 bool foundMatching =
false;
197 for (
auto& combRun3 :
run3 ) {
199 for (
auto&
c: combRun2 ){
203 for (
auto&
c: combRun3 ){
206 ATH_MSG_DEBUG(
"COMPARISON combRun2 == combRun3 are " << ( combRun2 == combRun3 ?
"identical" :
"distinct"));
207 if ( combRun2 == combRun3 ) {
208 ATH_MSG_DEBUG(
"Found matching combinations, run2 " << combRun2
209 <<
" run3 " << combRun3 );
210 foundMatching =
true;
214 if ( not foundMatching ) {
218 for (
auto&
c:
run3 ){
221 ATH_MSG_ERROR(
"When checking combinations in details found differences, (enable WARNING message for more details)");
223 return StatusCode::FAILURE;
227 return StatusCode::SUCCESS;
232 for (
auto outerc: combs )
PublicToolHandle< Trig::TrigDecisionTool > m_tdtRun3
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.
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
ToolHandle< Trig::IIParticleRetrievalTool > m_toolRun2
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.