|
|
Go to the documentation of this file.
19 m_ebCorrNoise{ebCorrNoise0, ebCorrNoise1}
44 CLHEP::HepRandomEngine* engine)
const {
55 int nSaturatedSamples = 0;
56 double icalconst = 1.;
61 findPedestal(detId, igain, pedestals[igain], widths[igain]);
77 noisy[ig]->
noisify(noiseframe[ig], engine);
81 std::vector<std::vector<int>> adctrace(
nSamples);
89 adctrace[
i][igain] = -1;
98 asignal = pedestals[igain] + ecalSamples[
i] / (LSB[igain] * icalconst) + trueRMS[igain] * noiseframe[igain][
i];
104 asignal = ecalSamples[
i] / (LSB[igain] * icalconst);
106 int isignal = asignal;
108 unsigned int adc = asignal - (double)isignal < 0.5 ? isignal : isignal + 1;
112 if (nSaturatedSamples == 0)
113 firstSaturatedSample[igain] =
i;
116 adctrace[
i][igain] =
adc;
118 if (nSaturatedSamples == 0) {
129 int previousSaturatedSamples = 5;
130 int nextSaturatedSamples = 10;
131 int startingLowerGainSample = 0;
132 int endingLowerGainSample = (firstSaturatedSample[0] + nextSaturatedSamples + (nSaturatedSamples));
134 if (nSaturatedSamples != 0 and (firstSaturatedSample[0] - previousSaturatedSamples) < 0) {
135 startingLowerGainSample = 0;
137 startingLowerGainSample = (firstSaturatedSample[0] - previousSaturatedSamples);
142 if (nSaturatedSamples != 0 and
j >= startingLowerGainSample and
j < endingLowerGainSample) {
154 ped = (*itped).mean(
gainId);
156 LogDebug(
"EcalLiteDTUCoder") <<
"Pedestals for " << detId.
rawId() <<
" gain range " <<
gainId <<
" : \n"
157 <<
"Mean = " << ped <<
" rms = " <<
width;
159 LogDebug(
"EcalLiteDTUCoder") <<
"Pedestals not found, put default values (ped: 12; width: 2.5) \n";
170 if (icalit != icalMap.
end()) {
171 thisconst = (*icalit);
173 LogDebug(
"EcalLiteDTUCoder") <<
"Intercalib Constant not found, put default value \n";
180 icalconst = thisconst;
void setFullScaleEnergy(double EBscale)
const self & getMap() const
const_iterator end() const
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
void findIntercalibConstant(const DetId &detId, double &icalconst) const
double fullScaleEnergy(const DetId &did) const
limit on the energy scale due to the electronics range
static constexpr unsigned int MAXADC
const EcalIntercalibConstantsMC * m_intercals
virtual ~EcalLiteDTUCoder()
dtor
virtual void analogToDigital(CLHEP::HepRandomEngine *, const EcalSamples &clf, EcalDataFrame_Ph2 &df) const
from EcalSamples to EcalDataFrame_Ph2
void setPedestals(const EcalLiteDTUPedestalsMap *pedestals)
can be fetched every event from the EventSetup
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
void findPedestal(const DetId &detId, int gainId, double &pedestal, double &width) const
const_iterator find(uint32_t rawId) const
EcalLiteDTUCoder(bool addNoise, bool PreMix1, Noisifier *ebCorrNoise0, Noisifier *ebCorrNoise1=nullptr)
ctor
const EcalLiteDTUPedestalsMap * m_peds
void setIntercalibConstants(const EcalIntercalibConstantsMC *ical)
constexpr uint32_t rawId() const
get the raw id
float EcalIntercalibConstantMC
void encode(const EcalSamples &ecalSamples, EcalDataFrame_Ph2 &df, CLHEP::HepRandomEngine *) const
produce the pulse-shape
void setGainRatios(float gainRatios)
static constexpr float gains[NGAINS]
const Noisifier * m_ebCorrNoise[ecalPh2::NGAINS]
std::vector< Item >::const_iterator const_iterator
Abs< T >::type abs(const T &t)
static constexpr double maxEneEB
static constexpr unsigned int NGAINS