|
|
Go to the documentation of this file.
4 #include "CLHEP/Random/RandGaussQ.h"
11 bxTime_(
pset.getParameter<double>(
"bxTime")),
12 integratedLum_(
pset.getParameter<double>(
"IntegratedLuminosity")),
14 lgadGain_(
pset.getParameter<
std::
string>(
"LGADGainVsFluence")),
16 adcNbits_(
pset.getParameter<uint32_t>(
"adcNbits")),
17 tdcNbits_(
pset.getParameter<uint32_t>(
"tdcNbits")),
18 adcSaturation_MIP_(
pset.getParameter<double>(
"adcSaturation_MIP")),
19 adcLSB_MIP_(adcSaturation_MIP_ /
std::
pow(2., adcNbits_)),
20 adcBitSaturation_(
std::
pow(2, adcNbits_) - 1),
21 adcThreshold_MIP_(
pset.getParameter<double>(
"adcThreshold_MIP")),
22 toaLSB_ns_(
pset.getParameter<double>(
"toaLSB_ns")),
23 tdcBitSaturation_(
std::
pow(2, tdcNbits_) - 1) {}
33 CLHEP::HepRandomEngine* hre)
const {
36 std::vector<double> emptyV;
37 std::vector<double>
radius(1);
38 std::vector<double> fluence(1);
39 std::vector<double>
gain(1);
41 for (MTDSimHitDataAccumulator::const_iterator it =
input.begin(); it !=
input.end(); it++) {
48 if (thedet ==
nullptr)
49 throw cms::Exception(
"EtlElectronicsSim") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" ("
54 const auto& global_point = thedet->
toGlobal(local_point);
56 for (
size_t i = 0;
i < it->second.hit_info[0].size();
i++) {
61 float finalToA = (it->second).hit_info[1][
i];
64 radius[0] = global_point.perp();
68 throw cms::Exception(
"EtlElectronicsSim") <<
"Null or negative LGAD gain!" << std::endl;
74 finalToA += CLHEP::RandGaussQ::shoot(hre, 0., sigmaToA);
77 const unsigned int ibucket = std::floor(finalToA /
bxTime_);
78 if ((
i + ibucket) >= chargeColl.size())
81 chargeColl[
i + ibucket] += (it->second).hit_info[0][
i];
83 if (toa[
i + ibucket] == 0. || (finalToA - ibucket *
bxTime_) < toa[
i + ibucket])
84 toa[
i + ibucket] = finalToA - ibucket *
bxTime_;
89 runTrivialShaper(rawDataFrame, chargeColl, toa, it->first.row_, it->first.column_);
98 const uint8_t
col)
const {
101 for (
int it = 0; it < (
int)(chargeColl.size()); it++)
109 for (
int it = 0; it < (
int)(chargeColl.size()); it++) {
122 std::ostringstream
msg;
130 if (rawDataFrame.
size() <= itIdx + 2)
135 bool putInEvent(
false);
136 for (
int it = 0; it <
dfSIZE; ++it) {
137 dataFrame.setSample(it, rawDataFrame[itIdx - 2 + it]);
139 putInEvent = rawDataFrame[itIdx - 2 + it].threshold();
void print(std::ostream &out=std::cout)
const D & id() const
det id
const float integratedLum_
const reco::FormulaEvaluator timeRes2_
static const std::string input
const float adcThreshold_MIP_
virtual const Topology & topology() const
void set(bool thr, bool mode, uint16_t toa, uint16_t data, uint8_t row, uint8_t col)
Detector identifier class for the Endcap Timing Layer.
void updateOutput(ETLDigiCollection &coll, const ETLDataFrame &rawDataFrame) const
void push_back(T const &t)
ETLElectronicsSim(const edm::ParameterSet &pset)
const reco::FormulaEvaluator fluence_
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
const MTDGeomDet * idToDet(DetId) const override
std::array< MTDSimData_t, nSamples > MTDSimHitData
void setSample(int i, const S &sample)
ETLDetId geographicalId() const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void runTrivialShaper(ETLDataFrame &dataFrame, const mtd::MTDSimHitData &chargeColl, const mtd::MTDSimHitData &toa, const uint8_t row, const uint8_t column) const
void getEventSetup(const edm::EventSetup &evt)
constexpr uint32_t rawId() const
get the raw id
const uint32_t tdcBitSaturation_
void resize(size_t s)
allow to set size
const reco::FormulaEvaluator lgadGain_
Log< level::Info, true > LogVerbatim
std::unordered_map< MTDCellId, MTDCellInfo > MTDSimHitDataAccumulator
virtual float localY(float mpY) const =0
const MTDGeometry * geom_
const uint32_t adcBitSaturation_
virtual float localX(float mpX) const =0
Power< A, B >::type pow(const A &a, const B &b)
int size() const
total number of samples in the digi
void run(const mtd::MTDSimHitDataAccumulator &input, ETLDigiCollection &output, CLHEP::HepRandomEngine *hre) const
static constexpr int dfSIZE