8#ifndef TRIGGER_DECISION_TOOL_FeatureCollectAthena_H
9#define TRIGGER_DECISION_TOOL_FeatureCollectAthena_H
70 const std::string&
label,
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;
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) {
127 for(
const T* obj : *source) {
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;
171 auto get_ptr = [](
const auto& link) {
172 if constexpr(std::is_same_v<FEATURE,container_type>)
189 std::vector<Trig::Feature<REQUESTED> >*
m_data{
nullptr};
204 const std::string&
label,
unsigned int condition,
const std::string& teName,
224 const std::vector<HLT::TriggerElement*> bif_tes = navigation->getDirectPredecessors(sourceTE);
225 if ( bif_tes.size() <= 1 ) {
266 if(orig_cont->size() != orig_tpf->
size()) {
271 unsigned int currentPos=0;
272 for(
const typename CONT::base_value_type* obj : *cont) {
273 const auto orig_obj = std::find(orig_cont->begin(),orig_cont->end(),obj);
275 if(orig_obj == orig_cont->end()) {
278 size_t idx = orig_obj-orig_cont->begin();
300 if(orig_cont->size() != orig_tpf->
size()) {
307 const auto orig_obj = std::find(orig_cont->begin(),orig_cont->end(), obj);
309 if(orig_obj == orig_cont->end()) {
312 size_t idx = orig_obj-orig_cont->begin();
323 const STORED* orig{};
325 std::string sourceLabel;
326 if (navigation->
getRecentFeature(f.te(), orig, f.label(), sourceTE, sourceLabel)) {
327 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.
char data[hepevt_bytes_allocation_ATLAS]
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.
void collect< xAOD::EmTauRoI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< xAOD::EmTauRoI > > &data, const std::string &, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
void collect< EmTau_ROI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< EmTau_ROI > > &data, const std::string &, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
void collect(const HLT::TriggerElement *te, std::vector< Trig::Feature< T > > &data, const std::string &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...
void collect< Jet_ROI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< Jet_ROI > > &data, const std::string &, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
void collect< xAOD::MuonRoI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< xAOD::MuonRoI > > &data, const std::string &, 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 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)
void collect< xAOD::JetRoI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< xAOD::JetRoI > > &data, const std::string &, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
TrigPassFlags build_flags(const CONT *orig_cont, const CONT *cont, const TrigPassFlags *orig_tpf)
const TrigPassBits * getBits(size_t sz, const HLT::TriggerElement *te, const std::string &, const HLT::NavigationCore *navigation)
TrigPassFlags build_flags2(const STORED *orig_cont, const T *obj, const TrigPassFlags *orig_tpf)
void collect< Muon_ROI >(const HLT::TriggerElement *te, std::vector< Trig::Feature< Muon_ROI > > &data, const std::string &, unsigned int condition, const std::string &, const HLT::TrigNavStructure *navigation)
const T * use_or_construct(const T *source, const HLT::TriggerElement *te, const std::string &label, unsigned int condition, const HLT::NavigationCore *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