CMS 3D CMS Logo

HcalSimpleRecAlgo Class Reference

This class reconstructs RecHits from Digis for HBHE, HF, and HO by addition of selected time samples, pedestal subtraction, and gain application. More...

#include <RecoLocalCalo/HcalRecAlgos/interface/HcalSimpleRecAlgo.h>

List of all members.

Public Member Functions

 HcalSimpleRecAlgo (int firstSample, int samplesToAdd)
 Simple constructor for PMT-based detectors.
 HcalSimpleRecAlgo (int firstSample, int samplesToAdd, bool correctForTimeslew, bool correctForContainment, float fixedPhaseNs)
 Full featured constructor for HB/HE and HO (HPD-based detectors).
HcalCalibRecHit reconstruct (const HcalCalibDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calibs) const
ZDCRecHit reconstruct (const ZDCDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calibs) const
HORecHit reconstruct (const HODataFrame &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

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
2006/11/08 17:02:07
Revision
1.7
Author:
J. Mans - Minnesota

Definition at line 31 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_.

00009                                                                                                                                     : 
00010   firstSample_(firstSample), 
00011   samplesToAdd_(samplesToAdd), 
00012   correctForTimeslew_(correctForTimeslew) {
00013   if (correctForPulse) 
00014     pulseCorr_=std::auto_ptr<HcalPulseContainmentCorrection>(new HcalPulseContainmentCorrection(samplesToAdd_,phaseNS,MaximumFractionalError));
00015 }

HcalSimpleRecAlgo::HcalSimpleRecAlgo ( int  firstSample,
int  samplesToAdd 
)

Simple constructor for PMT-based detectors.

Definition at line 17 of file HcalSimpleRecAlgo.cc.

00017                                                                       : 
00018   firstSample_(firstSample), 
00019   samplesToAdd_(samplesToAdd), 
00020   correctForTimeslew_(false) {
00021 }


Member Function Documentation

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

Definition at line 108 of file HcalSimpleRecAlgo.cc.

References correctForTimeslew_, HcalTimeSlew::Fast, firstSample_, pulseCorr_, and samplesToAdd_.

00108                                                                                                                                            {
00109   return HcalSimpleRecAlgoImpl::reco<HcalCalibDataFrame,HcalCalibRecHit>(digi,coder,calibs,
00110                                                                          firstSample_,samplesToAdd_,correctForTimeslew_,
00111                                                                          pulseCorr_.get(),
00112                                                                          HcalTimeSlew::Fast);
00113 }

ZDCRecHit HcalSimpleRecAlgo::reconstruct ( const ZDCDataFrame digi,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 101 of file HcalSimpleRecAlgo.cc.

References HcalTimeSlew::Fast, firstSample_, and samplesToAdd_.

00101                                                                                                                                {
00102   return HcalSimpleRecAlgoImpl::reco<ZDCDataFrame,ZDCRecHit>(digi,coder,calibs,
00103                                                              firstSample_,samplesToAdd_,false,
00104                                                              0,
00105                                                              HcalTimeSlew::Fast);
00106 }

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

Definition at line 94 of file HcalSimpleRecAlgo.cc.

References correctForTimeslew_, firstSample_, pulseCorr_, samplesToAdd_, and HcalTimeSlew::Slow.

00094                                                                                                                              {
00095   return HcalSimpleRecAlgoImpl::reco<HODataFrame,HORecHit>(digi,coder,calibs,
00096                                                            firstSample_,samplesToAdd_,correctForTimeslew_,
00097                                                            pulseCorr_.get(),
00098                                                            HcalTimeSlew::Slow);
00099 }

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

Definition at line 115 of file HcalSimpleRecAlgo.cc.

References HcalCoder::adc2fC(), lat::endl(), firstSample_, i, HFDataFrame::id(), LogDebug, HcalCalibrations::pedestal(), HFDataFrame::presamples(), HcalCalibrations::respcorrgain(), samplesToAdd_, CaloSamples::size(), and timeshift_ns_hf().

00115                                                                                                                              {
00116   CaloSamples tool;
00117   coder.adc2fC(digi,tool);
00118   
00119   double ampl=0; int maxI = -1; double maxA = -1e10; float ta=0;
00120   for (int i=firstSample_; i<tool.size() && i<samplesToAdd_+firstSample_; i++) {
00121     int capid=digi[i].capid();
00122     ta = (tool[i]-calibs.pedestal(capid))*calibs.respcorrgain(capid);
00123     ampl+=ta;
00124     if(ta>maxA){
00125       maxA=ta;
00126       maxI=i;
00127     }
00128   }
00129 
00130   float time=-9999.0;
00132   if(maxI==0 || maxI==(tool.size()-1)) {
00133       LogDebug("HCAL Pulse") << "HcalSimpleRecAlgo::reconstruct :" 
00134                                                << " Invalid max amplitude position, " 
00135                                                << " max Amplitude: "<< maxI
00136                                                << " first: "<<firstSample_
00137                                                << " last: "<<(tool.size()-1)
00138                                                << std::endl;
00139   } else {
00140     maxA=fabs(maxA);  
00141     int capid=digi[maxI-1].capid();
00142     float t0 = fabs((tool[maxI-1]-calibs.pedestal(capid))*calibs.respcorrgain(capid) );
00143     capid=digi[maxI+1].capid();
00144     float t2 = fabs((tool[maxI+1]-calibs.pedestal(capid))*calibs.respcorrgain(capid) );    
00145     float wpksamp = (t0 + maxA + t2);
00146     if (wpksamp!=0) wpksamp=(maxA + 2.0*t2) / wpksamp; 
00147     time = (maxI - digi.presamples())*25.0 + timeshift_ns_hf(wpksamp);
00148   }
00149 
00150   return HFRecHit(digi.id(),ampl,time); 
00151 }

HBHERecHit HcalSimpleRecAlgo::reconstruct ( const HBHEDataFrame digi,
const HcalCoder coder,
const HcalCalibrations calibs 
) const

Definition at line 87 of file HcalSimpleRecAlgo.cc.

References correctForTimeslew_, firstSample_, HcalTimeSlew::Medium, pulseCorr_, and samplesToAdd_.

Referenced by HcalSimpleReconstructor::produce().

00087                                                                                                                                  {
00088   return HcalSimpleRecAlgoImpl::reco<HBHEDataFrame,HBHERecHit>(digi,coder,calibs,
00089                                                                firstSample_,samplesToAdd_,correctForTimeslew_,
00090                                                                pulseCorr_.get(),
00091                                                                HcalTimeSlew::Medium);
00092 }


Member Data Documentation

bool HcalSimpleRecAlgo::correctForTimeslew_ [private]

Definition at line 46 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct().

int HcalSimpleRecAlgo::firstSample_ [private]

Definition at line 45 of file HcalSimpleRecAlgo.h.

Referenced by reconstruct().

std::auto_ptr<HcalPulseContainmentCorrection> HcalSimpleRecAlgo::pulseCorr_ [private]

Definition at line 47 of file HcalSimpleRecAlgo.h.

Referenced by HcalSimpleRecAlgo(), and reconstruct().

int HcalSimpleRecAlgo::samplesToAdd_ [private]

Definition at line 45 of file HcalSimpleRecAlgo.h.

Referenced by HcalSimpleRecAlgo(), and reconstruct().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:56 2009 for CMSSW by  doxygen 1.5.4