13 ISvcLocator* pSvcLocator ) :
23 return StatusCode::SUCCESS;
30 ATH_CHECK( previousDecisionsHandle.isValid() );
31 ATH_MSG_DEBUG(
"Running with "<< previousDecisionsHandle->size() <<
" previous decisions");
36 std::map<const xAOD::TrigEMCluster*, size_t> clusterToIndexMap;
37 size_t clusterCounter = 0;
38 const std::string featureStr{
"feature"};
39 for (
auto previousDecision : *previousDecisionsHandle){
42 if( not clusterELInfo.isValid() ) {
47 return StatusCode::FAILURE;
50 clusterToIndexMap.insert( std::make_pair( cluster, clusterCounter ) );
53 ATH_MSG_DEBUG(
"Cluster ptr to decision map has size " << clusterToIndexMap.size() );
57 auto decisions = outputHandle.
ptr();
59 std::vector<TrigEgammaFastPhotonHypoTool::PhotonInfo> hypoToolInput;
61 for (
auto previousDecision: *previousDecisionsHandle ) {
68 size_t photonCounter = 0;
72 ATH_MSG_DEBUG (
"electron handle size: " << photonsHandle->size() <<
"..." );
74 for (
auto photonIter = photonsHandle->begin(); photonIter != photonsHandle->end(); ++photonIter, photonCounter++ ) {
78 auto clusterPtr = (*photonIter)->emCluster();
84 auto origCluster = clusterToIndexMap.find( clusterPtr );
85 ATH_CHECK( origCluster != clusterToIndexMap.end() );
93 TCU::decisionIDs( previousDecisionsHandle->at( origCluster->second ), clusterDecisionIDs );
95 hypoToolInput.emplace_back( d, *photonIter, origCluster->first, std::move(clusterDecisionIDs) );
100 ATH_CHECK( tool->decide( hypoToolInput ) );
106 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
DataVector< SG::View > ViewContainer
View container for recording in StoreGate.
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)
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
pointer_type ptr()
Dereference the pointer.
virtual StatusCode execute(const EventContext &context) const override
TrigEgammaFastPhotonHypoAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::TrigPhotonContainer > m_photonsKey
ToolHandleArray< TrigEgammaFastPhotonHypoTool > m_hypoTools
virtual StatusCode initialize() override
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()
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.
std::string dump(const Decision *tc, const std::function< std::string(const Decision *)> &printerFnc)
Prints the Decision object including the linked seeds @warnign expensive call.
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 EventContext &ctx, 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...
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.
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.