8#ifndef TRIGGER_DECISION_TOOL_FeatureCollectAthena_H
9#define TRIGGER_DECISION_TOOL_FeatureCollectAthena_H
70 const HLT::NavigationCore* navigation );
72 const TrigPassFlags*
getFlags(
size_t sz,
const HLT::TriggerElement* te,
73 const std::string&
label,
const HLT::NavigationCore* navigation );
78 typename T::ElementProxy;
91 bits =
getBits(source->size(), te, navigation);
96 for(
const typename T::base_value_type *obj : *source) {
98 destination->push_back(obj);
100 return destination->asDataVector();
116 template<
class T,
class STORED,
bool flatten,
class LINK>
121 if constexpr(flatten) {
124 bits =
getBits(source->size(), te, navigation);
127 for(
const T* obj : *source) {
136 const T* possibly_reduced_container =
use_or_construct<T>(source, te, condition, navigation);
140 possibly_reduced_container != source,
145 template<
class REQUESTED,
class EDMLIST>
148 template<
class FEATURE>
155 constexpr bool do_flatten = (! std::is_same_v<REQUESTED,container_type>) && std::is_same_v<FEATURE,container_type>;
156 constexpr bool do_retrieve = ! (std::is_same_v<REQUESTED,container_type> && std::is_same_v<FEATURE,object_type>);
158 if constexpr( !do_retrieve ) {
163 std::string sourceLabel;
165 bool new_result{
false};
173 auto get_ptr = [](
const auto& link) {
174 if constexpr(std::is_same_v<FEATURE,container_type>)
191 std::vector<Trig::Feature<REQUESTED> >*
m_data{
nullptr};
206 std::string_view
label,
unsigned int condition,
const std::string& teName,
219 feature_list::for_each(link_getter);
226 const std::vector<HLT::TriggerElement*> bif_tes = navigation->getDirectPredecessors(sourceTE);
227 if ( bif_tes.size() <= 1 ) {
232 collect(predecesor_te, data, {
label.begin(),
label.end()}, condition, teName, navigation);
268 if(orig_cont->size() != orig_tpf->
size()) {
273 unsigned int currentPos=0;
274 for(
const typename CONT::base_value_type* obj : *cont) {
275 const auto orig_obj = std::find(orig_cont->begin(),orig_cont->end(),obj);
277 if(orig_obj == orig_cont->end()) {
280 size_t idx = orig_obj-orig_cont->begin();
302 if(orig_cont->size() != orig_tpf->
size()) {
309 const auto orig_obj = std::find(orig_cont->begin(),orig_cont->end(), obj);
311 if(orig_obj == orig_cont->end()) {
314 size_t idx = orig_obj-orig_cont->begin();
325 const STORED* orig{};
327 std::string sourceLabel;
328 if (navigation->
getRecentFeature(f.te(), orig, f.label(), sourceTE, sourceLabel)) {
329 if constexpr (std::is_same_v<T,STORED>)
DataVector adapter that acts like it holds const pointers.
Object2Features< FEATURE, EDMLIST >::type Object2Features_t
Features2Object< FEATURE, EDMLIST >::type Features2Object_t
Features2Container< FEATURE, EDMLIST >::type Features2Container_t
std::conditional_t< std::is_same_v< REQUESTED, CONTAINER >, DataLink< CONTAINER >, ElementLink< CONTAINER > > Features2LinkHelper_t
Get link type for feature.
DataVector adapter that acts like it holds const pointers.
ElementLink implementation for ROOT usage.
The NavigationCore class, adds on top of the TrigNavStructure the EDM read-only handling.
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
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
bool getActiveState() const
get state of the TriggerElement
A Flag is an ordered collection of bits (vector<bool>) that can hold additional (boolean) information...
unsigned int flagSize() const
gets size of the flag vector for the object at index
const std::vector< bool > & getFlag(const unsigned int position) const
Returns the flag (vector<bool>) at index position.
unsigned int size() const
gets size of the container object vector
void setFlag(const unsigned int position, const std::vector< bool > &flag, const void *cont=0)
Set the flag at index position.
is basic vehicle of object access in TDT
std::string label(const std::string &format, int i)
bool isPassing(const TrigPassBits *bits, const T *obj, const CONTAINER *container)
Check the bit for the object in the associated bits object.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
static const unsigned int Physics
This is the implementation of the Feature collection for Athena.
const T * use_or_construct(const T *source, const HLT::TriggerElement *te, unsigned int condition, const HLT::NavigationCore *navigation)
void collect< Jet_ROI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< Jet_ROI > > &data, std::string_view, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
const TrigPassFlags * getFlags(size_t size, const HLT::TriggerElement *te, const std::string &label, const HLT::NavigationCore *navigation)
void collect< xAOD::JetRoI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< xAOD::JetRoI > > &data, std::string_view, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
void insert_and_flatten(std::vector< Trig::Feature< T > > &destination, const STORED *source, const HLT::TriggerElement *te, const std::string &label, unsigned int condition, const HLT::NavigationCore *navigation, const LINK &lnk)
TrigPassFlags build_flags(const CONT *orig_cont, const CONT *cont, const TrigPassFlags *orig_tpf)
void collect< xAOD::EmTauRoI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< xAOD::EmTauRoI > > &data, std::string_view, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
void collect< Muon_ROI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< Muon_ROI > > &data, std::string_view, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
void collect(const HLT::TriggerElement *te, std::vector< Trig::Feature< T > > &data, std::string_view label, unsigned int condition, const std::string &teName, const HLT::TrigNavStructure *navstructure)
actual feature acceess implementation It has (thanks to the ClassTraits) functionality to flatten con...
const TrigPassBits * getBits(size_t sz, const HLT::TriggerElement *te, const HLT::NavigationCore *navigation)
void collect< xAOD::MuonRoI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< xAOD::MuonRoI > > &data, std::string_view, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
TrigPassFlags build_flags2(const STORED *orig_cont, const T *obj, const TrigPassFlags *orig_tpf)
void collect< EmTau_ROI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< EmTau_ROI > > &data, std::string_view, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
The common trigger namespace for trigger analysis tools.
std::string getTEName(const HLT::TriggerElement &te)
converts TEid to TE name (this may not always work, it depends on the availability of config)
TrigPassBits_v1 TrigPassBits
Define the latest version of the trigger pass bits class.
const HLT::TriggerElement ** m_sourceTE
const HLT::TriggerElement * m_te
const HLT::NavigationCore * m_navigation
std::vector< Trig::Feature< REQUESTED > > * m_data
const std::string m_label