ATLAS Offline Software
Classes | Functions
Trig::FeatureAccessImpl Namespace Reference

This is the implementation of the Feature collection for Athena. More...

Classes

struct  false_type
 
struct  get_links
 
struct  get_type
 
struct  get_type< false >
 
struct  get_type< true >
 
struct  getFlagsHelper
 
struct  getFlagsHelper< T, STORED, false >
 
struct  getFlagsHelper< T, STORED, true >
 
struct  insert_and_flatten
 
struct  insert_and_flatten< T, CONT, true, LINK >
 
struct  insert_and_flatten< T, STORED, false, LINK >
 
struct  isDataVector
 
struct  print_features
 
struct  print_features< LINK, false >
 
struct  print_features< LINK, true >
 
struct  true_type
 

Functions

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)
 
const TrigPassBitsgetBits (size_t sz, const HLT::TriggerElement *te, const std::string &, const HLT::NavigationCore *navigation)
 
const TrigPassFlagsgetFlags (size_t size, const HLT::TriggerElement *te, const std::string &label, const HLT::NavigationCore *navigation)
 
template<class T >
void l1collect (const HLT::TriggerElement *te, std::vector< Trig::Feature< T > > &data, unsigned int condition, const std::vector< T > &(LVL1_ROI::*method)() const, const HLT::TrigNavStructure *navstructure)
 
template<>
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)
 
template<>
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)
 
template<>
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)
 
template<typename ROI , typename ROICONTAINER >
void xAODcollect (const HLT::TriggerElement *te, std::vector< Trig::Feature< ROI > > &data, unsigned int condition, const HLT::TrigNavStructure *navstructure, const std::string &sgkey)
 
template<>
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)
 
template<>
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)
 
template<>
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)
 
template<>
TrigPassFlags getFlags (const Trig::Feature< EmTau_ROI > &, const TrigPassFlags *, HLT::NavigationCore *)
 
template<>
TrigPassFlags getFlags (const Trig::Feature< Muon_ROI > &, const TrigPassFlags *, HLT::NavigationCore *)
 
template<>
TrigPassFlags getFlags (const Trig::Feature< Jet_ROI > &, const TrigPassFlags *, HLT::NavigationCore *)
 
template<class T >
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 *)
 
template<class T >
const std::enable_if< isDataVector< T >::value, T >::type * use_or_construct (const T *source, const HLT::TriggerElement *te, const std::string &label, unsigned int condition, const HLT::NavigationCore *navigation)
 
template<class T >
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 containers of containers. More...
 
template<class CONT >
TrigPassFlags build_flags (const typename std::enable_if< isDataVector< CONT >::value, CONT >::type *orig_cont, const CONT *cont, const TrigPassFlags *orig_tpf)
 
template<class T >
TrigPassFlags build_flags (const typename std::enable_if<!isDataVector< T >::value, T >::type *orig, const T *feature, const TrigPassFlags *orig_tpf)
 
template<class T , class STORED >
TrigPassFlags build_flags2 (const STORED *orig_cont, const T *obj, const TrigPassFlags *orig_tpf)
 
template<class T >
TrigPassFlags getFlags (const Trig::Feature< T > &f, const TrigPassFlags *orig_tpf, HLT::NavigationCore *navigation)
 
template<typename REQUESTED , typename STORED , typename CONTAINER >
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())
 
template<typename STORED , typename REQUESTED >
void insert_element (std::vector< Trig::Feature< REQUESTED > > &, Trig::TypelessFeature &, const STORED *)
 
template<typename REQUESTED >
void insert_element (std::vector< Trig::Feature< REQUESTED > > &result, Trig::TypelessFeature &feature, const REQUESTED *element)
 
template<typename STORED >
void insert_flatten_if (std::vector< Trig::Feature< STORED > > &result, const Trig::TypelessFeature &feature, const std::shared_ptr< const STORED > &newfeature)
 
template<typename REQUESTED , typename STORED >
void insert_flatten_if (std::vector< Trig::Feature< REQUESTED > > &result, const Trig::TypelessFeature &feature, const std::shared_ptr< const STORED > &newfeature)
 
