CMS 3D CMS Logo

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