27 std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2,
28 std::unique_ptr<HcalDeterministicFit> detFit,
29 std::unique_ptr<MahiFit> mahi)
31 firstSampleShift_(firstSampleShift),
32 samplesToAdd_(samplesToAdd),
34 timeShift_(timeShift),
36 corrFPC_(correctForPhaseContainment),
37 applyLegacyHBMCorrection_(applyLegacyHBMCorrection),
39 hltOOTpuCorr_(
std::
move(detFit)),
71 float m0t = 0.f, m0E = 0.f;
77 const double fc_ampl = info.
chargeInWindow(ibeg, ibeg + nSamplesToAdd);
80 m0E =
m0Energy(info, fc_ampl, applyContainment, phasens, nSamplesToAdd);
82 m0t =
m0Time(info, fc_ampl, calibs, nSamplesToAdd);
86 float m2t = 0.f, m2E = 0.f,
chi2 = -1.f;
87 bool useTriple =
false;
100 float m3t = 0.f, m3E = 0.f;
110 float m4E = 0.f, m4chi2 = -1.f;
112 bool m4UseTriple=
false;
118 mahi->
phase1Apply(info,m4E,m4T,m4UseTriple,m4chi2);
146 rh =
HBHERecHit(channelId, rhE, rht, tdcTime);
155 if (useTriple || m4UseTriple)
163 const bool isRealData)
const 169 const int ieta = cell.
ieta();
170 const int iphi = cell.
iphi();
177 const double fc_ampl,
178 const bool applyContainmentCorrection,
179 const double phaseNs,
180 const int nSamplesToAdd)
189 double corrFactor = 1.0;
190 if (applyContainmentCorrection)
191 corrFactor =
pulseCorr_.
get(info.
id(), nSamplesToAdd, phaseNs)->getCorrection(fc_ampl);
199 const double fc_ampl,
201 const int nSamplesToExamine)
const 203 float time = -9999.f;
208 const int soi = info.
soi();
212 const int iend =
std::min(ibeg + nSamplesToExamine, (
int)nSamples - 1);
218 if(maxI >= nSamples) maxI = nSamples - 1
U;
223 if(maxI < (nSamples - 1U)) emax1 = info.
tsEnergy(maxI + 1U);
227 if(nSamplesToExamine < (
int)
nSamples) position -= soi;
229 time = 25.f * (
float)position;
230 if(emax0 > 0.
f && emax1 > 0.
f) time += 25.f * emax1/(emax0+emax1);
const Shape & getShape(int shapeType) const
HBHERecHit reconstruct(const HBHEChannelInfo &info, const HcalRecoParam *params, const HcalCalibrations &calibs, bool isRealData) override
const HcalTimeSlew * hcalTimeSlew_delay_
constexpr unsigned int samplesToAdd() const
void phase1Apply(const HBHEChannelInfo &channelData, float &reconstructedEnergy, float &reconstructedTime, bool &useTriple, float &chi2) const
HcalSubdetector subdet() const
get the subdetector
const HcalPulseContainmentCorrection * get(const HcalDetId &detId, int toAdd, float fixedphase_ns)
std::unique_ptr< HcalDeterministicFit > hltOOTpuCorr_
void beginRun(const edm::Run &, const edm::EventSetup &) override
float PulseContainmentFractionalError
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
constexpr void setFlagField(uint32_t value, int base, int width=1)
static const unsigned MAXSAMPLES
constexpr float correctionPhaseNS() const
float m0Time(const HBHEChannelInfo &info, double reconstructedCharge, const HcalCalibrations &calibs, int nSamplesToExamine) const
float soiRiseTime() const
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
SimpleHBHEPhase1Algo(int firstSampleShift, int samplesToAdd, float phaseNS, float timeShift, bool correctForPhaseContainment, bool applyLegacyHBMCorrection, std::unique_ptr< PulseShapeFitOOTPileupCorrection > m2, std::unique_ptr< HcalDeterministicFit > detFit, std::unique_ptr< MahiFit > mahi)
constexpr bool isSpecial(const float t)
float hbminusCorrectionFactor(const HcalDetId &cell, float energy, bool isRealData) const
bool applyLegacyHBMCorrection_
constexpr size_t nSamples
std::unique_ptr< MahiFit > mahiOOTpuCorr_
int iphi() const
get the cell iphi
constexpr bool correctForPhaseContainment() const
HcalPulseShapes theHcalPulseShapes_
double tsEnergy(const unsigned ts) const
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)
static int position[264][3]
void setChiSquared(const float chi2)
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...
unsigned nSamples() const
std::unique_ptr< PulseShapeFitOOTPileupCorrection > psFitOOTpuCorr_
void setRawEnergy(const float en)
unsigned peakEnergyTS(const unsigned begin, const unsigned end) const
void phase1Apply(const HBHEChannelInfo &channelData, float &reconstructedEnergy, float &reconstructedTime, const HcalTimeSlew *hcalTimeSlew_delay) const