template<typename STORED >
std::shared_ptr< const STORED > filter_if (boost::mpl::bool_< true > is_same, std::shared_ptr< const STORED > &original, const TrigPassBits *bits)
 
template<typename STORED >
std::shared_ptr< const STORED > filter_if (boost::mpl::bool_< false >, std::shared_ptr< const STORED > &original, const TrigPassBits *)
 

Detailed Description

This is the implementation of the Feature collection for Athena.

This is the implementation of the Feature collection for ASG.

Function Documentation

◆ build_flags() [1/2]

template<class CONT >
TrigPassFlags Trig::FeatureAccessImpl::build_flags ( const typename std::enable_if< isDataVector< CONT >::value, CONT >::type *  orig_cont,
const CONT *  cont,
const TrigPassFlags orig_tpf 
)

Definition at line 362 of file FeatureCollectAthena.h.

370  {
371  if(orig != feature) return TrigPassFlags(); // a problem TODO: print a ERROR
372 
373  TrigPassFlags tpf(1, orig_tpf->flagSize());
374  tpf.setFlag(0,orig_tpf->getFlag(0));
375  return tpf;
376  }
377 
378 
379 
380  // access by single object, stored as container
381  template<class T, class STORED> TrigPassFlags
382  build_flags2(const STORED* orig_cont, const T* obj, const TrigPassFlags * orig_tpf)
383  {
384  if(orig_cont->size() != orig_tpf->size()) {

◆ build_flags() [2/2]

template<class T >
TrigPassFlags Trig::FeatureAccessImpl::build_flags ( const typename std::enable_if<!isDataVector< T >::value, T >::type *  orig,
const T *  feature,
const TrigPassFlags orig_tpf 
)

Definition at line 388 of file FeatureCollectAthena.h.

393  {
394  //std::cout << "WARNING: object in reduced container can' be found in original." << std::endl;

◆ build_flags2()

template<class T , class STORED >
TrigPassFlags Trig::FeatureAccessImpl::build_flags2 ( const STORED *  orig_cont,
const T *  obj,
const TrigPassFlags orig_tpf 
)

Definition at line 400 of file FeatureCollectAthena.h.

409  {
410  static TrigPassFlags do_build(const STORED* orig_feat, const T* feat, const TrigPassFlags * orig_tpf) {
411  return build_flags(orig_feat, feat, orig_tpf);
412  }
413  };
414 
415 
416  // partial specialization for T!=STORED
417  template<class T, class STORED> struct getFlagsHelper<T, STORED, false> {
418  static TrigPassFlags do_build(const STORED* orig_feat, const T* feat, const TrigPassFlags * orig_tpf) {

◆ collect()

template<class T >
void Trig::FeatureAccessImpl::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 containers of containers.

Definition at line 299 of file FeatureCollectAthena.h.

302  {/*do nothing anymore*/
303  } else {
304  // getRecentFeature returned false -> bifurcation?
305  const std::vector<HLT::TriggerElement*> bif_tes = navigation->getDirectPredecessors(sourceTE);
306  if ( bif_tes.size() <= 1 ) {
307  return; // that means it is plain error (it will be printed by the Navigation)
308  } else {
309  // bifurcation point
310  for( const HLT::TriggerElement* predecesor_te : bif_tes )
311  collect(predecesor_te, data, label, condition, teName, navigation);
312  }
313  }
314  //std::cout << "Size after collecting " << data.size() << std::endl;
315  }
316 
317 
318  template<>
319  void collect<Muon_ROI>(const HLT::TriggerElement* te, std::vector<Trig::Feature<Muon_ROI> >& data, const std::string&, unsigned int, const std::string&, const HLT::TrigNavStructure* navigation);
320 
321  template<>
322  void collect<EmTau_ROI>(const HLT::TriggerElement* te, std::vector<Trig::Feature<EmTau_ROI> >& data, const std::string&, unsigned int, const std::string&, const HLT::TrigNavStructure* navigation);
323 
324  template<>
325  void collect<Jet_ROI>(const HLT::TriggerElement* te, std::vector<Trig::Feature<Jet_ROI> >& data, const std::string&, unsigned int, const std::string&, const HLT::TrigNavStructure* navigation);
326 
327  template<>
328  void collect<xAOD::EmTauRoI>(const HLT::TriggerElement* te, std::vector<Trig::Feature<xAOD::EmTauRoI> >& data, const std::string&, unsigned int, const std::string&, const HLT::TrigNavStructure* navigation);
329 
330  template<>
331  void collect<xAOD::MuonRoI>(const HLT::TriggerElement* te, std::vector<Trig::Feature<xAOD::MuonRoI> >& data, const std::string&, unsigned int, const std::string&, const HLT::TrigNavStructure* navigation);
332 
333  template<>

◆ collect< EmTau_ROI >()

template<>
void Trig::FeatureAccessImpl::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 
)

Definition at line 83 of file FeatureCollectAthena.cxx.

83  {
84  l1collect<EmTau_ROI>(te, data, condition, &LVL1_ROI::getEmTauROIs, navigation);
85  }

◆ collect< Jet_ROI >()

template<>
void Trig::FeatureAccessImpl::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 
)

Definition at line 88 of file FeatureCollectAthena.cxx.

88  {
89  l1collect<Jet_ROI>(te, data, condition, &LVL1_ROI::getJetROIs, navigation);
90  }

◆ collect< Muon_ROI >()

template<>
void Trig::FeatureAccessImpl::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 
)

Definition at line 78 of file FeatureCollectAthena.cxx.

78  {
79  l1collect<Muon_ROI>(te, data, condition, &LVL1_ROI::getMuonROIs, navigation);
80  }

◆ collect< xAOD::EmTauRoI >()

template<>
void Trig::FeatureAccessImpl::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 
)

Definition at line 126 of file FeatureCollectAthena.cxx.

126  {
127  xAODcollect<xAOD::EmTauRoI,xAOD::EmTauRoIContainer>(te, data, condition, navigation,"LVL1EmTauRoIs");
128  }

◆ collect< xAOD::JetRoI >()

template<>
void Trig::FeatureAccessImpl::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 
)

Definition at line 136 of file FeatureCollectAthena.cxx.

136  {
137  xAODcollect<xAOD::JetRoI,xAOD::JetRoIContainer>(te, data, condition, navigation,"LVL1JetRoIs");
138  }

◆ collect< xAOD::MuonRoI >()

template<>
void Trig::FeatureAccessImpl::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 
)

Definition at line 131 of file FeatureCollectAthena.cxx.

131  {
132  xAODcollect<xAOD::MuonRoI,xAOD::MuonRoIContainer>(te, data, condition, navigation,"LVL1MuonRoIs");
133  }

◆ filter_if() [1/2]

template<typename STORED >
std::shared_ptr<const STORED> Trig::FeatureAccessImpl::filter_if ( boost::mpl::bool_< false >  ,
std::shared_ptr< const STORED > &  original,
const TrigPassBits  
)

Definition at line 123 of file FeatureCollectStandalone.h.

123  {
124  //nothing
125  return original;
126  }

◆ filter_if() [2/2]

template<typename STORED >
std::shared_ptr<const STORED> Trig::FeatureAccessImpl::filter_if ( boost::mpl::bool_< true >  is_same,
std::shared_ptr< const STORED > &  original,
const TrigPassBits bits 
)

Definition at line 98 of file FeatureCollectStandalone.h.

98  {
99  (void)is_same;
100 
101 
102  if(bits==nullptr){
103  std::cerr << "WARNING: nullptr TrigPassBits" << std::endl;
104  return original;
105  }
106  if(original->size() != bits->size()){
107  std::cerr << "WARNING: bits size and owned size" << std::endl;
108  return original;
109  }
111 
112  for(auto obj : *original){
113  if(HLT::isPassing(bits,obj,original.get())){
114  f->push_back(obj);
115  }
116  }
117  //manage the memory
118  std::shared_ptr<const STORED> filtered(f->asDataVector());
119  return filtered;
120  }

◆ getBits()

const TrigPassBits * Trig::FeatureAccessImpl::getBits ( size_t  sz,
const HLT::TriggerElement te,
const std::string &  ,
const HLT::NavigationCore navigation 
)

Definition at line 21 of file FeatureCollectAthena.cxx.

21  {
22  if (!sz)
23  return 0;
24 
25  const TrigPassBits* bits(0);
26 
27  if ( navigation->getFeature(te, bits, "passbits" ) ){
28  // We have to apply (vague) verification if there are any bits and that they match the feature container
29  // this is if there are any bits,
30  // if so that they come from the same TE
31  // if so that they match by size
32 
33  if ( bits && sz == bits->size() )
34  return bits; // they are good and can be used
35  }
36  return 0; // bits recording was problematic (Navigation will complain bitterly, no need to handle it here).
37  }

◆ getFlags() [1/5]

template<>
TrigPassFlags Trig::FeatureAccessImpl::getFlags ( const Trig::Feature< EmTau_ROI > &  ,
const TrigPassFlags ,
HLT::NavigationCore  
)

Definition at line 142 of file FeatureCollectAthena.cxx.

142  {
143  return TrigPassFlags();
144  }

◆ getFlags() [2/5]

template<>
TrigPassFlags Trig::FeatureAccessImpl::getFlags ( const Trig::Feature< Jet_ROI > &  ,
const TrigPassFlags ,
HLT::NavigationCore  
)

Definition at line 150 of file FeatureCollectAthena.cxx.

150  {
151  return TrigPassFlags();
152  }

◆ getFlags() [3/5]

template<>
TrigPassFlags Trig::FeatureAccessImpl::getFlags ( const Trig::Feature< Muon_ROI > &  ,
const TrigPassFlags ,
HLT::NavigationCore  
)

Definition at line 146 of file FeatureCollectAthena.cxx.

146  {
147  return TrigPassFlags();
148  }

◆ getFlags() [4/5]

template<class T >
TrigPassFlags Trig::FeatureAccessImpl::getFlags ( const Trig::Feature< T > &  f,
const TrigPassFlags orig_tpf,
HLT::NavigationCore navigation 
)

Definition at line 446 of file FeatureCollectAthena.h.

◆ getFlags() [5/5]

const TrigPassFlags * Trig::FeatureAccessImpl::getFlags ( size_t  size,
const HLT::TriggerElement te,
const std::string &  label,
const HLT::NavigationCore navigation 
)

Definition at line 39 of file FeatureCollectAthena.cxx.

39  {
40  if(size==0) return 0;
41 
42  const TrigPassFlags* flags(0);
43  if(navigation->getFeature(te, flags, label) && flags && flags->size()==size)
44  return flags;
45 
46  return 0;
47  }

◆ getTypelessBits()

HLT::TriggerElement::FeatureAccessHelper Trig::FeatureAccessImpl::getTypelessBits ( const HLT::TriggerElement te,
const HLT::TrigNavStructure navigation 
)

Definition at line 26 of file FeatureCollectStandalone.cxx.

26  {
27 
28  //completely disabled for now. should be reenabled once we have more recent TNS tag in Athena
30  #ifndef XAOD_STANDALONE
31  answer = navigation->getFeature(te,ClassID_traits<TrigPassBits>::ID(),"passbits");
32  #else
33  (void)te;
34  (void)navigation;
35  #endif
36 
37 
38  if(answer.valid()){
39 #ifdef XAOD_STANDALONE // AnalysisBase
40  // In AnalysisBase we can't access TrigPassBits. So warn the user about
41  // this, and pretend that no TrigPassBits is available for this element.
42  static bool warningPrinted = false;
43  if( ! warningPrinted ) {
44  std::cerr << "FeatureAccessImpl::getTypelessBits WARNING "
45  << "Retrieving a container that has TrigPassBits attached "
46  << "to it" << std::endl;
47  std::cerr << "FeatureAccessImpl::getTypelessBits WARNING "
48  << "But it's not possible to use TrigPassBits in "
49  << "standalone mode" << std::endl;
50  std::cerr << "FeatureAccessImpl::getTypelessBits WARNING "
51  << "So, keep in mind that some of the returned objects "
52  << "didn't actually pass the required chain"
53  << std::endl;
54  warningPrinted = true;
55  }
57 #else
58  return answer;
59 #endif // XAOD_STANDALONE
60  }
62  }

◆ insert_element() [1/2]

template<typename STORED , typename REQUESTED >
void Trig::FeatureAccessImpl::insert_element ( std::vector< Trig::Feature< REQUESTED > > &  ,
Trig::TypelessFeature ,
const STORED *   
)

◆ insert_element() [2/2]

template<typename REQUESTED >
void Trig::FeatureAccessImpl::insert_element ( std::vector< Trig::Feature< REQUESTED > > &  result,
Trig::TypelessFeature feature,
const REQUESTED *  element 
)

Definition at line 79 of file FeatureCollectStandalone.h.

79  {
80  result.push_back(Trig::Feature<REQUESTED>(feature,element));
81  }

◆ insert_flatten_if() [1/2]

template<typename REQUESTED , typename STORED >
void Trig::FeatureAccessImpl::insert_flatten_if ( std::vector< Trig::Feature< REQUESTED > > &  result,
const Trig::TypelessFeature feature,
const std::shared_ptr< const STORED > &  newfeature 
)

Definition at line 90 of file FeatureCollectStandalone.h.

90  {
91  for(auto element : *newfeature){
92  result.push_back(Trig::Feature<REQUESTED>(feature,element));
93  }
94  }

◆ insert_flatten_if() [2/2]

template<typename STORED >
void Trig::FeatureAccessImpl::insert_flatten_if ( std::vector< Trig::Feature< STORED > > &  result,
const Trig::TypelessFeature feature,
const std::shared_ptr< const STORED > &  newfeature 
)

Definition at line 85 of file FeatureCollectStandalone.h.

85  {
86  result.push_back(Trig::Feature<STORED>(feature,newfeature));
87  }

◆ l1collect()

template<class T >
void Trig::FeatureAccessImpl::l1collect ( const HLT::TriggerElement te,
std::vector< Trig::Feature< T > > &  data,
unsigned int  condition,
const std::vector< T > &(LVL1_ROI::*)() const  method,
const HLT::TrigNavStructure navstructure 
)

Definition at line 51 of file FeatureCollectAthena.cxx.

53  {
54 
55  auto navigation = dynamic_cast<const HLT::NavigationCore*>(navstructure);
56 
57  // first we need to collect RoI descriptors
58  std::vector<Trig::Feature<TrigRoiDescriptor> > rois;
59  collect<TrigRoiDescriptor>(te, rois, "initialRoI", condition, "", navigation);
60 
61  const LVL1_ROI* lvl1(0);
62 
63  if ( !navigation || navigation->getAccessProxy()->retrieve(lvl1, "LVL1_ROI").isFailure() || lvl1 == 0 ) {
64  return;
65  }
66 
67  for(const Trig::Feature<TrigRoiDescriptor>& roi : rois) {
68  for(const T& specific : (lvl1->*(method))() ) {
69  if (specific.getROIWord() == roi.cptr()->roiWord()) {
70  data.push_back( Trig::Feature<T>( &specific, roi.te(), "") );
71  break;
72  }
73  }
74  }
75  }

◆ typedGet()

template<typename REQUESTED , typename STORED , typename CONTAINER >
std::vector< Trig::Feature< REQUESTED > > Trig::FeatureAccessImpl::typedGet ( const std::vector< TypelessFeature > &  features,
const HLT::TrigNavStructure navigation,
const asg::EventStoreType store,
const std::string &  container_name = ClassID_traits<CONTAINER>::typeName() 
)

Definition at line 129 of file FeatureCollectStandalone.h.

129  {
130  std::vector<Trig::Feature<REQUESTED> > typedvec;
131 
132  for(auto feature : features){
133  auto typelessholder = navigation->getHolder(feature.accessHelper());
134  if(!typelessholder){
135  std::cerr << "ERROR, holder not present" << std::endl;
136  continue;
137  }
138  HLT::TypedHolder<STORED,CONTAINER> typedholder(*typelessholder,store,container_name);
139  const STORED* dest = 0;
140 
141  StatusCode sc = typedholder.get(dest,feature.accessHelper().getIndex());
142  if(sc.isFailure()){
143  std::cerr << "TrigDecisionTool WARNING: Feature access failed for feature: " << feature.accessHelper() << std::endl;
144  continue;
145  }
146 
148  //take ownership because typedholder.get created VIEW container with 'new'
149  std::shared_ptr<const STORED> owned(dest);
150 
151  auto passbitsFeatureAccessHelper = FeatureAccessImpl::getTypelessBits(feature.te(),navigation);
152  if(passbitsFeatureAccessHelper.valid()){
153 #ifndef __CLING__
154  auto passbitsHolder = navigation->getHolder(passbitsFeatureAccessHelper);
156  const TrigPassBits* bits = 0;
157  if(typedBits.get(bits,passbitsFeatureAccessHelper.getIndex()).isFailure()){
158  std::cerr << "WARNING: couldn't get passbits from Holder" << std::endl;
159  }
160  owned = filter_if(boost::is_same<STORED,CONTAINER>(),owned,bits);
161 #endif
162  }
163  //if REQUESTED != STORED we assume REQUESTED is element type
164  //and we flatten the vector
165  insert_flatten_if(typedvec,feature,owned);
166  }
167  else{
169  std::shared_ptr<const STORED> owned(dest);
170  //TrigRoiDescriptor needs deletiong by us.. a bit hacky but oh well...
171  insert_flatten_if(typedvec,feature,owned);
172  }
173  else{
174  //storegate owns the pointer
175  insert_element(typedvec,feature,dest);
176  }
177  }
178  }
179  return typedvec;
180  }

◆ typelessCollect()

void Trig::FeatureAccessImpl::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 
)

Definition at line 65 of file FeatureCollectStandalone.cxx.

68  {
69  //collect recursively features for this trigger element
70  if (condition == TrigDefs::Physics && !te->getActiveState() ) return;
71 
72  const HLT::TriggerElement* source = 0;
73  HLT::TriggerElement::FeatureAccessHelper answer = navigation->getFeatureRecursively(te,clid,label,source);
74  if(!answer.valid() && source){
75  //source was set but answer invalid -> bifurcation
76  for(auto& predecessor : navigation->getDirectPredecessors(source)){
77  typelessCollect(predecessor,clid,data,label,condition,navigation);
78  }
79  }
80  if(answer.valid()){
81  auto typelessholder = navigation->getHolder(answer);
82  if(!typelessholder){
83  //this can happen, because features were thinned away (which deletes the Holders, but doesn't touch the TE structure)
84  //so we'll let this slip silently
85  return;
86  }
87  data.push_back(Trig::TypelessFeature(answer,source,typelessholder->label()));
88  }
89  }

◆ use_or_construct() [1/2]

template<class T >
const std::enable_if<!isDataVector<T>::value, T>::type* Trig::FeatureAccessImpl::use_or_construct ( const T *  source,
const HLT::TriggerElement ,
const std::string &  ,
unsigned int  ,
const HLT::NavigationCore  
)

Definition at line 113 of file FeatureCollectAthena.h.

137  {

◆ use_or_construct() [2/2]

template<class T >
const std::enable_if<isDataVector<T>::value, T>::type* Trig::FeatureAccessImpl::use_or_construct ( const T *  source,
const HLT::TriggerElement te,
const std::string &  label,
unsigned int  condition,
const HLT::NavigationCore navigation 
)

Definition at line 121 of file FeatureCollectAthena.h.

137  {
138  static void do_it(std::vector<Trig::Feature<T> >& destination, const STORED* source, const HLT::TriggerElement* te, const std::string& label,

◆ xAODcollect()

template<typename ROI , typename ROICONTAINER >
void Trig::FeatureAccessImpl::xAODcollect ( const HLT::TriggerElement te,
std::vector< Trig::Feature< ROI > > &  data,
unsigned int  condition,
const HLT::TrigNavStructure navstructure,
const std::string &  sgkey 
)

Definition at line 93 of file FeatureCollectAthena.cxx.

93  {
94  // first we need to collect RoI descriptors
95 
96  auto navigation = dynamic_cast<const HLT::NavigationCore*>(navstructure);
97 
98 
99  std::vector<Trig::Feature<TrigRoiDescriptor> > rois;
100  collect<TrigRoiDescriptor>(te, rois, "initialRoI", condition, "", navigation);
101 
102  //get all EmTau RoIs
103  const ROICONTAINER* cont;
104  if (!navigation || navigation->getAccessProxy()->retrieve(cont,sgkey).isFailure()) {
105  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR,"Feature.cxx:xAODcollect") << "failed retrieving RoI container" << endmsg;
106 
107  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR,"Feature.cxx:xAODcollect") << "\n" << (navigation ? navigation->getAccessProxy()->dump() : "") << endmsg;
108 
109 
110  return;
111  }
112 
113  typename ROICONTAINER::const_iterator emtauit;
114  //ROI* found(0);
115  for(const auto& it : rois){
116  for(emtauit=cont->begin();emtauit!=cont->end();++emtauit){
117  if((*emtauit)->roiWord() == it.cptr()->roiWord()){
118  data.push_back( Trig::Feature<ROI>(*emtauit, it.te(), "") );
119  break;
120  }
121  }
122  }
123  }
RunTileTBRec.method
method
Definition: RunTileTBRec.py:73
LVL1_ROI::getMuonROIs
const muons_type & getMuonROIs() const
Get all the muon RoIs in the event.
Definition: LVL1_ROI.h:63
Trig::FeatureAccessImpl::getTypelessBits
HLT::TriggerElement::FeatureAccessHelper getTypelessBits(const HLT::TriggerElement *te, const HLT::TrigNavStructure *navigation)
Definition: FeatureCollectStandalone.cxx:26
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
common.sgkey
def sgkey(tool)
Definition: common.py:1028
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Trig::Feature
Definition: Feature.h:112
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
fitman.sz
sz
Definition: fitman.py:527
get_generator_info.result
result
Definition: get_generator_info.py:21
Herwig7Control.do_build
def do_build(gen_config, integration_jobs)
Do the build step.
Definition: Herwig7Control.py:178
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
TrigPassFlags::size
unsigned int size() const
gets size of the container object vector
Definition: TrigPassFlags.h:73
TrigPassBits::size
unsigned int size() const
gets size of the bits array
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/TrigPassBits.h:44
skel.it
it
Definition: skel.GENtoEVGEN.py:423
HLT::TriggerElement::getActiveState
bool getActiveState() const
get state of the TriggerElement
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:48
navigation2dot.teName
def teName(teid)
Definition: navigation2dot.py:59
athena.value
value
Definition: athena.py:122
Trig::FeatureAccessImpl::build_flags
TrigPassFlags build_flags(const typename std::enable_if<!isDataVector< T >::value, T >::type *orig, const T *feature, const TrigPassFlags *orig_tpf)
Definition: FeatureCollectAthena.h:388
LArG4GenerateShowerLib.condition
condition
Definition: LArG4GenerateShowerLib.py:19
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
Trig::FeatureAccessImpl::collect< Muon_ROI >
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)
Definition: FeatureCollectAthena.cxx:78
HLT::TrigNavStructure
Definition: TrigNavStructure.h:40
Trig::FeatureAccessImpl::collect< EmTau_ROI >
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)
Definition: FeatureCollectAthena.cxx:83
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
HLT::NavigationCore::getFeature
bool getFeature(const TriggerElement *te, const T *&features, const std::string &label="", std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
LVL1_ROI::getJetROIs
const jets_type & getJetROIs() const
Get all the jet RoIs in the event.
Definition: LVL1_ROI.h:67
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
HLT::NavigationCore
The NavigationCore class, adds on top of the TrigNavStructure the EDM read-only handling.
Definition: NavigationCore.h:96
Trig::TypelessFeature
Feature class, holding information on Feature attached to navigation.
Definition: TypelessFeature.h:20
HLT::TrigNavStructure::getDirectPredecessors
static const std::vector< TriggerElement * > & getDirectPredecessors(const TriggerElement *te)
returns list of direct predecessors (nodes seeding me)
Definition: TrigNavStructure.cxx:120
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HLT::TriggerElement
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:27
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
HLT::isPassing
bool isPassing(const TrigPassBits *bits, const T *obj, const CONTAINER *container)
Check the bit for the object in the associated bits object.
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/TrigPassBits.h:82
TrigPassFlags::flagSize
unsigned int flagSize() const
gets size of the flag vector for the object at index
Definition: TrigPassFlags.h:78
HLT::TrigNavStructure::getFeature
TriggerElement::FeatureAccessHelper getFeature(const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label) const
typeless feature access metod
Definition: TrigNavStructure.cxx:783
LVL1_ROI
Top level AOD object storing LVL1 RoIs.
Definition: LVL1_ROI.h:43
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:345
TrigPassBits
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/TrigPassBits.h:17
Trig::FeatureAccessImpl::insert_element
void insert_element(std::vector< Trig::Feature< REQUESTED > > &result, Trig::TypelessFeature &feature, const REQUESTED *element)
Definition: FeatureCollectStandalone.h:79
HLT::TrigNavStructure::getFeatureRecursively
TriggerElement::FeatureAccessHelper getFeatureRecursively(const TriggerElement *startTE, class_id_type clid, const index_or_label_type &index_or_label, const TriggerElement *&sourceTE) const
recursive search for features the function is similar to the above butif th features is not found at ...
Definition: TrigNavStructure.cxx:797
Trig::FeatureAccessImpl::collect< Jet_ROI >
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)
Definition: FeatureCollectAthena.cxx:88
HLT::TriggerElement::FeatureAccessHelper
the FeatureAccessHelper is a class used to keep track of features attached to this TE.
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:192
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
HLT::TriggerElement::FeatureAccessHelper::valid
bool valid() const
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:226
TriggerTest.rois
rois
Definition: TriggerTest.py:23
TrigPassFlags
A Flag is an ordered collection of bits (vector<bool>) that can hold additional (boolean) information...
Definition: TrigPassFlags.h:29
Trig::FeatureAccessImpl::collect
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...
Definition: FeatureCollectAthena.h:299
TrigPassFlags::getFlag
const std::vector< bool > & getFlag(const unsigned int position) const
Returns the flag (vector<bool>) at index position.
Definition: TrigPassFlags.cxx:54
Trig::FeatureAccessImpl::build_flags2
TrigPassFlags build_flags2(const STORED *orig_cont, const T *obj, const TrigPassFlags *orig_tpf)
Definition: FeatureCollectAthena.h:400
Trig::FeatureAccessImpl::filter_if
std::shared_ptr< const STORED > filter_if(boost::mpl::bool_< false >, std::shared_ptr< const STORED > &original, const TrigPassBits *)
Definition: FeatureCollectStandalone.h:123
LVL1_ROI::getEmTauROIs
const emtaus_type & getEmTauROIs() const
Get all the em/tau RoIs in the event.
Definition: LVL1_ROI.h:65
HLT::TypedHolder
doubly templated class interfacing access to feature containers in StoreGate.
Definition: TypedHolder.h:42
python.PyAthena.obj
obj
Definition: PyAthena.py:135
HLT::TrigNavStructure::getHolder
const BaseHolder * getHolder(const TriggerElement::FeatureAccessHelper &fea) const
Definition: TrigNavStructure.cxx:923
Trig::FeatureAccessImpl::insert_flatten_if
void insert_flatten_if(std::vector< Trig::Feature< REQUESTED > > &result, const Trig::TypelessFeature &feature, const std::shared_ptr< const STORED > &newfeature)
Definition: FeatureCollectStandalone.h:90
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
Trig::FeatureAccessImpl::typelessCollect
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)
Definition: FeatureCollectStandalone.cxx:65