ATLAS Offline Software
Functions
DecisionSvc.cxx File Reference
#include "DecisionSvc.h"
#include "GaudiKernel/EventContext.h"
#include "PersistentDataModel/AthenaAttributeList.h"
#include <algorithm>
Include dependency graph for DecisionSvc.cxx:

Go to the source code of this file.

Functions

StatusCode DecisionSvc::DeclareToCutFlowSvc ATLAS_NOT_THREAD_SAFE ()
 Install fatal handler with default options. More...
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

StatusCode DecisionSvc::DeclareToCutFlowSvc ATLAS_NOT_THREAD_SAFE ( )

Install fatal handler with default options.

This is meant to be easy to call from python via ctypes.

Definition at line 368 of file DecisionSvc.cxx.

369 {
370  // Declare all decisions to CutFlowSvc for bookkeeping
371 
372  // Loop over all streams
373  for(auto ait = m_streamNames.begin();
374  ait != m_streamNames.end(); ++ait) {
375  const std::string &streamName=*ait;
376  const std::vector<std::string> *accFilt=nullptr;
377  const std::vector<std::string> *reqFilt=nullptr;
378  const std::vector<std::string> *vetFilt=nullptr;
379  std::vector< const std::vector<std::string>* > totFilt;
380  if (auto itr = m_stream_accept.find(streamName); itr != m_stream_accept.end()) {
381  accFilt = &itr->second;
382  totFilt.push_back(accFilt);
383  }
384  if (auto itr = m_stream_require.find(streamName); itr != m_stream_require.end()) {
385  reqFilt = &itr->second;
386  totFilt.push_back(reqFilt);
387  }
388  if (auto itr = m_stream_veto.find(streamName); itr != m_stream_veto.end()) {
389  vetFilt = &itr->second;
390  totFilt.push_back(vetFilt);
391  }
392 
393  // Now build logicalKey as string of filt ||, &&, ! based on
394  // whether it is accept, require, veto
395  std::string accstring(""), reqstring(""), vetstring("");
396  if(accFilt){
397  for (auto it = accFilt->begin(); it != accFilt->end(); ++it) {
398  if(!accstring.empty()) accstring += "||";
399  else accstring += '(';
400  accstring+=*it;
401  }
402  }
403  if(reqFilt){
404  for (auto it = reqFilt->begin(); it != reqFilt->end(); ++it) {
405  if(!reqstring.empty()) reqstring += "&&";
406  else reqstring += '(';
407  reqstring+=*it;
408  }
409  }
410  if(vetFilt){
411  for (auto it = vetFilt->begin(); it != vetFilt->end(); ++it) {
412  if(!vetstring.empty()) vetstring += "||";
413  else vetstring += '(';
414  vetstring+=*it;
415  }
416  }
417  std::string logicalKey("");
418  if(!accstring.empty()) {
419  accstring += ')';
420  logicalKey += accstring;
421  }
422  if(!reqstring.empty()) {
423  reqstring += ')';
424  if (!logicalKey.empty()) logicalKey += "&&";
425  logicalKey += reqstring;
426  }
427  if(!vetstring.empty()) {
428  vetstring += ')';
429  if (!logicalKey.empty()) logicalKey += "&&";
430  logicalKey += '!';
431  logicalKey += vetstring;
432  }
433  // If no filters, mark as PasThru
434  if (logicalKey.empty()) logicalKey="PassThru";
435  ATH_MSG_DEBUG("stream " << streamName << " uses logic " << logicalKey);
436 
437  // Now actually declare to the cutflowsvc
438  for(auto vec = totFilt.begin();
439  vec != totFilt.end(); ++vec) {
440  ATH_MSG_DEBUG("Declaring logic " << logicalKey << " for " << streamName);
441  for (auto filter = (*vec)->begin();
442  filter != (*vec)->end(); ++filter) {
443  if(!m_cutflowSvc.empty()) {m_cutflowSvc->registerTopFilter( (*filter), logicalKey, 2, streamName, true ); } // TODO: validate
444  }
445  }
446  }
447 
448  return StatusCode::SUCCESS;
449 }
skel.it
it
Definition: skel.GENtoEVGEN.py:396
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
covarianceTool.filter
filter
Definition: covarianceTool.py:514
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39