CMS 3D CMS Logo

Public Member Functions | Private Attributes

HcalSimpleRecAlgo Class Reference

#include <HcalSimpleRecAlgo.h>

List of all members.

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_

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.

Date:
2011/01/14 16:18:55
Revision:
1.10
Author:
J. Mans - Minnesota

Definition at line 32 of file HcalSimpleRecAlgo.h.


Constructor & Destructor Documentation

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_.

HcalSimpleRecAlgo::HcalSimpleRecAlgo ( int  firstSample,
int  samplesToAdd 
)

Simple constructor for PMT-based detectors

Definition at line 17 of file HcalSimpleRecAlgo.cc.


Member Function Documentation

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 
)

Member Data Documentation

Definition at line 49 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct().

Definition at line 48 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct(), and resetTimeSamples().

Definition at line 50 of file HcalSimpleRecAlgo.h.

Referenced by HcalSimpleRecAlgo(), and reconstruct().

Definition at line 48 of file HcalSimpleRecAlgo.h.

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