CMS 3D CMS Logo

Public Member Functions | Private Attributes

EcalUncalibRecHitLeadingEdgeAlgo< C > Class Template Reference

#include <EcalUncalibRecHitLeadingEdgeAlgo.h>

Inheritance diagram for EcalUncalibRecHitLeadingEdgeAlgo< C >:
EcalUncalibRecHitRecAbsAlgo< C >

List of all members.

Public Member Functions

 EcalUncalibRecHitLeadingEdgeAlgo ()
int getLeadingEdgeSample ()
std::vector< double > & getPulseShape ()
virtual EcalUncalibratedRecHit makeRecHit (const C &dataFrame, const double *pedestals, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalWeightSet::EcalChi2WeightMatrix **chi2Matrix)
 Compute parameters.
double saturationCorrection (int unsaturatedSample)
void setLeadingEdgeSample (int isample)
void setPulseShape (std::vector< double > &shape)
virtual ~EcalUncalibRecHitLeadingEdgeAlgo ()

Private Attributes

int leadingSample_
std::vector< double > shape_

Detailed Description

template<class C>
class EcalUncalibRecHitLeadingEdgeAlgo< C >

Template used to compute amplitude using the leading edge sample

$Id: EcalUncalibRecHitLeadingEdgeAlgo.h $Date: $Revision:

Author:
F. Ferri, M. Malberti

Definition at line 22 of file EcalUncalibRecHitLeadingEdgeAlgo.h.


Constructor & Destructor Documentation

Definition at line 25 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

: leadingSample_(0), shape_(0) { };
template<class C>
virtual EcalUncalibRecHitLeadingEdgeAlgo< C >::~EcalUncalibRecHitLeadingEdgeAlgo ( ) [inline, virtual]

Definition at line 26 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

{ };

Member Function Documentation

template<class C>
int EcalUncalibRecHitLeadingEdgeAlgo< C >::getLeadingEdgeSample ( ) [inline]

Definition at line 29 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

{ return leadingSample_; }
template<class C>
std::vector<double>& EcalUncalibRecHitLeadingEdgeAlgo< C >::getPulseShape ( ) [inline]

Definition at line 32 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

{ return shape_; }
template<class C>
virtual EcalUncalibratedRecHit EcalUncalibRecHitLeadingEdgeAlgo< C >::makeRecHit ( const C &  dataFrame,
const double *  pedestals,
const double *  gainRatios,
const EcalWeightSet::EcalWeightMatrix **  weights,
const EcalWeightSet::EcalChi2WeightMatrix **  chi2Matrix 
) [inline, virtual]

Compute parameters.

Implements EcalUncalibRecHitRecAbsAlgo< C >.

Definition at line 35 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

Referenced by EcalUncalibRecHitWorkerGlobal::run().

        {
                double amplitude_(-1.), pedestal_(-1.), jitter_(-1.), chi2_(-1.);

                // compute amplitude
                amplitude_ = double (((double) (dataFrame.sample( leadingSample_ ).adc() -
                                              pedestals[ dataFrame.sample( leadingSample_ ).gainId() - 1]) * 
                                              saturationCorrection( leadingSample_ ) *
                                              gainRatios[ dataFrame.sample( leadingSample_ ).gainId() - 1] )); 



                return EcalUncalibratedRecHit(dataFrame.id(), amplitude_, pedestal_, jitter_, chi2_);
        }
template<class C>
double EcalUncalibRecHitLeadingEdgeAlgo< C >::saturationCorrection ( int  unsaturatedSample) [inline]

Definition at line 56 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

Referenced by EcalUncalibRecHitLeadingEdgeAlgo< EBDataFrame >::makeRecHit().

        {
                if ( unsaturatedSample > 0 && unsaturatedSample < (int)shape_.size() ) {
                        return 1./ shape_[ unsaturatedSample ];
                } else {
                        edm::LogError("EcalUncalibRecHitLeadingEdgeAlgo") << "Invalid sample " << unsaturatedSample 
                                << " for a shape vector of size " << shape_.size();
                        return 0;
                }
        }
template<class C>
void EcalUncalibRecHitLeadingEdgeAlgo< C >::setLeadingEdgeSample ( int  isample) [inline]

Definition at line 28 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

Referenced by EcalUncalibRecHitWorkerGlobal::run().

{ leadingSample_ = isample; }
template<class C>
void EcalUncalibRecHitLeadingEdgeAlgo< C >::setPulseShape ( std::vector< double > &  shape) [inline]

Definition at line 31 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

Referenced by EcalUncalibRecHitWorkerGlobal::run().

{ shape_ = shape; }

Member Data Documentation

template<class C>
int EcalUncalibRecHitLeadingEdgeAlgo< C >::leadingSample_ [private]
template<class C>
std::vector< double > EcalUncalibRecHitLeadingEdgeAlgo< C >::shape_ [private]