10#include "GaudiKernel/SystemOfUnits.h"
47 return StatusCode::SUCCESS;
58 ATH_CHECK( previousDecisionsHandle.isValid() );
60 ATH_MSG_DEBUG(
"Running with " << previousDecisionsHandle->size() <<
" previous decisions" );
61 if( previousDecisionsHandle->size()!=1 ) {
62 ATH_MSG_ERROR(
"Previous decision handle size is not 1. It is" << previousDecisionsHandle->size() );
63 return StatusCode::FAILURE;
65 const Decision * previousDecision = previousDecisionsHandle->at(0);
70 for(
auto decisionID: previousDecisionIDs) {
ATH_MSG_DEBUG(
" " << decisionID ); }
75 auto outputDecisions = outputHandle.
ptr();
81 ATH_MSG_DEBUG (
"Track handle size: " << trackHandle->size() <<
"..." );
85 std::vector<float> mnt_pt;
90 unsigned int itrk_passed = 0;
91 std::vector<IDCalibHypoTool::IDCalibHypoInfo> IDCalibHypoInputs;
94 if (track->pt()< 1*Gaudi::Units::GeV )
continue;
97 mnt_pt.push_back(track->pt()/Gaudi::Units::GeV);
107 IDCalibHypoInputs.push_back( hypoInfo );
109 ATH_MSG_DEBUG(
"nr tracks = " << trackContainer->
size() <<
" -> selected nr = " << itrk_passed );
113 ATH_MSG_DEBUG(
"+++++ Now computing decision for " << tool->name() );
114 ATH_CHECK( tool->decide( IDCalibHypoInputs ) );
118 while(it != outputDecisions->end()) {
120 ATH_MSG_DEBUG(
"all failed, erasing for outputDecision: " << *it );
121 it = outputDecisions->erase(it);
132 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
Header file to be included by clients of the Monitored infrastructure.
bool allFailed(const Decision *d)
return true if there is no positive decision stored
DataModel_detail::iterator< DataVector > iterator
size_type size() const noexcept
Returns the number of elements in the collection.
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
ToolHandle< GenericMonitoringTool > m_monTool
virtual StatusCode execute(const EventContext &context) const override
IDCalibHypoAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksKey
ToolHandleArray< IDCalibHypoTool > m_hypoTools
Group of local monitoring quantities and retain correlation when filling histograms
pointer_type ptr()
Dereference the pointer.
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const std::string & viewString()
xAOD::TrigComposite Decision
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.
bool allFailed(const Decision *d)
return true if there is no positive decision stored
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.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...