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 setpuCorrMethod (int method)
 
void setpuCorrParams (bool iPedestalConstraint, bool iTimeConstraint, bool iAddPulseJitter, bool iUnConstrainedFit, bool iApplyTimeSlew, double iTS4Min, double iTS4Max, double iPulseJitter, double iTimeMean, double iTimeSig, double iPedMean, double iPedSig, double iNoise, double iTMin, double iTMax, double its3Chi2, double its4Chi2, double its345Chi2, double iChargeThreshold, int iFitTimes)
 
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
< PulseShapeFitOOTPileupCorrection
psFitOOTpuCorr_
 
int puCorrMethod_
 
std::auto_ptr
< HcalPulseContainmentManager
pulseCorr_
 
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 37 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 17 of file HcalSimpleRecAlgo.cc.

References MaximumFractionalError, and pulseCorr_.

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

Simple constructor for PMT-based detectors

Definition at line 29 of file HcalSimpleRecAlgo.cc.

Member Function Documentation

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

Definition at line 35 of file HcalSimpleRecAlgo.cc.

References pulseCorr_.

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

36 {
37  pulseCorr_->beginRun(es);
38 }
std::auto_ptr< HcalPulseContainmentManager > pulseCorr_
void HcalSimpleRecAlgo::endRun ( void  )

Definition at line 41 of file HcalSimpleRecAlgo.cc.

References pulseCorr_.

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

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

Definition at line 47 of file HcalSimpleRecAlgo.cc.

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

Definition at line 396 of file HcalSimpleRecAlgo.cc.

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

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

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

Definition at line 440 of file HcalSimpleRecAlgo.cc.

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

445 {
446  const HcalPulseContainmentCorrection* corr = pulseCorr_->get(digi.id(), toadd, phaseNS_);
447 
448  double amp_fC, ampl, uncorr_ampl, maxA;
449  int nRead, maxI;
450  bool leakCorrApplied;
451  float t0, t2;
452 
453  HcalSimpleRecAlgoImpl::removePileup(digi, coder, calibs, first, toadd,
454  correctForPulse_, corr, hfPileupCorr_.get(),
456  &maxA, &ampl, &uncorr_ampl, &amp_fC, &nRead,
457  &maxI, &leakCorrApplied, &t0, &t2);
458 
459  float time=-9999.f;
460  if (maxI > 0 && maxI < (nRead - 1))
461  time = HcalSimpleRecAlgoImpl::recoHFTime(digi,maxI,amp_fC,correctForTimeslew_,maxA,t0,t2) -
462  calibs.timecorr();
463 
464  HFRecHit rh(digi.id(),ampl,time);
465  setRawEnergy(rh, static_cast<float>(uncorr_ampl));
466  return rh;
467 }
const BunchXParameter * bunchCrossingInfo_
void setRawEnergy(HcalRecHit &h, float e)
Definition: rawEnergy.h:139
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 407 of file HcalSimpleRecAlgo.cc.

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

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

Definition at line 417 of file HcalSimpleRecAlgo.cc.

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

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

Definition at line 427 of file HcalSimpleRecAlgo.cc.

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

Referenced by HcalSimpleReconstructor::processUpgrade().

