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

#include <ZDCTriggerSim.h>

Inheritance diagram for ZDCTriggerSimCombLUT:
Collaboration diagram for ZDCTriggerSimCombLUT:

Public Member Functions

 ZDCTriggerSimCombLUT (const std::array< unsigned int, 256 > &inLUT)
 
virtual unsigned int simLevel1Trig (const ZDCTriggerSim::SimDataCPtr &inputBits) override
 
SimStack::const_iterator stackBottom () const
 
SimStack::const_reverse_iterator stackTop () const
 
void dump (std::ostream &strm) const
 

Protected Member Functions

virtual void doSimStage () override
 
void stackClear ()
 
void stackPush (const ZDCTriggerSim::SimDataCPtr &ptr)
 
const ZDCTriggerSim::SimDataCPtrstackTopData () const
 

Private Types

typedef std::list< ZDCTriggerSim::SimDataCPtrSimStack
 

Private Attributes

std::array< unsigned int, 256 > m_combLUT {}
 
SimStack m_stack
 

Detailed Description

Definition at line 224 of file ZDCTriggerSim.h.

Member Typedef Documentation

◆ SimStack

typedef std::list<ZDCTriggerSim::SimDataCPtr> ZDCTriggerSimBase::SimStack
privateinherited

Definition at line 181 of file ZDCTriggerSim.h.

Constructor & Destructor Documentation

◆ ZDCTriggerSimCombLUT()

ZDCTriggerSimCombLUT::ZDCTriggerSimCombLUT ( const std::array< unsigned int, 256 > &  inLUT)
inline

Definition at line 235 of file ZDCTriggerSim.h.

236  : m_combLUT(inLUT) {}

Member Function Documentation

◆ doSimStage()

void ZDCTriggerSimCombLUT::doSimStage ( )
overrideprotectedvirtual

Implements ZDCTriggerSimBase.

Reimplemented in ZDCTriggerSimFADC, ZDCTriggerSimModuleAmpls, and ZDCTriggerSimAllLUTs.

Definition at line 20 of file ZDCTriggerSim.cxx.

20  {
22  if (ptr->getNumData() != 2 || ptr->getNumBits() != 4)
23  throw std::logic_error("Invalid input data in ZDCTriggerSimCombLUT");
24 
25  unsigned int bitsSideA = ptr->getValueTrunc(0);
26  unsigned int bitsSideC = ptr->getValueTrunc(1);
27 
28  unsigned int address = (bitsSideC << 4) + bitsSideA;
29  unsigned int comLUTvalue = m_combLUT.at(address);
30 
31  // ZDCTriggerSim::SimDataPtr uses shared_ptr semantics so cleanup is
32  // guaranteed
33  //
35  static_cast<ZDCTriggerSim::CombLUTOutput*>(lutOut_p.get())
36  ->setDatum(comLUTvalue);
37 
38  stackPush(lutOut_p);
39 }

◆ dump()

void ZDCTriggerSimBase::dump ( std::ostream &  strm) const
inherited

Definition at line 11 of file ZDCTriggerSim.cxx.

11  {
12  for (auto entry : m_stack) {
13  strm << entry->getType() << ": ";
14  entry->dump(strm);
15  strm << std::endl;
16  }
17 }

◆ simLevel1Trig()

virtual unsigned int ZDCTriggerSimCombLUT::simLevel1Trig ( const ZDCTriggerSim::SimDataCPtr inputBits)
inlineoverridevirtual

Implements ZDCTriggerSimBase.

Reimplemented in ZDCTriggerSimFADC, ZDCTriggerSimModuleAmpls, and ZDCTriggerSimAllLUTs.

Definition at line 238 of file ZDCTriggerSim.h.

239  {
240  stackClear();
241  stackPush(inputBits);
242 
243  doSimStage();
244  return stackTopData()->getValueTrunc();
245  }

◆ stackBottom()

SimStack::const_iterator ZDCTriggerSimBase::stackBottom ( ) const
inlineinherited

Definition at line 212 of file ZDCTriggerSim.h.

213  {
214  return m_stack.begin();
215  }

◆ stackClear()

void ZDCTriggerSimBase::stackClear ( )
inlineprotectedinherited

Definition at line 187 of file ZDCTriggerSim.h.

187 { m_stack.clear(); }

◆ stackPush()

void ZDCTriggerSimBase::stackPush ( const ZDCTriggerSim::SimDataCPtr ptr)
inlineprotectedinherited

Definition at line 189 of file ZDCTriggerSim.h.

189  {
190  m_stack.push_back(SimStack::value_type(ptr));
191  }

◆ stackTop()

SimStack::const_reverse_iterator ZDCTriggerSimBase::stackTop ( ) const
inlineinherited

Definition at line 217 of file ZDCTriggerSim.h.

217  {
218  return m_stack.rbegin();
219  }

◆ stackTopData()

const ZDCTriggerSim::SimDataCPtr& ZDCTriggerSimBase::stackTopData ( ) const
inlineprotectedinherited

Definition at line 193 of file ZDCTriggerSim.h.

193  {
194  return m_stack.back();
195  }

Member Data Documentation

◆ m_combLUT

std::array<unsigned int, 256> ZDCTriggerSimCombLUT::m_combLUT {}
private

Definition at line 225 of file ZDCTriggerSim.h.

◆ m_stack

SimStack ZDCTriggerSimBase::m_stack
privateinherited

Definition at line 184 of file ZDCTriggerSim.h.


The documentation for this class was generated from the following files:
ZDCTriggerSimBase::m_stack
SimStack m_stack
Definition: ZDCTriggerSim.h:184
ZDCTriggerSim::SimDataCPtr
std::shared_ptr< const ZDCTriggerSimDataBase > SimDataCPtr
Definition: ZDCTriggerSim.h:170
ZDCTriggerSimBase::stackClear
void stackClear()
Definition: ZDCTriggerSim.h:187
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
ZDCTriggerSimCombLUT::m_combLUT
std::array< unsigned int, 256 > m_combLUT
Definition: ZDCTriggerSim.h:225
ZDCTriggerSimBase::stackTopData
const ZDCTriggerSim::SimDataCPtr & stackTopData() const
Definition: ZDCTriggerSim.h:193
ZDCTriggerSim::SimDataPtr
std::shared_ptr< ZDCTriggerSimDataBase > SimDataPtr
Definition: ZDCTriggerSim.h:171
ZDCTriggerSimCombLUT::doSimStage
virtual void doSimStage() override
Definition: ZDCTriggerSim.cxx:20
ZDCTriggerSimBase::stackPush
void stackPush(const ZDCTriggerSim::SimDataCPtr &ptr)
Definition: ZDCTriggerSim.h:189
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
ZDCTriggerSimData
Definition: ZDCTriggerSim.h:58
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55