CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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, edm::ConsumesCollector iC)
 
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 (std::shared_ptr< AbsOOTPileupCorrection > corr)
 
void setHOPileupCorrection (std::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_
 
const edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecorddelayToken_
 
std::shared_ptr< AbsOOTPileupCorrectionhbhePileupCorr_
 
const HcalTimeSlewhcalTimeSlew_delay_
 
std::shared_ptr< AbsOOTPileupCorrectionhfPileupCorr_
 
std::shared_ptr< AbsOOTPileupCorrectionhoPileupCorr_
 
unsigned lenBunchCrossingInfo_
 
float phaseNS_
 
int pileupCleaningID_
 
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 34 of file HcalSimpleRecAlgo.h.

Constructor & Destructor Documentation

◆ HcalSimpleRecAlgo()

HcalSimpleRecAlgo::HcalSimpleRecAlgo ( bool  correctForTimeslew,
bool  correctForContainment,
float  fixedPhaseNs,
edm::ConsumesCollector  iC 
)

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

Definition at line 20 of file HcalSimpleRecAlgo.cc.

References hcalTimeSlew_delay_, MaximumFractionalError, and pulseCorr_.

25  correctForPulse_(correctForPulse),
26  phaseNS_(phaseNS),
28  runnum_(0),
29  setLeakCorrection_(false),
30  puCorrMethod_(0) {
31  hcalTimeSlew_delay_ = nullptr;
32  pulseCorr_ = std::make_unique<HcalPulseContainmentManager>(MaximumFractionalError, false, iC);
33 }
const edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecord > delayToken_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
constexpr double MaximumFractionalError
const HcalTimeSlew * hcalTimeSlew_delay_

Member Function Documentation

◆ beginRun()

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

Definition at line 35 of file HcalSimpleRecAlgo.cc.

References delayToken_, edm::EventSetup::getData(), hcalTimeSlew_delay_, and pulseCorr_.

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

35  {
36  hcalTimeSlew_delay_ = &es.getData(delayToken_);
37 
38  pulseCorr_->beginRun(es);
39 }
const edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecord > delayToken_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
const HcalTimeSlew * hcalTimeSlew_delay_

◆ endRun()

void HcalSimpleRecAlgo::endRun ( )

Definition at line 41 of file HcalSimpleRecAlgo.cc.

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

41 {}

◆ initPulseCorr()

void HcalSimpleRecAlgo::initPulseCorr ( int  toadd)

Definition at line 43 of file HcalSimpleRecAlgo.cc.

43 {}

◆ reconstruct() [1/3]

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

Definition at line 380 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, alignCSCRings::corr, correctForPulse_, correctForTimeslew_, dqmdumpme::first, hfPileupCorr_, HFDataFrame::id(), lenBunchCrossingInfo_, findQualityFiles::maxI, phaseNS_, pulseCorr_, HcalSimpleRecAlgoImpl::recoHFTime(), HcalSimpleRecAlgoImpl::removePileup(), setRawEnergy(), FrontierCondition_GT_autoExpress_cfi::t0, RandomServiceHelper::t2, hcalRecHitTable_cff::time, and HcalCalibrations::timecorr().

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

384  {
385  const HcalPulseContainmentCorrection* corr = pulseCorr_->get(digi.id(), toadd, phaseNS_);
386 
387  double amp_fC, ampl, uncorr_ampl, maxA;
388  int nRead, maxI;
389  bool leakCorrApplied;
390  float t0, t2;
391 
393  coder,
394  calibs,
395  first,
396  toadd,
398  corr,
399  hfPileupCorr_.get(),
402  &maxA,
403  &ampl,
404  &uncorr_ampl,
405  &amp_fC,
406  &nRead,
407  &maxI,
408  &leakCorrApplied,
409  &t0,
410  &t2);
411 
412  float time = -9999.f;
413  if (maxI > 0 && maxI < (nRead - 1))
414  time = HcalSimpleRecAlgoImpl::recoHFTime(digi, maxI, amp_fC, correctForTimeslew_, maxA, t0, t2) - calibs.timecorr();
415 
416  HFRecHit rh(digi.id(), ampl, time);
417  setRawEnergy(rh, static_cast<float>(uncorr_ampl));
418  return rh;
419 }
constexpr HcalDetId const & id() const
Definition: HFDataFrame.h:23
const BunchXParameter * bunchCrossingInfo_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
constexpr double timecorr() const
get time correction factor
void setRawEnergy(HcalRecHit &h, float e)
Definition: rawEnergy.h:217
dictionary corr
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)
std::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)

