SimCalorimetry
HcalSimProducers
src
HcalDigiStatistics.h
Go to the documentation of this file.
1
#ifndef HcalSimProducers_HcalDigiStatistics_h
2
#define HcalSimProducers_HcalDigiStatistics_h
3
4
#include "
CalibFormats/CaloObjects/interface/CaloSamples.h
"
5
#include "
SimCalorimetry/CaloSimAlgos/interface/CaloHitAnalyzer.h
"
6
#include "
SimCalorimetry/CaloSimAlgos/interface/CaloValidationStatistics.h
"
7
#include <string>
8
9
class
HcalDigiStatistics
{
10
public
:
11
HcalDigiStatistics
(
std::string
name
,
12
int
maxBin
,
13
float
amplitudeThreshold
,
14
float
expectedPedestal,
15
float
binPrevToBinMax,
16
float
binNextToBinMax,
17
CaloHitAnalyzer
&litudeAnalyzer)
18
:
maxBin_
(
maxBin
),
19
amplitudeThreshold_
(
amplitudeThreshold
),
20
pedestal_
(
name
+
" pedestal"
, expectedPedestal, 0.),
21
binPrevToBinMax_
(
name
+
" binPrevToBinMax"
, binPrevToBinMax, 0.),
22
binNextToBinMax_
(
name
+
" binNextToBinMax"
, binNextToBinMax, 0.),
23
amplitudeAnalyzer_
(amplitudeAnalyzer) {}
24
25
template
<
class
Digi>
26
void
analyze
(
const
Digi
&digi);
27
28
private
:
29
int
maxBin_
;
30
float
amplitudeThreshold_
;
31
CaloValidationStatistics
pedestal_
;
32
CaloValidationStatistics
binPrevToBinMax_
;
33
CaloValidationStatistics
binNextToBinMax_
;
34
CaloHitAnalyzer
&
amplitudeAnalyzer_
;
35
};
36
37
template
<
class
Digi>
38
void
HcalDigiStatistics::analyze
(
const
Digi
&digi) {
39
pedestal_
.
addEntry
(digi[0].
adc
());
40
pedestal_
.
addEntry
(digi[1].
adc
());
41
42
double
pedestal_fC = 0.5 * (digi[0].nominal_fC() + digi[1].nominal_fC());
43
44
double
maxAmplitude = digi[
maxBin_
].nominal_fC() - pedestal_fC;
45
46
if
(maxAmplitude >
amplitudeThreshold_
) {
47
double
binPrevToBinMax = (digi[
maxBin_
- 1].nominal_fC() - pedestal_fC) / maxAmplitude;
48
binPrevToBinMax_
.
addEntry
(binPrevToBinMax);
49
50
double
binNextToBinMax = (digi[
maxBin_
+ 1].nominal_fC() - pedestal_fC) / maxAmplitude;
51
binNextToBinMax_
.
addEntry
(binNextToBinMax);
52
53
double
amplitude
= digi[
maxBin_
].nominal_fC() + digi[
maxBin_
+ 1].nominal_fC() - 2 * pedestal_fC;
54
55
amplitudeAnalyzer_
.
analyze
(digi.id().rawId(),
amplitude
);
56
}
57
}
58
59
#endif
CaloValidationStatistics
Definition:
CaloValidationStatistics.h:12
CustomPhysics_cfi.amplitude
amplitude
Definition:
CustomPhysics_cfi.py:12
HcalDigiStatistics::HcalDigiStatistics
HcalDigiStatistics(std::string name, int maxBin, float amplitudeThreshold, float expectedPedestal, float binPrevToBinMax, float binNextToBinMax, CaloHitAnalyzer &litudeAnalyzer)
Definition:
HcalDigiStatistics.h:11
CaloSamples.h
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition:
gpuClusterChargeCut.h:20
CaloValidationStatistics.h
TrendClient_cfi.Digi
Digi
Definition:
TrendClient_cfi.py:7
HcalDigiStatistics
Definition:
HcalDigiStatistics.h:9
HcalDigiStatistics::binNextToBinMax_
CaloValidationStatistics binNextToBinMax_
Definition:
HcalDigiStatistics.h:33
HcalDigiStatistics::binPrevToBinMax_
CaloValidationStatistics binPrevToBinMax_
Definition:
HcalDigiStatistics.h:32
HcalDigiStatistics::maxBin_
int maxBin_
Definition:
HcalDigiStatistics.h:29
HcalDigiStatistics::analyze
void analyze(const Digi &digi)
Definition:
HcalDigiStatistics.h:38
TestPulseClient_cfi.amplitudeThreshold
amplitudeThreshold
Definition:
TestPulseClient_cfi.py:8
CaloHitAnalyzer.h
CaloHitAnalyzer
Definition:
CaloHitAnalyzer.h:21
cms::cuda::allocator::maxBin
constexpr unsigned int maxBin
Definition:
getCachingDeviceAllocator.h:20
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
CaloHitAnalyzer::analyze
void analyze(int detId, double recEnergy)
to be called for each RecHit
Definition:
CaloHitAnalyzer.cc:47
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
HcalDigiStatistics::pedestal_
CaloValidationStatistics pedestal_
Definition:
HcalDigiStatistics.h:31
HcalDigiStatistics::amplitudeThreshold_
float amplitudeThreshold_
Definition:
HcalDigiStatistics.h:30
CaloValidationStatistics::addEntry
void addEntry(float value, float weight=1.)
Definition:
CaloValidationStatistics.cc:18
HcalDigiStatistics::amplitudeAnalyzer_
CaloHitAnalyzer & amplitudeAnalyzer_
Definition:
HcalDigiStatistics.h:34
Generated for CMSSW Reference Manual by
1.8.16