CMS 3D CMS Logo

SiStripSpyEventMatcher.cc
Go to the documentation of this file.
2 #ifdef SiStripMonitorHardware_BuildEventMatchingCode
3 
24 #include <algorithm>
25 #include <limits>
26 #include <memory>
27 
28 using edm::LogError;
29 using edm::LogInfo;
30 using edm::LogWarning;
31 
32 namespace sistrip {
33 
34  const char* const SpyEventMatcher::mlLabel_ = "SpyEventMatcher";
35 
36  SpyEventMatcher::EventKey::EventKey(const uint32_t eventId, const uint8_t apvAddress)
37  : eventId_(eventId), apvAddress_(apvAddress) {}
38 
40  : outputRawData_(outputRawData),
41  outputTotalEventCounters_(sistrip::FED_ID_MAX + 1),
42  outputL1ACounters_(sistrip::FED_ID_MAX + 1),
43  outputAPVAddresses_(sistrip::FED_ID_MAX + 1) {}
44 
46 
48  : rawDataTag_(config.getParameter<edm::InputTag>("RawSpyDataTag")),
49  totalEventCountersTag_(config.getParameter<edm::InputTag>("SpyTotalEventCountersTag")),
50  l1aCountersTag_(config.getParameter<edm::InputTag>("SpyL1ACountersTag")),
51  apvAddressesTag_(config.getParameter<edm::InputTag>("SpyAPVAddressesTag")),
52  scopeDigisTag_(config.getParameter<edm::InputTag>("SpyScopeDigisTag")),
53  payloadDigisTag_(config.getParameter<edm::InputTag>("SpyPayloadDigisTag")),
54  reorderedDigisTag_(config.getParameter<edm::InputTag>("SpyReorderedDigisTag")),
55  virginRawDigisTag_(config.getParameter<edm::InputTag>("SpyVirginRawDigisTag")),
56  counterDiffMax_(config.getParameter<uint32_t>("CounterDiffMaxAllowed")),
58  source_(constructSource(config.getParameter<edm::ParameterSet>("SpySource"))),
60  new edm::ProcessConfiguration(std::string("@MIXING"), edm::getReleaseVersion(), edm::getPassID())),
61  eventPrincipal_() {
62  // Use the empty parameter set for the parameter set ID of our "@MIXING" process.
64  productRegistry_->setFrozen();
65 
66  eventPrincipal_ = std::make_unique<edm::EventPrincipal>(source_->productRegistry(),
67  std::make_shared<edm::BranchIDListHelper>(),
68  std::make_shared<edm::ThinnedAssociationsHelper>(),
70  nullptr);
71  }
72 
73  std::unique_ptr<SpyEventMatcher::Source> SpyEventMatcher::constructSource(const edm::ParameterSet& sourceConfig) {
76  return sourceFactory->makeVectorInputSource(sourceConfig, description);
77  }
78 
80  size_t fileNameHash = 0U;
81  //add spy events to the map until there are none left
82  source_->loopOverEvents(
84  fileNameHash,
86  [this](auto const& iE, auto const&) {
87  this->addNextEventToMap(iE);
88  return true;
89  },
90  nullptr,
91  nullptr,
92  false);
93  //debug
94  std::ostringstream ss;
95  ss << "Events with possible matches (eventID,apvAddress): ";
96  for (std::map<EventKey, SpyEventList>::const_iterator iSpyEvent = eventMatches_.begin();
97  iSpyEvent != eventMatches_.end();
98  ++iSpyEvent) {
99  ss << "(" << iSpyEvent->first.eventId() << "," << uint16_t(iSpyEvent->first.apvAddress()) << ") ";
100  }
101  LogDebug(mlLabel_) << ss.str();
102  }
103 
105  edm::EventID spyEventId = nextSpyEvent.id();
106 
107  CountersPtr totalEventCounters = getCounters(nextSpyEvent, totalEventCountersTag_);
108  CountersPtr l1aCounters = getCounters(nextSpyEvent, l1aCountersTag_);
109  CountersPtr apvAddresses = getCounters(nextSpyEvent, apvAddressesTag_, false);
110  //loop over all FEDs. Maps should have same content and be in order so, avoid searches by iterating (and checking keys match)
111  //add all possible event keys to the map
112  std::vector<uint32_t>::const_iterator iTotalEventCount = totalEventCounters->begin();
113  std::vector<uint32_t>::const_iterator iL1ACount = l1aCounters->begin();
114  std::vector<uint32_t>::const_iterator iAPVAddress = apvAddresses->begin();
115  //for debug
116  std::map<EventKey, uint16_t> fedCounts;
117  unsigned int fedid = 0;
118  for (; ((iTotalEventCount != totalEventCounters->end()) && (iL1ACount != l1aCounters->end()) &&
119  (iAPVAddress != apvAddresses->end()));
120  (++iTotalEventCount, ++iL1ACount, ++iAPVAddress, ++fedid)) {
121  if (*iAPVAddress == 0) {
122  continue;
123  }
124 
125  if (((*iTotalEventCount) > (*iL1ACount)) || ((*iL1ACount) - (*iTotalEventCount) > counterDiffMax_)) {
126  LogWarning(mlLabel_) << "Spy event " << spyEventId.event() << " error in counter values for FED " << fedid
127  << ", totCount = " << *iTotalEventCount << ", L1Acount = " << *iL1ACount << std::endl;
128 
129  continue;
130  }
131 
132  for (uint32_t eventId = (*iTotalEventCount) + 1; eventId <= (*iL1ACount) + 1; ++eventId) {
133  EventKey key(eventId, *iAPVAddress);
134  eventMatches_[key].insert(spyEventId);
135  fedCounts[key]++;
136  }
137  }
138 
139  //for debug
140  std::ostringstream ss;
141  ss << "Spy event " << spyEventId.event() << " matches (eventID,apvAddress,nFEDs): ";
142  for (std::map<EventKey, uint16_t>::const_iterator iEventFEDCount = fedCounts.begin();
143  iEventFEDCount != fedCounts.end();
144  ++iEventFEDCount) {
145  ss << "(" << iEventFEDCount->first.eventId() << "," << uint16_t(iEventFEDCount->first.apvAddress()) << ","
146  << iEventFEDCount->second << ") ";
147  }
148  LogDebug(mlLabel_) << ss.str();
149  }
150 
152  const uint8_t apvAddress) const {
153  EventKey eventKey(eventId, apvAddress);
154  std::map<EventKey, SpyEventList>::const_iterator iMatch = eventMatches_.find(eventKey);
155  if (iMatch == eventMatches_.end()) {
156  LogDebug(mlLabel_) << "No match found for event " << eventId << " with APV address " << uint16_t(apvAddress);
157  return nullptr;
158  } else {
159  std::ostringstream ss;
160  ss << "Found matches to event " << eventId << " with address " << uint16_t(apvAddress) << " in spy events ";
161  for (SpyEventList::const_iterator iMatchingSpyEvent = iMatch->second.begin();
162  iMatchingSpyEvent != iMatch->second.end();
163  ++iMatchingSpyEvent) {
164  ss << iMatchingSpyEvent->event() << " ";
165  }
166  LogInfo(mlLabel_) << ss.str();
167  return &(iMatch->second);
168  }
169  }
170 
172  const uint32_t eventId,
173  const uint8_t apvAddress,
174  const SiStripFedCabling& cabling,
175  MatchingOutput& mo) {
176  //read the input collections from the event
177  const FEDRawDataCollection* inputRawDataPtr = getProduct<FEDRawDataCollection>(event, rawDataTag_);
178  if (!inputRawDataPtr) {
179  throw cms::Exception(mlLabel_) << "Failed to get raw spy data with tag " << rawDataTag_ << " from spy event";
180  }
181  const FEDRawDataCollection& inputRawData = *inputRawDataPtr;
182  CountersPtr inputTotalEventCounters = getCounters(event, totalEventCountersTag_);
183  CountersPtr inputL1ACounters = getCounters(event, l1aCountersTag_);
184  CountersPtr inputAPVAddresses = getCounters(event, apvAddressesTag_, false);
185  const edm::DetSetVector<SiStripRawDigi>* inputScopeDigis =
186  getProduct<edm::DetSetVector<SiStripRawDigi> >(event, scopeDigisTag_);
187  const edm::DetSetVector<SiStripRawDigi>* inputPayloadDigis =
188  getProduct<edm::DetSetVector<SiStripRawDigi> >(event, payloadDigisTag_);
189  const edm::DetSetVector<SiStripRawDigi>* inputReorderedDigis =
190  getProduct<edm::DetSetVector<SiStripRawDigi> >(event, reorderedDigisTag_);
191  const edm::DetSetVector<SiStripRawDigi>* inputVirginRawDigis =
192  getProduct<edm::DetSetVector<SiStripRawDigi> >(event, virginRawDigisTag_);
193  //construct the output vectors if the digis were found and they do not exist
194  if (inputScopeDigis && !mo.outputScopeDigisVector_.get())
196  if (inputPayloadDigis && !mo.outputPayloadDigisVector_.get())
198  if (inputReorderedDigis && !mo.outputReorderedDigisVector_.get())
200  if (inputVirginRawDigis && !mo.outputVirginRawDigisVector_.get())
202  //find matching FEDs
203  std::set<uint16_t> matchingFeds;
204  findMatchingFeds(eventId, apvAddress, inputTotalEventCounters, inputL1ACounters, inputAPVAddresses, matchingFeds);
205  LogInfo(mlLabel_) << "Spy event " << event.id() << " has " << matchingFeds.size() << " matching FEDs";
206  std::ostringstream ss;
207  ss << "Matching FEDs for event " << event.id() << ": ";
208  for (std::set<uint16_t>::const_iterator iFedId = matchingFeds.begin(); iFedId != matchingFeds.end(); ++iFedId) {
209  ss << *iFedId << " ";
210  }
211  LogDebug(mlLabel_) << ss.str();
212  //check there are no duplicates
213  std::vector<uint16_t> duplicateFeds(std::min(mo.alreadyMergedFeds_.size(), matchingFeds.size()));
214  std::vector<uint16_t>::iterator duplicatesBegin = duplicateFeds.begin();
215  std::vector<uint16_t>::iterator duplicatesEnd = std::set_intersection(mo.alreadyMergedFeds_.begin(),
216  mo.alreadyMergedFeds_.end(),
217  matchingFeds.begin(),
218  matchingFeds.end(),
219  duplicatesBegin);
220  if ((duplicatesEnd - duplicatesBegin) != 0) {
221  std::ostringstream ss;
222  ss << "Found a match for FEDs ";
223  for (std::vector<uint16_t>::const_iterator iDup = duplicatesBegin; iDup != duplicatesEnd; ++iDup) {
224  ss << *iDup << " ";
225  }
226  ss << ". Output SetSetVectors will be unusable!";
227  LogError(mlLabel_) << ss.str();
228  }
229  //merge the matching data
230  mergeMatchingData(matchingFeds,
231  inputRawData,
232  inputTotalEventCounters,
233  inputL1ACounters,
234  inputAPVAddresses,
235  inputScopeDigis,
236  inputPayloadDigis,
237  inputReorderedDigis,
238  inputVirginRawDigis,
239  mo.outputRawData_,
243  mo.outputScopeDigisVector_.get(),
244  mo.outputPayloadDigisVector_.get(),
247  cabling);
248  mo.alreadyMergedFeds_.insert(matchingFeds.begin(), matchingFeds.end());
249  }
250 
251  void SpyEventMatcher::getMatchedCollections(const uint32_t eventId,
252  const uint8_t apvAddress,
253  const SpyEventList* matchingEvents,
254  const SiStripFedCabling& cabling,
255  SpyDataCollections& collectionsToCreate) {
256  if (!matchingEvents)
257  return;
258  size_t fileNameHash = 0U;
259  FEDRawDataCollection outputRawData;
260  MatchingOutput mo(outputRawData);
261  source_->loopSpecified(
263  fileNameHash,
264  matchingEvents->begin(),
265  matchingEvents->end(),
266  [&](auto const& iE, auto const&) { this->getCollections(iE, eventId, apvAddress, cabling, mo); });
267  collectionsToCreate = SpyDataCollections(mo.outputRawData_,
271  mo.outputScopeDigisVector_.get(),
272  mo.outputPayloadDigisVector_.get(),
274  mo.outputVirginRawDigisVector_.get());
275  }
276 
277  void SpyEventMatcher::findMatchingFeds(const uint32_t eventId,
278  const uint8_t apvAddress,
279  SpyEventMatcher::CountersPtr totalEventCounters,
280  SpyEventMatcher::CountersPtr l1aCounters,
281  SpyEventMatcher::CountersPtr apvAddresses,
282  std::set<uint16_t>& matchingFeds) {
283  //loop over all FEDs. Maps should have same content and be in order so, avoid searches by iterating (and checking keys match)
284  std::vector<uint32_t>::const_iterator iTotalEventCount = totalEventCounters->begin();
285  std::vector<uint32_t>::const_iterator iL1ACount = l1aCounters->begin();
286  std::vector<uint32_t>::const_iterator iAPVAddress = apvAddresses->begin();
287  for (; ((iTotalEventCount != totalEventCounters->end()) && (iL1ACount != l1aCounters->end()) &&
288  (iAPVAddress != apvAddresses->end()));
289  (++iTotalEventCount, ++iL1ACount, ++iAPVAddress)) {
290  if (*iAPVAddress == 0) {
291  continue;
292  }
293  if ((eventId > *iTotalEventCount) && (eventId <= (*iL1ACount) + 1) && (*iAPVAddress == apvAddress)) {
294  matchingFeds.insert(matchingFeds.end(), iTotalEventCount - totalEventCounters->begin());
295  }
296  }
297  }
298 
299  void SpyEventMatcher::mergeMatchingData(const std::set<uint16_t>& matchingFeds,
300  const FEDRawDataCollection& inputRawData,
301  SpyEventMatcher::CountersPtr inputTotalEventCounters,
302  SpyEventMatcher::CountersPtr inputL1ACounters,
303  SpyEventMatcher::CountersPtr inputAPVAddresses,
304  const edm::DetSetVector<SiStripRawDigi>* inputScopeDigis,
305  const edm::DetSetVector<SiStripRawDigi>* inputPayloadDigis,
306  const edm::DetSetVector<SiStripRawDigi>* inputReorderedDigis,
307  const edm::DetSetVector<SiStripRawDigi>* inputVirginRawDigis,
308  FEDRawDataCollection& outputRawData,
309  std::vector<uint32_t>& outputTotalEventCounters,
310  std::vector<uint32_t>& outputL1ACounters,
311  std::vector<uint32_t>& outputAPVAddresses,
312  std::vector<edm::DetSet<SiStripRawDigi> >* outputScopeDigisVector,
313  std::vector<edm::DetSet<SiStripRawDigi> >* outputPayloadDigisVector,
314  std::vector<edm::DetSet<SiStripRawDigi> >* outputReorderedDigisVector,
315  std::vector<edm::DetSet<SiStripRawDigi> >* outputVirginRawDigisVector,
316  const SiStripFedCabling& cabling) {
317  //reserve space in vectors
318  if (inputScopeDigis) {
319  outputScopeDigisVector->reserve(outputScopeDigisVector->size() +
320  matchingFeds.size() *
321  FEDCH_PER_FED); //maximum number of channels on matching FEDs
322  }
323  if (inputPayloadDigis) {
324  outputPayloadDigisVector->reserve(outputPayloadDigisVector->size() + matchingFeds.size() * FEDCH_PER_FED);
325  }
326  if (inputReorderedDigis) {
327  outputReorderedDigisVector->reserve(outputReorderedDigisVector->size() + matchingFeds.size() * FEDCH_PER_FED);
328  }
329  if (inputVirginRawDigis) {
330  outputVirginRawDigisVector->reserve(outputVirginRawDigisVector->size() +
331  matchingFeds.size() * FEDCH_PER_FED /
332  2); //maximum number of dets on matching FEDs
333  }
334  //copy the data into output collections
335  std::set<uint32_t> usedDetIds;
336  for (std::set<uint16_t>::const_iterator iFedId = matchingFeds.begin(); iFedId != matchingFeds.end(); ++iFedId) {
337  const uint32_t fedId = *iFedId;
338  LogDebug(mlLabel_) << "Copying data for FED " << fedId;
339  if (inputRawData.FEDData(fedId).size() && inputRawData.FEDData(fedId).data()) {
340  outputRawData.FEDData(fedId) = inputRawData.FEDData(fedId);
341  }
342  outputTotalEventCounters[fedId] = (*inputTotalEventCounters)[fedId];
343  outputL1ACounters[fedId] = (*inputL1ACounters)[fedId];
344  outputAPVAddresses[fedId] = (*inputAPVAddresses)[fedId];
345  for (uint8_t chan = 0; chan < FEDCH_PER_FED; ++chan) {
346  uint32_t fedIndex = ((fedId & sistrip::invalid_) << 16) | (chan & sistrip::invalid_);
347  ;
348  if (inputScopeDigis) {
349  edm::DetSetVector<SiStripRawDigi>::const_iterator iScopeDigis = inputScopeDigis->find(fedIndex);
350  if (iScopeDigis != inputScopeDigis->end()) {
351  outputScopeDigisVector->push_back(*iScopeDigis);
352  }
353  }
354  if (inputPayloadDigis) {
355  edm::DetSetVector<SiStripRawDigi>::const_iterator iPayloadDigis = inputPayloadDigis->find(fedIndex);
356  if (iPayloadDigis != inputPayloadDigis->end()) {
357  outputPayloadDigisVector->push_back(*iPayloadDigis);
358  }
359  }
360  if (inputReorderedDigis) {
361  edm::DetSetVector<SiStripRawDigi>::const_iterator iReorderedDigis = inputReorderedDigis->find(fedIndex);
362  if (iReorderedDigis != inputReorderedDigis->end()) {
363  outputReorderedDigisVector->push_back(*iReorderedDigis);
364  }
365  }
366  }
367  if (inputVirginRawDigis) {
368  std::set<uint32_t> fedDetIds;
369  auto conns = cabling.fedConnections(fedId);
370  for (auto iConn = conns.begin(); iConn != conns.end(); ++iConn) {
371  if (!iConn->isConnected())
372  continue;
373  const uint32_t detId = iConn->detId();
374  if (usedDetIds.find(detId) != usedDetIds.end()) {
375  LogError(mlLabel_) << "Duplicate DetID found " << detId << " skipping data for this Det from FED " << fedId;
376  continue;
377  }
378  fedDetIds.insert(iConn->detId());
379  }
380  usedDetIds.insert(fedDetIds.begin(), fedDetIds.end());
381  for (std::set<uint32_t>::const_iterator iDetId = fedDetIds.begin(); iDetId != fedDetIds.end(); ++iDetId) {
382  edm::DetSetVector<SiStripRawDigi>::const_iterator iVirginRawDigis = inputVirginRawDigis->find(*iDetId);
383  if (iVirginRawDigis != inputVirginRawDigis->end()) {
384  outputVirginRawDigisVector->push_back(*iVirginRawDigis);
385  }
386  }
387  }
388  }
389  }
390 
392  const edm::InputTag& tag,
393  const bool mapKeyIsByFedID) {
394  const std::vector<uint32_t>* vectorFromEvent = getProduct<std::vector<uint32_t> >(event, tag);
395  if (vectorFromEvent) {
396  //vector is from event so, will be deleted when the event is destroyed (and not before)
397  return std::make_shared<CountersWrapper>(vectorFromEvent);
398  } else {
399  const std::map<uint32_t, uint32_t>* mapFromEvent = getProduct<std::map<uint32_t, uint32_t> >(event, tag);
400  if (mapFromEvent) {
401  std::vector<uint32_t>* newVector = new std::vector<uint32_t>(FED_ID_MAX + 1, 0);
402  if (mapKeyIsByFedID) {
403  for (std::map<uint32_t, uint32_t>::const_iterator iIdValue = mapFromEvent->begin();
404  iIdValue != mapFromEvent->end();
405  ++iIdValue) {
406  newVector->at(iIdValue->first) = iIdValue->second;
407  }
408  } else {
409  SpyUtilities::fillFEDMajorities(*mapFromEvent, *newVector);
410  }
411  // std::cout << " -- Map " << tag << std::endl;
412  // for (uint32_t lIt= 0;
413  // lIt < newVector->size();
414  // lIt++) {
415  // std::cout << lIt << " " << newVector->at(lIt) << std::endl;
416  // }
417  //vector was allocated here so, will need to be deleted when finished with
418  CountersPtr newCountersPtr(new CountersWrapper(newVector, true));
419  return newCountersPtr;
420  } else {
421  throw cms::Exception(mlLabel_) << "Unable to get product " << tag << " from spy event";
422  }
423  }
424  }
425 
427  FEDRawDataCollection& theRawData,
428  std::vector<uint32_t>& theTotalEventCounters,
429  std::vector<uint32_t>& theL1ACounters,
430  std::vector<uint32_t>& theAPVAddresses,
431  std::vector<edm::DetSet<SiStripRawDigi> >* theScopeDigisVector,
432  std::vector<edm::DetSet<SiStripRawDigi> >* thePayloadDigisVector,
433  std::vector<edm::DetSet<SiStripRawDigi> >* theReorderedDigisVector,
434  std::vector<edm::DetSet<SiStripRawDigi> >* theVirginRawDigisVector)
436  totalEventCounters(new std::vector<uint32_t>),
437  l1aCounters(new std::vector<uint32_t>),
438  apvAddresses(new std::vector<uint32_t>),
439  scopeDigis(theScopeDigisVector ? new edm::DetSetVector<SiStripRawDigi>(*theScopeDigisVector) : nullptr),
440  payloadDigis(thePayloadDigisVector ? new edm::DetSetVector<SiStripRawDigi>(*thePayloadDigisVector) : nullptr),
441  reorderedDigis(theReorderedDigisVector ? new edm::DetSetVector<SiStripRawDigi>(*theReorderedDigisVector)
442  : nullptr),
443  virginRawDigis(theVirginRawDigisVector ? new edm::DetSetVector<SiStripRawDigi>(*theVirginRawDigisVector)
444  : nullptr) {
445  rawData->swap(theRawData);
446  totalEventCounters->swap(theTotalEventCounters);
447  l1aCounters->swap(theL1ACounters);
448  apvAddresses->swap(theAPVAddresses);
449  }
450 
452  : rawData(),
453  totalEventCounters(),
454  l1aCounters(),
455  apvAddresses(),
456  scopeDigis(),
457  payloadDigis(),
458  reorderedDigis(),
459  virginRawDigis() {}
460 
462  : pConst(theCounters), p(nullptr), deleteP(false) {}
463 
464  SpyEventMatcher::CountersWrapper::CountersWrapper(Counters* theCounters, const bool takeOwnership)
465  : pConst(theCounters), p(theCounters), deleteP(takeOwnership) {}
466 
468  if (deleteP)
469  delete p;
470  }
471 
472 } // namespace sistrip
473 
474 #endif //SiStripMonitorHardware_BuildEventMatchingCode
void fillFEDMajorities(const std::map< uint32_t, uint32_t > &channelValues, std::vector< uint32_t > &fedMajoritiesToFill)
std::string getPassID()
Definition: GetPassID.h:7
std::map< EventKey, SpyEventList > eventMatches_
static void findMatchingFeds(const uint32_t eventId, const uint8_t apvAddress, CountersPtr totalEventCounters, CountersPtr l1aCounters, CountersPtr apvAddresses, std::set< uint16_t > &matchingFeds)
iterator find(det_id_type id)
Definition: DetSetVector.h:264
std::shared_ptr< std::vector< edm::DetSet< SiStripRawDigi > > > outputVirginRawDigisVector_
std::vector< uint32_t > Counters
std::unique_ptr< edm::EventPrincipal > eventPrincipal_
void getCollections(const edm::EventPrincipal &event, const uint32_t eventId, const uint8_t apvAddress, const SiStripFedCabling &cabling, MatchingOutput &matchingOutput)
static CountersPtr getCounters(const edm::EventPrincipal &event, const edm::InputTag &tag, const bool mapKeyIsByFedID=true)
std::unique_ptr< edm::ProcessConfiguration > processConfiguration_
const SpyEventList * matchesForEvent(const uint32_t eventId, const uint8_t apvAddress) const
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
void getMatchedCollections(const uint32_t eventId, const uint8_t apvAddress, const SpyEventList *matchingEvents, const SiStripFedCabling &cabling, SpyDataCollections &collectionsToCreate)
Definition: config.py:1
void fedIndex(uint32_t aFedIndex, uint16_t &aFedId, uint16_t &aFedChannel)
Log< level::Error, false > LogError
std::shared_ptr< std::vector< edm::DetSet< SiStripRawDigi > > > outputScopeDigisVector_
sistrip classes
std::shared_ptr< std::vector< edm::DetSet< SiStripRawDigi > > > outputReorderedDigisVector_
std::unique_ptr< FEDRawDataCollection > rawData
std::unique_ptr< Source > constructSource(const edm::ParameterSet &sourceConfig)
std::shared_ptr< CountersWrapper > CountersPtr
std::unique_ptr< VectorInputSource > makeVectorInputSource(ParameterSet const &, VectorInputSourceDescription const &) const
std::unique_ptr< std::vector< uint32_t > > totalEventCounters
std::set< EventID > SpyEventList
std::shared_ptr< edm::ProductRegistry > productRegistry_
std::unique_ptr< std::vector< uint32_t > > apvAddresses
MatchingOutput(FEDRawDataCollection &outputRawData)
std::unique_ptr< edm::VectorInputSource > const source_
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
static const char *const mlLabel_
std::string getReleaseVersion()
Log< level::Info, false > LogInfo
EventKey(const uint32_t eventId, const uint8_t apvAddress)
static VectorInputSourceFactory const * get()
static const uint16_t invalid_
Definition: Constants.h:16
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void addNextEventToMap(const edm::EventPrincipal &nextSpyEvent)
HLT enums.
static const uint16_t FEDCH_PER_FED
std::unique_ptr< std::vector< uint32_t > > l1aCounters
static void mergeMatchingData(const std::set< uint16_t > &matchingFeds, const FEDRawDataCollection &inputRawData, CountersPtr inputTotalEventCounters, CountersPtr inputL1ACounters, CountersPtr inputAPVAddresses, const edm::DetSetVector< SiStripRawDigi > *inputScopeDigis, const edm::DetSetVector< SiStripRawDigi > *inputPayloadDigis, const edm::DetSetVector< SiStripRawDigi > *inputReorderedDigis, const edm::DetSetVector< SiStripRawDigi > *inputVirginRawDigis, FEDRawDataCollection &outputRawData, std::vector< uint32_t > &outputTotalEventCounters, std::vector< uint32_t > &outputL1ACounters, std::vector< uint32_t > &outputAPVAddresses, std::vector< edm::DetSet< SiStripRawDigi > > *outputScopeDigisVector, std::vector< edm::DetSet< SiStripRawDigi > > *outputPayloadDigisVector, std::vector< edm::DetSet< SiStripRawDigi > > *outputReorderedDigisVector, std::vector< edm::DetSet< SiStripRawDigi > > *outputVirginRawDigisVector, const SiStripFedCabling &cabling)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
SpyEventMatcher(const edm::ParameterSet &config)
static const uint16_t FED_ID_MAX
std::shared_ptr< std::vector< edm::DetSet< SiStripRawDigi > > > outputPayloadDigisVector_
Log< level::Warning, false > LogWarning
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
A Digi for the silicon strip detector, containing only adc information, and suitable for storing raw ...
EventID const & id() const
static ParameterSetID emptyParameterSetID()
Definition: ParameterSet.cc:94
ConnsConstIterRange fedConnections(uint16_t fed_id) const
EventNumber_t event() const
Definition: EventID.h:40
Definition: event.py:1
#define LogDebug(id)
std::vector< std::string > set_intersection(std::vector< std::string > const &v1, std::vector< std::string > const &v2)