8#ifndef TRIGGER_DECISION_TOOL_FeatureCollectAthena_H
9#define TRIGGER_DECISION_TOOL_FeatureCollectAthena_H
71 const TrigPassBits*
getBits(
size_t sz,
const HLT::TriggerElement* te,
const std::string&
label,
const HLT::NavigationCore* navigation );
73 const TrigPassFlags*
getFlags(
size_t sz,
const HLT::TriggerElement* te,
const std::string&
label,
const HLT::NavigationCore* navigation );
94 const typename std::enable_if<!isDataVector<T>::value, T>
::type*
102 std::enable_if<isDataVector<T>::value, T>
::type*
112 for(
const typename T::base_value_type *obj : *source) {
114 destination->push_back(obj);
116 return destination->asDataVector();
136 template<
class T,
class STORED,
class LINK>
142 destination.push_back(
Trig::Feature<T>(possibly_reduced_possibly_container, te,
label, possibly_reduced_possibly_container != source,lnk));
148 template<
class T,
class CONT,
class LINK>
161 for(
const T* obj : *source) {
175 static void do_it(
const LINK& link,
bool ){
177 for(
unsigned int j=0;j<link.cptr()->size();++j){
187 static void do_it(
const LINK& ,
bool ){
199 template<
class REQUESTED,
class EDMLIST>
210 const std::string&
label,
unsigned int condition,
211 const std::string& teName,
218 template<
class FEATURE>
226 const bool do_flatten = (! std::is_same<REQUESTED,container_type>::value) && std::is_same<FEATURE,container_type>::value;
227 const bool do_retrieve = ! (std::is_same<REQUESTED,container_type>::value && std::is_same<FEATURE,object_type>::value);
233 template<
class FEATURE,
bool do_flatten>
236 template<
class FEATURE,
bool do_flatten>
240 std::string sourceLabel;
267 std::vector<Trig::Feature<REQUESTED> >*
m_data;
290 std::string sourceLabel;
305 const std::vector<HLT::TriggerElement*> bif_tes = navigation->getDirectPredecessors(sourceTE);
306 if ( bif_tes.size() <= 1 ) {
347 if(orig_cont->size() != orig_tpf->
size()) {
352 unsigned int currentPos=0;
353 for(
const typename CONT::base_value_type* obj : *cont) {
354 typename CONT::const_iterator orig_obj = std::find(orig_cont->begin(),orig_cont->end(),obj);
356 if(orig_obj == orig_cont->end()) {
359 size_t idx = orig_obj-orig_cont->begin();
384 if(orig_cont->size() != orig_tpf->
size()) {
391 typename STORED::const_iterator orig_obj = std::find(orig_cont->begin(),orig_cont->end(), obj);
393 if(orig_obj == orig_cont->end()) {
396 size_t idx = orig_obj-orig_cont->begin();
432 const STORED* orig(0);
434 std::string sourceLabel(
"");
435 if (navigation->
getRecentFeature(f.te(), orig, f.label(), sourceTE, sourceLabel)) {
DataVector adapter that acts like it holds const pointers.
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)
const std::enable_if<!isDataVector< T >::value, T >::type * use_or_construct(const T *source, const HLT::TriggerElement *, const std::string &, unsigned int, const HLT::NavigationCore *)
TrigPassFlags build_flags(const typename std::enable_if< isDataVector< CONT >::value, CONT >::type *orig_cont, const CONT *cont, const TrigPassFlags *orig_tpf)
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)
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)
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.
master_search< typenameEDMLIST::map, HLT::TypeInformation::get_feat, FEATURE >::result::search_result::container type
lnk_helper< CONTAINER, isCont >::type type
master_search< typenameEDMLIST::map, HLT::TypeInformation::get_feat, FEATURE >::result::search_result::object type
master_search< typenameEDMLIST::map, HLT::TypeInformation::get_objt, OBJECT >::result::search_result::list_of_features type
static TrigPassFlags do_build(const STORED *orig_feat, const T *feat, const TrigPassFlags *orig_tpf)
static TrigPassFlags do_build(const STORED *orig_feat, const T *feat, const TrigPassFlags *orig_tpf)
void _do_it(true_type=true_type())
const HLT::TriggerElement ** m_sourceTE
void _do_it(false_type dummy=false_type())
const HLT::TriggerElement * m_te
const HLT::NavigationCore * m_navigation
get_links(const HLT::TriggerElement *te, std::vector< Trig::Feature< REQUESTED > > *data, const std::string &label, unsigned int condition, const std::string &teName, const HLT::NavigationCore *navigation, bool *result, const HLT::TriggerElement **sourceTE)
std::vector< Trig::Feature< REQUESTED > > * m_data
const std::string m_label
static void do_it(std::vector< Trig::Feature< T > > &destination, const CONT *source, const HLT::TriggerElement *te, const std::string &label, unsigned int condition, const HLT::NavigationCore *navigation, const LINK &)
static void do_it(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)
static true_type trait_test_helper(typename U::ElementProxy *)
static false_type trait_test_helper(...)
static ptr_type get_ptr(const LINK &link)
LINK::ElementType ptr_type
static void do_it(const LINK &, bool)
static ptr_type get_ptr(const LINK &link)
static void do_it(const LINK &link, bool)
const LINK::value_type * ptr_type