CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EcalSRSettings.cc
Go to the documentation of this file.
3 
4 #include <sstream>
5 #include <iostream>
6 #include <cstdlib>
7 #include <cassert>
8 #include <algorithm>
9 
10 using namespace std;
11 
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##_.empty()) \
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##_.empty()) \
27  o << #a "[][]: <empty>\n"; \
28  for (size_t i = 0; i < val.a##_.size(); ++i) { \
29  o << #a "[" << i << "]"; \
30  if (val.a##_.empty()) \
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";
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";
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";
70 
71  o << "\n# ADC to GeV conversion factor used in ZS filter for EB\n";
73 
74  o << "\n# ADC to GeV conversion factor used in ZS filter for EE\n";
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";
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";
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";
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";
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";
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";
206 
207  return o;
208 }
roAction_t actions[nactions]
Definition: GenABIO.cc:181
tuple dccNormalizedWeights
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
#define SR_VPRINT(a)
static const double deltaEta
Definition: CaloConstants.h:8
#define SR_PRINT(a)
#define SR_VVPRINT(a)