CMS 3D CMS Logo

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 ()
 
- Public Member Functions inherited from EcalUncalibRecHitRecAbsAlgo< C >
virtual ~EcalUncalibRecHitRecAbsAlgo ()=default
 Constructor. More...
 

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

◆ EcalUncalibRecHitLeadingEdgeAlgo()

Definition at line 25 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

25 : leadingSample_(0), shape_(0) { };

◆ ~ EcalUncalibRecHitLeadingEdgeAlgo()

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

Definition at line 26 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

26 { };

Member Function Documentation

◆ getLeadingEdgeSample()

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

◆ getPulseShape()

template<class C >
std::vector<double>& EcalUncalibRecHitLeadingEdgeAlgo< C >::getPulseShape ( )
inline

Definition at line 32 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

32 { return shape_; }

References EcalUncalibRecHitLeadingEdgeAlgo< C >::shape_.

◆ makeRecHit()

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.

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  }

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

◆ saturationCorrection()

template<class C >
double EcalUncalibRecHitLeadingEdgeAlgo< C >::saturationCorrection ( int  unsaturatedSample)
inline

Definition at line 56 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

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  }

References EcalUncalibRecHitLeadingEdgeAlgo< C >::shape_.

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

◆ setLeadingEdgeSample()

template<class C >
void EcalUncalibRecHitLeadingEdgeAlgo< C >::setLeadingEdgeSample ( int  isample)
inline

◆ setPulseShape()

template<class C >
void EcalUncalibRecHitLeadingEdgeAlgo< C >::setPulseShape ( std::vector< double > &  shape)
inline

Definition at line 31 of file EcalUncalibRecHitLeadingEdgeAlgo.h.

31 { shape_ = shape; }

References EcalUncalibRecHitLeadingEdgeAlgo< C >::shape_.

Member Data Documentation

◆ leadingSample_

template<class C >
int EcalUncalibRecHitLeadingEdgeAlgo< C >::leadingSample_
private

◆ shape_

template<class C >
std::vector< double > EcalUncalibRecHitLeadingEdgeAlgo< C >::shape_
private
EcalUncalibRecHitLeadingEdgeAlgo::saturationCorrection
double saturationCorrection(int unsaturatedSample)
Definition: EcalUncalibRecHitLeadingEdgeAlgo.h:56
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
EcalUncalibratedRecHit
Definition: EcalUncalibratedRecHit.h:8
EcalUncalibRecHitLeadingEdgeAlgo::shape_
std::vector< double > shape_
Definition: EcalUncalibRecHitLeadingEdgeAlgo.h:69
EcalUncalibRecHitLeadingEdgeAlgo::leadingSample_
int leadingSample_
Definition: EcalUncalibRecHitLeadingEdgeAlgo.h:68