38 #define COUT std::cout << "VI "
40 #define COUT LogDebug("")
55 <<
"[ClustersFromRawProducer::"
58 <<
" NULL pointer to FEDRawData for FED id "
68 <<
"[ClustersFromRawProducer::"
70 <<
" FEDRawData has zero size for FED id "
84 <<
"Exception caught when creating FEDBuffer object for FED " << fedId <<
": " << e.
what();
86 delete buffer; buffer=
nullptr;
109 bool idoAPVEmulatorCheck):
113 doAPVEmulatorCheck(idoAPVEmulatorCheck){
118 ~ClusterFiller() { printStat();}
125 std::unique_ptr<sistrip::FEDBuffer> buffers[1024];
126 bool done[1024] = {};
136 bool doAPVEmulatorCheck;
149 void zeroStat()
const { stat = Stat(); }
150 void incTot(
int n)
const { stat.totDet=
n;}
151 void incReady()
const { stat.detReady++;}
152 void incSet()
const { stat.detSet++;}
153 void incAct()
const { stat.detAct++;}
154 void incNoZ()
const { stat.detNoZ++;}
155 void printStat()
const {
156 COUT <<
"VI clusters " << stat.totDet <<
','<< stat.detReady <<
','<< stat.detSet <<
','<< stat.detAct<<
','<< stat.detNoZ << std::endl;
160 static void zeroStat(){}
161 static void incTot(
int){}
162 static void incReady() {}
163 static void incSet() {}
164 static void incAct() {}
165 static void incNoZ() {}
166 static void printStat(){}
181 onDemand(conf.getParameter<bool>(
"onDemand")),
185 doAPVEmulatorCheck_(conf.existsAs<bool>(
"DoAPVEmulatorCheck") ? conf.getParameter<bool>(
"DoAPVEmulatorCheck") :
true)
188 produces< edmNew::DetSetVector<SiStripCluster> > ();
208 std::auto_ptr< edmNew::DetSetVector<SiStripCluster> >
218 output->reserve(15000,12*10000);
224 COUT <<
output->dataSize() <<
" clusters from "
225 <<
output->size() <<
" modules"
249 std::auto_ptr<SiStripRawProcessingAlgorithms>
rawAlgos_;
265 (*clusterizer_).initialize(es);
266 cabling_ = (*clusterizer_).cabling();
267 (*rawAlgos_).initialize(es);
283 if(record.empty()) record.abort();
292 auto idet= record.id();
296 if (!
clusterizer.stripByStripBegin(idet)) {
return; }
312 auto buffer = buffers[
fedId].get();
318 if unlikely(!buffer->channelGood(fedCh,doAPVEmulatorCheck)) {
320 std::ostringstream
ss;
321 ss <<
"Problem unpacking channel " << fedCh <<
" on FED " <<
fedId;
328 uint16_t ipair =
conn->apvPairNumber();
352 std::ostringstream
ss;
353 ss <<
"Unordered clusters for channel " << fedCh <<
" on FED " << fedId <<
": " << e.
what();
377 std::ostringstream
ss;
378 ss <<
"Unordered clusters for channel " << fedCh <<
" on FED " << fedId <<
": " << e.
what();
389 std::vector<int16_t> digis;
391 digis.push_back(unpacker.
adc());
396 uint32_t
id =
conn->detId();
401 uint16_t firstAPV = ipair*2;
402 rawAlgos.SuppressVirginRawData(
id, firstAPV,digis, zsdigis);
414 std::vector<int16_t> digis;
416 digis.push_back(unpacker.
adc());
421 uint32_t
id =
conn->detId();
425 uint16_t firstAPV = ipair*2;
426 rawAlgos.SuppressProcessedRawData(
id, firstAPV,digis, zsdigis);
432 <<
"[ClustersFromRawProducer::"
434 <<
" FEDRawData readout mode "
438 <<
" not supported.";
447 if(!record.empty()) incNoZ();
static FEDRawChannelUnpacker procRawModeUnpacker(const FEDChannel &channel)
virtual char const * what() const
T getParameter(std::string const &) const
static FEDZSChannelUnpacker zeroSuppressedModeUnpacker(const FEDChannel &channel)
void run(const FEDRawDataCollection &rawColl, edmNew::DetSetVector< SiStripCluster > &output)
static const char mlRawToCluster_[]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::auto_ptr< SiStripRawProcessingAlgorithms > rawAlgos_
static FEDRawChannelUnpacker virginRawModeUnpacker(const FEDChannel &channel)
std::auto_ptr< StripClusterizerAlgorithm > clusterizer_
void initialize(const edm::EventSetup &es)
size_t size() const
Lenght of the data buffer in bytes.
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual bool doChecks(bool doCRC=true) const
void beginRun(const edm::Run &, const edm::EventSetup &es)
void produce(edm::Event &ev, const edm::EventSetup &es)
static FEDZSChannelUnpacker zeroSuppressedLiteModeUnpacker(const FEDChannel &channel)
SiStripDetCabling const * cabling_
SiStripClusterizerFromRaw(const edm::ParameterSet &conf)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
if(conf.exists("allCellsPositionCalc"))
collection_type::const_iterator const_iterator
edm::EDGetTokenT< FEDRawDataCollection > productToken_