427  {
428  HBHERecHit result = HcalSimpleRecAlgoImpl::reco<HcalUpgradeDataFrame,HBHERecHit>(digi, coder, calibs,
430  pulseCorr_->get(digi.id(), toadd, phaseNS_),
431  HcalTimeSlew::Medium, 0, false,
432  hbhePileupCorr_.get(),
435  tdcReco.reconstruct(digi, result);
436  return result;
437 }
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
std::auto_ptr< PulseShapeFitOOTPileupCorrection > psFitOOTpuCorr_
HFRecHit HcalSimpleRecAlgo::reconstructHFUpgrade ( const HcalUpgradeDataFrame digi,
int  first,
int  toadd,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 472 of file HcalSimpleRecAlgo.cc.

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

Referenced by HcalSimpleReconstructor::processUpgrade().

477 {
478  const HcalPulseContainmentCorrection* corr = pulseCorr_->get(digi.id(), toadd, phaseNS_);
479 
480  double amp_fC, ampl, uncorr_ampl, maxA;
481  int nRead, maxI;
482  bool leakCorrApplied;
483  float t0, t2;
484 
485  HcalSimpleRecAlgoImpl::removePileup(digi, coder, calibs, first, toadd,
486  correctForPulse_, corr, hfPileupCorr_.get(),
488  &maxA, &ampl, &uncorr_ampl, &amp_fC, &nRead,
489  &maxI, &leakCorrApplied, &t0, &t2);
490 
491  float time=-9999.f;
492  if (maxI > 0 && maxI < (nRead - 1))
493  time = HcalSimpleRecAlgoImpl::recoHFTime(digi,maxI,amp_fC,correctForTimeslew_,maxA,t0,t2) -
494  calibs.timecorr();
495 
496  HFRecHit rh(digi.id(),ampl,time); // new RecHit gets second time = 0.
497  setRawEnergy(rh, static_cast<float>(uncorr_ampl));
498  return rh;
499 }
const BunchXParameter * bunchCrossingInfo_
void setRawEnergy(HcalRecHit &h, float e)
Definition: rawEnergy.h:139
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 103 of file HcalSimpleRecAlgo.cc.

References bunchCrossingInfo_, info(), and lenBunchCrossingInfo_.

105 {
107  lenBunchCrossingInfo_ = lenInfo;
108 }
static const TGPicture * info(bool iBackgroundIsBlack)
const BunchXParameter * bunchCrossingInfo_
unsigned lenBunchCrossingInfo_
void HcalSimpleRecAlgo::setForData ( int  runnum)

Definition at line 72 of file HcalSimpleRecAlgo.cc.

References HcalPulseShapes::getShape(), HPDShapev3DataNum, HPDShapev3MCNum, psFitOOTpuCorr_, puCorrMethod_, summaryLumi::runnum, runnum_, and theHcalPulseShapes_.

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

72  {
73  runnum_ = runnum;
74  if( puCorrMethod_ ==2 ){
75  int shapeNum = HPDShapev3MCNum;
76  if( runnum_ > 0 ){
77  shapeNum = HPDShapev3DataNum;
78  }
79  psFitOOTpuCorr_->setPulseShapeTemplate(theHcalPulseShapes_.getShape(shapeNum));
80  }
81 }
const Shape & getShape(int shapeType) const
HcalPulseShapes theHcalPulseShapes_
int HPDShapev3MCNum
std::auto_ptr< PulseShapeFitOOTPileupCorrection > psFitOOTpuCorr_
int HPDShapev3DataNum
tuple runnum
Definition: summaryLumi.py:210
void HcalSimpleRecAlgo::setHBHEPileupCorrection ( boost::shared_ptr< AbsOOTPileupCorrection corr)

Definition at line 85 of file HcalSimpleRecAlgo.cc.

References corr, and hbhePileupCorr_.

Referenced by HcalHitReconstructor::HcalHitReconstructor().

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

Definition at line 91 of file HcalSimpleRecAlgo.cc.

References corr, and hfPileupCorr_.

Referenced by HcalHitReconstructor::HcalHitReconstructor().

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

Definition at line 97 of file HcalSimpleRecAlgo.cc.

References corr, and hoPileupCorr_.

Referenced by HcalHitReconstructor::HcalHitReconstructor().

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

Definition at line 83 of file HcalSimpleRecAlgo.cc.

References setLeakCorrection_.

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

83 { setLeakCorrection_ = true;}
void HcalSimpleRecAlgo::setpuCorrMethod ( int  method)
inline
void HcalSimpleRecAlgo::setpuCorrParams ( bool  iPedestalConstraint,
bool  iTimeConstraint,
bool  iAddPulseJitter,
bool  iUnConstrainedFit,
bool  iApplyTimeSlew,
double  iTS4Min,
double  iTS4Max,
double  iPulseJitter,
double  iTimeMean,
double  iTimeSig,
double  iPedMean,
double  iPedSig,
double  iNoise,
double  iTMin,
double  iTMax,
double  its3Chi2,
double  its4Chi2,
double  its345Chi2,
double  iChargeThreshold,
int  iFitTimes 
)

Definition at line 58 of file HcalSimpleRecAlgo.cc.

References HcalTimeSlew::Medium, and psFitOOTpuCorr_.

Referenced by HcalHitReconstructor::HcalHitReconstructor().

62  {
63  if( iPedestalConstraint ) assert ( iPedSig );
64  if( iTimeConstraint ) assert( iTimeSig );
65  psFitOOTpuCorr_->setPUParams(iPedestalConstraint,iTimeConstraint,iAddPulseJitter,iUnConstrainedFit,iApplyTimeSlew,
66  iTS4Min, iTS4Max, iPulseJitter,iTimeMean,iTimeSig,iPedMean,iPedSig,iNoise,iTMin,iTMax,its3Chi2,its4Chi2,its345Chi2,
67  iChargeThreshold,HcalTimeSlew::Medium, iFitTimes);
68 // int shapeNum = HPDShapev3MCNum;
69 // psFitOOTpuCorr_->setPulseShapeTemplate(theHcalPulseShapes_.getShape(shapeNum));
70 }
std::auto_ptr< PulseShapeFitOOTPileupCorrection > psFitOOTpuCorr_
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 96 of file HcalSimpleRecAlgo.h.

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

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

Definition at line 97 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), and setHOPileupCorrection().

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

Definition at line 92 of file HcalSimpleRecAlgo.h.

Referenced by setRecoParams().

std::auto_ptr<PulseShapeFitOOTPileupCorrection> HcalSimpleRecAlgo::psFitOOTpuCorr_
private
int HcalSimpleRecAlgo::puCorrMethod_
private
std::auto_ptr<HcalPulseContainmentManager> HcalSimpleRecAlgo::pulseCorr_
private
int HcalSimpleRecAlgo::runnum_
private

Definition at line 90 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), and setForData().

bool HcalSimpleRecAlgo::setLeakCorrection_
private

Definition at line 91 of file HcalSimpleRecAlgo.h.

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

HcalPulseShapes HcalSimpleRecAlgo::theHcalPulseShapes_
private

Definition at line 99 of file HcalSimpleRecAlgo.h.

Referenced by setForData().