#include <HcalSimpleRecAlgo.h>
Public Member Functions | |
HcalSimpleRecAlgo (int firstSample, int samplesToAdd, bool correctForTimeslew, bool correctForContainment, float fixedPhaseNs) | |
HcalSimpleRecAlgo (int firstSample, int samplesToAdd) | |
HcalCalibRecHit | reconstruct (const HcalCalibDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calibs) const |
HFRecHit | reconstruct (const HFDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calibs) const |
HBHERecHit | reconstruct (const HBHEDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calibs) const |
HORecHit | reconstruct (const HODataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calibs) const |
void | resetTimeSamples (int firstSample, int samplesToAdd) |
Private Attributes | |
bool | correctForTimeslew_ |
int | firstSample_ |
std::auto_ptr < HcalPulseContainmentCorrection > | pulseCorr_ |
int | samplesToAdd_ |
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.
Definition at line 32 of file HcalSimpleRecAlgo.h.
HcalSimpleRecAlgo::HcalSimpleRecAlgo | ( | int | firstSample, |
int | samplesToAdd, | ||
bool | correctForTimeslew, | ||
bool | correctForContainment, | ||
float | fixedPhaseNs | ||
) |
Full featured constructor for HB/HE and HO (HPD-based detectors)
Definition at line 9 of file HcalSimpleRecAlgo.cc.
References MaximumFractionalError, pulseCorr_, and samplesToAdd_.
: firstSample_(firstSample), samplesToAdd_(samplesToAdd), correctForTimeslew_(correctForTimeslew) { if (correctForPulse) pulseCorr_=std::auto_ptr<HcalPulseContainmentCorrection>(new HcalPulseContainmentCorrection(samplesToAdd_,phaseNS,MaximumFractionalError)); }
HcalSimpleRecAlgo::HcalSimpleRecAlgo | ( | int | firstSample, |
int | samplesToAdd | ||
) |
Simple constructor for PMT-based detectors
Definition at line 17 of file HcalSimpleRecAlgo.cc.
: firstSample_(firstSample), samplesToAdd_(samplesToAdd), correctForTimeslew_(false) { }
HBHERecHit HcalSimpleRecAlgo::reconstruct | ( | const HBHEDataFrame & | digi, |
const HcalCoder & | coder, | ||
const HcalCalibrations & | calibs | ||
) | const |
Definition at line 102 of file HcalSimpleRecAlgo.cc.
References correctForTimeslew_, firstSample_, HcalTimeSlew::Medium, pulseCorr_, and samplesToAdd_.
Referenced by HcalSimpleReconstructor::produce(), and HcalHitReconstructor::produce().
{ return HcalSimpleRecAlgoImpl::reco<HBHEDataFrame,HBHERecHit>(digi,coder,calibs, firstSample_,samplesToAdd_,correctForTimeslew_, pulseCorr_.get(), HcalTimeSlew::Medium); }
HcalCalibRecHit HcalSimpleRecAlgo::reconstruct | ( | const HcalCalibDataFrame & | digi, |
const HcalCoder & | coder, | ||
const HcalCalibrations & | calibs | ||
) | const |
Definition at line 116 of file HcalSimpleRecAlgo.cc.
References correctForTimeslew_, HcalTimeSlew::Fast, firstSample_, pulseCorr_, and samplesToAdd_.
{ return HcalSimpleRecAlgoImpl::reco<HcalCalibDataFrame,HcalCalibRecHit>(digi,coder,calibs, firstSample_,samplesToAdd_,correctForTimeslew_, pulseCorr_.get(), HcalTimeSlew::Fast); }
HORecHit HcalSimpleRecAlgo::reconstruct | ( | const HODataFrame & | digi, |
const HcalCoder & | coder, | ||
const HcalCalibrations & | calibs | ||
) | const |
Definition at line 109 of file HcalSimpleRecAlgo.cc.
References correctForTimeslew_, firstSample_, pulseCorr_, samplesToAdd_, and HcalTimeSlew::Slow.
{ return HcalSimpleRecAlgoImpl::reco<HODataFrame,HORecHit>(digi,coder,calibs, firstSample_,samplesToAdd_,correctForTimeslew_, pulseCorr_.get(), HcalTimeSlew::Slow); }
HFRecHit HcalSimpleRecAlgo::reconstruct | ( | const HFDataFrame & | digi, |
const HcalCoder & | coder, | ||
const HcalCalibrations & | calibs | ||
) | const |
Definition at line 123 of file HcalSimpleRecAlgo.cc.
References HcalCoder::adc2fC(), correctForTimeslew_, ExpressReco_HICollisions_FallBack::e, funct::exp(), f, firstSample_, i, HFDataFrame::id(), LogDebug, findQualityFiles::maxI, min, HcalCalibrations::pedestal(), HFDataFrame::presamples(), HcalCalibrations::respcorrgain(), samplesToAdd_, CaloSamples::size(), cond::rpcobgas::time, HcalCalibrations::timecorr(), and timeshift_ns_hf().
{ CaloSamples tool; coder.adc2fC(digi,tool); double ampl=0; int maxI = -1; double maxA = -1e10; float ta=0; float amp_fC=0; for (int i=firstSample_; i<tool.size() && i<samplesToAdd_+firstSample_; i++) { int capid=digi[i].capid(); ta = (tool[i]-calibs.pedestal(capid))*calibs.respcorrgain(capid); ampl+=ta; amp_fC += tool[i]-calibs.pedestal(capid); if(ta>maxA){ maxA=ta; maxI=i; } } float time=-9999.0; if(maxI==0 || maxI==(tool.size()-1)) { LogDebug("HCAL Pulse") << "HcalSimpleRecAlgo::reconstruct :" << " Invalid max amplitude position, " << " max Amplitude: "<< maxI << " first: "<<firstSample_ << " last: "<<(tool.size()-1) << std::endl; } else { int capid=digi[maxI-1].capid(); float t0 = (tool[maxI-1]-calibs.pedestal(capid))*calibs.respcorrgain(capid); capid=digi[maxI+1].capid(); float t2 = (tool[maxI+1]-calibs.pedestal(capid))*calibs.respcorrgain(capid); // Handle negative excursions by moving "zero": float zerocorr=std::min(t0,t2); if (zerocorr<0.f) { t0 -= zerocorr; t2 -= zerocorr; maxA -= zerocorr; } // pair the peak with the larger of the two neighboring time samples float wpksamp=0.f; if (t0>t2) { wpksamp = t0+maxA; if (wpksamp != 0.f) wpksamp = maxA/wpksamp; } else { wpksamp = maxA+t2; if (wpksamp != 0.f) wpksamp = 1.+(t2/wpksamp); } time = (maxI - digi.presamples())*25.0 + timeshift_ns_hf(wpksamp); if (correctForTimeslew_ && (amp_fC>0)) { // -5.12327 - put in calibs.timecorr() double tslew=exp(0.337681-5.94689e-4*amp_fC)+exp(2.44628-1.34888e-2*amp_fC); time -= (float)tslew; } time=time-calibs.timecorr(); } return HFRecHit(digi.id(),ampl,time); }
void HcalSimpleRecAlgo::resetTimeSamples | ( | int | firstSample, |
int | samplesToAdd | ||
) |
Definition at line 24 of file HcalSimpleRecAlgo.cc.
References ExpressReco_HICollisions_FallBack::firstSample, firstSample_, ExpressReco_HICollisions_FallBack::samplesToAdd, and samplesToAdd_.
Referenced by HcalHitReconstructor::produce().
{ firstSample_ = firstSample; samplesToAdd_ = samplesToAdd; }
bool HcalSimpleRecAlgo::correctForTimeslew_ [private] |
Definition at line 49 of file HcalSimpleRecAlgo.h.
Referenced by reconstruct().
int HcalSimpleRecAlgo::firstSample_ [private] |
Definition at line 48 of file HcalSimpleRecAlgo.h.
Referenced by reconstruct(), and resetTimeSamples().
std::auto_ptr<HcalPulseContainmentCorrection> HcalSimpleRecAlgo::pulseCorr_ [private] |
Definition at line 50 of file HcalSimpleRecAlgo.h.
Referenced by HcalSimpleRecAlgo(), and reconstruct().
int HcalSimpleRecAlgo::samplesToAdd_ [private] |
Definition at line 48 of file HcalSimpleRecAlgo.h.
Referenced by HcalSimpleRecAlgo(), reconstruct(), and resetTimeSamples().