4
4
#include " RecoLocalTracker/SiStripZeroSuppression/interface/SiStripRawProcessingFactory.h"
5
5
6
6
#include " RecoLocalTracker/SiStripClusterizer/interface/StripClusterizerAlgorithm.h"
7
- #include " RecoLocalTracker/SiStripClusterizer/interface/ThreeThresholdAlgorithm.h"
8
7
#include " RecoLocalTracker/SiStripZeroSuppression/interface/SiStripRawProcessingAlgorithms.h"
9
8
10
9
#include " DataFormats/SiStripCluster/interface/SiStripCluster.h"
@@ -90,11 +89,10 @@ namespace {
90
89
return buffer;
91
90
}
92
91
93
- template <class AlgoT >
94
92
class ClusterFiller final : public StripClusterizerAlgorithm::output_t ::Getter {
95
93
public:
96
94
ClusterFiller (const FEDRawDataCollection& irawColl,
97
- const AlgoT & iclusterizer,
95
+ StripClusterizerAlgorithm & iclusterizer,
98
96
SiStripRawProcessingAlgorithms& irawAlgos,
99
97
bool idoAPVEmulatorCheck,
100
98
bool legacy,
@@ -121,7 +119,7 @@ namespace {
121
119
122
120
const FEDRawDataCollection& rawColl;
123
121
124
- const AlgoT & clusterizer;
122
+ StripClusterizerAlgorithm & clusterizer;
125
123
const SiStripClusterizerConditions& conditions;
126
124
SiStripRawProcessingAlgorithms& rawAlgos;
127
125
@@ -183,7 +181,7 @@ class SiStripClusterizerFromRaw final : public edm::stream::EDProducer<> {
183
181
legacy_(conf.getParameter<bool >(" LegacyUnpacker" )),
184
182
hybridZeroSuppressed_(conf.getParameter<bool >(" HybridZeroSuppressed" )) {
185
183
productToken_ = consumes<FEDRawDataCollection>(conf.getParameter <edm::InputTag>(" ProductLabel" ));
186
- produces<edmNew::DetSetVector<SiStripCluster>>();
184
+ produces<edmNew::DetSetVector<SiStripCluster> >();
187
185
assert (clusterizer_.get ());
188
186
assert (rawAlgos_.get ());
189
187
}
@@ -195,23 +193,12 @@ class SiStripClusterizerFromRaw final : public edm::stream::EDProducer<> {
195
193
edm::Handle <FEDRawDataCollection> rawData;
196
194
ev.getByToken (productToken_, rawData);
197
195
198
- const ThreeThresholdAlgorithm* clusterizer3 = dynamic_cast <const ThreeThresholdAlgorithm*>(clusterizer_.get ());
199
- std::unique_ptr<edmNew::DetSetVector<SiStripCluster>> output;
200
- if (onDemand) {
201
- if (clusterizer3 == nullptr )
202
- output = std::make_unique<edmNew::DetSetVector<SiStripCluster>>(edmNew::DetSetVector<SiStripCluster>(
203
- std::shared_ptr<edmNew::DetSetVector<SiStripCluster>::Getter>(
204
- std::make_shared<ClusterFiller<StripClusterizerAlgorithm>>(
205
- *rawData, *clusterizer_, *rawAlgos_, doAPVEmulatorCheck_, legacy_, hybridZeroSuppressed_)),
206
- clusterizer_->conditions ().allDetIds ()));
207
- else
208
- output = std::make_unique<edmNew::DetSetVector<SiStripCluster>>(edmNew::DetSetVector<SiStripCluster>(
209
- std::shared_ptr<edmNew::DetSetVector<SiStripCluster>::Getter>(
210
- std::make_shared<ClusterFiller<ThreeThresholdAlgorithm>>(
211
- *rawData, *clusterizer3, *rawAlgos_, doAPVEmulatorCheck_, legacy_, hybridZeroSuppressed_)),
212
- clusterizer_->conditions ().allDetIds ()));
213
- } else
214
- output = std::make_unique<edmNew::DetSetVector<SiStripCluster>>(edmNew::DetSetVector<SiStripCluster>());
196
+ std::unique_ptr<edmNew::DetSetVector<SiStripCluster> > output (
197
+ onDemand ? new edmNew::DetSetVector<SiStripCluster>(
198
+ std::shared_ptr<edmNew::DetSetVector<SiStripCluster>::Getter>(std::make_shared<ClusterFiller>(
199
+ *rawData, *clusterizer_, *rawAlgos_, doAPVEmulatorCheck_, legacy_, hybridZeroSuppressed_)),
200
+ clusterizer_->conditions ().allDetIds ())
201
+ : new edmNew::DetSetVector<SiStripCluster>());
215
202
216
203
if (onDemand)
217
204
assert (output->onDemand ());
@@ -279,38 +266,20 @@ void SiStripClusterizerFromRaw::initialize(const edm::EventSetup& es) {
279
266
}
280
267
281
268
void SiStripClusterizerFromRaw::run (const FEDRawDataCollection& rawColl, edmNew::DetSetVector<SiStripCluster>& output) {
282
- const ThreeThresholdAlgorithm* clusterizer3 = dynamic_cast <const ThreeThresholdAlgorithm*>(clusterizer_.get ());
283
- if (clusterizer3 == nullptr ) {
284
- ClusterFiller<StripClusterizerAlgorithm> filler (
285
- rawColl, *clusterizer_, *rawAlgos_, doAPVEmulatorCheck_, legacy_, hybridZeroSuppressed_);
269
+ ClusterFiller filler (rawColl, *clusterizer_, *rawAlgos_, doAPVEmulatorCheck_, legacy_, hybridZeroSuppressed_);
286
270
287
- // loop over good det in cabling
288
- for (auto idet : clusterizer_->conditions ().allDetIds ()) {
289
- StripClusterizerAlgorithm::output_t ::TSFastFiller record (output, idet);
271
+ // loop over good det in cabling
272
+ for (auto idet : clusterizer_->conditions ().allDetIds ()) {
273
+ StripClusterizerAlgorithm::output_t ::TSFastFiller record (output, idet);
290
274
291
- filler.fill (record);
275
+ filler.fill (record);
292
276
293
- if (record.empty ())
294
- record.abort ();
295
- } // end loop over dets
296
- } else {
297
- ClusterFiller<ThreeThresholdAlgorithm> filler (
298
- rawColl, *clusterizer3, *rawAlgos_, doAPVEmulatorCheck_, legacy_, hybridZeroSuppressed_);
299
-
300
- // loop over good det in cabling
301
- for (auto idet : clusterizer_->conditions ().allDetIds ()) {
302
- StripClusterizerAlgorithm::output_t ::TSFastFiller record (output, idet);
303
-
304
- filler.fill (record);
305
-
306
- if (record.empty ())
307
- record.abort ();
308
- } // end loop over dets
309
- }
277
+ if (record.empty ())
278
+ record.abort ();
279
+ } // end loop over dets
310
280
}
311
281
312
282
namespace {
313
- template <class AlgoT >
314
283
class StripByStripAdder {
315
284
public:
316
285
typedef std::output_iterator_tag iterator_category;
@@ -319,7 +288,7 @@ namespace {
319
288
typedef void pointer;
320
289
typedef void reference;
321
290
322
- StripByStripAdder (const AlgoT & clusterizer,
291
+ StripByStripAdder (StripClusterizerAlgorithm & clusterizer,
323
292
StripClusterizerAlgorithm::State& state,
324
293
StripClusterizerAlgorithm::output_t ::TSFastFiller& record)
325
294
: clusterizer_(clusterizer), state_(state), record_(record) {}
@@ -334,7 +303,7 @@ namespace {
334
303
StripByStripAdder& operator ++(int ) { return *this ; }
335
304
336
305
private:
337
- const AlgoT & clusterizer_;
306
+ StripClusterizerAlgorithm & clusterizer_;
338
307
StripClusterizerAlgorithm::State& state_;
339
308
StripClusterizerAlgorithm::output_t ::TSFastFiller& record_;
340
309
};
@@ -357,8 +326,7 @@ namespace {
357
326
};
358
327
} // namespace
359
328
360
- template <class AlgoT >
361
- void ClusterFiller<AlgoT>::fill(StripClusterizerAlgorithm::output_t ::TSFastFiller& record) const {
329
+ void ClusterFiller::fill (StripClusterizerAlgorithm::output_t ::TSFastFiller& record) const {
362
330
try { // edmNew::CapacityExaustedException
363
331
incReady ();
364
332
@@ -425,7 +393,7 @@ void ClusterFiller<AlgoT>::fill(StripClusterizerAlgorithm::output_t::TSFastFille
425
393
426
394
using namespace sistrip ;
427
395
if LIKELY (fedchannelunpacker::isZeroSuppressed (mode, legacy_, lmode)) {
428
- auto perStripAdder = StripByStripAdder<AlgoT> (clusterizer, state, record);
396
+ auto perStripAdder = StripByStripAdder (clusterizer, state, record);
429
397
const auto isNonLite = fedchannelunpacker::isNonLiteZS (mode, legacy_, lmode);
430
398
const uint8_t pCode = (isNonLite ? buffer->packetCode (legacy_, fedCh) : 0 );
431
399
auto st_ch = fedchannelunpacker::StatusCode::SUCCESS;
0 commit comments