RecoLocalCalo
EcalRecAlgos
interface
EcalUncalibRecHitLeadingEdgeAlgo.h
Go to the documentation of this file.
1
#ifndef RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitLeadingEdgeAlgo_HH
2
#define RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitLeadingEdgeAlgo_HH
3
13
#include "Math/SVector.h"
14
#include "Math/SMatrix.h"
15
#include "
RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitRecAbsAlgo.h
"
16
17
#include "
DataFormats/EcalDetId/interface/EBDetId.h
"
18
19
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
20
21
22
template
<
class
C >
class
EcalUncalibRecHitLeadingEdgeAlgo
:
public
EcalUncalibRecHitRecAbsAlgo
< C > {
23
public
:
24
// destructor
25
EcalUncalibRecHitLeadingEdgeAlgo < C >
() :
leadingSample_
(0),
shape_
(0) { };
26
virtual
~
EcalUncalibRecHitLeadingEdgeAlgo < C >
() { };
27
28
void
setLeadingEdgeSample
(
int
isample ) {
leadingSample_
= isample; }
29
int
getLeadingEdgeSample
() {
return
leadingSample_
; }
30
31
void
setPulseShape
( std::vector<double> & shape ) {
shape_
= shape; }
32
std::vector<double> &
getPulseShape
() {
return
shape_
; }
33
35
virtual
EcalUncalibratedRecHit
makeRecHit
(
const
C
& dataFrame,
36
const
double
*pedestals,
37
const
double
*gainRatios,
38
const
EcalWeightSet::EcalWeightMatrix
**
weights
,
39
const
EcalWeightSet::EcalChi2WeightMatrix
** chi2Matrix
40
)
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]) *
47
saturationCorrection
(
leadingSample_
) *
48
gainRatios[ dataFrame.sample(
leadingSample_
).gainId() - 1] ));
49
50
51
52
return
EcalUncalibratedRecHit
(dataFrame.id(), amplitude_, pedestal_, jitter_, chi2_);
53
}
54
55
// saturation correction
56
double
saturationCorrection
(
int
unsaturatedSample)
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
}
66
67
private
:
68
int
leadingSample_
;
69
std::vector< double >
shape_
;
70
};
71
#endif
MessageLogger.h
EBDetId.h
EcalUncalibRecHitLeadingEdgeAlgo::setPulseShape
void setPulseShape(std::vector< double > &shape)
Definition:
EcalUncalibRecHitLeadingEdgeAlgo.h:31
EcalWeightSet::EcalWeightMatrix
math::Matrix< 3, 10 >::type EcalWeightMatrix
Definition:
EcalWeightSet.h:19
EcalUncalibRecHitLeadingEdgeAlgo::saturationCorrection
double saturationCorrection(int unsaturatedSample)
Definition:
EcalUncalibRecHitLeadingEdgeAlgo.h:56
EcalUncalibRecHitRecAbsAlgo
Definition:
EcalUncalibRecHitRecAbsAlgo.h:18
HLT_FULL_cff.weights
weights
Definition:
HLT_FULL_cff.py:99244
EcalWeightSet::EcalChi2WeightMatrix
math::Matrix< 10, 10 >::type EcalChi2WeightMatrix
Definition:
EcalWeightSet.h:20
EcalUncalibRecHitRecAbsAlgo.h
EcalUncalibRecHitLeadingEdgeAlgo
Definition:
EcalUncalibRecHitLeadingEdgeAlgo.h:22
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
EcalUncalibratedRecHit
Definition:
EcalUncalibratedRecHit.h:8
EcalUncalibRecHitLeadingEdgeAlgo::getLeadingEdgeSample
int getLeadingEdgeSample()
Definition:
EcalUncalibRecHitLeadingEdgeAlgo.h:29
EcalUncalibRecHitLeadingEdgeAlgo::shape_
std::vector< double > shape_
Definition:
EcalUncalibRecHitLeadingEdgeAlgo.h:69
gen::C
C
Definition:
PomwigHadronizer.cc:78
EcalUncalibRecHitLeadingEdgeAlgo::makeRecHit
virtual EcalUncalibratedRecHit makeRecHit(const C &dataFrame, const double *pedestals, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalWeightSet::EcalChi2WeightMatrix **chi2Matrix)
Compute parameters.
Definition:
EcalUncalibRecHitLeadingEdgeAlgo.h:35
EcalUncalibRecHitLeadingEdgeAlgo::leadingSample_
int leadingSample_
Definition:
EcalUncalibRecHitLeadingEdgeAlgo.h:68
EcalUncalibRecHitLeadingEdgeAlgo::setLeadingEdgeSample
void setLeadingEdgeSample(int isample)
Definition:
EcalUncalibRecHitLeadingEdgeAlgo.h:28
EcalUncalibRecHitLeadingEdgeAlgo::getPulseShape
std::vector< double > & getPulseShape()
Definition:
EcalUncalibRecHitLeadingEdgeAlgo.h:32
Generated for CMSSW Reference Manual by
1.8.16