@@ -20,7 +20,6 @@ class L1ScoutingEtSumOrbitFlatTableProducer : public edm::stream::EDProducer<> {
20
20
void produce (edm::Event&, edm::EventSetup const &) override ;
21
21
22
22
private:
23
-
24
23
std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> produceSingle (l1ScoutingRun3::BxSumsOrbitCollection const &) const ;
25
24
std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> produceMultiple (l1ScoutingRun3::BxSumsOrbitCollection const &) const ;
26
25
@@ -56,7 +55,7 @@ L1ScoutingEtSumOrbitFlatTableProducer::L1ScoutingEtSumOrbitFlatTableProducer(con
56
55
phiPrecision_(params.getParameter<int >(" phiPrecision" )) {
57
56
if (!writePhysicalValues_ && !writeHardwareValues_) {
58
57
throw cms::Exception (" L1ScoutingEtSumOrbitFlatTableProducer" )
59
- << " writePhysicalValues and writeHardwareValues cannot be false at the same time!" ;
58
+ << " writePhysicalValues and writeHardwareValues cannot be false at the same time!" ;
60
59
}
61
60
produces<l1ScoutingRun3::OrbitFlatTable>();
62
61
}
@@ -68,7 +67,7 @@ void L1ScoutingEtSumOrbitFlatTableProducer::fillDescriptions(edm::ConfigurationD
68
67
desc.add <std::string>(" name" );
69
68
desc.add <std::string>(" doc" );
70
69
desc.add <bool >(" singleton" , true )
71
- ->setComment (" whether to output as singleton (one EtSum per bx) or not (multiple EtSums per bx)" );
70
+ ->setComment (" whether to output as singleton (one EtSum per bx) or not (multiple EtSums per bx)" );
72
71
desc.add <bool >(" writePhysicalValues" , true );
73
72
desc.add <bool >(" writeHardwareValues" , false );
74
73
desc.add <bool >(" writeHF" , true );
@@ -97,7 +96,7 @@ std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> L1ScoutingEtSumOrbitFlatTablePro
97
96
out->setDoc (doc_);
98
97
99
98
unsigned int nobjs = out->size ();
100
-
99
+
101
100
// physical values (float)
102
101
std::vector<float > totalEt (nobjs);
103
102
std::vector<float > totalEtEm (nobjs);
@@ -114,7 +113,7 @@ std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> L1ScoutingEtSumOrbitFlatTablePro
114
113
std::vector<float > asymHt (nobjs);
115
114
std::vector<float > asymEtHF (nobjs);
116
115
std::vector<float > asymHtHF (nobjs);
117
-
116
+
118
117
// hardware values (int)
119
118
std::vector<int > hwTotalEt (nobjs);
120
119
std::vector<int > hwTotalEtEm (nobjs);
@@ -140,7 +139,7 @@ std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> L1ScoutingEtSumOrbitFlatTablePro
140
139
std::vector<int > centrality (nobjs);
141
140
142
141
for (unsigned int i = 0 ; i < nobjs; i++) {
143
- const auto & sums = src[i];
142
+ const auto & sums = src[i];
144
143
145
144
// physical values
146
145
totalEt[i] = demux::fEt (sums.hwTotalEt ());
@@ -159,7 +158,7 @@ std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> L1ScoutingEtSumOrbitFlatTablePro
159
158
asymEtHF[i] = demux::fEt (sums.hwAsymEtHF ());
160
159
asymHtHF[i] = demux::fEt (sums.hwAsymHtHF ());
161
160
162
- // hardware values
161
+ // hardware values
163
162
hwTotalEt[i] = sums.hwTotalEt ();
164
163
hwTotalEtEm[i] = sums.hwTotalEtEm ();
165
164
hwMissEt[i] = sums.hwMissEt ();
@@ -218,14 +217,13 @@ std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> L1ScoutingEtSumOrbitFlatTablePro
218
217
out->template addColumn <int >(" hwMissHtHF" , hwMissHtHF, " hardware missHtHF" );
219
218
out->template addColumn <int >(" hwMissHtHFPhi" , hwMissHtHFPhi, " hardware missHtHF phi" );
220
219
}
221
-
222
220
}
223
221
if (writeAsym_) {
224
222
if (writePhysicalValues_) {
225
223
out->template addColumn <float >(" asymEt" , asymEt, " asymEt" , ptPrecision_);
226
224
out->template addColumn <float >(" asymHt" , asymHt, " asymHt" , ptPrecision_);
227
225
}
228
- if (writeHardwareValues_) {
226
+ if (writeHardwareValues_) {
229
227
out->template addColumn <int >(" hwAsymEt" , hwAsymEt, " hardware asymEt" );
230
228
out->template addColumn <int >(" hwAsymHt" , hwAsymHt, " hardware asymHt" );
231
229
}
@@ -257,7 +255,6 @@ std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> L1ScoutingEtSumOrbitFlatTablePro
257
255
out->template addColumn <int >(" centrality" , centrality, " centrality" );
258
256
}
259
257
260
-
261
258
return out;
262
259
}
263
260
@@ -267,24 +264,24 @@ std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> L1ScoutingEtSumOrbitFlatTablePro
267
264
// compute number of objects per bx to adjust bxOffsets
268
265
unsigned int nitems = 5 ; // totalEt, totalEtEm, missEt, totalHt, missHt
269
266
if (writeHF_)
270
- nitems += 2 ; // missEtHF, missHtHF
267
+ nitems += 2 ; // missEtHF, missHtHF
271
268
if (writeAsym_)
272
- nitems += (writeHF_ ? 4 : 2 ); // asymEt, asymHt, asymEtHF, asymHtHF
269
+ nitems += (writeHF_ ? 4 : 2 ); // asymEt, asymHt, asymEtHF, asymHtHF
273
270
if (writeMinBias_)
274
- nitems += 4 ; // minBiasHFP0, minBiasHFM0, minBiasHFP1, minBiasHFM1
271
+ nitems += 4 ; // minBiasHFP0, minBiasHFM0, minBiasHFP1, minBiasHFM1
275
272
if (writeTowerCount_)
276
- nitems += 1 ; // towerCount
273
+ nitems += 1 ; // towerCount
277
274
if (writeCentrality_)
278
- nitems += 1 ; // centrality
279
-
275
+ nitems += 1 ; // centrality
276
+
280
277
// adjust bxOffsets since each bx now contains multiple objects instead of single object
281
278
std::vector<unsigned > offsets (src.bxOffsets ());
282
279
for (auto & v : offsets)
283
280
v *= nitems;
284
281
285
282
auto out = std::make_unique<l1ScoutingRun3::OrbitFlatTable>(offsets, name_, /* singleton=*/ false );
286
283
out->setDoc (doc_);
287
-
284
+
288
285
unsigned int nobjs = out->size ();
289
286
290
287
// physical values
@@ -296,11 +293,11 @@ std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> L1ScoutingEtSumOrbitFlatTablePro
296
293
std::vector<int > hwPhi (nobjs, 0 );
297
294
298
295
std::vector<int > sumType (nobjs);
299
-
296
+
300
297
unsigned int i = 0 ;
301
298
for (const l1ScoutingRun3::BxSums& sums : src) {
302
299
assert (i + nitems <= nobjs && i % nitems == 0 );
303
-
300
+
304
301
// totalEt
305
302
pt[i] = demux::fEt (sums.hwTotalEt ());
306
303
hwEt[i] = sums.hwTotalEt ();
@@ -408,10 +405,11 @@ std::unique_ptr<l1ScoutingRun3::OrbitFlatTable> L1ScoutingEtSumOrbitFlatTablePro
408
405
out->template addColumn <int >(" hwPhi" , phi, " hardware phi" );
409
406
}
410
407
411
- out->template addColumn <int >(" etSumType" ,
412
- sumType,
413
- " the type of the EtSum "
414
- " (https://github.com/cms-sw/cmssw/blob/master/DataFormats/L1Trigger/interface/EtSum.h#L27-L56)" );
408
+ out->template addColumn <int >(
409
+ " etSumType" ,
410
+ sumType,
411
+ " the type of the EtSum "
412
+ " (https://github.com/cms-sw/cmssw/blob/master/DataFormats/L1Trigger/interface/EtSum.h#L27-L56)" );
415
413
return out;
416
414
}
417
415
0 commit comments