RecoLocalCalo
EcalRecAlgos
interface
EcalRecHitSimpleAlgo.h
Go to the documentation of this file.
1
#ifndef RecoLocalCalo_EcalRecAlgos_EcalRecHitSimpleAlgo_HH
2
#define RecoLocalCalo_EcalRecAlgos_EcalRecHitSimpleAlgo_HH
3
10
#include "
RecoLocalCalo/EcalRecAlgos/interface/EcalRecHitAbsAlgo.h
"
11
#include "
DataFormats/EcalDigi/interface/EcalDataFrame.h
"
12
#include "TMath.h"
13
#include <iostream>
14
15
class
EcalRecHitSimpleAlgo
:
public
EcalRecHitAbsAlgo
{
16
public
:
17
// default ctor
18
EcalRecHitSimpleAlgo
() {
19
adcToGeVConstant_
= -1;
20
adcToGeVConstantIsSet_
=
false
;
21
}
22
23
void
setADCToGeVConstant
(
const
float
&
value
)
override
{
24
adcToGeVConstant_
=
value
;
25
adcToGeVConstantIsSet_
=
true
;
26
}
27
28
// destructor
29
~EcalRecHitSimpleAlgo
()
override
{};
30
32
EcalRecHit
makeRecHit
(
const
EcalUncalibratedRecHit
& uncalibRH,
33
const
float
& intercalibConstant,
34
const
float
& timeIntercalib = 0,
35
const
uint32_t&
flags
= 0)
const override
{
36
if
(!
adcToGeVConstantIsSet_
) {
37
std::cout
<<
"EcalRecHitSimpleAlgo::makeRecHit: adcToGeVConstant_ not set before calling this method!"
38
<<
" will use -1 and produce bogus rechits!"
<< std::endl;
39
}
40
41
float
clockToNsConstant = 25;
42
float
energy
= uncalibRH.
amplitude
() *
adcToGeVConstant_
* intercalibConstant;
43
float
time
= uncalibRH.
jitter
() * clockToNsConstant + timeIntercalib;
44
45
EcalRecHit
rh(uncalibRH.
id
(),
energy
,
time
);
46
rh.
setChi2
(uncalibRH.
chi2
());
47
rh.setEnergyError(uncalibRH.
amplitudeError
() *
adcToGeVConstant_
* intercalibConstant);
48
/* rh.setOutOfTimeEnergy( uncalibRH.outOfTimeEnergy() * adcToGeVConstant_ * intercalibConstant ); */
49
/* rh.setOutOfTimeChi2( uncalibRH.outOfTimeChi2() ); */
50
rh.setTimeError(uncalibRH.
jitterErrorBits
());
51
52
// Now fill flags
53
54
bool
good =
true
;
55
56
if
(uncalibRH.
checkFlag
(
EcalUncalibratedRecHit::kLeadingEdgeRecovered
)) {
57
rh.setFlag(
EcalRecHit::kLeadingEdgeRecovered
);
58
good =
false
;
59
}
60
if
(uncalibRH.
checkFlag
(
EcalUncalibratedRecHit::kSaturated
)) {
61
// leading edge recovery failed - still keep the information
62
// about the saturation and do not flag as dead
63
rh.setFlag(
EcalRecHit::kSaturated
);
64
good =
false
;
65
}
66
if
(uncalibRH.
isSaturated
()) {
67
rh.setFlag(
EcalRecHit::kSaturated
);
68
good =
false
;
69
}
70
if
(uncalibRH.
checkFlag
(
EcalUncalibratedRecHit::kOutOfTime
)) {
71
rh.setFlag(
EcalRecHit::kOutOfTime
);
72
good =
false
;
73
}
74
if
(uncalibRH.
checkFlag
(
EcalUncalibratedRecHit::kPoorReco
)) {
75
rh.setFlag(
EcalRecHit::kPoorReco
);
76
good =
false
;
77
}
78
if
(uncalibRH.
checkFlag
(
EcalUncalibratedRecHit::kHasSwitchToGain6
)) {
79
rh.setFlag(
EcalRecHit::kHasSwitchToGain6
);
80
}
81
if
(uncalibRH.
checkFlag
(
EcalUncalibratedRecHit::kHasSwitchToGain1
)) {
82
rh.setFlag(
EcalRecHit::kHasSwitchToGain1
);
83
}
84
85
if
(good)
86
rh.setFlag(
EcalRecHit::kGood
);
87
return
rh;
88
}
89
90
private
:
91
float
adcToGeVConstant_
;
92
bool
adcToGeVConstantIsSet_
;
93
};
94
#endif
EcalUncalibratedRecHit::kHasSwitchToGain6
Definition:
EcalUncalibratedRecHit.h:18
EcalRecHit
Definition:
EcalRecHit.h:15
EcalRecHitSimpleAlgo::EcalRecHitSimpleAlgo
EcalRecHitSimpleAlgo()
Definition:
EcalRecHitSimpleAlgo.h:18
EcalRecHit::kHasSwitchToGain6
Definition:
EcalRecHit.h:37
EcalRecHitSimpleAlgo::setADCToGeVConstant
void setADCToGeVConstant(const float &value) override
make rechits from dataframes
Definition:
EcalRecHitSimpleAlgo.h:23
EcalUncalibratedRecHit::amplitude
float amplitude() const
Definition:
EcalUncalibratedRecHit.h:28
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
EcalRecHit::kSaturated
Definition:
EcalRecHit.h:27
EcalUncalibratedRecHit::jitterErrorBits
uint8_t jitterErrorBits() const
Definition:
EcalUncalibratedRecHit.cc:94
EcalRecHitSimpleAlgo::adcToGeVConstant_
float adcToGeVConstant_
Definition:
EcalRecHitSimpleAlgo.h:91
EcalRecHit::setChi2
void setChi2(float chi2)
Definition:
EcalRecHit.h:125
EcalRecHitAbsAlgo
Definition:
EcalRecHitAbsAlgo.h:14
EcalDataFrame.h
EcalRecHitSimpleAlgo::makeRecHit
EcalRecHit makeRecHit(const EcalUncalibratedRecHit &uncalibRH, const float &intercalibConstant, const float &timeIntercalib=0, const uint32_t &flags=0) const override
Compute parameters.
Definition:
EcalRecHitSimpleAlgo.h:32
EcalUncalibratedRecHit::kPoorReco
Definition:
EcalUncalibratedRecHit.h:14
EcalUncalibratedRecHit::kLeadingEdgeRecovered
Definition:
EcalUncalibratedRecHit.h:17
EcalUncalibratedRecHit::kOutOfTime
Definition:
EcalUncalibratedRecHit.h:16
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition:
HCALHighEnergyHPDFilter_cfi.py:5
EcalRecHit::kGood
Definition:
EcalRecHit.h:21
EcalRecHitSimpleAlgo::~EcalRecHitSimpleAlgo
~EcalRecHitSimpleAlgo() override
Definition:
EcalRecHitSimpleAlgo.h:29
EcalRecHitSimpleAlgo::adcToGeVConstantIsSet_
bool adcToGeVConstantIsSet_
Definition:
EcalRecHitSimpleAlgo.h:92
EcalRecHit::kPoorReco
Definition:
EcalRecHit.h:22
EcalRecHit::kLeadingEdgeRecovered
Definition:
EcalRecHit.h:28
EcalRecHit::kOutOfTime
Definition:
EcalRecHit.h:23
EcalRecHitAbsAlgo.h
EcalUncalibratedRecHit::id
DetId id() const
Definition:
EcalUncalibratedRecHit.h:38
EcalUncalibratedRecHit::checkFlag
bool checkFlag(Flags flag) const
Definition:
EcalUncalibratedRecHit.cc:109
value
Definition:
value.py:1
EcalUncalibratedRecHit::chi2
float chi2() const
Definition:
EcalUncalibratedRecHit.h:32
EcalUncalibratedRecHit::amplitudeError
float amplitudeError() const
Definition:
EcalUncalibratedRecHit.h:29
EcalRecHit::kHasSwitchToGain1
Definition:
EcalRecHit.h:38
EcalUncalibratedRecHit
Definition:
EcalUncalibratedRecHit.h:8
relativeConstraints.value
value
Definition:
relativeConstraints.py:53
EcalUncalibratedRecHit::isSaturated
bool isSaturated() const
Definition:
EcalUncalibratedRecHit.cc:27
EcalUncalibratedRecHit::kSaturated
Definition:
EcalUncalibratedRecHit.h:15
EcalRecHitSimpleAlgo
Definition:
EcalRecHitSimpleAlgo.h:15
EcalUncalibratedRecHit::jitter
float jitter() const
Definition:
EcalUncalibratedRecHit.h:31
EcalUncalibratedRecHit::kHasSwitchToGain1
Definition:
EcalUncalibratedRecHit.h:19
ntuplemaker.time
time
Definition:
ntuplemaker.py:310
HLT_2018_cff.flags
flags
Definition:
HLT_2018_cff.py:11758
Generated for CMSSW Reference Manual by
1.8.16