CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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)
 
 HcalSimpleRecAlgo ()
 
void initPulseCorr (int toadd)
 
HBHERecHit reconstruct (const HBHEDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
 
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
 
HBHERecHit reconstructHBHEUpgrade (const HcalUpgradeDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
 
HFRecHit reconstructHFUpgrade (const HcalUpgradeDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
 
void setBXInfo (const BunchXParameter *info, unsigned lenInfo)
 
void setForData (int runnum)
 
void setHBHEPileupCorrection (boost::shared_ptr< AbsOOTPileupCorrection > corr)
 
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
< AbsOOTPileupCorrection
hbhePileupCorr_
 
boost::shared_ptr
< AbsOOTPileupCorrection
hfPileupCorr_
 
boost::shared_ptr
< AbsOOTPileupCorrection
hoPileupCorr_
 
unsigned lenBunchCrossingInfo_
 
float phaseNS_
 
int pileupCleaningID_
 
std::auto_ptr
< HcalPulseContainmentManager
pulseCorr_
 
int runnum_
 
bool setLeakCorrection_
 

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 ( bool  correctForTimeslew,
bool  correctForContainment,
float  fixedPhaseNs 
)

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

Definition at line 15 of file HcalSimpleRecAlgo.cc.

References MaximumFractionalError, and pulseCorr_.

15  :
16  correctForTimeslew_(correctForTimeslew),
17  correctForPulse_(correctForPulse),
18  phaseNS_(phaseNS), runnum_(0), setLeakCorrection_(false)
19 {
20 
21  pulseCorr_ = std::auto_ptr<HcalPulseContainmentManager>(
23  );
24 }
std::auto_ptr< HcalPulseContainmentManager > pulseCorr_
constexpr double MaximumFractionalError
HcalSimpleRecAlgo::HcalSimpleRecAlgo ( )

Simple constructor for PMT-based detectors

Definition at line 27 of file HcalSimpleRecAlgo.cc.

27  :
28  correctForTimeslew_(false), runnum_(0) { }

Member Function Documentation

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

Definition at line 31 of file HcalSimpleRecAlgo.cc.

References pulseCorr_.

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

32 {
33  pulseCorr_->beginRun(es);
34 }
std::auto_ptr< HcalPulseContainmentManager > pulseCorr_
void HcalSimpleRecAlgo::endRun ( void  )

Definition at line 37 of file HcalSimpleRecAlgo.cc.

References pulseCorr_.

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

38 {
39  pulseCorr_->endRun();
40 }
std::auto_ptr< HcalPulseContainmentManager > pulseCorr_
void HcalSimpleRecAlgo::initPulseCorr ( int  toadd)

Definition at line 43 of file HcalSimpleRecAlgo.cc.

43  {
44 }
HBHERecHit HcalSimpleRecAlgo::reconstruct ( const HBHEDataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 348 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, correctForPulse_, correctForTimeslew_, first, hbhePileupCorr_, lenBunchCrossingInfo_, HcalTimeSlew::Medium, phaseNS_, pulseCorr_, runnum_, and setLeakCorrection_.

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

348  {
349  return HcalSimpleRecAlgoImpl::reco<HBHEDataFrame,HBHERecHit>(digi,coder,calibs,
351  pulseCorr_->get(digi.id(), toadd, phaseNS_),
354  hbhePileupCorr_.get(),
356 }
const BunchXParameter * bunchCrossingInfo_
boost::shared_ptr< AbsOOTPileupCorrection > hbhePileupCorr_
unsigned lenBunchCrossingInfo_
std::auto_ptr< HcalPulseContainmentManager > pulseCorr_
bool first
Definition: L1TdeRCT.cc:75
HFRecHit HcalSimpleRecAlgo::reconstruct ( const HFDataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 392 of file HcalSimpleRecAlgo.cc.

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

397 {
398  const HcalPulseContainmentCorrection* corr = pulseCorr_->get(digi.id(), toadd, phaseNS_);
399 
400  double amp_fC, ampl, uncorr_ampl, maxA;
401  int nRead, maxI;
402  bool leakCorrApplied;
403  float t0, t2;
404 
405  HcalSimpleRecAlgoImpl::removePileup(digi, coder, calibs, first, toadd,
406  correctForPulse_, corr, hfPileupCorr_.get(),
408  &maxA, &ampl, &uncorr_ampl, &amp_fC, &nRead,
409  &maxI, &leakCorrApplied, &t0, &t2);
410 
411  float time=-9999.f;
412  if (maxI > 0 && maxI < (nRead - 1))
413  time = HcalSimpleRecAlgoImpl::recoHFTime(digi,maxI,amp_fC,correctForTimeslew_,maxA,t0,t2) -
414  calibs.timecorr();
415 
416  HFRecHit rh(digi.id(),ampl,time);
417  setRawEnergy(rh, static_cast<float>(uncorr_ampl));
418  return rh;
419 }
const BunchXParameter * bunchCrossingInfo_
void setRawEnergy(HcalRecHit &h, float e)
Definition: rawEnergy.h:139
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:18
unsigned lenBunchCrossingInfo_
std::auto_ptr< HcalPulseContainmentManager > pulseCorr_
bool first
Definition: L1TdeRCT.cc:75
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 359 of file HcalSimpleRecAlgo.cc.

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

359  {
360  return HcalSimpleRecAlgoImpl::reco<HODataFrame,HORecHit>(digi,coder,calibs,
362  pulseCorr_->get(digi.id(), toadd, phaseNS_),
364  runnum_, false, hoPileupCorr_.get(),
366 }
const BunchXParameter * bunchCrossingInfo_
boost::shared_ptr< AbsOOTPileupCorrection > hoPileupCorr_
unsigned lenBunchCrossingInfo_
std::auto_ptr< HcalPulseContainmentManager > pulseCorr_
bool first
Definition: L1TdeRCT.cc:75
HcalCalibRecHit HcalSimpleRecAlgo::reconstruct ( const HcalCalibDataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 369 of file HcalSimpleRecAlgo.cc.

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

369  {
370  return HcalSimpleRecAlgoImpl::reco<HcalCalibDataFrame,HcalCalibRecHit>(digi,coder,calibs,
372  pulseCorr_->get(digi.id(), toadd, phaseNS_),
374  runnum_, false, 0,
376 }
const BunchXParameter * bunchCrossingInfo_
unsigned lenBunchCrossingInfo_
std::auto_ptr< HcalPulseContainmentManager > pulseCorr_
bool first
Definition: L1TdeRCT.cc:75
HBHERecHit HcalSimpleRecAlgo::reconstructHBHEUpgrade ( const HcalUpgradeDataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 379 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, correctForPulse_, correctForTimeslew_, first, hbhePileupCorr_, lenBunchCrossingInfo_, HcalTimeSlew::Medium, phaseNS_, pulseCorr_, query::result, and EcalTBTDCReconstructor_cfi::tdcReco.

Referenced by HcalSimpleReconstructor::processUpgrade().

379  {
380  HBHERecHit result = HcalSimpleRecAlgoImpl::reco<HcalUpgradeDataFrame,HBHERecHit>(digi, coder, calibs,
382  pulseCorr_->get(digi.id(), toadd, phaseNS_),
383  HcalTimeSlew::Medium, 0, false,
384  hbhePileupCorr_.get(),
387  tdcReco.reconstruct(digi, result);
388  return result;
389 }
const BunchXParameter * bunchCrossingInfo_
boost::shared_ptr< AbsOOTPileupCorrection > hbhePileupCorr_
unsigned lenBunchCrossingInfo_
tuple result
Definition: query.py:137
std::auto_ptr< HcalPulseContainmentManager > pulseCorr_
bool first
Definition: L1TdeRCT.cc:75
HFRecHit HcalSimpleRecAlgo::reconstructHFUpgrade ( const HcalUpgradeDataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 424 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, corr, correctForPulse_, correctForTimeslew_, hfPileupCorr_, HcalUpgradeDataFrame::id(), lenBunchCrossingInfo_, findQualityFiles::maxI, phaseNS_, pulseCorr_, HcalSimpleRecAlgoImpl::recoHFTime(), HcalSimpleRecAlgoImpl::removePileup(), setRawEnergy(), reco::t2, cond::rpcobgas::time, and HcalCalibrations::timecorr().

Referenced by HcalSimpleReconstructor::processUpgrade().

429 {
430  const HcalPulseContainmentCorrection* corr = pulseCorr_->get(digi.id(), toadd, phaseNS_);
431 
432  double amp_fC, ampl, uncorr_ampl, maxA;
433  int nRead, maxI;
434  bool leakCorrApplied;
435  float t0, t2;
436 
437  HcalSimpleRecAlgoImpl::removePileup(digi, coder, calibs, first, toadd,
438  correctForPulse_, corr, hfPileupCorr_.get(),
440  &maxA, &ampl, &uncorr_ampl, &amp_fC, &nRead,
441  &maxI, &leakCorrApplied, &t0, &t2);
442 
443  float time=-9999.f;
444  if (maxI > 0 && maxI < (nRead - 1))
445  time = HcalSimpleRecAlgoImpl::recoHFTime(digi,maxI,amp_fC,correctForTimeslew_,maxA,t0,t2) -
446  calibs.timecorr();
447 
448  HFRecHit rh(digi.id(),ampl,time); // new RecHit gets second time = 0.
449  setRawEnergy(rh, static_cast<float>(uncorr_ampl));
450  return rh;
451 }
const BunchXParameter * bunchCrossingInfo_
void setRawEnergy(HcalRecHit &h, float e)
Definition: rawEnergy.h:139
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:18
unsigned lenBunchCrossingInfo_
std::auto_ptr< HcalPulseContainmentManager > pulseCorr_
bool first
Definition: L1TdeRCT.cc:75
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_
const HcalDetId & id() const
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 76 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, info(), and lenBunchCrossingInfo_.

78 {
80  lenBunchCrossingInfo_ = lenInfo;
81 }
static const TGPicture * info(bool iBackgroundIsBlack)
const BunchXParameter * bunchCrossingInfo_
unsigned lenBunchCrossingInfo_
void HcalSimpleRecAlgo::setForData ( int  runnum)
void HcalSimpleRecAlgo::setHBHEPileupCorrection ( boost::shared_ptr< AbsOOTPileupCorrection corr)

Definition at line 58 of file HcalSimpleRecAlgo.cc.

References corr, and hbhePileupCorr_.

Referenced by HcalHitReconstructor::HcalHitReconstructor().

60 {
62 }
boost::shared_ptr< AbsOOTPileupCorrection > hbhePileupCorr_
JetCorrectorParameters corr
Definition: classes.h:5
void HcalSimpleRecAlgo::setHFPileupCorrection ( boost::shared_ptr< AbsOOTPileupCorrection corr)

Definition at line 64 of file HcalSimpleRecAlgo.cc.

References corr, and hfPileupCorr_.

Referenced by HcalHitReconstructor::HcalHitReconstructor().

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

Definition at line 70 of file HcalSimpleRecAlgo.cc.

References corr, and hoPileupCorr_.

Referenced by HcalHitReconstructor::HcalHitReconstructor().

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

Definition at line 56 of file HcalSimpleRecAlgo.cc.

References setLeakCorrection_.

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

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

Member Data Documentation

const BunchXParameter* HcalSimpleRecAlgo::bunchCrossingInfo_
private
bool HcalSimpleRecAlgo::correctForPulse_
private
bool HcalSimpleRecAlgo::correctForTimeslew_
private
boost::shared_ptr<AbsOOTPileupCorrection> HcalSimpleRecAlgo::hbhePileupCorr_
private
boost::shared_ptr<AbsOOTPileupCorrection> HcalSimpleRecAlgo::hfPileupCorr_
private

Definition at line 88 of file HcalSimpleRecAlgo.h.

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

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

Definition at line 89 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), and setHOPileupCorrection().

unsigned HcalSimpleRecAlgo::lenBunchCrossingInfo_
private
float HcalSimpleRecAlgo::phaseNS_
private
int HcalSimpleRecAlgo::pileupCleaningID_
private

Definition at line 84 of file HcalSimpleRecAlgo.h.

Referenced by setRecoParams().

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

Definition at line 82 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), and setForData().

bool HcalSimpleRecAlgo::setLeakCorrection_
private

Definition at line 83 of file HcalSimpleRecAlgo.h.

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