|
|
|
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 253 of file HcalSimpleRecAlgo.cc.
269 double fc_ampl = 0, ampl = 0, uncorr_ampl = 0, m3_ampl = 0, maxA = -1.e300;
270 int nRead = 0,
maxI = -1;
271 bool leakCorrApplied =
false;
272 float t0 = 0,
t2 = 0;
299 if (
maxI > 0 &&
maxI < (nRead - 1)) {
312 float wpksamp = (
t0 + maxA +
t2);
314 wpksamp = (maxA + 2.0 *
t2) / wpksamp;
324 if (useLeak && !leakCorrApplied) {
325 uncorr_ampl *=
leakCorr(uncorr_ampl);
326 if (puCorrMethod < 2)
330 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 73 of file HcalSimpleRecAlgo.cc.
88 wpksamp = maxA / wpksamp;
92 wpksamp = 1. + (
t2 / wpksamp);
97 if (slewCorrect && amp_fC > 0.0) {
99 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 107 of file HcalSimpleRecAlgo.cc.
128 const int nRead =
cs.size();
129 const int iStop =
std::min(nRead,
n + ifirst);
136 double* correctedEnergy =
nullptr;
137 double fc_ampl = 0.0, corr_fc_ampl = 0.0;
138 bool pulseShapeCorrApplied =
false, readjustTiming =
false;
139 *leakCorrApplied =
false;
141 if (pileupCorrection) {
142 correctedEnergy = &
buf[0];
147 for (
int i = 0;
i < nRead; ++
i) {
148 const int capid = digi[
i].capid();
153 for (
int i = ifirst;
i < iStop; ++
i)
154 fc_ampl += correctionInput[
i];
157 for (
int i = 0;
i < nRead; ++
i) {
158 uncorrectedEnergy[
i] = correctionInput[
i] * gains[
i];
160 correctionInput[
i] = uncorrectedEnergy[
i];
163 pileupCorrection->
apply(digi.id(),
172 &pulseShapeCorrApplied,
178 for (
int i = ifirst;
i < iStop; ++
i)
180 corr_fc_ampl += correctedEnergy[
i] / gains[
i];
182 for (
int i = ifirst;
i < iStop; ++
i)
183 corr_fc_ampl += correctedEnergy[
i];
184 for (
int i = 0;
i < nRead; ++
i)
185 correctedEnergy[
i] *= gains[
i];
188 correctedEnergy = &uncorrectedEnergy[0];
191 const int istart =
std::max(ifirst - 1, 0);
192 const int iend =
std::min(
n + ifirst + 1, nRead);
193 for (
int i = istart;
i < iend; ++
i) {
194 const int capid = digi[
i].capid();
196 if (
i >= ifirst &&
i < iStop)
199 uncorrectedEnergy[
i] = ta;
201 corr_fc_ampl = fc_ampl;
205 double ampl = 0.0, corr_ampl = 0.0;
206 for (
int i = ifirst;
i < iStop; ++
i) {
207 ampl += uncorrectedEnergy[
i];
208 corr_ampl += correctedEnergy[
i];
212 if (
corr && pulseCorrect) {
213 ampl *=
corr->getCorrection(fc_ampl);
214 if (pileupCorrection) {
215 if (!pulseShapeCorrApplied)
216 corr_ampl *=
corr->getCorrection(corr_fc_ampl);
222 const double* etime = readjustTiming ? &correctedEnergy[0] : &uncorrectedEnergy[0];
224 double maxA = -1.e300;
225 for (
int i = ifirst;
i < iStop; ++
i)
226 if (etime[
i] > maxA) {
234 *p_uncorr_ampl = ampl;
235 *p_fc_ampl = readjustTiming ? corr_fc_ampl : fc_ampl;
239 if (maxI <= 0 || maxI >= (nRead - 1)) {
240 LogDebug(
"HCAL Pulse") <<
"HcalSimpleRecAlgoImpl::removePileup :"
241 <<
" Invalid max amplitude position, "
242 <<
" max Amplitude: " <<
maxI <<
" first: " << ifirst <<
" last: " << ifirst +
n
247 *p_t0 = etime[
maxI - 1];
248 *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