test
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
EcalUncalibRecHitLeadingEdgeAlgo< C > Class Template Reference

#include <EcalUncalibRecHitLeadingEdgeAlgo.h>

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

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. More...
 
double saturationCorrection (int unsaturatedSample)
 
void setLeadingEdgeSample (int isample)
 
void setPulseShape (std::vector< double > &shape)
 
virtual ~EcalUncalibRecHitLeadingEdgeAlgo ()
 

Private Attributes

int leadingSample_
 
std::vector< double > shape_
 

Additional Inherited Members

- Public Types inherited from EcalUncalibRecHitRecAbsAlgo< C >
enum  { nWeightsRows = 3, iAmplitude = 0, iPedestal = 1, iTime = 2 }
 

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

template<class C >
virtual EcalUncalibRecHitLeadingEdgeAlgo< C >::~EcalUncalibRecHitLeadingEdgeAlgo ( )
inlinevirtual

Definition at line 26 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

26 { };

Member Function Documentation

template<class C >
int EcalUncalibRecHitLeadingEdgeAlgo< C >::getLeadingEdgeSample ( )
inline
template<class C >
std::vector<double>& EcalUncalibRecHitLeadingEdgeAlgo< C >::getPulseShape ( )
inline
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 
)
inlinevirtual

Compute parameters.

Implements EcalUncalibRecHitRecAbsAlgo< C >.

Definition at line 35 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

References EcalUncalibRecHitLeadingEdgeAlgo< C >::leadingSample_, and EcalUncalibRecHitLeadingEdgeAlgo< C >::saturationCorrection().

41  {
42  double amplitude_(-1.), pedestal_(-1.), jitter_(-1.), chi2_(-1.);
43 
44  // compute amplitude
45  amplitude_ = double (((double) (dataFrame.sample( leadingSample_ ).adc() -
46  pedestals[ dataFrame.sample( leadingSample_ ).gainId() - 1]) *
48  gainRatios[ dataFrame.sample( leadingSample_ ).gainId() - 1] ));
49 
50 
51 
52  return EcalUncalibratedRecHit(dataFrame.id(), amplitude_, pedestal_, jitter_, chi2_);
53  }
double saturationCorrection(int unsaturatedSample)
template<class C >
double EcalUncalibRecHitLeadingEdgeAlgo< C >::saturationCorrection ( int  unsaturatedSample)
inline

Definition at line 56 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

References EcalUncalibRecHitLeadingEdgeAlgo< C >::shape_.

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

57  {
58  if ( unsaturatedSample > 0 && unsaturatedSample < (int)shape_.size() ) {
59  return 1./ shape_[ unsaturatedSample ];
60  } else {
61  edm::LogError("EcalUncalibRecHitLeadingEdgeAlgo") << "Invalid sample " << unsaturatedSample
62  << " for a shape vector of size " << shape_.size();
63  return 0;
64  }
65  }
template<class C >
void EcalUncalibRecHitLeadingEdgeAlgo< C >::setLeadingEdgeSample ( int  isample)
inline
template<class C >
void EcalUncalibRecHitLeadingEdgeAlgo< C >::setPulseShape ( std::vector< double > &  shape)
inline

Member Data Documentation

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