Main Page
Namespaces
Classes
Package Documentation
RecoLocalCalo
EcalRecAlgos
interface
EcalUncalibRecHitMaxSampleAlgo.h
Go to the documentation of this file.
1
#ifndef RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitMaxSampleAlgo_HH
2
#define RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitMaxSampleAlgo_HH
3
11
#include "
RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitRecAbsAlgo.h
"
12
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
13
14
template
<
class
C>
15
class
EcalUncalibRecHitMaxSampleAlgo
:
public
EcalUncalibRecHitRecAbsAlgo
<C> {
16
public
:
17
~
EcalUncalibRecHitMaxSampleAlgo<C>
()
override
{};
18
EcalUncalibratedRecHit
makeRecHit
(
const
C
& dataFrame,
19
const
double
* pedestals,
20
const
double
* gainRatios,
21
const
EcalWeightSet::EcalWeightMatrix
**
weights
,
22
const
EcalWeightSet::EcalChi2WeightMatrix
** chi2Matrix)
override
;
23
24
private
:
25
int16_t
amplitude_
,
pedestal_
,
jitter_
,
sampleAdc_
,
gainId_
;
26
double
chi2_
;
27
};
28
30
template
<
class
C>
31
EcalUncalibratedRecHit
EcalUncalibRecHitMaxSampleAlgo<C>::makeRecHit
(
32
const
C
& dataFrame,
33
const
double
* pedestals,
34
const
double
* gainRatios,
35
const
EcalWeightSet::EcalWeightMatrix
**
weights
,
36
const
EcalWeightSet::EcalChi2WeightMatrix
** chi2Matrix) {
37
amplitude_
=
std::numeric_limits<int16_t>::min
();
38
pedestal_
= 4095;
39
jitter_
= -1;
40
chi2_
= -1;
41
//bool isSaturated = 0;
42
uint32_t
flags
= 0;
43
for
(int16_t iSample = 0; iSample < C::MAXSAMPLES; iSample++) {
44
gainId_
= dataFrame.sample(iSample).gainId();
45
46
if
(
gainId_
== 0) {
47
flags =
EcalUncalibratedRecHit::kSaturated
;
48
}
49
50
// ampli gain 12
51
if
(
gainId_
== 1) {
52
sampleAdc_
= dataFrame.sample(iSample).adc();
53
}
54
55
else
{
56
if
(
gainId_
== 2) {
// ampli gain 6
57
sampleAdc_
= 200 + (dataFrame.sample(iSample).adc() - 200) * 2;
58
}
else
{
// accounts for gainId_==3 or 0 - ampli gain 1 and gain0
59
sampleAdc_
= 200 + (dataFrame.sample(iSample).adc() - 200) * 12;
60
}
61
}
62
63
if
(
sampleAdc_
>
amplitude_
) {
64
amplitude_
=
sampleAdc_
;
65
jitter_
= iSample;
66
}
// if statement
67
68
if
(
sampleAdc_
<
pedestal_
)
69
pedestal_
=
sampleAdc_
;
70
71
}
// loop on samples
72
73
return
EcalUncalibratedRecHit
(dataFrame.id(),
74
static_cast<
double
>
(
amplitude_
-
pedestal_
),
75
static_cast<double>(
pedestal_
),
76
static_cast<
double
>
(
jitter_
- 5),
77
chi2_
,
78
flags);
79
}
80
81
#endif
HGCalRecHit_cfi.weights
weights
Definition:
HGCalRecHit_cfi.py:6
MessageLogger.h
EcalUncalibRecHitMaxSampleAlgo::sampleAdc_
int16_t sampleAdc_
Definition:
EcalUncalibRecHitMaxSampleAlgo.h:25
EcalUncalibratedRecHit
Definition:
EcalUncalibratedRecHit.h:8
EcalWeightSet::EcalChi2WeightMatrix
math::Matrix< 10, 10 >::type EcalChi2WeightMatrix
Definition:
EcalWeightSet.h:21
EcalWeightSet::EcalWeightMatrix
math::Matrix< 3, 10 >::type EcalWeightMatrix
Definition:
EcalWeightSet.h:20
EcalUncalibRecHitMaxSampleAlgo::amplitude_
int16_t amplitude_
Definition:
EcalUncalibRecHitMaxSampleAlgo.h:25
EcalUncalibRecHitMaxSampleAlgo::gainId_
int16_t gainId_
Definition:
EcalUncalibRecHitMaxSampleAlgo.h:25
EcalUncalibRecHitRecAbsAlgo
Definition:
EcalUncalibRecHitRecAbsAlgo.h:18
min
T min(T a, T b)
Definition:
MathUtil.h:58
EcalUncalibRecHitMaxSampleAlgo::chi2_
double chi2_
Definition:
EcalUncalibRecHitMaxSampleAlgo.h:26
HLT_2018_cff.flags
flags
Definition:
HLT_2018_cff.py:11743
EcalUncalibratedRecHit::kSaturated
Definition:
EcalUncalibratedRecHit.h:15
EcalUncalibRecHitRecAbsAlgo.h
EcalUncalibRecHitMaxSampleAlgo::pedestal_
int16_t pedestal_
Definition:
EcalUncalibRecHitMaxSampleAlgo.h:25
gen::C
C
Definition:
PomwigHadronizer.cc:76
EcalUncalibRecHitMaxSampleAlgo
Definition:
EcalUncalibRecHitMaxSampleAlgo.h:15
EcalUncalibRecHitMaxSampleAlgo::makeRecHit
EcalUncalibratedRecHit makeRecHit(const C &dataFrame, const double *pedestals, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalWeightSet::EcalChi2WeightMatrix **chi2Matrix) override
compute rechits
Definition:
EcalUncalibRecHitMaxSampleAlgo.h:31
EcalUncalibRecHitMaxSampleAlgo::jitter_
int16_t jitter_
Definition:
EcalUncalibRecHitMaxSampleAlgo.h:25
Generated for CMSSW Reference Manual by
1.8.11