CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripSpyEventMatcher.cc
Go to the documentation of this file.
2 #ifdef SiStripMonitorHardware_BuildEventMatchingCode
3 
23 #include "boost/bind.hpp"
24 #include "boost/shared_ptr.hpp"
25 #include <algorithm>
26 #include <limits>
27 
28 using edm::LogInfo;
29 using edm::LogWarning;
30 using edm::LogError;
31 
32 namespace sistrip {
33 
34  const char* SpyEventMatcher::mlLabel_ = "SpyEventMatcher";
35 
36  SpyEventMatcher::EventKey::EventKey(const uint32_t eventId, const uint8_t apvAddress)
37  : eventId_(eventId), apvAddress_(apvAddress) {}
38 
39  SpyEventMatcher::MatchingOutput::MatchingOutput(FEDRawDataCollection& outputRawData) :
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 
45  SpyEventMatcher::~SpyEventMatcher() {}
46 
47  SpyEventMatcher::SpyEventMatcher(const edm::ParameterSet& config)
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")),
57  productRegistry_(new edm::SignallingProductRegistry),
58  source_(constructSource(config.getParameter<edm::ParameterSet>("SpySource"))),
59  processConfiguration_(new edm::ProcessConfiguration(std::string("@MIXING"), edm::getReleaseVersion(), edm::getPassID())),
60  eventPrincipal_()
61  {
62  // Use the empty parameter set for the parameter set ID of our "@MIXING" process.
63  edm::ParameterSet emptyPSet;
64  emptyPSet.registerIt();
65  processConfiguration_->setParameterSetID(emptyPSet.id());
66  source_->productRegistry()->setFrozen();
67 
68  eventPrincipal_.reset(new edm::EventPrincipal(source_->productRegistry(),
69  source_->branchIDListHelper(),
70  *processConfiguration_,
71  nullptr));
72  }
73 
74  std::unique_ptr<SpyEventMatcher::Source> SpyEventMatcher::constructSource(const edm::ParameterSet& sourceConfig)
75  {
78  *productRegistry_,
79  boost::shared_ptr<edm::BranchIDListHelper>(new edm::BranchIDListHelper),
80  boost::shared_ptr<edm::ActivityRegistry>(new edm::ActivityRegistry),
81  -1, -1);
82  return sourceFactory->makeVectorInputSource(sourceConfig, description);
83  }
84 
85  void SpyEventMatcher::initialize()
86  {
87  //add spy events to the map until there are none left
88  source_->loopSequential(*eventPrincipal_,std::numeric_limits<size_t>::max(),boost::bind(&SpyEventMatcher::addNextEventToMap,this,_1));
89  //debug
90  std::ostringstream ss;
91  ss << "Events with possible matches (eventID,apvAddress): ";
92  for (std::map<EventKey,SpyEventList>::const_iterator iSpyEvent = eventMatches_.begin(); iSpyEvent != eventMatches_.end(); ++iSpyEvent) {
93  ss << "(" << iSpyEvent->first.eventId() << "," << uint16_t(iSpyEvent->first.apvAddress()) << ") ";
94  }
95  LogDebug(mlLabel_) << ss.str();
96  }
97 
98  void SpyEventMatcher::addNextEventToMap(const edm::EventPrincipal& nextSpyEvent)
99  {
100  edm::EventID spyEventId = nextSpyEvent.id();
101 
102  CountersPtr totalEventCounters = getCounters(nextSpyEvent,totalEventCountersTag_);
103  CountersPtr l1aCounters = getCounters(nextSpyEvent,l1aCountersTag_);
104  CountersPtr apvAddresses = getCounters(nextSpyEvent,apvAddressesTag_,false);
105  //loop over all FEDs. Maps should have same content and be in order so, avoid searches by iterating (and checking keys match)
106  //add all possible event keys to the map
107  std::vector<uint32_t>::const_iterator iTotalEventCount = totalEventCounters->begin();
108  std::vector<uint32_t>::const_iterator iL1ACount = l1aCounters->begin();
109  std::vector<uint32_t>::const_iterator iAPVAddress = apvAddresses->begin();
110  //for debug
111  std::map<EventKey,uint16_t> fedCounts;
112  unsigned int fedid = 0;
113  for (;
114  ( (iTotalEventCount != totalEventCounters->end()) && (iL1ACount != l1aCounters->end()) && (iAPVAddress != apvAddresses->end()) );
115  (++iTotalEventCount, ++iL1ACount, ++iAPVAddress, ++fedid)
116  ){
117  if (*iAPVAddress == 0) {
118  continue;
119  }
120 
121  if ( ((*iTotalEventCount) > (*iL1ACount) ) ||
122  ((*iL1ACount)-(*iTotalEventCount) > counterDiffMax_)
123  ) {
124  LogWarning(mlLabel_) << "Spy event " << spyEventId.event()
125  << " error in counter values for FED " << fedid
126  << ", totCount = " << *iTotalEventCount
127  << ", L1Acount = " << *iL1ACount
128  << std::endl;
129 
130  continue;
131  }
132 
133  for (uint32_t eventId = (*iTotalEventCount)+1; eventId <= (*iL1ACount)+1; ++eventId) {
134  EventKey key(eventId,*iAPVAddress);
135  eventMatches_[key].insert(spyEventId);
136  fedCounts[key]++;
137  }
138  }
139 
140  //for debug
141  std::ostringstream ss;
142  ss << "Spy event " << spyEventId.event() << " matches (eventID,apvAddress,nFEDs): ";
143  for (std::map<EventKey,uint16_t>::const_iterator iEventFEDCount = fedCounts.begin(); iEventFEDCount != fedCounts.end(); ++iEventFEDCount) {
144  ss << "(" << iEventFEDCount->first.eventId() << "," << uint16_t(iEventFEDCount->first.apvAddress()) << "," << iEventFEDCount->second << ") ";
145  }
146  LogDebug(mlLabel_) << ss.str();
147  }
148 
149  const SpyEventMatcher::SpyEventList* SpyEventMatcher::matchesForEvent(const uint32_t eventId, const uint8_t apvAddress) const
150  {
151  EventKey eventKey(eventId,apvAddress);
152  std::map<EventKey,SpyEventList>::const_iterator iMatch = eventMatches_.find(eventKey);
153  if (iMatch == eventMatches_.end()) {
154  LogDebug(mlLabel_) << "No match found for event " << eventId << " with APV address " << uint16_t(apvAddress);
155  return NULL;
156  }
157  else {
158  std::ostringstream ss;
159  ss << "Found matches to event " << eventId << " with address " << uint16_t(apvAddress) << " in spy events ";
160  for (SpyEventList::const_iterator iMatchingSpyEvent = iMatch->second.begin(); iMatchingSpyEvent != iMatch->second.end(); ++iMatchingSpyEvent) {
161  ss << iMatchingSpyEvent->event() << " ";
162  }
163  LogInfo(mlLabel_) << ss.str();
164  return &(iMatch->second);
165  }
166  }
167 
168  void SpyEventMatcher::getCollections(const edm::EventPrincipal& event, const uint32_t eventId,
169  const uint8_t apvAddress, const SiStripFedCabling& cabling,
170  MatchingOutput& mo) {
171 
172  //read the input collections from the event
173  const FEDRawDataCollection* inputRawDataPtr = getProduct< FEDRawDataCollection >(event,rawDataTag_);
174  if (!inputRawDataPtr) {
175  throw cms::Exception(mlLabel_) << "Failed to get raw spy data with tag " << rawDataTag_ << " from spy event";
176  }
177  const FEDRawDataCollection& inputRawData = *inputRawDataPtr;
178  CountersPtr inputTotalEventCounters = getCounters(event,totalEventCountersTag_);
179  CountersPtr inputL1ACounters = getCounters(event,l1aCountersTag_);
180  CountersPtr inputAPVAddresses = getCounters(event,apvAddressesTag_,false);
181  const edm::DetSetVector<SiStripRawDigi>* inputScopeDigis = getProduct< edm::DetSetVector<SiStripRawDigi> >(event,scopeDigisTag_);
182  const edm::DetSetVector<SiStripRawDigi>* inputPayloadDigis = getProduct< edm::DetSetVector<SiStripRawDigi> >(event,payloadDigisTag_);
183  const edm::DetSetVector<SiStripRawDigi>* inputReorderedDigis = getProduct< edm::DetSetVector<SiStripRawDigi> >(event,reorderedDigisTag_);
184  const edm::DetSetVector<SiStripRawDigi>* inputVirginRawDigis = getProduct< edm::DetSetVector<SiStripRawDigi> >(event,virginRawDigisTag_);
185  //construct the output vectors if the digis were found and they do not exist
186  if (inputScopeDigis && !mo.outputScopeDigisVector_.get() ) mo.outputScopeDigisVector_.reset(new std::vector< edm::DetSet<SiStripRawDigi> >);
187  if (inputPayloadDigis && !mo.outputPayloadDigisVector_.get() ) mo.outputPayloadDigisVector_.reset(new std::vector< edm::DetSet<SiStripRawDigi> >);
188  if (inputReorderedDigis && !mo.outputReorderedDigisVector_.get() ) mo.outputReorderedDigisVector_.reset(new std::vector< edm::DetSet<SiStripRawDigi> >);
189  if (inputVirginRawDigis && !mo.outputVirginRawDigisVector_.get() ) mo.outputVirginRawDigisVector_.reset(new std::vector< edm::DetSet<SiStripRawDigi> >);
190  //find matching FEDs
191  std::set<uint16_t> matchingFeds;
192  findMatchingFeds(eventId,apvAddress,inputTotalEventCounters,inputL1ACounters,inputAPVAddresses,matchingFeds);
193  LogInfo(mlLabel_) << "Spy event " << event.id() << " has " << matchingFeds.size() << " matching FEDs";
194  std::ostringstream ss;
195  ss << "Matching FEDs for event " << event.id() << ": ";
196  for (std::set<uint16_t>::const_iterator iFedId = matchingFeds.begin(); iFedId != matchingFeds.end(); ++iFedId) {
197  ss << *iFedId << " ";
198  }
199  LogDebug(mlLabel_) << ss.str();
200  //check there are no duplicates
201  std::vector<uint16_t> duplicateFeds( std::min(mo.alreadyMergedFeds_.size(),matchingFeds.size()) );
202  std::vector<uint16_t>::iterator duplicatesBegin = duplicateFeds.begin();
203  std::vector<uint16_t>::iterator duplicatesEnd = std::set_intersection(mo.alreadyMergedFeds_.begin(),mo.alreadyMergedFeds_.end(),
204  matchingFeds.begin(),matchingFeds.end(),
205  duplicatesBegin);
206  if ( (duplicatesEnd-duplicatesBegin) != 0 ) {
207  std::ostringstream ss;
208  ss << "Found a match for FEDs ";
209  for (std::vector<uint16_t>::const_iterator iDup = duplicatesBegin; iDup != duplicatesEnd; ++iDup) {
210  ss << *iDup << " ";
211  }
212  ss << ". Output SetSetVectors will be unusable!";
213  LogError(mlLabel_) << ss.str();
214  }
215  //merge the matching data
216  mergeMatchingData(matchingFeds,inputRawData,inputTotalEventCounters,inputL1ACounters,inputAPVAddresses,
217  inputScopeDigis,inputPayloadDigis,inputReorderedDigis,inputVirginRawDigis,
218  mo.outputRawData_,mo.outputTotalEventCounters_,mo.outputL1ACounters_,mo.outputAPVAddresses_,
219  mo.outputScopeDigisVector_.get(),mo.outputPayloadDigisVector_.get(),
220  mo.outputReorderedDigisVector_.get(),mo.outputVirginRawDigisVector_.get(),
221  cabling);
222  mo.alreadyMergedFeds_.insert(matchingFeds.begin(),matchingFeds.end());
223  }
224 
225  void SpyEventMatcher::getMatchedCollections(const uint32_t eventId, const uint8_t apvAddress,
226  const SpyEventList* matchingEvents, const SiStripFedCabling& cabling,
227  SpyDataCollections& collectionsToCreate)
228  {
229  if (!matchingEvents) return;
230  FEDRawDataCollection outputRawData;
231  MatchingOutput mo(outputRawData);
232  source_->loopSpecified(*eventPrincipal_,*matchingEvents,boost::bind(&SpyEventMatcher::getCollections,this,_1,
233  eventId,apvAddress,boost::cref(cabling),boost::ref(mo)));
234  SpyDataCollections collections(mo.outputRawData_,mo.outputTotalEventCounters_,mo.outputL1ACounters_,mo.outputAPVAddresses_,
235  mo.outputScopeDigisVector_.get(),mo.outputPayloadDigisVector_.get(),
236  mo.outputReorderedDigisVector_.get(),mo.outputVirginRawDigisVector_.get());
237  collectionsToCreate = collections;
238  }
239 
240  void SpyEventMatcher::findMatchingFeds(const uint32_t eventId, const uint8_t apvAddress,
241  SpyEventMatcher::CountersPtr totalEventCounters,
242  SpyEventMatcher::CountersPtr l1aCounters,
243  SpyEventMatcher::CountersPtr apvAddresses,
244  std::set<uint16_t>& matchingFeds)
245  {
246  //loop over all FEDs. Maps should have same content and be in order so, avoid searches by iterating (and checking keys match)
247  std::vector<uint32_t>::const_iterator iTotalEventCount = totalEventCounters->begin();
248  std::vector<uint32_t>::const_iterator iL1ACount = l1aCounters->begin();
249  std::vector<uint32_t>::const_iterator iAPVAddress = apvAddresses->begin();
250  for (;
251  ( (iTotalEventCount != totalEventCounters->end()) && (iL1ACount != l1aCounters->end()) && (iAPVAddress != apvAddresses->end()) );
252  (++iTotalEventCount, ++iL1ACount, ++iAPVAddress)
253  ){
254  if (*iAPVAddress == 0) {
255  continue;
256  }
257  if ( (eventId > *iTotalEventCount) && (eventId <= (*iL1ACount)+1) && (*iAPVAddress == apvAddress) ) {
258  matchingFeds.insert(matchingFeds.end(),iTotalEventCount-totalEventCounters->begin());
259  }
260  }
261  }
262 
263  void SpyEventMatcher::mergeMatchingData(const std::set<uint16_t>& matchingFeds,
264  const FEDRawDataCollection& inputRawData,
265  SpyEventMatcher::CountersPtr inputTotalEventCounters,
266  SpyEventMatcher::CountersPtr inputL1ACounters,
267  SpyEventMatcher::CountersPtr inputAPVAddresses,
268  const edm::DetSetVector<SiStripRawDigi>* inputScopeDigis,
269  const edm::DetSetVector<SiStripRawDigi>* inputPayloadDigis,
270  const edm::DetSetVector<SiStripRawDigi>* inputReorderedDigis,
271  const edm::DetSetVector<SiStripRawDigi>* inputVirginRawDigis,
272  FEDRawDataCollection& outputRawData,
273  std::vector<uint32_t>& outputTotalEventCounters,
274  std::vector<uint32_t>& outputL1ACounters,
275  std::vector<uint32_t>& outputAPVAddresses,
276  std::vector< edm::DetSet<SiStripRawDigi> >* outputScopeDigisVector,
277  std::vector< edm::DetSet<SiStripRawDigi> >* outputPayloadDigisVector,
278  std::vector< edm::DetSet<SiStripRawDigi> >* outputReorderedDigisVector,
279  std::vector< edm::DetSet<SiStripRawDigi> >* outputVirginRawDigisVector,
280  const SiStripFedCabling& cabling)
281  {
282  //reserve space in vectors
283  if (inputScopeDigis) {
284  outputScopeDigisVector->reserve(outputScopeDigisVector->size()+matchingFeds.size()*FEDCH_PER_FED); //maximum number of channels on matching FEDs
285  }
286  if (inputPayloadDigis) {
287  outputPayloadDigisVector->reserve(outputPayloadDigisVector->size()+matchingFeds.size()*FEDCH_PER_FED);
288  }
289  if (inputReorderedDigis) {
290  outputReorderedDigisVector->reserve(outputReorderedDigisVector->size()+matchingFeds.size()*FEDCH_PER_FED);
291  }
292  if (inputVirginRawDigis) {
293  outputVirginRawDigisVector->reserve(outputVirginRawDigisVector->size()+matchingFeds.size()*FEDCH_PER_FED/2); //maximum number of dets on matching FEDs
294  }
295  //copy the data into output collections
296  std::set<uint32_t> usedDetIds;
297  for (std::set<uint16_t>::const_iterator iFedId = matchingFeds.begin(); iFedId != matchingFeds.end(); ++iFedId) {
298  const uint32_t fedId = *iFedId;
299  LogDebug(mlLabel_) << "Copying data for FED " << fedId;
300  if (inputRawData.FEDData(fedId).size() && inputRawData.FEDData(fedId).data()) {
301  outputRawData.FEDData(fedId) = inputRawData.FEDData(fedId);
302  }
303  outputTotalEventCounters[fedId] = (*inputTotalEventCounters)[fedId];
304  outputL1ACounters[fedId] = (*inputL1ACounters)[fedId];
305  outputAPVAddresses[fedId] = (*inputAPVAddresses)[fedId];
306  for (uint8_t chan = 0; chan < FEDCH_PER_FED; ++chan) {
307  uint32_t fedIndex = SiStripFedKey::fedIndex(fedId,chan);
308  if (inputScopeDigis) {
309  edm::DetSetVector<SiStripRawDigi>::const_iterator iScopeDigis = inputScopeDigis->find(fedIndex);
310  if (iScopeDigis != inputScopeDigis->end()) {
311  outputScopeDigisVector->push_back(*iScopeDigis);
312  }
313  }
314  if (inputPayloadDigis) {
315  edm::DetSetVector<SiStripRawDigi>::const_iterator iPayloadDigis = inputPayloadDigis->find(fedIndex);
316  if (iPayloadDigis != inputPayloadDigis->end()) {
317  outputPayloadDigisVector->push_back(*iPayloadDigis);
318  }
319  }
320  if (inputReorderedDigis) {
321  edm::DetSetVector<SiStripRawDigi>::const_iterator iReorderedDigis = inputReorderedDigis->find(fedIndex);
322  if (iReorderedDigis != inputReorderedDigis->end()) {
323  outputReorderedDigisVector->push_back(*iReorderedDigis);
324  }
325  }
326  }
327  if (inputVirginRawDigis) {
328  std::set<uint32_t> fedDetIds;
329  const std::vector<FedChannelConnection>& conns = cabling.connections(fedId);
330  for (std::vector<FedChannelConnection>::const_iterator iConn = conns.begin(); iConn != conns.end(); ++iConn) {
331  if (!iConn->isConnected()) continue;
332  const uint32_t detId = iConn->detId();
333  if (usedDetIds.find(detId) != usedDetIds.end()) {
334  LogError(mlLabel_) << "Duplicate DetID found " << detId << " skipping data for this Det from FED " << fedId;
335  continue;
336  }
337  fedDetIds.insert(iConn->detId());
338  }
339  usedDetIds.insert(fedDetIds.begin(),fedDetIds.end());
340  for (std::set<uint32_t>::const_iterator iDetId = fedDetIds.begin(); iDetId != fedDetIds.end(); ++iDetId) {
341  edm::DetSetVector<SiStripRawDigi>::const_iterator iVirginRawDigis = inputVirginRawDigis->find(*iDetId);
342  if (iVirginRawDigis != inputVirginRawDigis->end()) {
343  outputVirginRawDigisVector->push_back(*iVirginRawDigis);
344  }
345  }
346  }
347  }
348  }
349 
350  SpyEventMatcher::CountersPtr SpyEventMatcher::getCounters(const edm::EventPrincipal& event, const edm::InputTag& tag, const bool mapKeyIsByFedID)
351  {
352  const std::vector<uint32_t>* vectorFromEvent = getProduct< std::vector<uint32_t> >(event,tag);
353  if (vectorFromEvent) {
354  //vector is from event so, will be deleted when the event is destroyed (and not before)
355  return CountersPtr(new CountersWrapper(vectorFromEvent) );
356  } else {
357  const std::map<uint32_t,uint32_t>* mapFromEvent = getProduct< std::map<uint32_t,uint32_t> >(event,tag);
358  if (mapFromEvent) {
359  std::vector<uint32_t>* newVector = new std::vector<uint32_t>(FED_ID_MAX+1,0);
360  if (mapKeyIsByFedID) {
361  for (std::map<uint32_t,uint32_t>::const_iterator iIdValue = mapFromEvent->begin(); iIdValue != mapFromEvent->end(); ++iIdValue) {
362  newVector->at(iIdValue->first) = iIdValue->second;
363  }
364  } else {
365  SpyUtilities::fillFEDMajorities(*mapFromEvent,*newVector);
366  }
367 // std::cout << " -- Map " << tag << std::endl;
368 // for (uint32_t lIt= 0;
369 // lIt < newVector->size();
370 // lIt++) {
371 // std::cout << lIt << " " << newVector->at(lIt) << std::endl;
372 // }
373  //vector was allocated here so, will need to be deleted when finished with
374  CountersPtr newCountersPtr( new CountersWrapper(newVector,true) );
375  return newCountersPtr;
376  } else {
377  throw cms::Exception(mlLabel_) << "Unable to get product " << tag << " from spy event";
378  }
379  }
380  }
381 
382  SpyEventMatcher::SpyDataCollections::SpyDataCollections(FEDRawDataCollection& theRawData,
383  std::vector<uint32_t>& theTotalEventCounters,
384  std::vector<uint32_t>& theL1ACounters,
385  std::vector<uint32_t>& theAPVAddresses,
386  std::vector< edm::DetSet<SiStripRawDigi> >* theScopeDigisVector,
387  std::vector< edm::DetSet<SiStripRawDigi> >* thePayloadDigisVector,
388  std::vector< edm::DetSet<SiStripRawDigi> >* theReorderedDigisVector,
389  std::vector< edm::DetSet<SiStripRawDigi> >* theVirginRawDigisVector)
390  : rawData(new FEDRawDataCollection),
391  totalEventCounters(new std::vector<uint32_t>),
392  l1aCounters(new std::vector<uint32_t>),
393  apvAddresses(new std::vector<uint32_t>),
394  scopeDigis(theScopeDigisVector ? new edm::DetSetVector<SiStripRawDigi>(*theScopeDigisVector) : NULL),
395  payloadDigis(thePayloadDigisVector ? new edm::DetSetVector<SiStripRawDigi>(*thePayloadDigisVector) : NULL),
396  reorderedDigis(theReorderedDigisVector ? new edm::DetSetVector<SiStripRawDigi>(*theReorderedDigisVector) : NULL),
397  virginRawDigis(theVirginRawDigisVector ? new edm::DetSetVector<SiStripRawDigi>(*theVirginRawDigisVector) : NULL)
398  {
399  rawData->swap(theRawData);
400  totalEventCounters->swap(theTotalEventCounters);
401  l1aCounters->swap(theL1ACounters);
402  apvAddresses->swap(theAPVAddresses);
403  }
404 
405  SpyEventMatcher::SpyDataCollections::SpyDataCollections()
406  : rawData(),
407  totalEventCounters(),
408  l1aCounters(),
409  apvAddresses(),
410  scopeDigis(),
411  payloadDigis(),
412  reorderedDigis(),
413  virginRawDigis()
414  {}
415 
416  SpyEventMatcher::SpyDataCollections& SpyEventMatcher::SpyDataCollections::operator = (SpyDataCollections original)
417  {
418  rawData = original.rawData;
419  totalEventCounters = original.totalEventCounters;
420  l1aCounters = original.l1aCounters;
421  apvAddresses = original.apvAddresses;
422  scopeDigis = original.scopeDigis;
423  payloadDigis = original.payloadDigis;
424  virginRawDigis = original.virginRawDigis;
425  return *this;
426  }
427 
428  SpyEventMatcher::CountersWrapper::CountersWrapper(const Counters* theCounters)
429  : pConst(theCounters),
430  p(NULL),
431  deleteP(false)
432  {
433  }
434 
435  SpyEventMatcher::CountersWrapper::CountersWrapper(Counters* theCounters, const bool takeOwnership)
436  : pConst(theCounters),
437  p(theCounters),
438  deleteP(takeOwnership)
439  {
440 
441  }
442 
443  SpyEventMatcher::CountersWrapper::~CountersWrapper()
444  {
445  if (deleteP) delete p;
446  }
447 
448 }
449 
450 #endif //SiStripMonitorHardware_BuildEventMatchingCode
#define LogDebug(id)
EventNumber_t event() const
Definition: EventID.h:44
std::string getPassID()
Definition: GetPassID.h:8
iterator find(det_id_type id)
Definition: DetSetVector.h:285
ParameterSetID id() const
list original
Definition: definitions.py:60
EventID const & id() const
#define NULL
Definition: scimark2.h:8
#define min(a, b)
Definition: mlp_lapack.h:161
static uint32_t fedIndex(const uint16_t &fed_id, const uint16_t &fed_ch)
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
std::unique_ptr< VectorInputSource > makeVectorInputSource(ParameterSet const &, InputSourceDescription const &) const
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
const T & max(const T &a, const T &b)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:356
std::string getReleaseVersion()
tuple description
Definition: idDealer.py:66
EventKey(const uint32_t eventId, const uint8_t apvAddress)
static VectorInputSourceFactory * get()
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
list key
Definition: combine.py:13
static const uint16_t FEDCH_PER_FED
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
static const uint16_t FED_ID_MAX
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106
A Digi for the silicon strip detector, containing only adc information, and suitable for storing raw ...
ParameterSet const & registerIt()
const std::vector< FedChannelConnection > & connections(uint16_t fed_id) const