CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalSimpleRecAlgo Class Reference

#include <HcalSimpleRecAlgo.h>

Public Member Functions

void beginRun (edm::EventSetup const &es)
 
void endRun ()
 
 HcalSimpleRecAlgo (bool correctForTimeslew, bool correctForContainment, float fixedPhaseNs)
 
void initPulseCorr (int toadd)
 
HFRecHit reconstruct (const HFDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
 
HORecHit reconstruct (const HODataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
 
HcalCalibRecHit reconstruct (const HcalCalibDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
 
HFRecHit reconstructQIE10 (const QIE10DataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
 
void setBXInfo (const BunchXParameter *info, unsigned lenInfo)
 
void setHFPileupCorrection (boost::shared_ptr< AbsOOTPileupCorrection > corr)
 
void setHOPileupCorrection (boost::shared_ptr< AbsOOTPileupCorrection > corr)
 
void setLeakCorrection ()
 
void setRecoParams (bool correctForTimeslew, bool correctForPulse, bool setLeakCorrection, int pileupCleaningID, float phaseNS)
 

Private Attributes

const BunchXParameter * bunchCrossingInfo_
 
bool correctForPulse_
 
bool correctForTimeslew_
 
boost::shared_ptr< AbsOOTPileupCorrectionhbhePileupCorr_
 
const HcalTimeSlewhcalTimeSlew_delay_
 
boost::shared_ptr< AbsOOTPileupCorrectionhfPileupCorr_
 
std::unique_ptr< HcalDeterministicFithltOOTpuCorr_
 
boost::shared_ptr< AbsOOTPileupCorrectionhoPileupCorr_
 
unsigned lenBunchCrossingInfo_
 
std::unique_ptr< PedestalSubpedSubFxn_
 
float phaseNS_
 
int pileupCleaningID_
 
std::unique_ptr< PulseShapeFitOOTPileupCorrectionpsFitOOTpuCorr_
 
int puCorrMethod_
 
std::unique_ptr< HcalPulseContainmentManagerpulseCorr_
 
int runnum_
 
bool setLeakCorrection_
 
HcalPulseShapes theHcalPulseShapes_
 

Detailed Description

This class reconstructs RecHits from Digis for HBHE, HF, and HO by addition of selected time samples, pedestal subtraction, and gain application. The time of the hit is reconstructed using a weighted peak bin calculation supplemented by precise time lookup table. A consumer of this class also has the option of correcting the reconstructed time for energy-dependent time slew associated with the QIE.

Author
J. Mans - Minnesota

Definition at line 40 of file HcalSimpleRecAlgo.h.

Constructor & Destructor Documentation

HcalSimpleRecAlgo::HcalSimpleRecAlgo ( bool  correctForTimeslew,
bool  correctForContainment,
float  fixedPhaseNs 
)

Full featured constructor for HB/HE and HO (HPD-based detectors)

Definition at line 20 of file HcalSimpleRecAlgo.cc.

References hcalTimeSlew_delay_, hltOOTpuCorr_, MaximumFractionalError, pedSubFxn_, and pulseCorr_.

20  :
22  correctForPulse_(correctForPulse),
23  phaseNS_(phaseNS), runnum_(0), setLeakCorrection_(false), puCorrMethod_(0)
24 {
25  hcalTimeSlew_delay_ = nullptr;
26  pulseCorr_ = std::make_unique<HcalPulseContainmentManager>(MaximumFractionalError);
27  pedSubFxn_ = std::make_unique<PedestalSub>();
28  hltOOTpuCorr_ = std::make_unique<HcalDeterministicFit>();
29 }
std::unique_ptr< HcalDeterministicFit > hltOOTpuCorr_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
double MaximumFractionalError
std::unique_ptr< PedestalSub > pedSubFxn_
const HcalTimeSlew * hcalTimeSlew_delay_

Member Function Documentation

void HcalSimpleRecAlgo::beginRun ( edm::EventSetup const &  es)

Definition at line 32 of file HcalSimpleRecAlgo.cc.

References edm::EventSetup::get(), hcalTimeSlew_delay_, and pulseCorr_.

Referenced by HcalSimpleReconstructor::beginRun(), and HcalHitReconstructor::beginRun().

33 {
35  es.get<HcalTimeSlewRecord>().get("HBHE", delay);
36  hcalTimeSlew_delay_ = &*delay;
37 
38  pulseCorr_->beginRun(es);
39 }
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
const HcalTimeSlew * hcalTimeSlew_delay_
void HcalSimpleRecAlgo::endRun ( )

Definition at line 42 of file HcalSimpleRecAlgo.cc.

References pulseCorr_.

Referenced by HcalSimpleReconstructor::endRun(), and HcalHitReconstructor::endRun().

43 {
44  pulseCorr_->endRun();
45 }
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
void HcalSimpleRecAlgo::initPulseCorr ( int  toadd)

Definition at line 48 of file HcalSimpleRecAlgo.cc.

48  {
49 }
HFRecHit HcalSimpleRecAlgo::reconstruct ( const HFDataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 356 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, corr, correctForPulse_, correctForTimeslew_, hfPileupCorr_, HFDataFrame::id(), lenBunchCrossingInfo_, findQualityFiles::maxI, phaseNS_, pulseCorr_, HcalSimpleRecAlgoImpl::recoHFTime(), HcalSimpleRecAlgoImpl::removePileup(), setRawEnergy(), cscNeutronWriter_cfi::t0, reco::t2, ntuplemaker::time, and HcalCalibrations::timecorr().

Referenced by HcalSimpleReconstructor::process(), and HcalHitReconstructor::produce().

361 {
362  const HcalPulseContainmentCorrection* corr = pulseCorr_->get(digi.id(), toadd, phaseNS_);
363 
364  double amp_fC, ampl, uncorr_ampl, maxA;
365  int nRead, maxI;
366  bool leakCorrApplied;
367  float t0, t2;
368 
369  HcalSimpleRecAlgoImpl::removePileup(digi, coder, calibs, first, toadd,
370  correctForPulse_, corr, hfPileupCorr_.get(),
372  &maxA, &ampl, &uncorr_ampl, &amp_fC, &nRead,
373  &maxI, &leakCorrApplied, &t0, &t2);
374 
375  float time=-9999.f;
376  if (maxI > 0 && maxI < (nRead - 1))
377  time = HcalSimpleRecAlgoImpl::recoHFTime(digi,maxI,amp_fC,correctForTimeslew_,maxA,t0,t2) -
378  calibs.timecorr();
379 
380  HFRecHit rh(digi.id(),ampl,time);
381  setRawEnergy(rh, static_cast<float>(uncorr_ampl));
382  return rh;
383 }
const BunchXParameter * bunchCrossingInfo_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
void setRawEnergy(HcalRecHit &h, float e)
Definition: rawEnergy.h:215
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
unsigned lenBunchCrossingInfo_
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)
JetCorrectorParameters corr
Definition: classes.h:5
double timecorr() const
get time correction factor
boost::shared_ptr< AbsOOTPileupCorrection > hfPileupCorr_
float recoHFTime(const Digi &digi, const int maxI, const double amp_fC, const bool slewCorrect, double maxA, float t0, float t2)
const HcalDetId & id() const
Definition: HFDataFrame.h:22
HORecHit HcalSimpleRecAlgo::reconstruct ( const HODataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 332 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, correctForPulse_, correctForTimeslew_, plotBeamSpotDB::first, hcalTimeSlew_delay_, hltOOTpuCorr_, hoPileupCorr_, lenBunchCrossingInfo_, pedSubFxn_, phaseNS_, psFitOOTpuCorr_, puCorrMethod_, pulseCorr_, runnum_, and HcalTimeSlew::Slow.

332  {
333  return HcalSimpleRecAlgoImpl::reco<HODataFrame,HORecHit>(digi,coder,calibs,
335  pulseCorr_->get(digi.id(), toadd, phaseNS_),
337  runnum_, false, hoPileupCorr_.get(),
339  puCorrMethod_, psFitOOTpuCorr_.get(),/*hlt*/hltOOTpuCorr_.get(),pedSubFxn_.get(),
341 }
std::unique_ptr< HcalDeterministicFit > hltOOTpuCorr_
const BunchXParameter * bunchCrossingInfo_
boost::shared_ptr< AbsOOTPileupCorrection > hoPileupCorr_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
unsigned lenBunchCrossingInfo_
std::unique_ptr< PedestalSub > pedSubFxn_
const HcalTimeSlew * hcalTimeSlew_delay_
std::unique_ptr< PulseShapeFitOOTPileupCorrection > psFitOOTpuCorr_
HcalCalibRecHit HcalSimpleRecAlgo::reconstruct ( const HcalCalibDataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 344 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, correctForPulse_, correctForTimeslew_, HcalTimeSlew::Fast, plotBeamSpotDB::first, hcalTimeSlew_delay_, hltOOTpuCorr_, lenBunchCrossingInfo_, pedSubFxn_, phaseNS_, psFitOOTpuCorr_, puCorrMethod_, pulseCorr_, and runnum_.

344  {
345  return HcalSimpleRecAlgoImpl::reco<HcalCalibDataFrame,HcalCalibRecHit>(digi,coder,calibs,
347  pulseCorr_->get(digi.id(), toadd, phaseNS_),
349  runnum_, false, nullptr,
351  puCorrMethod_, psFitOOTpuCorr_.get(),/*hlt*/hltOOTpuCorr_.get(),pedSubFxn_.get(),
353 }
std::unique_ptr< HcalDeterministicFit > hltOOTpuCorr_
const BunchXParameter * bunchCrossingInfo_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
unsigned lenBunchCrossingInfo_
std::unique_ptr< PedestalSub > pedSubFxn_
const HcalTimeSlew * hcalTimeSlew_delay_
std::unique_ptr< PulseShapeFitOOTPileupCorrection > psFitOOTpuCorr_
HFRecHit HcalSimpleRecAlgo::reconstructQIE10 ( const QIE10DataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 385 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, corr, correctForPulse_, correctForTimeslew_, hfPileupCorr_, QIE10DataFrame::id(), lenBunchCrossingInfo_, findQualityFiles::maxI, phaseNS_, pulseCorr_, HcalSimpleRecAlgoImpl::recoHFTime(), HcalSimpleRecAlgoImpl::removePileup(), setRawEnergy(), cscNeutronWriter_cfi::t0, reco::t2, ntuplemaker::time, and HcalCalibrations::timecorr().

390 {
391  const HcalPulseContainmentCorrection* corr = pulseCorr_->get(digi.id(), toadd, phaseNS_);
392 
393  double amp_fC, ampl, uncorr_ampl, maxA;
394  int nRead, maxI;
395  bool leakCorrApplied;
396  float t0, t2;
397 
398  HcalSimpleRecAlgoImpl::removePileup(digi, coder, calibs, first, toadd,
399  correctForPulse_, corr, hfPileupCorr_.get(),
401  &maxA, &ampl, &uncorr_ampl, &amp_fC, &nRead,
402  &maxI, &leakCorrApplied, &t0, &t2);
403 
404  float time=-9999.f;
405  if (maxI > 0 && maxI < (nRead - 1))
406  time = HcalSimpleRecAlgoImpl::recoHFTime(digi,maxI,amp_fC,correctForTimeslew_,maxA,t0,t2) -
407  calibs.timecorr();
408 
409  HFRecHit rh(digi.id(),ampl,time);
410  setRawEnergy(rh, static_cast<float>(uncorr_ampl));
411  return rh;
412 }
edm::DataFrame::id_type id() const
const BunchXParameter * bunchCrossingInfo_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
void setRawEnergy(HcalRecHit &h, float e)
Definition: rawEnergy.h:215
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
unsigned lenBunchCrossingInfo_
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)
JetCorrectorParameters corr
Definition: classes.h:5
double timecorr() const
get time correction factor
boost::shared_ptr< AbsOOTPileupCorrection > hfPileupCorr_
float recoHFTime(const Digi &digi, const int maxI, const double amp_fC, const bool slewCorrect, double maxA, float t0, float t2)
void HcalSimpleRecAlgo::setBXInfo ( const BunchXParameter *  info,
unsigned  lenInfo 
)

Definition at line 73 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, info(), leakCorr(), lenBunchCrossingInfo_, and timeshift_ns_hf().

75 {
77  lenBunchCrossingInfo_ = lenInfo;
78 }
static const TGPicture * info(bool iBackgroundIsBlack)
const BunchXParameter * bunchCrossingInfo_
unsigned lenBunchCrossingInfo_
void HcalSimpleRecAlgo::setHFPileupCorrection ( boost::shared_ptr< AbsOOTPileupCorrection corr)

Definition at line 61 of file HcalSimpleRecAlgo.cc.

References corr, and hfPileupCorr_.

63 {
65 }
JetCorrectorParameters corr
Definition: classes.h:5
boost::shared_ptr< AbsOOTPileupCorrection > hfPileupCorr_
void HcalSimpleRecAlgo::setHOPileupCorrection ( boost::shared_ptr< AbsOOTPileupCorrection corr)

Definition at line 67 of file HcalSimpleRecAlgo.cc.

References corr, and hoPileupCorr_.

69 {
71 }
boost::shared_ptr< AbsOOTPileupCorrection > hoPileupCorr_
JetCorrectorParameters corr
Definition: classes.h:5
void HcalSimpleRecAlgo::setLeakCorrection ( )

Definition at line 59 of file HcalSimpleRecAlgo.cc.

References setLeakCorrection_.

Referenced by HcalHitReconstructor::produce(), and setRecoParams().

59 { setLeakCorrection_ = true;}
void HcalSimpleRecAlgo::setRecoParams ( bool  correctForTimeslew,
bool  correctForPulse,
bool  setLeakCorrection,
int  pileupCleaningID,
float  phaseNS 
)

Member Data Documentation

const BunchXParameter* HcalSimpleRecAlgo::bunchCrossingInfo_
private

Definition at line 80 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), reconstructQIE10(), and setBXInfo().

bool HcalSimpleRecAlgo::correctForPulse_
private

Definition at line 74 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), reconstructQIE10(), and setRecoParams().

bool HcalSimpleRecAlgo::correctForTimeslew_
private

Definition at line 73 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), reconstructQIE10(), and setRecoParams().

boost::shared_ptr<AbsOOTPileupCorrection> HcalSimpleRecAlgo::hbhePileupCorr_
private

Definition at line 82 of file HcalSimpleRecAlgo.h.

const HcalTimeSlew* HcalSimpleRecAlgo::hcalTimeSlew_delay_
private

Definition at line 90 of file HcalSimpleRecAlgo.h.

Referenced by beginRun(), HcalSimpleRecAlgo(), and reconstruct().

boost::shared_ptr<AbsOOTPileupCorrection> HcalSimpleRecAlgo::hfPileupCorr_
private

Definition at line 83 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), reconstructQIE10(), and setHFPileupCorrection().

std::unique_ptr<HcalDeterministicFit> HcalSimpleRecAlgo::hltOOTpuCorr_
private

Definition at line 97 of file HcalSimpleRecAlgo.h.

Referenced by HcalSimpleRecAlgo(), and reconstruct().

boost::shared_ptr<AbsOOTPileupCorrection> HcalSimpleRecAlgo::hoPileupCorr_
private

Definition at line 84 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), and setHOPileupCorrection().

unsigned HcalSimpleRecAlgo::lenBunchCrossingInfo_
private

Definition at line 81 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), reconstructQIE10(), and setBXInfo().

std::unique_ptr<PedestalSub> HcalSimpleRecAlgo::pedSubFxn_
private

Definition at line 94 of file HcalSimpleRecAlgo.h.

Referenced by HcalSimpleRecAlgo(), and reconstruct().

float HcalSimpleRecAlgo::phaseNS_
private

Definition at line 75 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), reconstructQIE10(), and setRecoParams().

int HcalSimpleRecAlgo::pileupCleaningID_
private

Definition at line 79 of file HcalSimpleRecAlgo.h.

Referenced by setRecoParams().

std::unique_ptr<PulseShapeFitOOTPileupCorrection> HcalSimpleRecAlgo::psFitOOTpuCorr_
private

Definition at line 92 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct().

int HcalSimpleRecAlgo::puCorrMethod_
private

Definition at line 88 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct().

std::unique_ptr<HcalPulseContainmentManager> HcalSimpleRecAlgo::pulseCorr_
private
int HcalSimpleRecAlgo::runnum_
private

Definition at line 77 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct().

bool HcalSimpleRecAlgo::setLeakCorrection_
private

Definition at line 78 of file HcalSimpleRecAlgo.h.

Referenced by setLeakCorrection(), and setRecoParams().

HcalPulseShapes HcalSimpleRecAlgo::theHcalPulseShapes_
private

Definition at line 86 of file HcalSimpleRecAlgo.h.