CMS 3D CMS Logo

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