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

#include <CTPUnpackingEmulationTool.h>

Inheritance diagram for CTPUnpackingEmulationTool:
Collaboration diagram for CTPUnpackingEmulationTool:

Public Member Functions

 CTPUnpackingEmulationTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode decode (const ROIB::RoIBResult &roib, HLT::IDVec &enabledChains) const override
 
virtual StatusCode initialize () override
 
virtual bool isEmulated () const override
 
virtual StatusCode passBeforePrescaleSelection (const ROIB::RoIBResult *, const std::vector< std::string > &, bool &) const override
 

Protected Attributes

std::unordered_map< int, HLT::IDVecm_ctpToChain
 
Gaudi::Property< bool > m_forceEnable
 
ToolHandle< GenericMonitoringToolm_monTool {this, "MonTool", "", "Monitoring tool"}
 

Static Protected Attributes

static constexpr int s_CTPIDForUnseededChains = -1
 

Private Member Functions

StatusCode parseInputFile ()
 Fill the m_events vector with configuration from an input file. More...
 

Private Attributes

Gaudi::Property< std::string > m_inputFileName
 
std::vector< HLT::IDVecm_events
 Chain IDs (inner vector) to activate for each event (outer vector) More...
 

Detailed Description

Definition at line 12 of file CTPUnpackingEmulationTool.h.

Constructor & Destructor Documentation

◆ CTPUnpackingEmulationTool()

CTPUnpackingEmulationTool::CTPUnpackingEmulationTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 13 of file CTPUnpackingEmulationTool.cxx.

Member Function Documentation

◆ decode()

StatusCode CTPUnpackingEmulationTool::decode ( const ROIB::RoIBResult roib,
HLT::IDVec enabledChains 
) const
overridevirtual

Reimplemented from CTPUnpackingToolBase.

Definition at line 56 of file CTPUnpackingEmulationTool.cxx.

56  {
57  if ( m_events.empty() ){
58  ATH_MSG_ERROR( "No chain set found. Cannot decode CTP emulation" );
59  return StatusCode::FAILURE;
60  }
61 
62  const EventContext& context = Gaudi::Hive::currentContext();
63  size_t line = context.evt() % m_events.size();
64  enabledChains = m_events[line];
65 
66  return StatusCode::SUCCESS;
67 }

◆ initialize()

StatusCode CTPUnpackingEmulationTool::initialize ( )
overridevirtual

Reimplemented from CTPUnpackingToolBase.

Definition at line 50 of file CTPUnpackingEmulationTool.cxx.

50  {
52  return parseInputFile();
53 }

◆ isEmulated()

virtual bool CTPUnpackingEmulationTool::isEmulated ( ) const
inlineoverridevirtual

Reimplemented from CTPUnpackingToolBase.

Definition at line 24 of file CTPUnpackingEmulationTool.h.

24 {return true;}

◆ parseInputFile()

StatusCode CTPUnpackingEmulationTool::parseInputFile ( )
private

Fill the m_events vector with configuration from an input file.

Definition at line 19 of file CTPUnpackingEmulationTool.cxx.

19  {
20  std::ifstream inputFile( m_inputFileName );
21  if ( not inputFile.good() ) {
22  ATH_MSG_ERROR( "Input file " << m_inputFileName << " inaccessible" );
23  return StatusCode::FAILURE;
24  }
25 
26  std::string line;
27  while ( std::getline( inputFile, line ) ) {
28  if ( line[0] == '#' ) {continue;}
29  std::istringstream allChains( line );
31  while ( allChains ) {
32  std::string chainName;
33  allChains >> chainName;
34  if ( not chainName.empty() ) {
35  ids.push_back( HLT::Identifier( chainName ).numeric() );
36  }
37  }
38 
39  if ( not ids.empty() ) {
40  m_events.push_back( ids ); // new event
41  }
42  }
43  inputFile.close();
44 
45  ATH_MSG_DEBUG( "In input file "<<m_inputFileName.value()<<" found "<<m_events.size()<<" chain sets" );
46  return StatusCode::SUCCESS;
47 }

◆ passBeforePrescaleSelection()

StatusCode CTPUnpackingToolBase::passBeforePrescaleSelection ( const ROIB::RoIBResult ,
const std::vector< std::string > &  ,
bool &   
) const
overridevirtualinherited

Reimplemented in CTPUnpackingTool.

Definition at line 24 of file CTPUnpackingToolBase.cxx.

26  {
27  ATH_MSG_ERROR("Base class should not call this function");
28  return StatusCode::FAILURE;
29 }

Member Data Documentation

◆ m_ctpToChain

std::unordered_map<int, HLT::IDVec> CTPUnpackingToolBase::m_ctpToChain
protectedinherited

Definition at line 45 of file CTPUnpackingToolBase.h.

◆ m_events

std::vector<HLT::IDVec> CTPUnpackingEmulationTool::m_events
private

Chain IDs (inner vector) to activate for each event (outer vector)

Definition at line 32 of file CTPUnpackingEmulationTool.h.

◆ m_forceEnable

Gaudi::Property<bool> CTPUnpackingToolBase::m_forceEnable
protectedinherited
Initial value:
{
this, "ForceEnableAllChains", false, "Enables all chains in each event, testing mode"}

Definition at line 47 of file CTPUnpackingToolBase.h.

◆ m_inputFileName

Gaudi::Property<std::string> CTPUnpackingEmulationTool::m_inputFileName
private
Initial value:
{
this, "InputFilename", "CTPEmulation.dat", "Fake CTP RoIB input filename"}

Definition at line 28 of file CTPUnpackingEmulationTool.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> CTPUnpackingToolBase::m_monTool {this, "MonTool", "", "Monitoring tool"}
protectedinherited

Definition at line 50 of file CTPUnpackingToolBase.h.

◆ s_CTPIDForUnseededChains

constexpr int CTPUnpackingToolBase::s_CTPIDForUnseededChains = -1
staticconstexprprotectedinherited

Definition at line 44 of file CTPUnpackingToolBase.h.


The documentation for this class was generated from the following files:
checkFileSG.line
line
Definition: checkFileSG.py:75
CTPUnpackingEmulationTool::m_events
std::vector< HLT::IDVec > m_events
Chain IDs (inner vector) to activate for each event (outer vector)
Definition: CTPUnpackingEmulationTool.h:32
CTPUnpackingEmulationTool::parseInputFile
StatusCode parseInputFile()
Fill the m_events vector with configuration from an input file.
Definition: CTPUnpackingEmulationTool.cxx:19
CTPUnpackingToolBase::CTPUnpackingToolBase
CTPUnpackingToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CTPUnpackingToolBase.cxx:8
HLT::IDVec
std::vector< HLT::Identifier > IDVec
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:62
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
CTPUnpackingEmulationTool::m_inputFileName
Gaudi::Property< std::string > m_inputFileName
Definition: CTPUnpackingEmulationTool.h:28
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:426
CTPUnpackingToolBase::initialize
virtual StatusCode initialize() override
Definition: CTPUnpackingToolBase.cxx:14