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")) {
20 CLHEP::HepRandomEngine *hre)
const {
24 for(MTDSimHitDataAccumulator::const_iterator it=input.begin();
30 for(
size_t i=0;
i<it->second.hit_info[0].size();
i++) {
32 float finalToA = (it->second).hit_info[1][
i];
33 while(finalToA < 0.
f) finalToA+=25.f;
34 while(finalToA > 25.
f) finalToA-=25.f;
38 chargeColl[
i] = (it->second).hit_info[0][
i];
56 for(
int it=0; it<(
int)(chargeColl.size()); it++) debug |= (chargeColl[it]>adcThreshold_fC_);
59 if(debug)
edm::LogVerbatim(
"ETLElectronicsSim") <<
"[runTrivialShaper]" << std::endl;
62 for(
int it=0; it<(
int)(chargeColl.size()); it++)
66 const uint32_t tdc_time=std::floor( toa[it] /
toaLSB_ns_ );
75 std::ostringstream
msg;
84 if(rawDataFrame.
size()<=itIdx+2)
return;
88 bool putInEvent(
false);
89 for(
int it=0;it<
dfSIZE; ++it) {
90 dataFrame.setSample(it, rawDataFrame[itIdx-2+it]);
91 if(it==2) putInEvent = rawDataFrame[itIdx-2+it].threshold();
int adc(sample_type sample)
get the ADC sample (12 bits)
void print(std::ostream &out=std::cout)
void push_back(T const &t)
const D & id() const
det id
ETLElectronicsSim(const edm::ParameterSet &pset)
std::array< MTDSimData_t, nSamples > MTDSimHitData
static std::string const input
void runTrivialShaper(ETLDataFrame &dataFrame, const mtd::MTDSimHitData &chargeColl, const mtd::MTDSimHitData &toa) const
void updateOutput(ETLDigiCollection &coll, const ETLDataFrame &rawDataFrame) const
void resize(size_t s)
allow to set size
void setSample(int i, const S &sample)
int size() const
total number of samples in the digi
void run(const mtd::MTDSimHitDataAccumulator &input, ETLDigiCollection &output, CLHEP::HepRandomEngine *hre) const
std::unordered_map< uint32_t, MTDCellInfo > MTDSimHitDataAccumulator
const float adcSaturation_MIP_
void set(bool thr, bool mode, uint16_t toa, uint16_t data)
Power< A, B >::type pow(const A &a, const B &b)
const float adcThreshold_MIP_