SimCalorimetry
CastorSim
plugins
CastorDigiStatistics.h
Go to the documentation of this file.
1
#ifndef CastorSim_CastorDigiStatistics_h
2
#define CastorSim_CastorDigiStatistics_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
CastorDigiStatistics
{
10
public
:
11
CastorDigiStatistics
(
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
CastorDigiStatistics::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
CastorDigiStatistics::amplitudeThreshold_
float amplitudeThreshold_
Definition:
CastorDigiStatistics.h:30
CaloSamples.h
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition:
gpuClusterChargeCut.h:20
CaloValidationStatistics.h
CastorDigiStatistics::maxBin_
int maxBin_
Definition:
CastorDigiStatistics.h:29
TrendClient_cfi.Digi
Digi
Definition:
TrendClient_cfi.py:7
CastorDigiStatistics::CastorDigiStatistics
CastorDigiStatistics(std::string name, int maxBin, float amplitudeThreshold, float expectedPedestal, float binPrevToBinMax, float binNextToBinMax, CaloHitAnalyzer &litudeAnalyzer)
Definition:
CastorDigiStatistics.h:11
TestPulseClient_cfi.amplitudeThreshold
amplitudeThreshold
Definition:
TestPulseClient_cfi.py:8
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
CastorDigiStatistics
Definition:
CastorDigiStatistics.h:9
CaloHitAnalyzer.h
CastorDigiStatistics::binPrevToBinMax_
CaloValidationStatistics binPrevToBinMax_
Definition:
CastorDigiStatistics.h:32
CaloHitAnalyzer
Definition:
CaloHitAnalyzer.h:21
cms::cuda::allocator::maxBin
constexpr unsigned int maxBin
Definition:
getCachingDeviceAllocator.h:20
CastorDigiStatistics::binNextToBinMax_
CaloValidationStatistics binNextToBinMax_
Definition:
CastorDigiStatistics.h:33
CastorDigiStatistics::analyze
void analyze(const Digi &digi)
Definition:
CastorDigiStatistics.h:38
CastorDigiStatistics::amplitudeAnalyzer_
CaloHitAnalyzer & amplitudeAnalyzer_
Definition:
CastorDigiStatistics.h:34
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
CaloValidationStatistics::addEntry
void addEntry(float value, float weight=1.)
Definition:
CaloValidationStatistics.cc:18
CastorDigiStatistics::pedestal_
CaloValidationStatistics pedestal_
Definition:
CastorDigiStatistics.h:31
Generated for CMSSW Reference Manual by
1.8.16