Skip to content
Snippets Groups Projects
Commit def8078d authored by Tomasz Bold's avatar Tomasz Bold
Browse files

attempt to get FS decision associated wiht FSRoI

parent 5eebc335
1 merge request!20779WIP: Migrate DataQualityTools to ToolHandles
...@@ -50,7 +50,10 @@ StatusCode JRoIsUnpackingTool::unpack( const EventContext& ctx, ...@@ -50,7 +50,10 @@ StatusCode JRoIsUnpackingTool::unpack( const EventContext& ctx,
auto trigRoIs = std::make_unique< TrigRoiDescriptorCollection >(); auto trigRoIs = std::make_unique< TrigRoiDescriptorCollection >();
auto recRoIs = std::make_unique< DataVector<LVL1::RecJetRoI> >(); auto recRoIs = std::make_unique< DataVector<LVL1::RecJetRoI> >();
auto decision = TrigCompositeUtils::newDecisionIn( decisionOutput.get() );
decision->setObjectLink( "initialRoI", ElementLink<TrigRoiDescriptorCollection>( m_fsRoIKey, 0 ) );
// RoIBResult contains vector of TAU fragments // RoIBResult contains vector of TAU fragments
for ( auto& jetFragment : roib.jetEnergyResult() ) { for ( auto& jetFragment : roib.jetEnergyResult() ) {
...@@ -63,15 +66,17 @@ StatusCode JRoIsUnpackingTool::unpack( const EventContext& ctx, ...@@ -63,15 +66,17 @@ StatusCode JRoIsUnpackingTool::unpack( const EventContext& ctx,
auto recRoI = new LVL1::RecJetRoI( roIWord, &m_jetThresholds ); auto recRoI = new LVL1::RecJetRoI( roIWord, &m_jetThresholds );
recRoIs->push_back( recRoI ); recRoIs->push_back( recRoI );
/* TDOD, decide if we need this collection at all here, now keep filling of it commented out
//decision->setObjectLink( "initialRecRoI", ElementLink<DataVector<LVL1::RecJetRoI>>( m_recRoIsKey.key(), recRoIs->size()-1 ) );
auto trigRoI = new TrigRoiDescriptor( roIWord, 0u ,0u, auto trigRoI = new TrigRoiDescriptor( roIWord, 0u ,0u,
recRoI->eta(), recRoI->eta()-m_roIWidth, recRoI->eta()+m_roIWidth, recRoI->eta(), recRoI->eta()-m_roIWidth, recRoI->eta()+m_roIWidth,
recRoI->phi(), recRoI->phi()-m_roIWidth, recRoI->phi()+m_roIWidth ); recRoI->phi(), recRoI->phi()-m_roIWidth, recRoI->phi()+m_roIWidth );
trigRoIs->push_back( trigRoI ); trigRoIs->push_back( trigRoI );
*/
ATH_MSG_DEBUG( "RoI word: 0x" << MSG::hex << std::setw( 8 ) << roIWord << MSG::dec ); ATH_MSG_DEBUG( "RoI word: 0x" << MSG::hex << std::setw( 8 ) << roIWord << MSG::dec );
auto decision = TrigCompositeUtils::newDecisionIn( decisionOutput.get() );
for ( auto th: m_jetThresholds ) { for ( auto th: m_jetThresholds ) {
ATH_MSG_VERBOSE( "Checking if the threshold " << th->name() << " passed" ); ATH_MSG_VERBOSE( "Checking if the threshold " << th->name() << " passed" );
...@@ -86,11 +91,17 @@ StatusCode JRoIsUnpackingTool::unpack( const EventContext& ctx, ...@@ -86,11 +91,17 @@ StatusCode JRoIsUnpackingTool::unpack( const EventContext& ctx,
} }
// TODO would be nice to have this. Requires modifying the TC class: decision->setDetail( "Thresholds", passedThresholds ); // record passing threshold names ( for easy debugging )
decision->setObjectLink( "initialRoI", ElementLink<TrigRoiDescriptorCollection>( m_trigRoIsKey.key(), trigRoIs->size()-1 ) );
decision->setObjectLink( "initialRecRoI", ElementLink<DataVector<LVL1::RecJetRoI>>( m_recRoIsKey.key(), recRoIs->size()-1 ) );
} }
} }
TrigCompositeUtils::DecisionIDContainer uniqueDecisions; // this is set
std::vector<int>& storedIDs = TrigCompositeUtils::decisionIDs( decision );
TrigCompositeUtils::decisionIDs( decision, uniqueDecisions ); // copy to set -> unique
storedIDs.clear();
storedIDs.insert( storedIDs.end(), uniqueDecisions.begin(), uniqueDecisions.end() );
//copy back
if ( msgLvl(MSG::DEBUG) ) { if ( msgLvl(MSG::DEBUG) ) {
for ( auto roi: *trigRoIs ) { for ( auto roi: *trigRoIs ) {
ATH_MSG_DEBUG( "RoI Eta: " << roi->eta() << " Phi: " << roi->phi() << " RoIWord: " << roi->roiWord() ); ATH_MSG_DEBUG( "RoI Eta: " << roi->eta() << " Phi: " << roi->phi() << " RoIWord: " << roi->roiWord() );
......
...@@ -42,6 +42,9 @@ private: ...@@ -42,6 +42,9 @@ private:
Gaudi::Property<float> m_roIWidth{ Gaudi::Property<float> m_roIWidth{
this, "RoIWidth", 0.4, "Size of RoI in eta/ phi"}; this, "RoIWidth", 0.4, "Size of RoI in eta/ phi"};
//SG::ReadHandleKey<TrigRoiDescriptorCollection> m_fsRoIKey{ this, "FSRoIKey", "FSRoI", "The key of FS RoI made earlier by the L1Decoder" };
Gaudi::Property<std::string> m_fsRoIKey{ this, "FSRoIKey", "FSRoI", "The key of FS RoI made earlier by the L1Decoder" };
ServiceHandle<TrigConf::ILVL1ConfigSvc> m_configSvc; ServiceHandle<TrigConf::ILVL1ConfigSvc> m_configSvc;
std::vector<TrigConf::TriggerThreshold*> m_jetThresholds; std::vector<TrigConf::TriggerThreshold*> m_jetThresholds;
......
...@@ -75,7 +75,14 @@ StatusCode L1Decoder::execute_r (const EventContext& ctx) const { ...@@ -75,7 +75,14 @@ StatusCode L1Decoder::execute_r (const EventContext& ctx) const {
// this should really be: const ROIB::RoIBResult* roib = SG::INPUT_PTR (m_RoIBResultKey, ctx); // this should really be: const ROIB::RoIBResult* roib = SG::INPUT_PTR (m_RoIBResultKey, ctx);
// or const ROIB::RoIBResult& roib = SG::INPUT_REF (m_RoIBResultKey, ctx); // or const ROIB::RoIBResult& roib = SG::INPUT_REF (m_RoIBResultKey, ctx);
{
std::unique_ptr<TrigRoiDescriptorCollection> fsRoIsColl = std::make_unique<TrigRoiDescriptorCollection>();
TrigRoiDescriptor* fsRoI = new TrigRoiDescriptor( true ); // true == FS
fsRoIsColl->push_back( fsRoI );
auto handle = SG::makeHandle( m_trigFSRoIKey, ctx );
ATH_CHECK( handle.record ( std::move( fsRoIsColl ) ) );
}
auto chainsInfo = std::make_unique<DecisionContainer>(); auto chainsInfo = std::make_unique<DecisionContainer>();
auto chainsAux = std::make_unique<DecisionAuxContainer>(); auto chainsAux = std::make_unique<DecisionAuxContainer>();
...@@ -120,14 +127,6 @@ StatusCode L1Decoder::execute_r (const EventContext& ctx) const { ...@@ -120,14 +127,6 @@ StatusCode L1Decoder::execute_r (const EventContext& ctx) const {
ATH_CHECK( unpacker->unpack( ctx, *roib, rerunChainSet ) ); ATH_CHECK( unpacker->unpack( ctx, *roib, rerunChainSet ) );
} }
{
std::unique_ptr<TrigRoiDescriptorCollection> fsRoIsColl = std::make_unique<TrigRoiDescriptorCollection>();
TrigRoiDescriptor* fsRoI = new TrigRoiDescriptor( true ); // true == FS
fsRoIsColl->push_back( fsRoI );
auto handle = SG::makeHandle( m_trigFSRoIKey, ctx );
ATH_CHECK( handle.record ( std::move( fsRoIsColl ) ) );
}
ATH_MSG_DEBUG("Recording chains"); ATH_MSG_DEBUG("Recording chains");
......
...@@ -54,7 +54,7 @@ def jetRecoSequence(inputMakerOut): ...@@ -54,7 +54,7 @@ def jetRecoSequence(inputMakerOut):
from TrigCaloRec.TrigCaloRecConfig import TrigCaloClusterMakerMT_topo from TrigCaloRec.TrigCaloRecConfig import TrigCaloClusterMakerMT_topo
algo2 = TrigCaloClusterMakerMT_topo(doMoments=True, doLC=False) algo2 = TrigCaloClusterMakerMT_topo(doMoments=True, doLC=False)
algo2.Cells = "StoreGateSvc+FullScanCells" algo2.Cells = "CellsClusters"
algo2.OutputLevel = INFO algo2.OutputLevel = INFO
jetRecoSequence += algo2 jetRecoSequence += algo2
......
...@@ -16,7 +16,7 @@ def jetSequence(): ...@@ -16,7 +16,7 @@ def jetSequence():
#reco sequence #reco sequence
from TrigUpgradeTest.jetDefs import jetRecoSequence from TrigUpgradeTest.jetDefs import jetRecoSequence
(recoSequence, sequenceOut) = jetRecoSequence(InputMakerAlg.Output) (recoSequence, sequenceOut) = jetRecoSequence("FSRoI")
#hypo #hypo
from TrigHLTJetHypo.TrigHLTJetHypoConf import TrigJetHypoAlgMT from TrigHLTJetHypo.TrigHLTJetHypoConf import TrigJetHypoAlgMT
......
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