Skip to content
Snippets Groups Projects
Commit e56f6a42 authored by Andrea Coccaro's avatar Andrea Coccaro
Browse files

Merge branch 'setup-nav-conversion-checking' into '22.0'

Enable conversion checking together wiht the conversion

See merge request !57180
parents 4db6649f b27cbe21
4 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!572112022-10-03: daily merge of 22.0 into master,!57180Enable conversion checking together wiht the conversion
......@@ -12,9 +12,7 @@ def NavConverterCfg(flags):
"""Configures Run 1/2 to Run 3 navigation conversion algorithm for all triggers"""
acc = ComponentAccumulator()
from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
tdt_ca = TrigDecisionToolCfg(flags)
tdt = tdt_ca.getPrimary()
acc.merge(tdt_ca)
tdt = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
cnvAlg = CompFactory.Run2ToRun3TrigNavConverterV2("TrigRun2ToRun3NavConverter")
cnvAlg.TrigDecisionTool = tdt
......@@ -39,6 +37,18 @@ def NavConverterCfg(flags):
cnvAlg.doCompression = True
acc.addEventAlgo(cnvAlg)
checker = CompFactory.Trig.NavigationTesterAlg()
checker.RetrievalToolRun2Nav = CompFactory.Trig.IParticleRetrievalTool()
# in conversion job Run2 TDT is setup as default, we need to setup an alternative to access Run 3 format
run3tdt = CompFactory.Trig.TrigDecisionTool("Run3TrigDecisionTool",
HLTSummary = "HLTNav_R2ToR3Summary",
NavigationFormat = 'TrigComposite',
AcceptMultipleInstance=True)
acc.addPublicTool(run3tdt)
checker.RetrievalToolRun3Nav = CompFactory.Trig.R3IParticleRetrievalTool(TrigDecisionTool = run3tdt)
checker.Chains=['HLT_e26_lhtight_nod0_e15_etcut_L1EM7_Zee', 'HLT_mu4'] #TODO automate this
acc.addEventAlgo(checker)
return acc
......
......@@ -54,9 +54,8 @@ namespace Trig {
StatusCode NavigationTesterAlg::initialize()
{
ATH_CHECK(m_tool1.retrieve());
/*** TODO ***/
// ATH_CHECK(m_tool2.retrieve());
ATH_CHECK(m_toolRun2.retrieve());
ATH_CHECK(m_toolRun3.retrieve());
if (m_chains.size() == 0)
ATH_MSG_WARNING("No chains provided, algorithm will be no-op");
return StatusCode::SUCCESS;
......@@ -76,30 +75,37 @@ namespace Trig {
// We don't care about the order of the combinations, or the order within the
// combinations, we just care that they are the same. Therefore, we can convert the
// vectors to sets and just look at the differences between them
std::vector<std::vector<const xAOD::IParticle *>> vecCombinations1;
/*** TODO ***/
//std::vector<std::vector<const xAOD::IParticle *>> vecCombinations2;
ATH_MSG_DEBUG("###### CHAIN name " << chain);
ATH_CHECK(m_tool1->retrieveParticles(vecCombinations1, chain));
auto combs1 = vectorToSet(vecCombinations1);
ATH_MSG_DEBUG("combs1 size " << combs1.size());
for (auto& c : combs1 ) {
std::vector<std::vector<const xAOD::IParticle *>> vecCombinationsRun2;
ATH_MSG_DEBUG("###### checking features of CHAIN " << chain);
ATH_CHECK(m_toolRun2->retrieveParticles(vecCombinationsRun2, chain));
auto combsRun2 = vectorToSet(vecCombinationsRun2);
ATH_MSG_DEBUG("Run 2 size " << combsRun2.size());
for (auto& c : combsRun2 ) {
ATH_MSG_DEBUG(c);
}
/*** TODO ***/
// ATH_CHECK(m_tool2->retrieveParticles(vecCombinations2, chain));
// auto combs2 = vectorToSet(vecCombinations2);
// for (auto& c : combs2 ) {
// ATH_MSG_DEBUG(c);
// }
std::vector<std::vector<const xAOD::IParticle *>> vecCombinationsRun3;
ATH_CHECK(m_toolRun3->retrieveParticles(vecCombinationsRun3, chain));
auto combsRun3 = vectorToSet(vecCombinationsRun3);
ATH_MSG_DEBUG("Run 3 size " << combsRun3.size());
for (auto& c : combsRun3 ) {
ATH_MSG_DEBUG(c);
}
if ( combsRun2.size() != combsRun3.size()) {
if ( m_failOnDifference ) {
ATH_MSG_ERROR("Different count of feature accessed from chain " << chain
<< " using Run 2 navigation " << combsRun2.size()
<< " Run 3 navigation " << combsRun3.size() );
return StatusCode::FAILURE;
}
}
}
/*** TODO ***/
// ATH_CHECK(m_tool2->retrieveParticles(vecCombinations2, chain));
// std::set<std::set<const xAOD::IParticle *>> combos1 = vectorToSet(vecCombinations1);
// std::set<std::set<const xAOD::IParticle *>> combos2 = vectorToSet(vecCombinations2);
// ATH_CHECK(m_toolRun3->retrieveParticles(vecCombinationsRun3, chain));
// std::set<std::set<const xAOD::IParticle *>> combos1 = vectorToSet(vecCombinationsRun2);
// std::set<std::set<const xAOD::IParticle *>> combos2 = vectorToSet(vecCombinationsRun3);
// ATH_MSG_DEBUG("Tool 1 retrieved " << combos1.size() << " combinations, tool 2 retrieved " << combos2.size());
// std::vector<std::set<const xAOD::IParticle *>> onlyIn1;
// std::vector<std::set<const xAOD::IParticle *>> onlyIn2;
......
......@@ -20,10 +20,10 @@ namespace Trig {
StatusCode execute() override;
private:
ToolHandle<Trig::IIParticleRetrievalTool> m_tool1{
this, "RetrievalTool1", "", "The first retrieval tool to test"};
ToolHandle<Trig::IIParticleRetrievalTool> m_tool2{
this, "RetrievalTool2", "", "The second retrieval tool to test"};
ToolHandle<Trig::IIParticleRetrievalTool> m_toolRun2{
this, "RetrievalToolRun2Nav", "", "The tool configured to use Run 2 format"};
ToolHandle<Trig::IIParticleRetrievalTool> m_toolRun3{
this, "RetrievalToolRun3Nav", "", "The tool configured for fetching RUn 3 format"};
Gaudi::Property<std::vector<std::string>> m_chains{
this, "Chains", {}, "The chains to test"};
Gaudi::Property<bool> m_failOnDifference{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment