ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
RoRSeqFilter Class Reference

#include <RoRSeqFilter.h>

Inheritance diagram for RoRSeqFilter:
Collaboration diagram for RoRSeqFilter:

Public Member Functions

 RoRSeqFilter (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual StatusCode initialize () override final
 Setup input and output handles. More...
 
virtual StatusCode execute (const EventContext &ctx) const override final
 Apply this filter in-between Steps of trigger execution. More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

size_t copyPassing (const TrigCompositeUtils::DecisionContainer &input, TrigCompositeUtils::DecisionContainer &output, const std::set< HLT::Identifier > &topass, const EventContext &ctx) const
 Applies generic filter to input container, keeping only the decision objects with at least one affirmative decision from the previous Stage. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainerm_inputKeys { this, "Input", {}, "Inputs to the filter" }
 
SG::WriteHandleKeyArray< TrigCompositeUtils::DecisionContainerm_outputKeys { this, "Output", {}, "Output" }
 
Gaudi::Property< std::vector< std::string > > m_chainsProperty { this, "Chains", {}, "Chains of which this filter is concerned" }
 
std::set< HLT::Identifierm_chains
 
Gaudi::Property< std::vector< std::vector< std::string > > > m_chainsPerInputProperty { this, "ChainsPerInput", {}, "Chains of which this filter is concerned" }
 
std::vector< std::set< HLT::Identifier > > m_chainsPerInput
 
Gaudi::Property< std::vector< std::vector< unsigned > > > m_ioMappingProperty { this, "IOMapping", {}, "Maps which inputs should be routed to which output" }
 It can be used to define a custom routing from input to output collections Example: [[0,1,3], [2]] means that inputs 0, 1, and 3 are directed to output 0, and input under the index 2 to aoutput 1 When not set the default is used. More...
 
std::vector< std::vector< unsigned > > m_ioMapping
 
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Filter I/O monitoring" }
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 47 of file RoRSeqFilter.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ RoRSeqFilter()

RoRSeqFilter::RoRSeqFilter ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 23 of file RoRSeqFilter.cxx.

24  :
25  ::AthReentrantAlgorithm( name, pSvcLocator )
26 {}

Member Function Documentation

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ copyPassing()

size_t RoRSeqFilter::copyPassing ( const TrigCompositeUtils::DecisionContainer input,
TrigCompositeUtils::DecisionContainer output,
const std::set< HLT::Identifier > &  topass,
const EventContext &  ctx 
) const
private

Applies generic filter to input container, keeping only the decision objects with at least one affirmative decision from the previous Stage.

Considering only decisions from chains utilising this filter.

Parameters
inputKeyStoregate key of input, needed to link newly created decision objects to their parents.
outputWriteable output container to store copies of decision objects which pass the filter.
Returns
The number of decision objects which passed the filter.

Produced a selective copy of all Decision objects in the input container which possess a positive decision from at least one of the chains which this filter algorithm is configured for. This new object is linked to its parent and stored in the output collection. It will form the starting point for the next Step.

Definition at line 193 of file RoRSeqFilter.cxx.

195  {
196  size_t passCounter = 0;
197  for (const Decision* inputDecision : input) {
198 
199  ATH_MSG_DEBUG("Number of positive decisions for this input is " << decisionIDs(inputDecision).size()
200  <<". Applying filter of size " << topass.size());
201 
202  const DecisionIDContainer& intersection = passedDecisionIDs(inputDecision, topass);
203 
204  if ( not intersection.empty() ) {
205  // This sets up the 'self' link & the 'seed' link (seeds from inputDecision)
206  Decision* decisionCopy = newDecisionIn( &output, inputDecision, filterNodeName(), ctx );
207 
208  // Copy accross only the DecisionIDs which have passed through this Filter for this Decision object.
209  // WARNING: Still need to 100% confirm if the correct set to propagate forward is objDecisions or intersection.
210  // Tim M changing this from inputDecisions (all IDs) -> intersection (only passed IDs) Feb 19
211  insertDecisionIDs(intersection, decisionCopy);
212  passCounter ++;
213  if (msgLvl(MSG::DEBUG)){
214  ATH_MSG_DEBUG("Input satisfied at least one filtering chain. Chain(s) passing:");
215  for ( DecisionID id : intersection ) {
216  ATH_MSG_DEBUG( " -- " << HLT::Identifier( id ) );
217  }
218  }
219 
220  } else {
221  ATH_MSG_DEBUG("No Input decisions requested by filtering chains");
222  }
223  }
224  return passCounter;
225 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode RoRSeqFilter::execute ( const EventContext &  ctx) const
finaloverridevirtual

Apply this filter in-between Steps of trigger execution.

Fully implicit inputs, requires Control Flow to unlock. will signal a negative filter result to the Scheduler if zero chains remain active upon termination.

Definition at line 115 of file RoRSeqFilter.cxx.

115  {
116  ATH_MSG_DEBUG ( "Executing " << name() << "..." );
117  if (Athena::Timeout::instance(ctx).reached()) {
118  ATH_MSG_ERROR("Timeout reached before " << name());
120  }
121  auto inputHandles = m_inputKeys.makeHandles( ctx );
122  auto outputHandles = m_outputKeys.makeHandles( ctx );
123 
124  std::vector<std::string> inputNames( {"exec", "anyvalid"} );
125  std::vector<bool> inputStats({true, false}); // position 0 for number of execs, always true, bool at position 1 is set later
126  inputNames.reserve(inputHandles.size() + 2);
127  inputStats.reserve(inputHandles.size() + 2);
128  bool validInputs = false;
129  for ( auto& inputHandle: inputHandles ) {
130  inputNames.push_back( inputHandle.name() );
131  if( inputHandle.isValid() ) {// this is because input is implicit
132  validInputs = true;
133  inputStats.push_back( true );
134  } else {
135  inputStats.push_back( false );
136  }
137  }
138  inputStats[1] = validInputs; // position 1 for number of execes with any collection valid
139  auto inputName = Monitored::Collection<std::vector<std::string>>( "name", inputNames );
140  auto inputStat = Monitored::Collection<std::vector<bool>>( "stat", inputStats );
141  Monitored::Group( m_monTool, inputStat, inputName );
142 
143  if (!validInputs) {
144  setFilterPassed(false, ctx);
145  ATH_MSG_DEBUG ( "No valid inputs found, filter failed. Return...." );
146  return StatusCode::SUCCESS;
147  }
148 
149  ATH_MSG_DEBUG ( "Running on "<< inputHandles.size() <<" input keys" );
150 
151  size_t passCounter = 0;
152 
153  for ( size_t outputIndex = 0; outputIndex < m_ioMapping.size(); ++outputIndex ) {
154  bool anyPresent = false;
155  for ( unsigned inputIndex : m_ioMapping[outputIndex] ) {
156  if( not inputHandles[inputIndex].isValid() ) {
157  ATH_MSG_DEBUG( "InputHandle "<< inputHandles[inputIndex].key() <<" not present" );
158  } else if ( inputHandles[inputIndex]->empty() ) {
159  ATH_MSG_DEBUG( "InputHandle "<< inputHandles[inputIndex].key() <<" contains all rejected decisions, skipping" );
160  } else {
161  anyPresent = true;
162  }
163  }
164  if ( anyPresent ) {
165  createAndStore(outputHandles[outputIndex]);
166  DecisionContainer* output = outputHandles[outputIndex].ptr();
167  for ( auto inputIndex : m_ioMapping[outputIndex] ) {
168  if ( inputHandles[inputIndex].isValid() and not inputHandles[inputIndex]->empty() ) {
169  ATH_MSG_DEBUG( "Checking inputHandle: "<< inputHandles[inputIndex].key() <<" has " << inputHandles[inputIndex]->size() <<" elements");
170  if ( not m_chainsPerInput.empty() ) {
171  passCounter += copyPassing( *inputHandles[inputIndex], *output, m_chainsPerInput[inputIndex], ctx );
172  } else {
173  passCounter += copyPassing( *inputHandles[inputIndex], *output, m_chains, ctx );
174  }
175  ATH_MSG_DEBUG( "Recorded output key " << m_outputKeys[ outputIndex ].key() <<" of size "<<output->size() <<" at index "<< outputIndex);
176  }
177  }
178  }
179  }
180 
181  setFilterPassed( passCounter != 0, ctx );
182  ATH_MSG_DEBUG( "Filter " << ( filterPassed(ctx) ? "passed" : "rejected" ) );
183  if ( msgLvl( MSG::DEBUG ) ){
184  for ( auto& output: outputHandles ) {
185  if( output.isValid() ) ATH_MSG_DEBUG( " "<<output.key() );
186  }
187  }
188 
189 
190  return StatusCode::SUCCESS;
191 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ initialize()

StatusCode RoRSeqFilter::initialize ( )
finaloverridevirtual

Setup input and output handles.

Renounce all input handles. Get IDs for all configured chains.

Definition at line 29 of file RoRSeqFilter.cxx.

30 {
31  CHECK( not m_inputKeys.empty() );
32  CHECK( not m_outputKeys.empty() );
33 
34  CHECK( m_inputKeys.initialize() );
35  CHECK( m_outputKeys.initialize() );
36 
38 
39  // default IO mappnig nth input -> nth output
40  if ( m_ioMappingProperty.empty()) {
41  CHECK( m_inputKeys.size() == m_outputKeys.size() );
42  for ( unsigned i = 0; i < m_inputKeys.size(); ++i ) {
43  m_ioMapping.push_back( {i} );
44  }
45  ATH_MSG_DEBUG( "Default I/O collections mapping nth input -> nth output" );
46  } else {
48  ATH_MSG_DEBUG( "Custom I/O mapping used by the filter" );
49  }
50 
51  for ( size_t i = 0; i < m_ioMapping.size(); ++i ) {
52  for ( unsigned inIndex: m_ioMapping[i] ) {
53  ATH_MSG_DEBUG("Input collection: " << m_inputKeys[inIndex] );
54  }
55  ATH_MSG_DEBUG(" Routed to output collection " << m_outputKeys[i] );
56  }
57 
58  // crosscheck mapping (also the default one)
59  CHECK( m_ioMapping.size() == m_outputKeys.size() ); // all outputs will be filled
60  std::set<int> inIndices;
61  for ( auto i: m_ioMapping ) {
62  CHECK( not i.empty() ); // all outputs are connected to at least one input
63  inIndices.insert( i.begin(), i.end() );
64  }
65  CHECK( inIndices.size() == m_inputKeys.size() ); // all inputs are routed
66  for ( size_t i = 0; i < m_ioMapping.size(); ++i ) {
67  auto iset = std::set( m_ioMapping[i].begin(), m_ioMapping[i].end() );
68  for ( size_t j = i+1; j < m_ioMapping.size(); ++j ) {
69  for ( auto el: m_ioMapping[j] ) {
70  if ( iset.count( el ) != 0 ) {
71  ATH_MSG_ERROR( "The input index " << el << " directed to two outputs " << m_ioMapping[i] << " " << m_ioMapping[j] );
72  return StatusCode::FAILURE;
73  }
74  }
75  }
76  }
77 
78  if (msgLvl(MSG::DEBUG)){
79  ATH_MSG_DEBUG("Will consume implicit ReadDH:" );
80  for (auto& input: m_inputKeys){
81  ATH_MSG_DEBUG(" - "<<input.key());
82  }
83  ATH_MSG_DEBUG("Will produce WriteDH: ");
84  for (auto& output: m_outputKeys){
85  ATH_MSG_DEBUG(" - "<<output.key());
86  }
87  }
88 
89  CHECK( not m_chainsProperty.empty() );
90 
91  for ( const std::string& el: m_chainsProperty )
92  m_chains.insert( HLT::Identifier( el ).numeric() );
93 
94 
96  for ( size_t i = 0; i < m_chainsPerInputProperty.size(); ++i ) {
97  for ( const std::string& el: m_chainsPerInputProperty[i] )
98  m_chainsPerInput[i].insert( HLT::Identifier( el ).numeric() );
99  }
100 
101  if (msgLvl(MSG::DEBUG)){
102  ATH_MSG_DEBUG( "Configured to require these chains: ");
103  for ( const HLT::Identifier& id: m_chains )
104  ATH_MSG_DEBUG( " - " << id );
105  }
106 
107  if ( not m_monTool.name().empty() ) {
108  ATH_CHECK( m_monTool.retrieve() );
109  }
110 
111  return StatusCode::SUCCESS;
112 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_chains

std::set<HLT::Identifier> RoRSeqFilter::m_chains
private

Definition at line 70 of file RoRSeqFilter.h.

◆ m_chainsPerInput

std::vector<std::set<HLT::Identifier> > RoRSeqFilter::m_chainsPerInput
private

Definition at line 73 of file RoRSeqFilter.h.

◆ m_chainsPerInputProperty

Gaudi::Property<std::vector <std::vector<std::string> > > RoRSeqFilter::m_chainsPerInputProperty { this, "ChainsPerInput", {}, "Chains of which this filter is concerned" }
private

Definition at line 72 of file RoRSeqFilter.h.

◆ m_chainsProperty

Gaudi::Property<std::vector<std::string> > RoRSeqFilter::m_chainsProperty { this, "Chains", {}, "Chains of which this filter is concerned" }
private

Definition at line 69 of file RoRSeqFilter.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_inputKeys

SG::ReadHandleKeyArray<TrigCompositeUtils::DecisionContainer> RoRSeqFilter::m_inputKeys { this, "Input", {}, "Inputs to the filter" }
private

Definition at line 66 of file RoRSeqFilter.h.

◆ m_ioMapping

std::vector<std::vector<unsigned> > RoRSeqFilter::m_ioMapping
private

Definition at line 81 of file RoRSeqFilter.h.

◆ m_ioMappingProperty

Gaudi::Property< std::vector<std::vector<unsigned> > > RoRSeqFilter::m_ioMappingProperty { this, "IOMapping", {}, "Maps which inputs should be routed to which output" }
private

It can be used to define a custom routing from input to output collections Example: [[0,1,3], [2]] means that inputs 0, 1, and 3 are directed to output 0, and input under the index 2 to aoutput 1 When not set the default is used.

I.e. nth input -> nth output

Definition at line 80 of file RoRSeqFilter.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> RoRSeqFilter::m_monTool { this, "MonTool", "", "Filter I/O monitoring" }
private

Definition at line 98 of file RoRSeqFilter.h.

◆ m_outputKeys

SG::WriteHandleKeyArray<TrigCompositeUtils::DecisionContainer> RoRSeqFilter::m_outputKeys { this, "Output", {}, "Output" }
private

Definition at line 67 of file RoRSeqFilter.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
RoRSeqFilter::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: RoRSeqFilter.h:98
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
TrigCompositeUtils::DecisionID
unsigned int DecisionID
Definition: TrigComposite_v1.h:27
TrigCompositeUtils::DecisionContainer
xAOD::TrigCompositeContainer DecisionContainer
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigCompositeContainer.h:21
TrigCompositeUtils::newDecisionIn
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
Definition: TrigCompositeUtilsRoot.cxx:46
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AthCommonDataStore::renounce
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Definition: AthCommonDataStore.h:380
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
RoRSeqFilter::m_outputKeys
SG::WriteHandleKeyArray< TrigCompositeUtils::DecisionContainer > m_outputKeys
Definition: RoRSeqFilter.h:67
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TrigCompositeUtils::insertDecisionIDs
void insertDecisionIDs(const Decision *src, Decision *dest)
Appends the decision IDs of src to the dest decision object.
Definition: TrigCompositeUtilsRoot.cxx:80
TrigCompositeUtils::passedDecisionIDs
DecisionIDContainer passedDecisionIDs(const Decision *d, const T &required)
return DecisionIDs in Decision object that match the required ones
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
TrigCompositeUtils::createAndStore
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
Definition: TrigCompositeUtilsRoot.cxx:30
RoRSeqFilter::m_inputKeys
SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainer > m_inputKeys
Definition: RoRSeqFilter.h:66
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray
void renounceArray(SG::VarHandleKeyArray &handlesArray)
remove all handles from I/O resolution
Definition: AthCommonDataStore.h:364
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
intersection
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
Definition: compareFlatTrees.cxx:25
empty
bool empty(TH1 *h)
Definition: computils.cxx:295
AthReentrantAlgorithm::filterPassed
virtual bool filterPassed(const EventContext &ctx) const
Definition: AthReentrantAlgorithm.h:135
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles
virtual std::vector< Gaudi::DataHandle * > inputHandles() const override
Return this algorithm's input handles.
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
RoRSeqFilter::m_chainsProperty
Gaudi::Property< std::vector< std::string > > m_chainsProperty
Definition: RoRSeqFilter.h:69
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
RoRSeqFilter::copyPassing
size_t copyPassing(const TrigCompositeUtils::DecisionContainer &input, TrigCompositeUtils::DecisionContainer &output, const std::set< HLT::Identifier > &topass, const EventContext &ctx) const
Applies generic filter to input container, keeping only the decision objects with at least one affirm...
Definition: RoRSeqFilter.cxx:193
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Athena::Timeout::instance
static Timeout & instance()
Get reference to Timeout singleton.
Definition: Timeout.h:64
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge.output
output
Definition: merge.py:17
RoRSeqFilter::m_ioMappingProperty
Gaudi::Property< std::vector< std::vector< unsigned > > > m_ioMappingProperty
It can be used to define a custom routing from input to output collections Example: [[0,...
Definition: RoRSeqFilter.h:80
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigCompositeUtils::Decision
xAOD::TrigComposite Decision
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:20
RoRSeqFilter::m_ioMapping
std::vector< std::vector< unsigned > > m_ioMapping
Definition: RoRSeqFilter.h:81
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
Athena::Status::TIMEOUT
@ TIMEOUT
Timeout during event processing.
TrigCompositeUtils::filterNodeName
const std::string & filterNodeName()
Definition: TrigCompositeUtilsRoot.cxx:896
a
TList * a
Definition: liststreamerinfos.cxx:10
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition: TrigCompositeUtilsRoot.cxx:67
RoRSeqFilter::m_chains
std::set< HLT::Identifier > m_chains
Definition: RoRSeqFilter.h:70
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
RoRSeqFilter::m_chainsPerInputProperty
Gaudi::Property< std::vector< std::vector< std::string > > > m_chainsPerInputProperty
Definition: RoRSeqFilter.h:72
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
RoRSeqFilter::m_chainsPerInput
std::vector< std::set< HLT::Identifier > > m_chainsPerInput
Definition: RoRSeqFilter.h:73
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
AthReentrantAlgorithm::setFilterPassed
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Definition: AthReentrantAlgorithm.h:139
ServiceHandle< ICondSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37