8#ifndef TRIGNAVIGATION_HLTNAVIGATIONCORE_H
9#define TRIGNAVIGATION_HLTNAVIGATIONCORE_H
16#include "GaudiKernel/ClassID.h"
17#include "GaudiKernel/MsgStream.h"
18#include "GaudiKernel/ServiceHandle.h"
96 friend class ::TrigNavigationThinningSvc;
112 virtual void reset(
bool inFinalize =
false);
136 virtual bool serialize( std::vector<uint32_t>& output)
const;
137 bool serialize( std::vector<uint32_t>& output, std::vector<unsigned int>& cuts )
const;
138 bool serialize( std::vector<uint32_t>& output, std::vector<unsigned int>& cuts, std::vector<std::pair<CLID, std::string> >& clid_name)
const;
139 bool serialize_DSonly( std::vector<uint32_t>& output, std::vector<unsigned int>& cuts, std::vector<std::pair<CLID, std::string> >& clid_name)
const;
140 bool deserialize(
const std::vector<uint32_t>& input );
171 std::map<const T*, std::string>* labels=0 )
const;
174 bool getFeature(
const TriggerElement* te,
const T*& features,
const std::string&
label=
"", std::string& sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel)
const;
179 const std::string&
label=
"", std::string& sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel)
const;
192 const C* container)
const;
197 template<
class C,
class T>
217 std::vector< const T*>& features,
const std::string&
label=
"",
218 std::map<const T*, std::string>* labels=0 )
const;
222 const T*& feature,
const std::string&
label=
"",
223 const TriggerElement*& source = ::HLT::TrigNavStructure::m_unspecifiedTE,
224 std::string& sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel )
const;
226 template<
class LinkType>
228 LinkType& link,
const std::string&
label=
"",
229 const TriggerElement*& source = ::HLT::TrigNavStructure::m_unspecifiedTE,
230 std::string& sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel)
const;
232 template<
class C,
class T>
236 template<
class C,
class T>
239 const TriggerElement*& source = ::HLT::TrigNavStructure::m_unspecifiedTE,
240 std::string& sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel )
const;
262 bool only_single_feature,
264 bool travel_backward_recursively,
266 std::string& sourcelabel = m_unspecifiedLabel)
const;
271 bool only_single_feature,
273 const TriggerElement*& source = ::HLT::TrigNavStructure::m_unspecifiedTE,
274 std::string& sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel)
const;
289 const std::string&
label=
"", std::map<const T*, std::string>* labels=0 )
const;
320 static uint32_t
string2hash(
const std::string&,
const std::string& category=
"TE" );
327 std::vector< HLT::TriggerElement* >& output,
328 const bool activeOnly=
true)
const;
359 bool addOneLevel(std::vector< std::vector<TriggerElement*> >& currentCombs,
360 std::vector< std::vector<std::pair<unsigned int, unsigned int> > >& currentIdxs,
362 std::vector< std::vector<TriggerElement*> >& newCombs,
363 std::vector< std::vector<std::pair<unsigned int, unsigned int> > >& newIdxs,
364 unsigned int maxResults = 1000,
bool onlyActive = 1);
399 bool extractBlob(
const std::vector<uint32_t>& input,
400 std::vector<uint32_t>::const_iterator& it,
401 std::vector<uint32_t>& blob)
const ;
408 MsgStream&
msg(
const MSG::Level lvl)
const {
return msg() << lvl; }
409 bool msgLvl(
const MSG::Level lvl)
const {
return msg().level() <= lvl; }
414 std::vector<uint32_t>& output,std::vector<unsigned int>& cuts ,std::vector<std::pair<CLID, std::string> >& clid_name)
const;
416 bool serializeHoldersWithoutPayload(
const std::vector<HLTNavDetails::IHolder*>& holders, std::vector<uint32_t>& output, std::vector<uint32_t>& holderblobsizes,std::vector<std::pair<CLID, std::string> >& clid_name)
const;
418 bool serializeHoldersWithPayload(
const std::vector<CSPair>& payload, std::vector<uint32_t>& output, std::vector<uint32_t>& holderblobsizes,
419 std::vector<std::pair<CLID, std::string> >& clid_name)
const;
423 MsgStream&
operator<< ( MsgStream& m,
const NavigationCore& nav );
An STL vector of pointers that by default owns its pointed-to elements.
uint32_t CLID
The Class ID type.
DataVector adapter that acts like it holds const pointers.
ElementLinkVector implementation for standalone ROOT.
ElementLink implementation for ROOT usage.
bool registerHolder(HLTNavDetails::IHolder *holder)
NavigationCore(const AthAlgTool &logger)
constructor with parent AlgTool for printing
bool getFeaturesLinks(const TriggerElement *te, ElementLinkVector< C > &links, const std::string &label="") const
const T * featureLink2Object(const TrigFeatureLink &) const
ITrigHolderFactory * m_holderfactory
std::vector< std::string > m_classesFromPayloadIgnoreProperty
list of classes::keys to ignore on deserialization
bool getFeature(const TriggerElement *te, const ConstDataVector< T > *&features, const std::string &label="", std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
uint16_t nextSubTypeIndex(CLID clid, const std::string &label) const
bool extractBlob(const std::vector< uint32_t > &input, std::vector< uint32_t >::const_iterator &it, std::vector< uint32_t > &blob) const
static void registerFeatureContainer()
Specialized by type and container for this type.
const AthAlgTool & m_logger
std::vector< CSPair > m_classesToPayload_DSonly
classess are put to payload according to that priority list (CLID + key)
static uint32_t string2hash(const std::string &, const std::string &category="TE")
convert strin g to hash.
bool getFeaturesInRoI(const TriggerElement *te, std::vector< const T * > &features, const std::string &label="", std::map< const T *, std::string > *labels=0) const
retrieve features attached to the RoIs seeding this TriggerElement
HLTNavDetails::Holder< T > * getHolder(uint16_t subTypeIndex) const
as above but does not create holder on demand (return 0 if not found)
virtual void reset(bool inFinalize=false)
resets all the navigation, goes to the factory and asks to withdraw all produced objects
IConversionSvc * m_serializerSvc
TrigFeatureLink object2FeatureLink(const TriggerElement *te, const std::string &label, const typename Container2Object< C >::type *obj, const C *container) const
virtual bool serialize(std::vector< uint32_t > &output) const
method serizlizes the navigation structure The structure is serrizlized in following order ....
MemoryManagement
defines 3 possible origins of the objects which are attached to TEs This should be used like this:
bool getRecentFeatureDataOrElementLink(const TriggerElement *te, LinkType &link, const std::string &label="", const TriggerElement *&source=::HLT::TrigNavStructure::m_unspecifiedTE, std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
unsigned m_objectsIndexOffset
small integer used to generate sub type index
virtual bool getFeatureAccessorsSingleTE(const TriggerElement *te, CLID clid, const index_or_label_type &index_or_label, bool only_single_feature, TriggerElement::FeatureVec &features, const TriggerElement *&source=::HLT::TrigNavStructure::m_unspecifiedTE, std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
void getAllOfType(const std::string &id, std::vector< HLT::TriggerElement * > &output, const bool activeOnly=true) const
return trigger elements given the name of TEs
bool serializeHoldersWithPayload(const std::vector< CSPair > &payload, std::vector< uint32_t > &output, std::vector< uint32_t > &holderblobsizes, std::vector< std::pair< CLID, std::string > > &clid_name) const
bool addOneLevel(std::vector< std::vector< TriggerElement * > > ¤tCombs, std::vector< std::vector< std::pair< unsigned int, unsigned int > > > ¤tIdxs, unsigned int type, std::vector< std::vector< TriggerElement * > > &newCombs, std::vector< std::vector< std::pair< unsigned int, unsigned int > > > &newIdxs, unsigned int maxResults=1000, bool onlyActive=1)
Helper method for "combine": add one "level" of multiplicity to the results.
std::vector< std::string > m_classesToPayloadProperty_DSonly
list of classes::keys to be put to DS payload
bool getFeatures(const TriggerElement *te, std::vector< const T * > &features, const std::string &label="", std::map< const T *, std::string > *labels=0) const
retrieve features attached to given TriggerElement
bool getRecentFeatures(const TriggerElement *te, std::vector< const T * > &features, const std::string &label="", std::map< const T *, std::string > *labels=0) const
retrieve features attached to given TriggerElement or its predecessors the algorithm will go recursiv...
std::vector< std::string > m_classesToPayloadProperty
list of classes::keys to be put to BS payload
StoreGateSvc * m_storeGate
std::vector< std::string > m_classesToPreregisterProperty
as above but for preregistration
std::vector< CSPair > m_classesToPayload
classess are put to payload according to that priority list (CLID + key)
bool getRecentFeatureLink(const TriggerElement *te, ElementLink< C > &link, const std::string &label="", const TriggerElement *&source=::HLT::TrigNavStructure::m_unspecifiedTE, std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
bool getRecentFeaturesLinks(const TriggerElement *te, ElementLinkVector< C > &links, const std::string &label="") const
virtual void prepare()
prepapres the navigation for next event
std::vector< CSPair > m_classesToPreregister
classes mentioned here will be put to SG irrespectively of thier presence in event
TrigFeatureLink object2FeatureLink(const TriggerElement *te, const std::string &label, const T *obj) const
bool getAllFeatures(ElementLinkVector< C > &features, const std::string &label="") const
gets all features of type T atachedd to whichever TE
bool getRecentFeature(const TriggerElement *te, const T *&feature, const std::string &label="", const TriggerElement *&source=::HLT::TrigNavStructure::m_unspecifiedTE, std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
bool msgLvl(const MSG::Level lvl) const
virtual bool getFeatureAccessors(const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label, bool only_single_feature, TriggerElement::FeatureVec &features, bool travel_backward_recursively, const TriggerElement *&source=m_unspecifiedTE, std::string &sourcelabel=m_unspecifiedLabel) const
retrieve features accessors according to the requrements This method is actually workhorse for all ab...
bool deserialize(const std::vector< uint32_t > &input)
MsgStream & msg(const MSG::Level lvl) const
bool serializeHoldersWithoutPayload(const std::vector< HLTNavDetails::IHolder * > &holders, std::vector< uint32_t > &output, std::vector< uint32_t > &holderblobsizes, std::vector< std::pair< CLID, std::string > > &clid_name) const
std::string m_objectsKeyPrefix
property setting prefix which is to be given to all trigger EDM objects
bool getFeature(const TriggerElement *te, const T *&features, const std::string &label="", std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
virtual ~NavigationCore()=default
bool serialize_DSonly(std::vector< uint32_t > &output, std::vector< unsigned int > &cuts, std::vector< std::pair< CLID, std::string > > &clid_name) const
HLTNavDetails::Holder< T > * getHolder(const std::string &label, uint16_t suggestedIndex) const
aware holder discovery, creates holder if needed
const AccessProxy * getAccessProxy() const
gets the access proxy
bool serializeWithHolderSection(const std::vector< uint32_t > &holderdata, const std::vector< unsigned int > &holderblobsizes, std::vector< uint32_t > &output, std::vector< unsigned int > &cuts, std::vector< std::pair< CLID, std::string > > &clid_name) const
bool createHolder(HLTNavDetails::IHolder *&holder, CLID clid, const std::string &label, uint16_t idx) const
creates holder for type given by CLID
HLTNavDetails::IHolder * prepareOneHolder(CLID clid, const std::string &label)
void getAllOfType(const te_id_type id, std::vector< TriggerElement * > &output, const bool activeOnly=true) const
The query returning a collection of all TriggerElements if name is given.
std::string label(class_id_type clid, const index_or_label_type &sti_or_label) const
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
std::vector< FeatureAccessHelper > FeatureVec
The Athena Transient Store API.
Utility class (not a tool or so) to serialize strings into stream of 32bit integers.
The TrigNavigationThinningSvc is an athena tool used to slim the trigger Navigation structure in vari...
Class helping in dealing with dynamic branch selection.
static Root::TMsgLogger logger("iLumiCalc")
std::string label(const std::string &format, int i)
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
std::variant< sub_index_type, std::string > index_or_label_type
MsgStream & operator<<(MsgStream &m, const Navigation &nav)
EDMLIST::map::template find< CONTAINER, HLT::TypeInformation::MatchContainer >::object type
CSPair(CLID clid, const std::string &key, xAOD::AuxSelection &&the_sel)