CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
SiStripFEDMonitorPlugin Class Reference

#include <DQM/SiStripMonitorHardware/plugins/SiStripFEDMonitor.cc>

Inheritance diagram for SiStripFEDMonitorPlugin:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 SiStripFEDMonitorPlugin (const edm::ParameterSet &)
 
 ~SiStripFEDMonitorPlugin ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 
void getMajority (const std::vector< std::pair< unsigned int, unsigned int > > &aFeMajVec, unsigned int &aMajorityCounter, std::vector< unsigned int > &afedIds)
 
void updateCabling (const edm::EventSetup &eventSetup)
 

Static Private Member Functions

static bool pairComparison (const std::pair< unsigned int, unsigned int > &pair1, const std::pair< unsigned int, unsigned int > &pair2)
 

Private Attributes

const SiStripFedCablingcabling_
 
uint32_t cablingCacheId_
 
bool doFEMajorityCheck_
 
bool doMedHists_
 
bool doTkHistoMap_
 
DQMStoredqm_
 
std::string dqmStoreFileName_
 
FEDErrors fedErrors_
 
FEDHistograms fedHists_
 
bool fillAllDetailedHistograms_
 
bool fillWithEvtNum_
 
std::string folderName_
 
unsigned int maxFedBufferSize_
 
unsigned int nEvt_
 
unsigned int printDebug_
 
edm::InputTag rawDataTag_
 
bool writeDQMStore_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: DQM source application to produce data integrety histograms for SiStrip data

Definition at line 61 of file SiStripFEDMonitor.cc.

Constructor & Destructor Documentation

SiStripFEDMonitorPlugin::SiStripFEDMonitorPlugin ( const edm::ParameterSet iConfig)
explicit

Definition at line 125 of file SiStripFEDMonitor.cc.

References doFEMajorityCheck_, doMedHists_, doTkHistoMap_, dqmStoreFileName_, fedHists_, fillAllDetailedHistograms_, fillWithEvtNum_, folderName_, LogTrace, nEvt_, NULL, printDebug_, rawDataTag_, and writeDQMStore_.

126  : rawDataTag_(iConfig.getUntrackedParameter<edm::InputTag>("RawDataTag",edm::InputTag("source",""))),
127  folderName_(iConfig.getUntrackedParameter<std::string>("HistogramFolderName","SiStrip/ReadoutView/FedSummary")),
128  fillAllDetailedHistograms_(iConfig.getUntrackedParameter<bool>("FillAllDetailedHistograms",false)),
129  fillWithEvtNum_(iConfig.getUntrackedParameter<bool>("FillWithEventNumber",false)),
130  printDebug_(iConfig.getUntrackedParameter<unsigned int>("PrintDebugMessages",1)),
131  //printDebug_(iConfig.getUntrackedParameter<bool>("PrintDebugMessages",false)),
132  writeDQMStore_(iConfig.getUntrackedParameter<bool>("WriteDQMStore",false)),
133  dqmStoreFileName_(iConfig.getUntrackedParameter<std::string>("DQMStoreFileName","DQMStore.root")),
134  dqm_(0),
135  cablingCacheId_(0),
137 {
138  //print config to debug log
139  std::ostringstream debugStream;
140  if (printDebug_>1) {
141  debugStream << "[SiStripFEDMonitorPlugin]Configuration for SiStripFEDMonitorPlugin: " << std::endl
142  << "[SiStripFEDMonitorPlugin]\tRawDataTag: " << rawDataTag_ << std::endl
143  << "[SiStripFEDMonitorPlugin]\tHistogramFolderName: " << folderName_ << std::endl
144  << "[SiStripFEDMonitorPlugin]\tFillAllDetailedHistograms? " << (fillAllDetailedHistograms_ ? "yes" : "no") << std::endl
145  << "[SiStripFEDMonitorPlugin]\tFillWithEventNumber?" << (fillWithEvtNum_ ? "yes" : "no") << std::endl
146  << "[SiStripFEDMonitorPlugin]\tPrintDebugMessages? " << (printDebug_ ? "yes" : "no") << std::endl
147  << "[SiStripFEDMonitorPlugin]\tWriteDQMStore? " << (writeDQMStore_ ? "yes" : "no") << std::endl;
148  if (writeDQMStore_) debugStream << "[SiStripFEDMonitorPlugin]\tDQMStoreFileName: " << dqmStoreFileName_ << std::endl;
149  }
150 
151  //don;t generate debug mesages if debug is disabled
152  std::ostringstream* pDebugStream = (printDebug_>1 ? &debugStream : NULL);
153 
154  fedHists_.initialise(iConfig,pDebugStream);
155 
156  doTkHistoMap_ = fedHists_.tkHistoMapEnabled();
157 
158  doMedHists_ = fedHists_.cmHistosEnabled();
159 
160  doFEMajorityCheck_ = fedHists_.feMajHistosEnabled();
161 
162  if (printDebug_) {
163  LogTrace("SiStripMonitorHardware") << debugStream.str();
164 
165  //debugStream.str("");
166 
167  //debugStream << " -- Quelle est la difference entre un canard ? " << std::endl
168  // << " -- Reponse: c'est qu'il a les deux pattes de la meme longueur, surtout la gauche." << std::endl;
169 
170  //edm::LogError("SiStripMonitorHardware") << debugStream.str();
171  }
172 
173  nEvt_ = 0;
174 
175 }
T getUntrackedParameter(std::string const &, T const &) const
#define NULL
Definition: scimark2.h:8
#define LogTrace(id)
SiStripFEDMonitorPlugin::~SiStripFEDMonitorPlugin ( )

