|
|
|
template<class Digi , class RecHit > |
RecHit | reco (const Digi &digi, const HcalCoder &coder, const HcalCalibrations &calibs, const int ifirst, const int n, const bool slewCorrect, const bool pulseCorrect, const HcalPulseContainmentCorrection *corr, const HcalTimeSlew::BiasSetting slewFlavor, const int runnum, const bool useLeak, const AbsOOTPileupCorrection *pileupCorrection, const BunchXParameter *bxInfo, const unsigned lenInfo, const int puCorrMethod, const HcalTimeSlew *hcalTimeSlew_delay_) |
|
template<class Digi > |
float | recoHFTime (const Digi &digi, const int maxI, const double amp_fC, const bool slewCorrect, double maxA, float t0, float t2) |
|
template<class Digi > |
void | removePileup (const Digi &digi, const HcalCoder &coder, const HcalCalibrations &calibs, const int ifirst, const int n, const bool pulseCorrect, const HcalPulseContainmentCorrection *corr, const AbsOOTPileupCorrection *pileupCorrection, const BunchXParameter *bxInfo, const unsigned lenInfo, double *p_maxA, double *p_ampl, double *p_uncorr_ampl, double *p_fc_ampl, int *p_nRead, int *p_maxI, bool *leakCorrApplied, float *p_t0, float *p_t2) |
|
◆ reco()
template<class Digi , class RecHit >
RecHit HcalSimpleRecAlgoImpl::reco |
( |
const Digi & |
digi, |
|
|
const HcalCoder & |
coder, |
|
|
const HcalCalibrations & |
calibs, |
|
|
const int |
ifirst, |
|
|
const int |
n, |
|
|
const bool |
slewCorrect, |
|
|
const bool |
pulseCorrect, |
|
|
const HcalPulseContainmentCorrection * |
corr, |
|
|
const HcalTimeSlew::BiasSetting |
slewFlavor, |
|
|
const int |
runnum, |
|
|
const bool |
useLeak, |
|
|
const AbsOOTPileupCorrection * |
pileupCorrection, |
|
|
const BunchXParameter * |
bxInfo, |
|
|
const unsigned |
lenInfo, |
|
|
const int |
puCorrMethod, |
|
|
const HcalTimeSlew * |
hcalTimeSlew_delay_ |
|
) |
| |
|
inline |
Definition at line 251 of file HcalSimpleRecAlgo.cc.
267 double fc_ampl = 0, ampl = 0, uncorr_ampl = 0, m3_ampl = 0, maxA = -1.e300;
268 int nRead = 0,
maxI = -1;
269 bool leakCorrApplied =
false;
270 float t0 = 0,
t2 = 0;
297 if (
maxI > 0 &&
maxI < (nRead - 1)) {
310 float wpksamp = (
t0 + maxA +
t2);
312 wpksamp = (maxA + 2.0 *
t2) / wpksamp;
322 if (useLeak && !leakCorrApplied) {
323 uncorr_ampl *=
leakCorr(uncorr_ampl);
324 if (puCorrMethod < 2)
328 RecHit rh(digi.id(), ampl,
time);
References alignCSCRings::corr, HcalTimeSlew::delay(), leakCorr(), SiStripPI::max, findQualityFiles::maxI, dqmiodumpmetadata::n, removePileup(), setAuxEnergy(), setRawEnergy(), FrontierCondition_GT_autoExpress_cfi::t0, RandomServiceHelper::t2, ntuplemaker::time, HcalCalibrations::timecorr(), and timeshift_ns_hbheho().
◆ recoHFTime()
template<class Digi >
float HcalSimpleRecAlgoImpl::recoHFTime |
( |
const Digi & |
digi, |
|
|
const int |
maxI, |
|
|
const double |
amp_fC, |
|
|
const bool |
slewCorrect, |
|
|
double |
maxA, |
|
|
float |
t0, |
|
|
float |
t2 |
|
) |
| |
|
inline |
Definition at line 71 of file HcalSimpleRecAlgo.cc.
86 wpksamp = maxA / wpksamp;
90 wpksamp = 1. + (
t2 / wpksamp);
95 if (slewCorrect && amp_fC > 0.0) {
97 double tslew =
exp(0.337681 - 5.94689
e-4 * amp_fC) +
exp(2.44628 - 1.34888
e-2 * amp_fC);
References MillePedeFileConverter_cfg::e, JetChargeProducer_cfi::exp, f, dqmMemoryStats::float, findQualityFiles::maxI, min(), FrontierCondition_GT_autoExpress_cfi::t0, RandomServiceHelper::t2, ntuplemaker::time, and timeshift_ns_hf().
Referenced by HcalSimpleRecAlgo::reconstruct(), and HcalSimpleRecAlgo::reconstructQIE10().
◆ removePileup()
template<class Digi >
void HcalSimpleRecAlgoImpl::removePileup |
( |
const Digi & |
digi, |
|
|
const HcalCoder & |
coder, |
|
|
const HcalCalibrations & |
calibs, |
|
|
const int |
ifirst, |
|
|
const int |
n, |
|
|
const bool |
pulseCorrect, |
|
|
const HcalPulseContainmentCorrection * |
corr, |
|
|
const AbsOOTPileupCorrection * |
pileupCorrection, |
|
|
const BunchXParameter * |
bxInfo, |
|
|
const unsigned |
lenInfo, |
|
|
double * |
p_maxA, |
|
|
double * |
p_ampl, |
|
|
double * |
p_uncorr_ampl, |
|
|
double * |
p_fc_ampl, |
|
|
int * |
p_nRead, |
|
|
int * |
p_maxI, |
|
|
bool * |
leakCorrApplied, |
|
|
float * |
p_t0, |
|
|
float * |
p_t2 |
|
) |
| |
|
inline |
Definition at line 105 of file HcalSimpleRecAlgo.cc.
126 const int nRead =
cs.size();
127 const int iStop =
std::min(nRead,
n + ifirst);
134 double* correctedEnergy =
nullptr;
135 double fc_ampl = 0.0, corr_fc_ampl = 0.0;
136 bool pulseShapeCorrApplied =
false, readjustTiming =
false;
137 *leakCorrApplied =
false;
139 if (pileupCorrection) {
140 correctedEnergy = &
buf[0];
145 for (
int i = 0;
i < nRead; ++
i) {
146 const int capid = digi[
i].capid();
151 for (
int i = ifirst;
i < iStop; ++
i)
152 fc_ampl += correctionInput[
i];
155 for (
int i = 0;
i < nRead; ++
i) {
156 uncorrectedEnergy[
i] = correctionInput[
i] * gains[
i];
158 correctionInput[
i] = uncorrectedEnergy[
i];
161 pileupCorrection->
apply(digi.id(),
170 &pulseShapeCorrApplied,
176 for (
int i = ifirst;
i < iStop; ++
i)
178 corr_fc_ampl += correctedEnergy[
i] / gains[
i];
180 for (
int i = ifirst;
i < iStop; ++
i)
181 corr_fc_ampl += correctedEnergy[
i];
182 for (
int i = 0;
i < nRead; ++
i)
183 correctedEnergy[
i] *= gains[
i];
186 correctedEnergy = &uncorrectedEnergy[0];
189 const int istart =
std::max(ifirst - 1, 0);
190 const int iend =
std::min(
n + ifirst + 1, nRead);
191 for (
int i = istart;
i < iend; ++
i) {
192 const int capid = digi[
i].capid();
194 if (
i >= ifirst &&
i < iStop)
197 uncorrectedEnergy[
i] = ta;
199 corr_fc_ampl = fc_ampl;
203 double ampl = 0.0, corr_ampl = 0.0;
204 for (
int i = ifirst;
i < iStop; ++
i) {
205 ampl += uncorrectedEnergy[
i];
206 corr_ampl += correctedEnergy[
i];
210 if (
corr && pulseCorrect) {
211 ampl *=
corr->getCorrection(fc_ampl);
212 if (pileupCorrection) {
213 if (!pulseShapeCorrApplied)
214 corr_ampl *=
corr->getCorrection(corr_fc_ampl);
220 const double* etime = readjustTiming ? &correctedEnergy[0] : &uncorrectedEnergy[0];
222 double maxA = -1.e300;
223 for (
int i = ifirst;
i < iStop; ++
i)
224 if (etime[
i] > maxA) {
232 *p_uncorr_ampl = ampl;
233 *p_fc_ampl = readjustTiming ? corr_fc_ampl : fc_ampl;
237 if (maxI <= 0 || maxI >= (nRead - 1)) {
238 LogDebug(
"HCAL Pulse") <<
"HcalSimpleRecAlgoImpl::removePileup :"
239 <<
" Invalid max amplitude position, "
240 <<
" max Amplitude: " <<
maxI <<
" first: " << ifirst <<
" last: " << ifirst +
n
245 *p_t0 = etime[
maxI - 1];
246 *p_t2 = etime[
maxI + 1];
References HcalCoder::adc2fC(), AbsOOTPileupCorrection::apply(), visDQMUpload::buf, alignCSCRings::corr, fwrapper::cs, mps_fire::i, AbsOOTPileupCorrection::inputIsEnergy(), LogDebug, SiStripPI::max, findQualityFiles::maxI, CaloSamples::MAXSAMPLES, min(), dqmiodumpmetadata::n, HcalCalibrations::pedestal(), and HcalCalibrations::respcorrgain().
Referenced by reco(), HcalSimpleRecAlgo::reconstruct(), and HcalSimpleRecAlgo::reconstructQIE10().
void setAuxEnergy(HcalRecHit &h, float e)
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const =0
unique_ptr< ClusterSequence > cs
void removePileup(const Digi &digi, const HcalCoder &coder, const HcalCalibrations &calibs, const int ifirst, const int n, const bool pulseCorrect, const HcalPulseContainmentCorrection *corr, const AbsOOTPileupCorrection *pileupCorrection, const BunchXParameter *bxInfo, const unsigned lenInfo, double *p_maxA, double *p_ampl, double *p_uncorr_ampl, double *p_fc_ampl, int *p_nRead, int *p_maxI, bool *leakCorrApplied, float *p_t0, float *p_t2)
static float timeshift_ns_hf(float wpksamp)
Timeshift correction for the HF PMTs.
static const int MAXSAMPLES
float delay(float fC, BiasSetting bias=Medium) const
Returns the amount (ns) by which a pulse of the given number of fC will be delayed by the timeslew ef...
static float leakCorr(double energy)
Leak correction.
constexpr double respcorrgain(int fCapId) const
get response corrected gain for capid=0..3
constexpr double timecorr() const
get time correction factor
virtual bool inputIsEnergy() const =0
float timeshift_ns_hbheho(float wpksamp)
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
void setRawEnergy(HcalRecHit &h, float e)
virtual void apply(const HcalDetId &id, const double *inputCharge, unsigned lenInputCharge, const BunchXParameter *bcParams, unsigned lenBcParams, unsigned firstTimeSlice, unsigned nTimeSlices, double *correctedCharge, unsigned lenCorrectedCharge, bool *pulseShapeCorrApplied, bool *leakCorrApplied, bool *readjustTiming) const =0