|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #ifndef ZDCTRIGVALID__ZDCTriggerSim__h
12 #define ZDCTRIGVALID__ZDCTriggerSim__h
20 #include <type_traits>
26 const std::vector<std::string>
TypeStrings = {
"CombLUTOutput",
"CombLUTInput",
27 "SideLUTsInput",
"ModAmplsInput",
"FADCInput"};
43 virtual void dump(std::ostream& strm)
const = 0;
56 template <
typename T,
unsigned int NData,
unsigned int NBits,
66 unsigned int value = inValue;
72 unsigned int valueTruncZero =
std::max(
static_cast<unsigned int>(0),
value);
73 unsigned int valueTruncBits =
74 std::min(valueTruncZero,
static_cast<unsigned int>((1 << NBits) - 1));
75 return valueTruncBits;
82 static_assert(NData > 0,
"ZDCTriggerSimData requires at least one datum");
83 static_assert(NBits > 0,
"ZDCTriggerSimData requires at least 1 bit");
91 static_assert(NData > 0,
"ZDCTriggerSimData requires at least one datum");
92 static_assert(NBits > 0,
"ZDCTriggerSimData requires at least 1 bit");
97 unsigned int getNumBits()
const override {
return NBits; }
98 unsigned int getNumData()
const override {
return NData; }
103 throw std::logic_error(
"No data available for ZDCTriggerSimData");
109 throw std::logic_error(
110 "ZDCTriggerSimData setDatum called with NData > 1");
123 virtual void dump(std::ostream& strm)
const override {
124 strm <<
"Data for Type: " <<
Type <<
": ";
125 for (
auto datum :
m_data) {
181 typedef std::list<ZDCTriggerSim::SimDataCPtr>
SimStack;
217 SimStack::const_reverse_iterator
stackTop()
const {
221 void dump(std::ostream& strm)
const;
264 const std::array<unsigned int, 4096>& sideCLUT,
265 const std::array<unsigned int, 256>& inCombLUT)
291 const std::array<unsigned int, 4096>& sideCLUT,
292 const std::array<unsigned int, 256>& inCombLUT)
313 std::array<std::array<unsigned int, 4>, 2>
m_maxADC{};
329 const std::array<unsigned int, 4096>& sideCLUT,
330 const std::array<unsigned int, 256>& inCombLUT,
331 const std::array<std::array<unsigned int, 4>, 2>& negDeriv2ndThresh,
332 unsigned int minSampleAna,
unsigned int maxSampleAna,
unsigned int baselineDelta) :
virtual void doSimStage() override
char data[hepevt_bytes_allocation_ATLAS]
const auto & getBaselines() const
std::shared_ptr< const ZDCTriggerSimDataBase > SimDataCPtr
virtual unsigned int getNumData() const =0
virtual ZDCTriggerSim::DataType getType() const override
virtual unsigned int simLevel1Trig(const ZDCTriggerSim::SimDataCPtr &data)=0
unsigned int getNumData() const override
virtual unsigned int simLevel1Trig(const ZDCTriggerSim::SimDataCPtr &inputData) override
virtual unsigned int getValueTrunc(unsigned int idx=0) const =0
unsigned int m_baselineDelta
virtual unsigned int getValueTrunc(unsigned int idx=0) const override
ZDCTriggerSimData(const std::vector< float > &conversionFactors)
unsigned int m_maxSampleAna
virtual void doSimStage() override
std::array< unsigned int, 4096 > m_LUTA
unsigned int doConvTrunc(const T &inValue) const
virtual unsigned int simLevel1Trig(const ZDCTriggerSim::SimDataCPtr &inputData) override
std::array< std::array< unsigned int, 4 >, 2 > m_maxADC
virtual ~ZDCTriggerSimBase()=default
unsigned int getNumBits() const override
ZDCTriggerSimData< unsigned int, 1, 3, TCombLUTOutput > CombLUTOutput
std::list< ZDCTriggerSim::SimDataCPtr > SimStack
std::array< unsigned int, 256 > m_combLUT
virtual void dump(std::ostream &strm) const override
const ZDCTriggerSim::SimDataCPtr & stackTopData() const
virtual ZDCTriggerSim::DataType getType() const =0
virtual void dump(std::ostream &strm) const =0
SimStack::const_iterator stackBottom() const
virtual unsigned int simLevel1Trig(const ZDCTriggerSim::SimDataCPtr &inputBits) override
ZDCTriggerSimFADC(const std::array< unsigned int, 4096 > &sideALUT, const std::array< unsigned int, 4096 > &sideCLUT, const std::array< unsigned int, 256 > &inCombLUT, const std::array< std::array< unsigned int, 4 >, 2 > &negDeriv2ndThresh, unsigned int minSampleAna, unsigned int maxSampleAna, unsigned int baselineDelta)
ZDCTriggerSimCombLUT(const std::array< unsigned int, 256 > &inLUT)
virtual ~ZDCTriggerSimData() override
unsigned int m_minSampleAna
const auto & getMaxADCs() const
virtual unsigned int simLevel1Trig(const ZDCTriggerSim::SimDataCPtr &inputData) override
virtual ~ZDCTriggerSimDataBase()=default
std::shared_ptr< ZDCTriggerSimDataBase > SimDataPtr
virtual void doSimStage() override
void stackPush(const ZDCTriggerSim::SimDataCPtr &ptr)
virtual void doSimStage() override
const std::vector< std::string > TypeStrings
std::vector< float > m_convertFactors
virtual void doSimStage()=0
std::array< std::array< int, 4 >, 2 > m_maxNegDeriv2nd
ZDCTriggerSimModuleAmpls(const std::array< unsigned int, 4096 > &sideALUT, const std::array< unsigned int, 4096 > &sideCLUT, const std::array< unsigned int, 256 > &inCombLUT)
ZDCTriggerSimData< float, 8, 12, TModAmplsInput > ModuleAmplInputsFloat
std::vector< unsigned int > CalculateNeg2ndDerivatives(const std::vector< unsigned int > &samples, unsigned int step)
ZDCTriggerSimData< float, 2, 12, TSideLUTsInput > SideLUTInputsFloat
std::array< unsigned int, 4096 > m_LUTC
ZDCTriggerSimBase()=default
ZDCTriggerSimData< unsigned int, 8 *24, 12, TFADCInputs > FADCInputs
void dump(std::ostream &strm) const
void setData(const std::vector< T > &inData)
ZDCTriggerSimData< unsigned int, 2, 4, TCombLUTInput > CombLUTInputsInt
ZDCTriggerSimData< unsigned int, 8, 12, TModAmplsInput > ModuleAmplInputsInt
const auto & getMaxNegDeriv2nds() const
std::array< std::array< unsigned int, 4 >, 2 > m_deriv2ndThresholds
ZDCTriggerSimData< unsigned int, 2, 12, TSideLUTsInput > SideLUTInputsInt
std::array< std::array< unsigned int, 4 >, 2 > m_baseline
virtual unsigned int getNumBits() const =0
ZDCTriggerSimAllLUTs(const std::array< unsigned int, 4096 > &sideALUT, const std::array< unsigned int, 4096 > &sideCLUT, const std::array< unsigned int, 256 > &inCombLUT)
SimStack::const_reverse_iterator stackTop() const