Definition at line 177 of file SiStripFEDMonitor.cc.

178 {
179 }

Member Function Documentation

void SiStripFEDMonitorPlugin::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 188 of file SiStripFEDMonitor.cc.

References begin, cabling_, doFEMajorityCheck_, doMedHists_, doTkHistoMap_, end, edm::EventID::event(), edm::HandleBase::failedToGet(), FEDRawDataCollection::FEDData(), fedErrors_, fedHists_, fillWithEvtNum_, edm::EventSetup::get(), edm::Event::getByLabel(), getMajority(), edm::EventBase::id(), edm::HandleBase::isValid(), maxFedBufferSize_, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, nEvt_, edm::EventBase::orbitNumber(), pairComparison(), printDebug_, edm::ESHandle< class >::product(), rawDataTag_, FEDRawData::size(), findQualityFiles::size, python.multivaluedict::sort(), and updateCabling().

190 {
191  //Retrieve tracker topology from geometry
192  edm::ESHandle<TrackerTopology> tTopoHandle;
193  iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
194  const TrackerTopology* const tTopo = tTopoHandle.product();
195 
196  //update cabling
197  updateCabling(iSetup);
198 
199  //get raw data
200  edm::Handle<FEDRawDataCollection> rawDataCollectionHandle;
201  iEvent.getByLabel(rawDataTag_,rawDataCollectionHandle);
202  const FEDRawDataCollection& rawDataCollection = *rawDataCollectionHandle;
203 
204  fedErrors_.initialiseEvent();
205 
206  //add the deltaBX value if the product exist
207 
209  iEvent.getByLabel("consecutiveHEs",he);
210 
211  if(he.isValid() && !he.failedToGet()) {
212  fedErrors_.fillEventProperties(he->deltaBX());
213  }
214 
215  //initialise map of fedId/bad channel number
216  std::map<unsigned int,std::pair<unsigned short,unsigned short> > badChannelFraction;
217 
218  unsigned int lNFEDMonitoring = 0;
219  unsigned int lNFEDUnpacker = 0;
220  unsigned int lNChannelMonitoring = 0;
221  unsigned int lNChannelUnpacker = 0;
222 
223  unsigned int lNTotBadFeds = 0;
224  unsigned int lNTotBadChannels = 0;
225  unsigned int lNTotBadActiveChannels = 0;
226 
227  std::vector<std::vector<std::pair<unsigned int,unsigned int> > > lFeMajFrac;
228  const unsigned int nParts = 4;
229  if (doFEMajorityCheck_){
230  lFeMajFrac.resize(nParts);
231  //max nFE per partition
232  lFeMajFrac[0].reserve(912);
233  lFeMajFrac[1].reserve(1080);
234  lFeMajFrac[2].reserve(768);
235  lFeMajFrac[3].reserve(760);
236  }
237 
238  maxFedBufferSize_ = 0;
239 
240  //loop over siStrip FED IDs
241  for (unsigned int fedId = FEDNumbering::MINSiStripFEDID;
243  fedId++) {//loop over FED IDs
244  const FEDRawData& fedData = rawDataCollection.FEDData(fedId);
245 
246  //create an object to fill all errors
247  fedErrors_.initialiseFED(fedId,cabling_,tTopo);
248  bool lFullDebug = false;
249 
250  //Do detailed check
251  //first check if data exists
252  bool lDataExist = fedErrors_.checkDataPresent(fedData);
253  if (!lDataExist) {
254  fedHists_.fillFEDHistograms(fedErrors_,0,lFullDebug);
255  continue;
256  }
257 
258 
259 
260  //check for problems and fill detailed histograms
261  fedErrors_.fillFEDErrors(fedData,
262  lFullDebug,
263  printDebug_,
264  lNChannelMonitoring,
265  lNChannelUnpacker,
266  doMedHists_,
267  fedHists_.cmHistPointer(false),
268  fedHists_.cmHistPointer(true),
270  lFeMajFrac
271  );
272 
273  //check filled in previous method.
274  bool lFailUnpackerFEDcheck = fedErrors_.failUnpackerFEDCheck();
275 
276  fedErrors_.incrementFEDCounters();
277  unsigned int lSize = fedData.size();
278  if (lSize > maxFedBufferSize_){
279  maxFedBufferSize_ = lSize;
280  }
281  //std::cout << " -- " << fedId << " " << lSize << std::endl;
282 
283  fedHists_.fillFEDHistograms(fedErrors_,lSize,lFullDebug);
284 
285  bool lFailMonitoringFEDcheck = fedErrors_.failMonitoringFEDCheck();
286  if (lFailMonitoringFEDcheck) lNTotBadFeds++;
287 
288 
289  //sanity check: if something changed in the unpacking code
290  //but wasn't propagated here
291  //print only the summary, and more info if printDebug>1
292  if (lFailMonitoringFEDcheck != lFailUnpackerFEDcheck) {
293  if (printDebug_>1) {
294  std::ostringstream debugStream;
295  debugStream << " --- WARNING: FED " << fedId << std::endl
296  << " ------ Monitoring FED check " ;
297  if (lFailMonitoringFEDcheck) debugStream << "failed." << std::endl;
298  else debugStream << "passed." << std::endl ;
299  debugStream << " ------ Unpacker FED check " ;
300  if (lFailUnpackerFEDcheck) debugStream << "failed." << std::endl;
301  else debugStream << "passed." << std::endl ;
302  edm::LogError("SiStripMonitorHardware") << debugStream.str();
303  }
304 
305  if (lFailMonitoringFEDcheck) lNFEDMonitoring++;
306  else if (lFailUnpackerFEDcheck) lNFEDUnpacker++;
307  }
308 
309 
310  //Fill TkHistoMap:
311  //add an entry for all channels (good = 0),
312  //so that tkHistoMap knows which channels should be there.
313  if (doTkHistoMap_ && !fedHists_.tkHistoMapPointer()) {
314  edm::LogWarning("SiStripMonitorHardware") << " -- Fedid " << fedId
315  << ", TkHistoMap enabled but pointer is null." << std::endl;
316  }
317 
318  fedErrors_.fillBadChannelList(doTkHistoMap_,
319  fedHists_.tkHistoMapPointer(),
320  fedHists_.getFedvsAPVpointer(),
321  lNTotBadChannels,
322  lNTotBadActiveChannels);
323  }//loop over FED IDs
324 
325 
326  if (doFEMajorityCheck_){
327  for (unsigned int iP(0); iP<nParts; ++iP){
328  //std::cout << " -- Partition " << iP << std::endl;
329  //std::cout << " --- Number of elements in vec = " << lFeMajFrac[iP].size() << std::endl;
330  if (lFeMajFrac[iP].size()==0) continue;
331  std::sort(lFeMajFrac[iP].begin(),lFeMajFrac[iP].end(),SiStripFEDMonitorPlugin::pairComparison);
332 
333  unsigned int lMajorityCounter = 0;
334  std::vector<unsigned int> lfedIds;
335 
336  getMajority(lFeMajFrac[iP],lMajorityCounter,lfedIds);
337  //std::cout << " -- Found " << lfedIds.size() << " unique elements not matching the majority." << std::endl;
338  fedHists_.fillMajorityHistograms(iP,static_cast<float>(lMajorityCounter)/lFeMajFrac[iP].size(),lfedIds);
339  }
340  }
341 
342  if ((lNTotBadFeds> 0 || lNTotBadChannels>0) && printDebug_>1) {
343  std::ostringstream debugStream;
344  debugStream << "[SiStripFEDMonitorPlugin] --- Total number of bad feds = "
345  << lNTotBadFeds << std::endl
346  << "[SiStripFEDMonitorPlugin] --- Total number of bad channels = "
347  << lNTotBadChannels << std::endl
348  << "[SiStripFEDMonitorPlugin] --- Total number of bad active channels = "
349  << lNTotBadActiveChannels << std::endl;
350  edm::LogInfo("SiStripMonitorHardware") << debugStream.str();
351  }
352 
353  if ((lNFEDMonitoring > 0 || lNFEDUnpacker > 0 || lNChannelMonitoring > 0 || lNChannelUnpacker > 0) && printDebug_) {
354  std::ostringstream debugStream;
355  debugStream
356  << "[SiStripFEDMonitorPlugin]-------------------------------------------------------------------------" << std::endl
357  << "[SiStripFEDMonitorPlugin]-------------------------------------------------------------------------" << std::endl
358  << "[SiStripFEDMonitorPlugin]-- Summary of differences between unpacker and monitoring at FED level : " << std::endl
359  << "[SiStripFEDMonitorPlugin] ---- Number of times monitoring fails but not unpacking = " << lNFEDMonitoring << std::endl
360  << "[SiStripFEDMonitorPlugin] ---- Number of times unpacking fails but not monitoring = " << lNFEDUnpacker << std::endl
361  << "[SiStripFEDMonitorPlugin]-------------------------------------------------------------------------" << std::endl
362  << "[SiStripFEDMonitorPlugin]-- Summary of differences between unpacker and monitoring at Channel level : " << std::endl
363  << "[SiStripFEDMonitorPlugin] ---- Number of times monitoring fails but not unpacking = " << lNChannelMonitoring << std::endl
364  << "[SiStripFEDMonitorPlugin] ---- Number of times unpacking fails but not monitoring = " << lNChannelUnpacker << std::endl
365  << "[SiStripFEDMonitorPlugin]-------------------------------------------------------------------------" << std::endl
366  << "[SiStripFEDMonitorPlugin]-------------------------------------------------------------------------" << std::endl ;
367  edm::LogError("SiStripMonitorHardware") << debugStream.str();
368 
369  }
370 
371  FEDErrors::getFEDErrorsCounters().nTotalBadChannels = lNTotBadChannels;
372  FEDErrors::getFEDErrorsCounters().nTotalBadActiveChannels = lNTotBadActiveChannels;
373 
374  //fedHists_.fillCountersHistograms(FEDErrors::getFEDErrorsCounters(), nEvt_);
375  //time in seconds since beginning of the run or event number
376  if (fillWithEvtNum_) fedHists_.fillCountersHistograms(FEDErrors::getFEDErrorsCounters(),FEDErrors::getChannelErrorsCounters(),maxFedBufferSize_,iEvent.id().event());
377  else fedHists_.fillCountersHistograms(FEDErrors::getFEDErrorsCounters(),FEDErrors::getChannelErrorsCounters(),maxFedBufferSize_,iEvent.orbitNumber()/11223.);
378 
379  nEvt_++;
380 
381 }//analyze method
EventNumber_t event() const
Definition: EventID.h:44
const SiStripFedCabling * cabling_
void getMajority(const std::vector< std::pair< unsigned int, unsigned int > > &aFeMajVec, unsigned int &aMajorityCounter, std::vector< unsigned int > &afedIds)
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
#define end
Definition: vmac.h:38
int orbitNumber() const
Definition: EventBase.h:63
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
bool failedToGet() const
Definition: HandleBase.h:80
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::EventID id() const
Definition: EventBase.h:56
#define begin
Definition: vmac.h:31
static bool pairComparison(const std::pair< unsigned int, unsigned int > &pair1, const std::pair< unsigned int, unsigned int > &pair2)
tuple size
Write out results.
void updateCabling(const edm::EventSetup &eventSetup)
void SiStripFEDMonitorPlugin::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 458 of file SiStripFEDMonitor.cc.

