![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #ifndef TRIGGER_DECISION_TOOL_FeatureCollectStandalone_H
8 #define TRIGGER_DECISION_TOOL_FeatureCollectStandalone_H
24 #include <type_traits>
25 #include "boost/type_traits/is_same.hpp"
50 class TrigNavStructure;
61 namespace FeatureAccessImpl{
68 template<
typename REQUESTED,
typename STORED,
typename CONTAINER>
75 template<
typename STORED,
typename REQUESTED>
78 template<
typename REQUESTED>
84 template<
typename STORED>
89 template<
typename REQUESTED,
typename STORED>
91 for(
auto element : *newfeature){
97 template<
typename STORED>
98 std::shared_ptr<const STORED>
filter_if(boost::mpl::bool_<true> is_same, std::shared_ptr<const STORED>& original,
const TrigPassBits* bits){
103 std::cerr <<
"WARNING: nullptr TrigPassBits" << std::endl;
106 if(original->size() != bits->
size()){
107 std::cerr <<
"WARNING: bits size and owned size" << std::endl;
112 for(
auto obj : *original){
118 std::shared_ptr<const STORED> filtered(
f->asDataVector());
122 template<
typename STORED>
123 std::shared_ptr<const STORED>
filter_if(boost::mpl::bool_<false> , std::shared_ptr<const STORED>& original,
const TrigPassBits* ){
128 template<
typename REQUESTED,
typename STORED,
typename CONTAINER>
130 std::vector<Trig::Feature<REQUESTED> > typedvec;
132 for(
auto feature : features){
133 auto typelessholder = navigation->
getHolder(feature.accessHelper());
135 std::cerr <<
"ERROR, holder not present" << std::endl;
139 const STORED*
dest = 0;
143 std::cerr <<
"TrigDecisionTool WARNING: Feature access failed for feature: " << feature.accessHelper() << std::endl;
149 std::shared_ptr<const STORED> owned(
dest);
152 if(passbitsFeatureAccessHelper.valid()){
154 auto passbitsHolder = navigation->
getHolder(passbitsFeatureAccessHelper);
157 if(typedBits.
get(bits,passbitsFeatureAccessHelper.getIndex()).isFailure()){
158 std::cerr <<
"WARNING: couldn't get passbits from Holder" << std::endl;
160 owned =
filter_if(boost::is_same<STORED,CONTAINER>(),owned,bits);
169 std::shared_ptr<const STORED> owned(
dest);
192 asg::AsgMessaging(
"TypedHolder"),
211 std::vector<const IRoiDescriptor*>
rois;
213 if((
idx.objectsEnd() -
idx.objectsBegin())!=1){
214 ATH_MSG_ERROR(
"accessing RoI holder with key: is not single element: ");
215 return StatusCode::FAILURE;
218 if(
rois.size() <
idx.objectsBegin()){
220 return StatusCode::FAILURE;
230 return StatusCode::SUCCESS;
TypedHolder(const BaseHolder &baseholder, const asg::EventStoreType *store, const std::string &="")
Helper class for conversion from/to int stored in TE and pair of ints used in Navigation Object point...
HLT::TriggerElement::FeatureAccessHelper getTypelessBits(const HLT::TriggerElement *te, const HLT::TrigNavStructure *navigation)
char data[hepevt_bytes_allocation_ATLAS]
#define ASG_CHECK(...)
Helper macro for checking the status code returned by a function call.
void insert_element(std::vector< Trig::Feature< REQUESTED > > &, Trig::TypelessFeature &, const STORED *)
The common trigger namespace for trigger analysis tools.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
DataVector adapter that acts like it holds const pointers.
unsigned int size() const
gets size of the bits array
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
std::string formatSGkey(const std::string &prefix, const std::string &containername, const std::string &label)
declaration of formatting function.
const asg::EventStoreType * m_store
std::vector< Trig::Feature< REQUESTED > > typedGet(const std::vector< TypelessFeature > &features, const HLT::TrigNavStructure *navigation, const asg::EventStoreType *store, const std::string &container_name=ClassID_traits< CONTAINER >::typeName())
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
The Athena Transient Store API.
Feature class, holding information on Feature attached to navigation.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
const std::vector< std::vector< uint32_t > > & serialised() const
expose the navigation information (in serialised form)
::StatusCode StatusCode
StatusCode definition for legacy code.
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
Default, invalid implementation of ClassID_traits.
void deserialise(const roiserial_type &s, std::vector< const IRoiDescriptor * > &rois)
deserialise uint32_t vector into a full vector of IRoiDescriptors
std::string key() const
key used to access EventStore
bool isPassing(const TrigPassBits *bits, const T *obj, const CONTAINER *container)
Check the bit for the object in the associated bits object.
std::shared_ptr< const STORED > filter_if(boost::mpl::bool_< true > is_same, std::shared_ptr< const STORED > &original, const TrigPassBits *bits)
Class mimicking the AthMessaging class from the offline software.
StatusCode get(const TrigRoiDescriptor *&destination, HLT::TriggerElement::ObjectIndex idx)
the FeatureAccessHelper is a class used to keep track of features attached to this TE.
DataVector adapter that acts like it holds const pointers.
StatusCode_if< T, true > get(const T *&destination, HLT::TriggerElement::ObjectIndex idx)
method creates a new VIEW container containing pointers to the elements pointed to by the ObjectIndex...
const asg::EventStoreType * m_store
doubly templated class interfacing access to feature containers in StoreGate.
const BaseHolder * getHolder(const TriggerElement::FeatureAccessHelper &fea) const
void typelessCollect(const HLT::TriggerElement *te, HLT::class_id_type clid, std::vector< Trig::TypelessFeature > &data, const std::string &label, unsigned int condition, const HLT::TrigNavStructure *navigation)
void insert_flatten_if(std::vector< Trig::Feature< STORED > > &result, const Trig::TypelessFeature &feature, const std::shared_ptr< const STORED > &newfeature)