5#include "Gaudi/Property.h"
46 return StatusCode::SUCCESS;
59 ATH_CHECK( previousDecisionsHandle.isValid() );
60 ATH_MSG_DEBUG(
"Running with "<< previousDecisionsHandle->size() <<
" previous decisions");
63 ATH_MSG_DEBUG(
"Event No.: "<<context.eventID().event_number());
67 auto decisions = outputHandle.
ptr();
72 std::map<const xAOD::TrigEMCluster*, size_t> clusterToIndexMap;
73 size_t clusterCounter = 0;
74 for (
auto previousDecision : *previousDecisionsHandle){
78 clusterLink = linkInfo.
link;
82 clusterToIndexMap.insert( std::make_pair( cluster, clusterCounter ) );
87 ATH_MSG_DEBUG(
"Cluster ptr to decision map has size " << clusterToIndexMap.size() );
90 std::vector<ITrigEgammaFastElectronHypoTool::ElectronInfo> hypoToolInput;
92 for (
auto previousDecision: *previousDecisionsHandle ) {
98 size_t electronCounter = 0;
101 ATH_MSG_DEBUG (
"electron handle size: " << electronsHandle->size() <<
"..." );
103 for (
auto electronIter = electronsHandle->begin(); electronIter != electronsHandle->end(); ++electronIter, electronCounter++ ) {
108 auto clusterPtr = (*electronIter)->emCluster();
114 auto origCluster = clusterToIndexMap.find( clusterPtr );
115 ATH_CHECK( origCluster != clusterToIndexMap.end() );
122 auto ringerLink = linkInfo.
link;
132 decisionIDs( previousDecisionsHandle->at( origCluster->second ), clusterDecisionIDs );
134 auto el = *electronIter;
135 auto cl = origCluster->first;
141 info.valueDecorator[
"avgmu"] = avgmu;
144 if(rings && cl && el){
147 timer_predict.start();
149 timer_predict.stop();
150 info.pidDecorator[pidname] =
static_cast<bool>(
m_ringerNNTools[idx]->accept(rings, nnOutput, avgmu));
151 info.valueDecorator[pidname+
"NNOutput"] = nnOutput;
156 hypoToolInput.push_back(info);
163 ATH_CHECK( tool->decide( hypoToolInput ) );
168 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name="")
Helper method to create a Decision object, place it in the container and return a pointer to it.
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
const std::string & hypoAlgNodeName()
void decisionIDs(const Decision *d, DecisionIDContainer &id)
Extracts DecisionIDs stored in the Decision object.
const std::string & featureString()
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
Header file to be included by clients of the Monitored infrastructure.
const std::string & viewString()
LinkInfo< T > findLink(const Decision *start, const std::string &linkName, const bool suppressMultipleLinksWarning=false)
Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision obj...
DataVector< SG::View > ViewContainer
View container for recording in StoreGate.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
ElementLink implementation for ROOT usage.
bool isValid() const
Test to see if the link can be dereferenced.
const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & decisionInput() const
methods for derived classes to access handles of the base class input other read/write handles may be...
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutput() const
methods for derived classes to access handles of the base class output other read/write handles may b...
StatusCode hypoBaseOutputProcessing(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl=MSG::DEBUG) const
Base class function to be called once slice specific code has finished. Handles debug printing and va...
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
Group of local monitoring quantities and retain correlation when filling histograms
pointer_type ptr()
Dereference the pointer.
ToolHandle< GenericMonitoringTool > m_monTool
SG::ReadHandleKey< xAOD::TrigElectronContainer > m_electronsKey
ToolHandle< ILumiBlockMuTool > m_lumiBlockMuTool
Gaudi::Property< std::vector< std::string > > m_pidNames
ToolHandleArray< Ringer::IAsgRingerSelectorTool > m_ringerNNTools
virtual StatusCode initialize() override
ToolHandleArray< ITrigEgammaFastElectronHypoTool > m_hypoTools
TrigEgammaFastElectronHypoAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &context) const override
Gaudi::Property< bool > m_runInView
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const std::string & viewString()
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
const std::string & featureString()
xAOD::TrigCompositeAuxContainer DecisionAuxContainer
std::set< DecisionID > DecisionIDContainer
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
const std::string & hypoAlgNodeName()
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
LinkInfo< T > findLink(const Decision *start, const std::string &linkName, const bool suppressMultipleLinksWarning=false)
Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision obj...
xAOD::TrigCompositeContainer DecisionContainer
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
ElementLink< T > makeLink(const SG::View *view, const SG::ReadHandle< T > &handle, size_t index)
Create EL to a collection in view.
auto makeHandle(const SG::View *view, const KEY &key, const EventContext &ctx)
Create a view handle from a handle key.
TrigRingerRings_v2 TrigRingerRings
Define the latest version of the TrigRingerRings class.
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
ElementLink< T > link
Link to the feature.