24 std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2,
25 std::unique_ptr<HcalDeterministicFit> detFit)
27 firstSampleShift_(firstSampleShift),
28 samplesToAdd_(samplesToAdd),
30 timeShift_(timeShift),
32 corrFPC_(correctForPhaseContainment),
34 hltOOTpuCorr_(
std::
move(detFit))
61 float m0t = 0.f, m0E = 0.f;
67 const double fc_ampl = info.
chargeInWindow(ibeg, ibeg + nSamplesToAdd);
70 m0E =
m0Energy(info, fc_ampl, applyContainment, phasens, nSamplesToAdd);
72 m0t =
m0Time(info, fc_ampl, calibs, nSamplesToAdd);
76 float m2t = 0.f, m2E = 0.f,
chi2 = -1.f;
77 bool useTriple =
false;
90 float m3t = 0.f, m3E = 0.f;
115 rh =
HBHERecHit(channelId, rhE, rht, tdcTime);
132 const bool isRealData)
const 138 const int ieta = cell.
ieta();
139 const int iphi = cell.
iphi();
146 const double fc_ampl,
147 const bool applyContainmentCorrection,
148 const double phaseNs,
149 const int nSamplesToAdd)
158 double corrFactor = 1.0;
159 if (applyContainmentCorrection)
160 corrFactor =
pulseCorr_.
get(info.
id(), nSamplesToAdd, phaseNs)->getCorrection(fc_ampl);
168 const double fc_ampl,
170 const int nSamplesToExamine)
const 172 float time = -9999.f;
177 const int soi = info.
soi();
181 const int iend = ibeg + nSamplesToExamine;
187 else if (maxI >= nSamples - 1
U)
188 maxI = nSamples - 2
U;
198 if (maxA < minA) minA = maxA;
199 if (t2 < minA) minA=
t2;
200 if (minA < 0.
f) { maxA-=minA; t0-=minA; t2-=minA; }
201 float wpksamp = (t0 + maxA +
t2);
202 if (wpksamp) wpksamp = (maxA + 2.f*
t2) / wpksamp;
const Shape & getShape(int shapeType) const
virtual HBHERecHit reconstruct(const HBHEChannelInfo &info, const HcalRecoParam *params, const HcalCalibrations &calibs, bool isRealData) override
float timeshift_ns_hbheho(float wpksamp)
HcalSubdetector subdet() const
get the subdetector
const HcalPulseContainmentCorrection * get(const HcalDetId &detId, int toAdd, float fixedphase_ns)
std::unique_ptr< HcalDeterministicFit > hltOOTpuCorr_
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
float PulseContainmentFractionalError
void phase1Apply(const HBHEChannelInfo &channelData, float &reconstructedEnergy, float &reconstructedTime) const
bool correctForPhaseContainment() const
void setFlagField(uint32_t value, int base, int width=1)
HcalPulseContainmentManager pulseCorr_
float hbminus_special_ecorr(int ieta, int iphi, double energy, int runnum)
Special energy correction for some HB- cells.
void phase1Apply(const HBHEChannelInfo &channelData, float &reconstructedEnergy, float &reconstructedTime, bool &useTriple, float &chi2) const
static const unsigned MAXSAMPLES
bool isSpecial(const float t)
auto const T2 &decltype(t1.eta()) t2
float m0Time(const HBHEChannelInfo &info, double reconstructedCharge, const HcalCalibrations &calibs, int nSamplesToExamine) const
float soiRiseTime() const
SimpleHBHEPhase1Algo(int firstSampleShift, int samplesToAdd, float phaseNS, float timeShift, bool correctForPhaseContainment, std::unique_ptr< PulseShapeFitOOTPileupCorrection > m2, std::unique_ptr< HcalDeterministicFit > detFit)
int ieta() const
get the cell ieta
double energyInWindow(const unsigned begin, const unsigned end) const
double chargeInWindow(const unsigned begin, const unsigned end) const
unsigned int samplesToAdd() const
float hbminusCorrectionFactor(const HcalDetId &cell, float energy, bool isRealData) const
constexpr size_t nSamples
virtual void endRun() override
float correctionPhaseNS() const
int iphi() const
get the cell iphi
HcalPulseShapes theHcalPulseShapes_
double tsEnergy(const unsigned ts) const
double timecorr() const
get time correction factor
correctForPhaseContainment
void beginRun(edm::EventSetup const &es)
float m0Energy(const HBHEChannelInfo &info, double reconstructedCharge, bool applyContainmentCorrection, double phaseNS, int nSamplesToAdd)
static void setAux(const HBHEChannelInfo &info, HBHERecHit *rechit)
void setAuxEnergy(const float en)
void setChiSquared(const float chi2)
unsigned nSamples() const
std::unique_ptr< PulseShapeFitOOTPileupCorrection > psFitOOTpuCorr_
void setRawEnergy(const float en)
unsigned peakEnergyTS(const unsigned begin, const unsigned end) const
static double delay(double fC, BiasSetting bias=Medium)
Returns the amount (ns) by which a pulse of the given number of fC will be delayed by the timeslew ef...