References dqm_, fedHists_, fillAllDetailedHistograms_, folderName_, nEvt_, and DQMStore::setCurrentFolder().

459 {
460  //get DQM store
463 
464  //this propagates dqm_ to the histoclass, must be called !
465  fedHists_.bookTopLevelHistograms(dqm_);
466 
467  if (fillAllDetailedHistograms_) fedHists_.bookAllFEDHistograms();
468 
469  nEvt_ = 0;
470 
471  //const unsigned int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
472  //const unsigned int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
473 
474  //mark all channels as inactive until they have been 'locked' at least once
475  // activeChannels_.resize(siStripFedIdMax+1);
476  // for (unsigned int fedId = siStripFedIdMin;
477  // fedId <= siStripFedIdMax;
478  // fedId++) {
479  // activeChannels_[fedId].resize(sistrip::FEDCH_PER_FED,false);
480  // }
481 
482 
483 
484 
485 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void SiStripFEDMonitorPlugin::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 497 of file SiStripFEDMonitor.cc.

References fedErrors_.

499 {
500 
501  fedErrors_.initialiseLumiBlock();
502 
503 }
void SiStripFEDMonitorPlugin::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 489 of file SiStripFEDMonitor.cc.

References dqm_, dqmStoreFileName_, DQMStore::save(), and writeDQMStore_.

490 {
492 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118
void SiStripFEDMonitorPlugin::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 507 of file SiStripFEDMonitor.cc.

References fedErrors_, and fedHists_.

509 {
510  fedHists_.fillLumiHistograms(fedErrors_.getLumiErrors());
511 }
void SiStripFEDMonitorPlugin::getMajority ( const std::vector< std::pair< unsigned int, unsigned int > > &  aFeMajVec,
unsigned int &  aMajorityCounter,
std::vector< unsigned int > &  afedIds 
)
private

Definition at line 389 of file SiStripFEDMonitor.cc.

References gather_cfg::cout, and python.multivaluedict::sort().

Referenced by analyze().

391  {
392 
393 
394  unsigned int lMajAddress = 0;
395  std::vector<std::pair<unsigned int,unsigned int> >::const_iterator lIter = aFeMajVec.begin();
396  unsigned int lMajAddr = (*lIter).second;
397  unsigned int lCounter = 0;
398 
399  //std::cout << " --- First element: addr = " << lMajAddr << " counter = " << lCounter << std::endl;
400  unsigned int iele=0;
401  //bool foundMaj = false;
402  for ( ; lIter != aFeMajVec.end(); ++lIter,++iele) {
403  //std::cout << " ---- Ele " << iele << " " << (*lIter).first << " " << (*lIter).second << " ref " << lMajAddr << std::endl;
404  if ((*lIter).second == lMajAddr) {
405  ++lCounter;
406  //std::cout << " ----- =ref: Counter = " << lCounter << std::endl;
407  }
408  else {
409  //std::cout << " ----- !=ref: Counter = " << lCounter << " Majority = " << aMajorityCounter << std::endl;
410  if (lCounter > aMajorityCounter) {
411  //std::cout << " ------ >Majority: " << std::endl;
412  aMajorityCounter = lCounter;
413  // AV bug here??
414  lMajAddress = lMajAddr;
415  // lMajAddress = (*lIter).second;
416  //foundMaj=true;
417  }
418  lCounter = 0;
419  lMajAddr = (*lIter).second;
420  --lIter;
421  --iele;
422  }
423  }
424  // AV Bug here? The check has to be done regardless foundMaj == false or true
425  // if (!foundMaj) {
426  if (lCounter > aMajorityCounter) {
427  //std::cout << " ------ >Majority: " << std::endl;
428  aMajorityCounter = lCounter;
429  lMajAddress = lMajAddr;
430  }
431  // }
432  //std::cout << " -- found majority value for " << aMajorityCounter << " elements out of " << aFeMajVec.size() << "." << std::endl;
433  //get list of feds with address different from majority in partition:
434  lIter = aFeMajVec.begin();
435  afedIds.reserve(135);
436  for ( ; lIter != aFeMajVec.end(); ++lIter ) {
437  if((*lIter).second != lMajAddress) {
438  afedIds.push_back((*lIter).first);
439  }
440  else {
441  lIter += aMajorityCounter-1;
442  if(lIter >= aFeMajVec.end()) {
443  std::cout << "Here it is a bug: " << aMajorityCounter << " " << aFeMajVec.size() << " " << lIter - aFeMajVec.end() << std::endl;
444  }
445  }
446  }
447  //std::cout << " -- Found " << lfedIds.size() << " elements not matching the majority." << std::endl;
448  if (afedIds.size()>0) {
449  std::sort(afedIds.begin(),afedIds.end());
450  std::vector<unsigned int>::iterator lIt = std::unique(afedIds.begin(),afedIds.end());
451  afedIds.erase(lIt,afedIds.end());
452  }
453 
454 }
tuple cout
Definition: gather_cfg.py:121
bool SiStripFEDMonitorPlugin::pairComparison ( const std::pair< unsigned int, unsigned int > &  pair1,
const std::pair< unsigned int, unsigned int > &  pair2 
)
staticprivate

Definition at line 384 of file SiStripFEDMonitor.cc.

Referenced by analyze().

385  {
386  return (pair1.second < pair2.second) ;
387 }
void SiStripFEDMonitorPlugin::updateCabling ( const edm::EventSetup eventSetup)
private

Definition at line 516 of file SiStripFEDMonitor.cc.

References cabling_, cablingCacheId_, edm::EventSetup::get(), and edm::ESHandle< class >::product().

Referenced by analyze().

517 {
518  uint32_t currentCacheId = eventSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
519  if (cablingCacheId_ != currentCacheId) {
520  edm::ESHandle<SiStripFedCabling> cablingHandle;
521  eventSetup.get<SiStripFedCablingRcd>().get(cablingHandle);
522  cabling_ = cablingHandle.product();
523  cablingCacheId_ = currentCacheId;
524  }
525 }
const SiStripFedCabling * cabling_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62

Member Data Documentation

const SiStripFedCabling* SiStripFEDMonitorPlugin::cabling_
private

Definition at line 105 of file SiStripFEDMonitor.cc.

Referenced by analyze(), and updateCabling().

uint32_t SiStripFEDMonitorPlugin::cablingCacheId_
private

Definition at line 104 of file SiStripFEDMonitor.cc.

Referenced by updateCabling().

bool SiStripFEDMonitorPlugin::doFEMajorityCheck_
private

Definition at line 110 of file SiStripFEDMonitor.cc.

Referenced by analyze(), and SiStripFEDMonitorPlugin().

bool SiStripFEDMonitorPlugin::doMedHists_
private

Definition at line 109 of file SiStripFEDMonitor.cc.

Referenced by analyze(), and SiStripFEDMonitorPlugin().

bool SiStripFEDMonitorPlugin::doTkHistoMap_
private

Definition at line 108 of file SiStripFEDMonitor.cc.

Referenced by analyze(), and SiStripFEDMonitorPlugin().

DQMStore* SiStripFEDMonitorPlugin::dqm_
private

Definition at line 102 of file SiStripFEDMonitor.cc.

Referenced by beginJob(), and endJob().

std::string SiStripFEDMonitorPlugin::dqmStoreFileName_
private

Definition at line 100 of file SiStripFEDMonitor.cc.

Referenced by endJob(), and SiStripFEDMonitorPlugin().

FEDErrors SiStripFEDMonitorPlugin::fedErrors_
private

Definition at line 116 of file SiStripFEDMonitor.cc.

Referenced by analyze(), beginLuminosityBlock(), and endLuminosityBlock().

FEDHistograms SiStripFEDMonitorPlugin::fedHists_
private
bool SiStripFEDMonitorPlugin::fillAllDetailedHistograms_
private

Definition at line 92 of file SiStripFEDMonitor.cc.

Referenced by beginJob(), and SiStripFEDMonitorPlugin().

bool SiStripFEDMonitorPlugin::fillWithEvtNum_
private

Definition at line 94 of file SiStripFEDMonitor.cc.

Referenced by analyze(), and SiStripFEDMonitorPlugin().

std::string SiStripFEDMonitorPlugin::folderName_
private

Definition at line 90 of file SiStripFEDMonitor.cc.

Referenced by beginJob(), and SiStripFEDMonitorPlugin().

unsigned int SiStripFEDMonitorPlugin::maxFedBufferSize_
private

Definition at line 117 of file SiStripFEDMonitor.cc.

Referenced by analyze().

unsigned int SiStripFEDMonitorPlugin::nEvt_
private

Definition at line 112 of file SiStripFEDMonitor.cc.

Referenced by analyze(), beginJob(), and SiStripFEDMonitorPlugin().

unsigned int SiStripFEDMonitorPlugin::printDebug_
private

Definition at line 96 of file SiStripFEDMonitor.cc.

Referenced by analyze(), and SiStripFEDMonitorPlugin().

edm::InputTag SiStripFEDMonitorPlugin::rawDataTag_
private

Definition at line 86 of file SiStripFEDMonitor.cc.

Referenced by analyze(), and SiStripFEDMonitorPlugin().

bool SiStripFEDMonitorPlugin::writeDQMStore_
private

Definition at line 99 of file SiStripFEDMonitor.cc.

Referenced by endJob(), and SiStripFEDMonitorPlugin().