8 : debug_(pset.getUntrackedParameter<
bool>(
"debug",
false)),
9 adcNbits_(pset.getParameter<uint32_t>(
"adcNbits")),
10 tdcNbits_(pset.getParameter<uint32_t>(
"tdcNbits")),
11 adcSaturation_MIP_(pset.getParameter<double>(
"adcSaturation_MIP")),
12 adcLSB_MIP_(adcSaturation_MIP_ /
std::
pow(2., adcNbits_)),
13 adcThreshold_MIP_(pset.getParameter<double>(
"adcThreshold_MIP")),
14 toaLSB_ns_(pset.getParameter<double>(
"toaLSB_ns")) {}
19 for (FTLSimHitDataAccumulator::const_iterator it = input.begin(); it != input.end(); it++) {
22 for (
size_t i = 0;
i < it->second.hit_info[0].size();
i++) {
24 float finalToA = (it->second).hit_info[1][
i];
25 while (finalToA < 0.
f)
27 while (finalToA > 25.
f)
32 chargeColl[
i] = (it->second).hit_info[0][
i];
47 for (
int it = 0; it < (
int)(chargeColl.size()); it++)
48 debug |= (chargeColl[it] > adcThreshold_fC_);
52 edm::LogVerbatim(
"FTLSimpleElectronicsSimInMIPs") <<
"[runTrivialShaper]" << std::endl;
55 for (
int it = 0; it < (
int)(chargeColl.size()); it++) {
58 const uint32_t tdc_time = std::floor(toa[it] /
toaLSB_ns_);
68 std::ostringstream
msg;
76 if (rawDataFrame.
size() <= itIdx + 2)
81 bool putInEvent(
false);
82 for (
int it = 0; it < 5; ++it) {
83 dataFrame.setSample(it, rawDataFrame[itIdx - 2 + it]);
85 putInEvent = rawDataFrame[itIdx - 2 + it].threshold();
void push_back(T const &t)
const float adcThreshold_MIP_
int size() const
total number of samples in the digi
const float adcSaturation_MIP_
static std::string const input
std::unordered_map< uint32_t, FTLCellInfo > FTLSimHitDataAccumulator
void run(const ftl::FTLSimHitDataAccumulator &input, FTLDigiCollection &output) const
void resize(size_t s)
allow to set size
void setSample(int i, const S &sample)
void updateOutput(FTLDigiCollection &coll, const FTLDataFrame &rawDataFrame) const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
std::array< FTLSimData_t, nSamples > FTLSimHitData
void runTrivialShaper(FTLDataFrame &dataFrame, const ftl::FTLSimHitData &chargeColl, const ftl::FTLSimHitData &toa) const
void print(std::ostream &out=std::cout)
void set(bool thr, bool mode, uint16_t toa, uint16_t data)
SimpleElectronicsSimInMIPs(const edm::ParameterSet &pset)
Power< A, B >::type pow(const A &a, const B &b)
const D & id() const
det id