CondFormats
EcalObjects
src
EcalSRSettings.cc
Go to the documentation of this file.
1
#include "
CondFormats/EcalObjects/interface/EcalSRSettings.h
"
2
#include "
FWCore/Utilities/interface/Exception.h
"
3
4
#include <sstream>
5
#include <iostream>
6
#include <cstdlib>
7
#include <cassert>
8
#include <algorithm>
9
10
using namespace
std
;
11
12
EcalSRSettings::EcalSRSettings
()
13
: ebDccAdcToGeV_(0.), eeDccAdcToGeV_(0.), bxGlobalOffset_(0), automaticMasks_(0), automaticSrpSelect_(0) {}
14
15
#define SR_PRINT(a) o << #a ": " << val.a##_ << "\n";
16
#define SR_VPRINT(a) \
17
o << #a; \
18
if (val.a##_.size()) \
19
o << "[0.." << (val.a##_.size() - 1) << "]:"; \
20
else \
21
o << "[]: <empty>"; \
22
for (size_t i = 0; i < val.a##_.size(); ++i) \
23
o << "\t" << val.a##_[i]; \
24
o << "\n";
25
#define SR_VVPRINT(a) \
26
if (val.a##_.size() == 0) \
27
o << #a "[][]: <empty>\n"; \
28
for (size_t i = 0; i < val.a##_.size(); ++i) { \
29
o << #a "[" << i << "]"; \
30
if (val.a##_.size()) \
31
o << "[0.." << (val.a##_[i].size() - 1) << "]:"; \
32
else \
33
o << "[]: <empty>"; \
34
for (size_t j = 0; j < val.a##_[i].size(); ++j) \
35
o << "\t" << val.a##_[i][j]; \
36
o << "\n"; \
37
}
38
39
std::ostream&
operator<<
(std::ostream&
o
,
const
EcalSRSettings
&
val
) {
40
o
<<
"# Neighbour eta range, neighborhood: (2*deltaEta+1)*(2*deltaPhi+1)\n"
41
"# In the vector contains:\n"
42
"# - 1 element, then value applies to whole ECAL\n"
43
"# - 2 elements, then element 0 applies to EB, element 1 to EE\n"
44
"# - 12 elements, then element i applied to SRP (i+1)\n"
45
"# SRP emulation (see SimCalorimetry/EcalSelectiveReadoutProcuders) supports\n"
46
"# only 1 element mode.\n"
;
47
SR_VPRINT
(
deltaEta
);
48
49
o
<<
"\n# Neighbouring eta range, neighborhood: (2*deltaEta+1)*(2*deltaPhi+1)\n"
50
"# If the vector contains...\n"
51
"# ... 1 element, then value applies to whole ECAL\n"
52
"# ... 2 elements, then element 0 applies to EB, element 1 to EE\n"
53
"# ... 12 elements, then element i applied to SRP (i+1)\n"
54
"# If the vector contains...\n"
55
"# ... 1 element, then value applies to whole ECAL\n"
56
"# ... 2 elements, then element 0 applies to EB, element 1 to EE\n"
57
"# ... 12 elements, then element i applied to SRP (i+1)\n"
58
"# SRP emulation (see SimCalorimetry/EcalSelectiveReadoutProcuders) supports\n"
59
"# only the single-element mode.\n"
;
60
SR_VPRINT
(
deltaPhi
);
61
62
o
<<
"\n# Index of time sample (staring from 1) the first DCC weights is implied\n"
63
"# If the vector contains:\n"
64
"# ... 1 element, then value applies to whole ECAL\n"
65
"# ... 2 elements, then element 0 applies to EB, element 1 to EE\n"
66
"# ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)\n"
67
"# SRP emulation (see SimCalorimetry/EcalSelectiveReadoutProcuders) supports\n"
68
"# only the single-element mode.\n"
;
69
SR_VPRINT
(
ecalDccZs1stSample
);
70
71
o
<<
"\n# ADC to GeV conversion factor used in ZS filter for EB\n"
;
72
SR_PRINT
(
ebDccAdcToGeV
);
73
74
o
<<
"\n# ADC to GeV conversion factor used in ZS filter for EE\n"
;
75
SR_PRINT
(
eeDccAdcToGeV
);
76
77
o
<<
"\n# DCC ZS FIR weights: weights are rounded in such way that in Hw\n"
78
"# representation (weigth*1024 rounded to nearest integer) the sum is null:\n"
79
"# Each element is a vector of 6 values, the 6 weights\n"
80
"# If the vector contains...\n"
81
"# ... 1 element, then the weight set applies to whole ECAL\n"
82
"# ... 2 elements, then element 0 applies to EB, element 1 to EE\n"
83
"# ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)\n"
;
84
SR_VVPRINT
(
dccNormalizedWeights
);
85
86
o
<<
"\n# Switch to use a symetric zero suppression (cut on absolute value). For\n"
87
"# studies only, for time being it is not supported by the hardware.\n"
88
"# having troubles for vector<bool> with coral (3.8.0pre1), using vector<int> instead,\n"
89
"# 0 means false, a value different than 0 means true.\n"
90
"# If the vector contains...\n"
91
"# ... 1 element, then the weight set applies to whole ECAL\n"
92
"# ... 2 elements, then element 0 applies to EB, element 1 to EE\n"
93
"# ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)\n"
94
"# ... 75848 elements, then:\n"
95
"# for i < 61200, element i applies to EB crystal with denseIndex i\n"
96
"# (see EBDetId::denseIndex())\n"
97
"# for i >= 61200, element i applies to EE crystal with denseIndex (i+61200)\n"
98
"# (see EBDetId::denseIndex())\n"
99
"# SRP emulation supports only 1 element mode. Hardware does not support\n"
100
"# the symetric ZS, so symetricZS = 0 for real data.\n"
;
101
SR_VPRINT
(
symetricZS
);
102
103
o
<<
"\n# ZS energy threshold in GeV to apply to low interest channels of barrel\n"
104
"# If the vector contains...\n"
105
"# ... 1 element, then the weight set applies to whole ECAL\n"
106
"# ... 2 elements, then element 0 applies to EB, element 1 to EE\n"
107
"# ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)\n"
108
"# SRP emulation supports only the 2-element mode.\n"
109
"# Corresponds to srpBarrelLowInterestChannelZS and srpEndcapLowInterestChannelZS\n"
110
"# of python configuration file parameters\n"
;
111
SR_VPRINT
(srpLowInterestChannelZS);
112
113
o
<<
"\n# ZS energy threshold in GeV to apply to high interest channels of endcap\n"
114
"# If the vector contains...\n"
115
"# ... 1 element, then the weight set applies to whole ECAL\n"
116
"# ... 2 elements, then element 0 applies to EB, element 1 to EE\n"
117
"# ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)\n"
118
"# SRP emulation supports only the 2-element mode.\n"
119
"# Corresponds to srpBarrelLowInterestChannelZS and srpEndcapLowInterestChannelZS\n"
120
"# of python configuration file parameters\n"
;
121
SR_VPRINT
(srpHighInterestChannelZS);
122
123
// o << "\n# Switch to run w/o trigger primitive. For debug use only\n"
124
// "# having troubles for vector<bool> with coral (3.8.0pre1), using vector<int> instead\n"
125
// "# Parameter only relevant for emulation. For real data, must be contains 1 element with\n"
126
// "# value 0.\n"
127
// "# ... 1 element, then the weight set applies to whole ECAL\n"
128
// "# ... 2 elements, then element 0 applies to EB, element 1 to EE\n"
129
// "# ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)\n"
130
// "# SRP emulation supports only the single-element mode.\n";
131
// SR_VPRINT(trigPrimBypass);\n"
132
//
133
// o << "\n# Mode selection for "# Trig bypass" mode\n"
134
// "# 0: TT thresholds applied on sum of crystal Et's\n"
135
// "# 1: TT thresholds applies on compressed Et from Trigger primitive\n"
136
// "# @see trigPrimByPass switch\n"
137
// "# Parameter only relevant for \n";
138
// SR_VPRINT(trigPrimBypassMode);
139
//
140
// o << "\n# for debug mode only:\n";
141
// SR_VPRINT( trigPrimBypassLTH);
142
//
143
// o << "\n# for debug mode only:\n";
144
// SR_VPRINT(trigPrimBypassHTH);
145
//
146
// o << "\n# for debug mode only\n"
147
// "# having troubles for vector<bool> with coral (3.8.0pre1), using vector<int> instead\n";
148
// SR_VPRINT( trigPrimBypassWithPeakFinder);
149
//
150
// o << "\n# Trigger Tower Flag to use when a flag is not found from the input\n"
151
// "# Trigger Primitive collection. Must be one of the following values:\n"
152
// "# 0: low interest, 1: mid interest, 3: high interest\n"
153
// "# 4: forced low interest, 5: forced mid interest, 7: forced high interest\n";
154
// SR_VPRINT(defaultTtf);\n"
155
156
o
<<
"\n# SR->action flag map. 4 elements\n"
157
"# action_[i]: action for flag value i\n"
;
158
SR_VPRINT
(
actions
);
159
160
o
<<
"\n# Masks for TTC inputs of SRP cards\n"
161
"# One element per TCC, that is 108 elements: element i applies to TCC (i+1)\n"
;
162
SR_VPRINT
(tccMasksFromConfig);
163
164
o
<<
"\n# Masks for SRP-SRP inputs of SRP cards\n"
165
"# One element per SRP, that is 12 elements: element i applies to SRP (i+1)\n"
166
"# indices: [iSrp][iCh]\n"
;
167
SR_VVPRINT
(srpMasksFromConfig);
168
169
o
<<
"\n# Masks for DCC output of SRP cards\n"
170
"# One element per DCC, that is 54 elements: element i applies to DCC (i+1)\n"
;
171
SR_VPRINT
(dccMasks);
172
173
o
<<
"\n# Mask to enable pattern test. Typical value: 0.\n"
174
"# One element per SRP, that is 12 elements: element i applies to SRP (i+1)\n"
;
175
SR_VPRINT
(srfMasks);
176
177
o
<<
"\n# Substitution flags used in patterm mode\n"
178
"# indices: [iSrp][iFlag]\n"
;
179
SR_VVPRINT
(substitutionSrfs);
180
181
o
<<
"\n# Tester mode configuration\n"
;
182
SR_VPRINT
(testerTccEmuSrpIds);
183
SR_VPRINT
(testerSrpEmuSrpIds);
184
SR_VPRINT
(testerDccTestSrpIds);
185
SR_VPRINT
(testerSrpTestSrpIds);
187
188
o
<<
"\n# Per SRP card bunch crossing counter offset.\n"
189
"# This offset is added to the bxGlobalOffset\n"
;
190
SR_VPRINT
(bxOffsets);
191
192
o
<<
"\n# SRP system bunch crossing counter offset.\n"
193
"# For each card the bxOffset[i]\n"
194
"# is added to this one.\n"
;
195
SR_PRINT
(bxGlobalOffset);
196
197
o
<<
"\n# Switch for automatic channel masking. 0: disabled; 1: enabled. Standard configuration: 1.\n"
198
"# When enabled, if a FED is excluded from the run, the corresponding TCC inputs is automatically\n"
199
"# masked (overwrites the tccInputMasks).\n"
;
200
SR_PRINT
(automaticMasks);
201
202
o
<<
"\n# Switch for automatic SRP card selection. 0: disabled; 1 : enabled..\n"
203
"# When enabled, if all the FEDs corresponding to a given SRP is excluded from the run,\n"
204
"# Then the corresponding SRP card is automatically excluded.\n"
;
205
SR_PRINT
(automaticSrpSelect);
206
207
return
o
;
208
}
SR_VPRINT
#define SR_VPRINT(a)
Definition:
EcalSRSettings.cc:16
ecalDigis_beamcom09_cff.ecalDccZs1stSample
ecalDccZs1stSample
Definition:
ecalDigis_beamcom09_cff.py:12
ecalDigis_craft_cfi.symetricZS
symetricZS
Definition:
ecalDigis_craft_cfi.py:53
DigiCosmics_cff.ebDccAdcToGeV
ebDccAdcToGeV
Definition:
DigiCosmics_cff.py:50
EcalSRSettings.h
EcalTangentSkim_cfg.o
o
Definition:
EcalTangentSkim_cfg.py:36
spr::deltaEta
static const double deltaEta
Definition:
CaloConstants.h:8
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition:
SiPixelRawToDigiRegional_cfi.py:9
EcalSRSettings::EcalSRSettings
EcalSRSettings()
Definition:
EcalSRSettings.cc:12
ecalDigis_beamcom09_cff.eeDccAdcToGeV
eeDccAdcToGeV
Definition:
ecalDigis_beamcom09_cff.py:19
operator<<
std::ostream & operator<<(std::ostream &o, const EcalSRSettings &val)
Definition:
EcalSRSettings.cc:39
EcalSRSettings
Definition:
EcalSRSettings.h:29
heppy_batch.val
val
Definition:
heppy_batch.py:351
std
Definition:
JetResolutionObject.h:76
SR_PRINT
#define SR_PRINT(a)
Definition:
EcalSRSettings.cc:15
Exception.h
actions
roAction_t actions[nactions]
Definition:
GenABIO.cc:181
ecalDigis_beamcom09_cff.dccNormalizedWeights
dccNormalizedWeights
Definition:
ecalDigis_beamcom09_cff.py:9
SR_VVPRINT
#define SR_VVPRINT(a)
Definition:
EcalSRSettings.cc:25
Generated for CMSSW Reference Manual by
1.8.16