|
ATLAS Offline Software
|
Go to the documentation of this file.
38 ATH_MSG_ERROR(
"either vertex Key name or track count key name is undefined " );
39 return StatusCode::FAILURE;
45 return StatusCode::SUCCESS;
57 ATH_CHECK( previousDecisionsHandle.isValid() );
59 if (previousDecisionsHandle->size() == 0) {
61 return StatusCode::SUCCESS;
64 ATH_MSG_DEBUG(
"Running with "<< previousDecisionsHandle->size() <<
" implicit ReadHandles for previous decisions. Looking for :" <<
viewString());
79 auto vtxCountContainer = std::make_unique< xAOD::TrigCompositeContainer>();
80 auto vtxCountContainerAux = std::make_unique< xAOD::TrigCompositeAuxContainer>();
81 vtxCountContainer->setStore(vtxCountContainerAux.get());
83 std::unordered_map<Decision*, size_t> mapDecVtxContIdx;
85 for(
const Decision* previousDecision : *previousDecisionsHandle ) {
90 const auto viewELInfo = findLink<ViewContainer>( previousDecision,
viewString() );
108 int nVtx = vtxHandle->
size();
116 std::vector<const xAOD::Vertex*> selectedVtx;
117 float maxVtxNTrk = 0.;
118 float maxVtxMass = 0.;
125 if (
vertex ==
nullptr)
continue;
128 const size_t ntrk =
vertex->nTrackParticles();
130 const float x_ =
vertex->position().x();
131 const float y_ =
vertex->position().y();
132 const float r = std::sqrt(x_*x_+y_*y_);
138 selectedVtx.push_back(
vertex);
139 maxVtxNTrk =
std::max(maxVtxNTrk,
static_cast<float>(ntrk));
146 mon_preselNVtx = selectedVtx.size();
147 mon_maxVtxNTrk = maxVtxNTrk;
148 mon_maxVtxMass = maxVtxMass;
151 vtxCountContainer->push_back(vtxCount);
152 vtxCount->
setDetail(
"vsiHypo_nVtx",
static_cast<float>(nVtx) );
156 vtxCount->
setDetail(
"vsiHypo_counts",
static_cast<float>(selectedVtx.size()) );
165 mapDecVtxContIdx.emplace(
d, vtxCountContainer->size()-1 );
171 ATH_CHECK(vtxCountHandle.
record( std::move( vtxCountContainer ), std::move( vtxCountContainerAux ) ) );
184 size_t idx = mapDecVtxContIdx.at(*
it);
197 ATH_MSG_DEBUG(
" TrigVSIHypoAlg:" <<
name() <<
" successfully executed. Returning StatusCode::SUCCESS.");
198 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
SG::ReadHandleKey< xAOD::VertexContainer > m_verticesKey
bool setDetail(const std::string &name, const TYPE &value)
Set an TYPE detail on the object.
Group
Properties of a chain group.
xAOD::TrigCompositeContainer DecisionContainer
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
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 & hypoAlgNodeName()
Gaudi::Property< float > m_minR
SG::ReadHandle< T > makeHandle(const SG::View *view, const SG::ReadHandleKey< T > &rhKey, const EventContext &context)
navigate from the TrigComposite to nearest view and fetch object from it
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)
virtual StatusCode execute(const EventContext &context) const override
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...
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
Gaudi::Property< float > m_minPt
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...
bool isValid() const
Test to see if the link can be dereferenced.
virtual StatusCode initialize() override
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
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...
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
Gaudi::Property< float > m_requiredNTrks
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_vtxCountKey
Class used to describe composite objects in the HLT.
ToolHandleArray< TrigVSIHypoTool > m_hypoTools
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::TrigCompositeAuxContainer DecisionAuxContainer
ElementLink implementation for ROOT usage.
const std::string & featureString()
Gaudi::Property< bool > m_isViewBased
Hypothesis algorithms take the output of reco algorithms and the decision from the preceeding InputMa...
xAOD::TrigComposite Decision
ToolHandle< GenericMonitoringTool > m_monTool
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
std::set< DecisionID > DecisionIDContainer
Class describing a Vertex.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
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...
bool allFailed(const Decision *d)
return true if there is no positive decision stored
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Helper class to provide constant type-safe access to aux data.
Declare a monitored scalar variable.
size_type size() const noexcept
Returns the number of elements in the collection.
const std::string & viewString()
const_reference_type withDefault(const ELT &e, const T &deflt) const
Fetch the variable for one element, as a const reference, with a default.