◆ reconstruct() [2/3]

HORecHit HcalSimpleRecAlgo::reconstruct ( const HODataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 337 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, correctForPulse_, correctForTimeslew_, dqmdumpme::first, hcalTimeSlew_delay_, hoPileupCorr_, lenBunchCrossingInfo_, phaseNS_, puCorrMethod_, pulseCorr_, runnum_, and HcalTimeSlew::Slow.

338  {
339  return HcalSimpleRecAlgoImpl::reco<HODataFrame, HORecHit>(digi,
340  coder,
341  calibs,
342  first,
343  toadd,
346  pulseCorr_->get(digi.id(), toadd, phaseNS_),
348  runnum_,
349  false,
350  hoPileupCorr_.get(),
355 }
const BunchXParameter * bunchCrossingInfo_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
unsigned lenBunchCrossingInfo_
const HcalTimeSlew * hcalTimeSlew_delay_
std::shared_ptr< AbsOOTPileupCorrection > hoPileupCorr_

◆ reconstruct() [3/3]

HcalCalibRecHit HcalSimpleRecAlgo::reconstruct ( const HcalCalibDataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 357 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, correctForPulse_, correctForTimeslew_, HcalTimeSlew::Fast, dqmdumpme::first, hcalTimeSlew_delay_, lenBunchCrossingInfo_, phaseNS_, puCorrMethod_, pulseCorr_, and runnum_.

361  {
362  return HcalSimpleRecAlgoImpl::reco<HcalCalibDataFrame, HcalCalibRecHit>(digi,
363  coder,
364  calibs,
365  first,
366  toadd,
369  pulseCorr_->get(digi.id(), toadd, phaseNS_),
371  runnum_,
372  false,
373  nullptr,
378 }
const BunchXParameter * bunchCrossingInfo_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
unsigned lenBunchCrossingInfo_
const HcalTimeSlew * hcalTimeSlew_delay_

◆ reconstructQIE10()

HFRecHit HcalSimpleRecAlgo::reconstructQIE10 ( const QIE10DataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 421 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, alignCSCRings::corr, correctForPulse_, correctForTimeslew_, dqmdumpme::first, hfPileupCorr_, QIE10DataFrame::id(), lenBunchCrossingInfo_, findQualityFiles::maxI, phaseNS_, pulseCorr_, HcalSimpleRecAlgoImpl::recoHFTime(), HcalSimpleRecAlgoImpl::removePileup(), setRawEnergy(), FrontierCondition_GT_autoExpress_cfi::t0, RandomServiceHelper::t2, hcalRecHitTable_cff::time, and HcalCalibrations::timecorr().

425  {
426  const HcalPulseContainmentCorrection* corr = pulseCorr_->get(digi.id(), toadd, phaseNS_);
427 
428  double amp_fC, ampl, uncorr_ampl, maxA;
429  int nRead, maxI;
430  bool leakCorrApplied;
431  float t0, t2;
432 
434  coder,
435  calibs,
436  first,
437  toadd,
439  corr,
440  hfPileupCorr_.get(),
443  &maxA,
444  &ampl,
445  &uncorr_ampl,
446  &amp_fC,
447  &nRead,
448  &maxI,
449  &leakCorrApplied,
450  &t0,
451  &t2);
452 
453  float time = -9999.f;
454  if (maxI > 0 && maxI < (nRead - 1))
455  time = HcalSimpleRecAlgoImpl::recoHFTime(digi, maxI, amp_fC, correctForTimeslew_, maxA, t0, t2) - calibs.timecorr();
456 
457  HFRecHit rh(digi.id(), ampl, time);
458  setRawEnergy(rh, static_cast<float>(uncorr_ampl));
459  return rh;
460 }
constexpr edm::DataFrame::id_type id() const
const BunchXParameter * bunchCrossingInfo_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
constexpr double timecorr() const
get time correction factor
void setRawEnergy(HcalRecHit &h, float e)
Definition: rawEnergy.h:217
dictionary corr
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)
std::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)

◆ setBXInfo()

void HcalSimpleRecAlgo::setBXInfo ( const BunchXParameter *  info,
unsigned  lenInfo 
)

Definition at line 60 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, info(), and lenBunchCrossingInfo_.

60  {
62  lenBunchCrossingInfo_ = lenInfo;
63 }
static const TGPicture * info(bool iBackgroundIsBlack)
const BunchXParameter * bunchCrossingInfo_
unsigned lenBunchCrossingInfo_

◆ setHFPileupCorrection()

void HcalSimpleRecAlgo::setHFPileupCorrection ( std::shared_ptr< AbsOOTPileupCorrection corr)

Definition at line 56 of file HcalSimpleRecAlgo.cc.

References alignCSCRings::corr, and hfPileupCorr_.

56 { hfPileupCorr_ = corr; }
dictionary corr
std::shared_ptr< AbsOOTPileupCorrection > hfPileupCorr_

◆ setHOPileupCorrection()

void HcalSimpleRecAlgo::setHOPileupCorrection ( std::shared_ptr< AbsOOTPileupCorrection corr)

Definition at line 58 of file HcalSimpleRecAlgo.cc.

References alignCSCRings::corr, and hoPileupCorr_.

58 { hoPileupCorr_ = corr; }
dictionary corr
std::shared_ptr< AbsOOTPileupCorrection > hoPileupCorr_

◆ setLeakCorrection()

void HcalSimpleRecAlgo::setLeakCorrection ( )

Definition at line 54 of file HcalSimpleRecAlgo.cc.

References setLeakCorrection_.

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

54 { setLeakCorrection_ = true; }

◆ setRecoParams()

void HcalSimpleRecAlgo::setRecoParams ( bool  correctForTimeslew,
bool  correctForPulse,
bool  setLeakCorrection,
int  pileupCleaningID,
float  phaseNS 
)

Member Data Documentation

◆ bunchCrossingInfo_

const BunchXParameter* HcalSimpleRecAlgo::bunchCrossingInfo_
private

Definition at line 81 of file HcalSimpleRecAlgo.h.

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

◆ correctForPulse_

bool HcalSimpleRecAlgo::correctForPulse_
private

Definition at line 74 of file HcalSimpleRecAlgo.h.

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

◆ correctForTimeslew_

bool HcalSimpleRecAlgo::correctForTimeslew_
private

Definition at line 73 of file HcalSimpleRecAlgo.h.

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

◆ delayToken_

const edm::ESGetToken<HcalTimeSlew, HcalTimeSlewRecord> HcalSimpleRecAlgo::delayToken_
private

Definition at line 76 of file HcalSimpleRecAlgo.h.

Referenced by beginRun().

◆ hbhePileupCorr_

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

Definition at line 83 of file HcalSimpleRecAlgo.h.

◆ hcalTimeSlew_delay_

const HcalTimeSlew* HcalSimpleRecAlgo::hcalTimeSlew_delay_
private

Definition at line 91 of file HcalSimpleRecAlgo.h.

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

◆ hfPileupCorr_

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

Definition at line 84 of file HcalSimpleRecAlgo.h.

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

◆ hoPileupCorr_

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

Definition at line 85 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), and setHOPileupCorrection().

◆ lenBunchCrossingInfo_

unsigned HcalSimpleRecAlgo::lenBunchCrossingInfo_
private

Definition at line 82 of file HcalSimpleRecAlgo.h.

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

◆ phaseNS_

float HcalSimpleRecAlgo::phaseNS_
private

Definition at line 75 of file HcalSimpleRecAlgo.h.

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

◆ pileupCleaningID_

int HcalSimpleRecAlgo::pileupCleaningID_
private

Definition at line 80 of file HcalSimpleRecAlgo.h.

Referenced by setRecoParams().

◆ puCorrMethod_

int HcalSimpleRecAlgo::puCorrMethod_
private

Definition at line 89 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct().

◆ pulseCorr_

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

Definition at line 77 of file HcalSimpleRecAlgo.h.

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

◆ runnum_

int HcalSimpleRecAlgo::runnum_
private

Definition at line 78 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct().

◆ setLeakCorrection_

bool HcalSimpleRecAlgo::setLeakCorrection_
private

Definition at line 79 of file HcalSimpleRecAlgo.h.

Referenced by setLeakCorrection(), and setRecoParams().

◆ theHcalPulseShapes_

HcalPulseShapes HcalSimpleRecAlgo::theHcalPulseShapes_
private

Definition at line 87 of file HcalSimpleRecAlgo.h.