7#ifndef TRIGGER_DECISION_TOOL_FeatureCollectStandalone_H
8#define TRIGGER_DECISION_TOOL_FeatureCollectStandalone_H
62 HLT::TriggerElement::FeatureAccessHelper
getTypelessBits(
const HLT::TriggerElement* te,
const HLT::TrigNavStructure* navigation);
64 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);
67 template<
typename REQUESTED,
typename STORED,
typename CONTAINER>
74 template<
typename STORED,
typename REQUESTED>
77 template<
typename REQUESTED>
83 template<
typename STORED>
88 template<
typename REQUESTED,
typename STORED>
90 for(
auto element : *newfeature){
96 template<
typename STORED>
97 std::shared_ptr<const STORED>
filter_if(std::true_type is_same, std::shared_ptr<const STORED>& original,
const TrigPassBits* bits){
102 std::cerr <<
"WARNING: nullptr TrigPassBits" << std::endl;
105 if(original->size() != bits->
size()){
106 std::cerr <<
"WARNING: bits size and owned size" << std::endl;
111 for(
auto obj : *original){
117 std::shared_ptr<const STORED> filtered(f->asDataVector());
121 template<
typename STORED>
122 std::shared_ptr<const STORED>
filter_if(std::false_type , std::shared_ptr<const STORED>& original,
const TrigPassBits* ){
127 template<
typename REQUESTED,
typename STORED,
typename CONTAINER>
129 std::vector<Trig::Feature<REQUESTED> > typedvec;
131 for(
auto feature : features){
132 auto typelessholder = navigation->
getHolder(feature.accessHelper());
134 std::cerr <<
"ERROR, holder not present" << std::endl;
138 const STORED* dest = 0;
140 StatusCode sc = typedholder.
get(dest,feature.accessHelper().getIndex());
142 std::cerr <<
"TrigDecisionTool WARNING: Feature access failed for feature: " << feature.accessHelper() << std::endl;
146 if(std::is_same<STORED, CONTAINER>::value){
148 std::shared_ptr<const STORED> owned(dest);
151 if(passbitsFeatureAccessHelper.valid()){
153 auto passbitsHolder = navigation->
getHolder(passbitsFeatureAccessHelper);
156 if(typedBits.
get(bits,passbitsFeatureAccessHelper.getIndex()).isFailure()){
157 std::cerr <<
"WARNING: couldn't get passbits from Holder" << std::endl;
159 owned =
filter_if(std::is_same<STORED, CONTAINER>(),owned,bits);
167 if(std::is_same<STORED,TrigRoiDescriptor>::value){
168 std::shared_ptr<const STORED> owned(dest);
210 std::vector<const IRoiDescriptor*> rois;
212 if((idx.objectsEnd() - idx.objectsBegin())!=1){
213 ATH_MSG_ERROR(
"accessing RoI holder with key: is not single element: ");
214 return StatusCode::FAILURE;
217 if(rois.size() < idx.objectsBegin()){
219 return StatusCode::FAILURE;
222 if(
index == idx.objectsBegin()){
226 delete rois.at(
index);
229 return StatusCode::SUCCESS;
#define ASG_CHECK(...)
Helper macro for checking the status code returned by a function call.
DataVector adapter that acts like it holds const pointers.
char data[hepevt_bytes_allocation_ATLAS]
DataVector adapter that acts like it holds const pointers.
const BaseHolder * getHolder(const TriggerElement::FeatureAccessHelper &fea) const
Helper class for conversion from/to int stored in TE and pair of ints used in Navigation Object point...
StatusCode get(const TrigRoiDescriptor *&destination, HLT::TriggerElement::ObjectIndex idx)
TypedHolder(const BaseHolder &baseholder, const asg::EventStoreType *store, const std::string &="")
const asg::EventStoreType * m_store
doubly templated class interfacing access to feature containers in StoreGate.
const std::string & key() const
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...
TypelessHolder(class_id_type clid, const std::string &label, sub_index_type sub)
virtual sub_index_type subTypeIndex() const
virtual class_id_type typeClid() const
virtual const std::string & label() const
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_ANA...
is basic vehicle of object access in TDT
Feature class, holding information on Feature attached to navigation.
Class mimicking the AthMessaging class from the offline software.
AsgMessaging(const std::string &name)
Constructor with a name.
const std::vector< std::vector< uint32_t > > & serialised() const
expose the navigation information (in serialised form)
std::string label(const std::string &format, int i)
std::string formatSGkey(const std::string &prefix, const std::string &containername, const std::string &label)
declaration of formatting function.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
bool isPassing(const TrigPassBits *bits, const T *obj, const CONTAINER *container)
Check the bit for the object in the associated bits object.
void deserialise(const roiserial_type &s, std::vector< const IRoiDescriptor * > &rois)
deserialise uint32_t vector into a full vector of IRoiDescriptors
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
This is the implementation of the Feature collection for Athena.
HLT::TriggerElement::FeatureAccessHelper getTypelessBits(const HLT::TriggerElement *te, const HLT::TrigNavStructure *navigation)
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)
std::shared_ptr< const STORED > filter_if(std::true_type is_same, std::shared_ptr< const STORED > &original, const TrigPassBits *bits)
void insert_element(std::vector< Trig::Feature< REQUESTED > > &, Trig::TypelessFeature &, const STORED *)
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())
The common trigger namespace for trigger analysis tools.
StoreGateSvc EventStoreType
the type returned by AsgTool::evtStore
RoiDescriptorStore_v1 RoiDescriptorStore
Define the latest version of the serialised RoiDescriptor storage.
static const std::string & typeName()