Skip to content
Snippets Groups Projects
Commit b27cbe21 authored by Tomasz Bold's avatar Tomasz Bold Committed by Andrea Coccaro
Browse files

Enable conversion checking together wiht the conversion

Enable conversion checking together wiht the conversion
parent a729440a
No related branches found
No related tags found
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): ...@@ -12,9 +12,7 @@ def NavConverterCfg(flags):
"""Configures Run 1/2 to Run 3 navigation conversion algorithm for all triggers""" """Configures Run 1/2 to Run 3 navigation conversion algorithm for all triggers"""
acc = ComponentAccumulator() acc = ComponentAccumulator()
from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
tdt_ca = TrigDecisionToolCfg(flags) tdt = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
tdt = tdt_ca.getPrimary()
acc.merge(tdt_ca)
cnvAlg = CompFactory.Run2ToRun3TrigNavConverterV2("TrigRun2ToRun3NavConverter") cnvAlg = CompFactory.Run2ToRun3TrigNavConverterV2("TrigRun2ToRun3NavConverter")
cnvAlg.TrigDecisionTool = tdt cnvAlg.TrigDecisionTool = tdt
...@@ -39,6 +37,18 @@ def NavConverterCfg(flags): ...@@ -39,6 +37,18 @@ def NavConverterCfg(flags):
cnvAlg.doCompression = True cnvAlg.doCompression = True
acc.addEventAlgo(cnvAlg) 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 return acc
......
...@@ -54,9 +54,8 @@ namespace Trig { ...@@ -54,9 +54,8 @@ namespace Trig {
StatusCode NavigationTesterAlg::initialize() StatusCode NavigationTesterAlg::initialize()
{ {
ATH_CHECK(m_tool1.retrieve()); ATH_CHECK(m_toolRun2.retrieve());
/*** TODO ***/ ATH_CHECK(m_toolRun3.retrieve());
// ATH_CHECK(m_tool2.retrieve());
if (m_chains.size() == 0) if (m_chains.size() == 0)
ATH_MSG_WARNING("No chains provided, algorithm will be no-op"); ATH_MSG_WARNING("No chains provided, algorithm will be no-op");
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
...@@ -76,30 +75,37 @@ namespace Trig { ...@@ -76,30 +75,37 @@ namespace Trig {
// We don't care about the order of the combinations, or the order within the // 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 // 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 // vectors to sets and just look at the differences between them
std::vector<std::vector<const xAOD::IParticle *>> vecCombinations1; std::vector<std::vector<const xAOD::IParticle *>> vecCombinationsRun2;
/*** TODO ***/ ATH_MSG_DEBUG("###### checking features of CHAIN " << chain);
//std::vector<std::vector<const xAOD::IParticle *>> vecCombinations2; ATH_CHECK(m_toolRun2->retrieveParticles(vecCombinationsRun2, chain));
ATH_MSG_DEBUG("###### CHAIN name " << chain); auto combsRun2 = vectorToSet(vecCombinationsRun2);
ATH_CHECK(m_tool1->retrieveParticles(vecCombinations1, chain)); ATH_MSG_DEBUG("Run 2 size " << combsRun2.size());
auto combs1 = vectorToSet(vecCombinations1); for (auto& c : combsRun2 ) {
ATH_MSG_DEBUG("combs1 size " << combs1.size());
for (auto& c : combs1 ) {
ATH_MSG_DEBUG(c); ATH_MSG_DEBUG(c);
} }
/*** TODO ***/ std::vector<std::vector<const xAOD::IParticle *>> vecCombinationsRun3;
// ATH_CHECK(m_tool2->retrieveParticles(vecCombinations2, chain)); ATH_CHECK(m_toolRun3->retrieveParticles(vecCombinationsRun3, chain));
// auto combs2 = vectorToSet(vecCombinations2); auto combsRun3 = vectorToSet(vecCombinationsRun3);
// for (auto& c : combs2 ) { ATH_MSG_DEBUG("Run 3 size " << combsRun3.size());
// ATH_MSG_DEBUG(c);
// }
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 ***/ /*** TODO ***/
// ATH_CHECK(m_tool2->retrieveParticles(vecCombinations2, chain)); // ATH_CHECK(m_toolRun3->retrieveParticles(vecCombinationsRun3, chain));
// std::set<std::set<const xAOD::IParticle *>> combos1 = vectorToSet(vecCombinations1); // std::set<std::set<const xAOD::IParticle *>> combos1 = vectorToSet(vecCombinationsRun2);
// std::set<std::set<const xAOD::IParticle *>> combos2 = vectorToSet(vecCombinations2); // std::set<std::set<const xAOD::IParticle *>> combos2 = vectorToSet(vecCombinationsRun3);
// ATH_MSG_DEBUG("Tool 1 retrieved " << combos1.size() << " combinations, tool 2 retrieved " << combos2.size()); // 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 *>> onlyIn1;
// std::vector<std::set<const xAOD::IParticle *>> onlyIn2; // std::vector<std::set<const xAOD::IParticle *>> onlyIn2;
......
...@@ -20,10 +20,10 @@ namespace Trig { ...@@ -20,10 +20,10 @@ namespace Trig {
StatusCode execute() override; StatusCode execute() override;
private: private:
ToolHandle<Trig::IIParticleRetrievalTool> m_tool1{ ToolHandle<Trig::IIParticleRetrievalTool> m_toolRun2{
this, "RetrievalTool1", "", "The first retrieval tool to test"}; this, "RetrievalToolRun2Nav", "", "The tool configured to use Run 2 format"};
ToolHandle<Trig::IIParticleRetrievalTool> m_tool2{ ToolHandle<Trig::IIParticleRetrievalTool> m_toolRun3{
this, "RetrievalTool2", "", "The second retrieval tool to test"}; this, "RetrievalToolRun3Nav", "", "The tool configured for fetching RUn 3 format"};
Gaudi::Property<std::vector<std::string>> m_chains{ Gaudi::Property<std::vector<std::string>> m_chains{
this, "Chains", {}, "The chains to test"}; this, "Chains", {}, "The chains to test"};
Gaudi::Property<bool> m_failOnDifference{ 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