Main Page
Namespaces
Classes
Package Documentation
SimRomanPot
SimFP420
src
DigiConverterFP420.cc
Go to the documentation of this file.
1
// File: DigiConverterFP420.cc
3
// Date: 12.2006
4
// Description: DigiConverterFP420 for FP420
5
// Modifications:
7
#include "
SimRomanPot/SimFP420/interface/DigiConverterFP420.h
"
8
9
DigiConverterFP420::DigiConverterFP420
(
float
in
,
int
verbosity
) {
10
electronperADC
=
in
;
11
verbos
=
verbosity
;
12
13
const
int
defaultBits = 10;
14
const
int
largestBits = 30;
15
16
// example is in SiStrips:
17
// static SimpleConfigurable<int>
18
// adcBits(defaultBits, "DigiConverterFP420:rawDataAdcBits");
19
adcBits
= defaultBits;
20
21
if
(
adcBits
> largestBits ||
adcBits
< 1)
22
adcBits
= largestBits;
23
24
theMaxADC
= ~(~0 <<
adcBits
);
25
// std::cout << "theMaxADC= "<< theMaxADC << std::endl; // = 1023
26
if
(
verbos
> 0) {
27
std::cout
<<
" ***DigiConverterFP420: constructor"
<< std::endl;
28
std::cout
<<
"with known electronperADC = "
<<
electronperADC
<<
"the adcBits = "
<<
adcBits
29
<<
" theMaxADC= "
<<
theMaxADC
<<
"for known defaultBits= "
<< defaultBits
30
<<
" largestBits= "
<< largestBits << std::endl;
31
}
32
}
33
34
DConverterFP420::DigitalMapType
DigiConverterFP420::convert
(
const
signal_map_type
&analogSignal) {
35
DConverterFP420::DigitalMapType
_temp;
36
37
for
(signal_map_type::const_iterator
i
= analogSignal.begin();
i
!= analogSignal.end();
i
++) {
38
// convert analog amplitude to digital, means integer number simulating ADC
39
// digitization!
40
// with truncation check
41
int
adc
=
convert
((*i).second);
42
43
if
(
verbos
> 0) {
44
std::cout
<<
" ***DigiConverterFP420: convert: after truncation "
<< std::endl;
45
std::cout
<<
"adc = "
<< adc <<
" (*i).first = "
<< (*i).first << std::endl;
46
}
47
if
(adc > 0)
48
_temp.insert(_temp.end(),
DigitalMapType::value_type
((*i).first, adc));
49
}
50
51
return
_temp;
52
}
53
54
int
DigiConverterFP420::truncate
(
float
in_adc) {
55
int
adc
=
int
(in_adc);
56
if
(
verbos
> 0) {
57
std::cout
<<
" ***DigiConverterFP420: truncate"
<< std::endl;
58
std::cout
<<
"if adc = "
<< adc <<
"bigger theMaxADC = "
<<
theMaxADC
<<
" adc=theMaxADC !!!"
<< std::endl;
59
}
60
if
(adc >
theMaxADC
)
61
adc =
theMaxADC
;
62
63
return
adc
;
64
}
DigiConverterFP420::theMaxADC
int theMaxADC
Definition:
DigiConverterFP420.h:17
mps_fire.i
i
Definition:
mps_fire.py:338
DigiConverterFP420::truncate
int truncate(float in_adc)
Definition:
DigiConverterFP420.cc:54
DConverterFP420::DigitalMapType
std::map< int, int, std::less< int > > DigitalMapType
Definition:
DConverterFP420.h:8
HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition:
HIPAlignmentAlgorithm_cfi.py:7
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
DigiConverterFP420::DigiConverterFP420
DigiConverterFP420(float in, int)
Definition:
DigiConverterFP420.cc:9
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition:
JetExtendedAssociation.h:30
DigiConverterFP420.h
createfilelist.int
int
Definition:
createfilelist.py:10
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition:
EcalMGPASample.h:11
DigiConverterFP420::electronperADC
float electronperADC
Definition:
DigiConverterFP420.h:16
DigiConverterFP420::verbos
int verbos
Definition:
DigiConverterFP420.h:19
DConverterFP420::signal_map_type
PileUpFP420::signal_map_type signal_map_type
Definition:
DConverterFP420.h:9
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
DigiConverterFP420::convert
DigitalMapType convert(const signal_map_type &) override
Definition:
DigiConverterFP420.cc:34
DigiConverterFP420::adcBits
int adcBits
Definition:
DigiConverterFP420.h:18
Generated for CMSSW Reference Manual by
1.8.11