Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:11:38

0001 #include "DQM/SiStripCommissioningSources/interface/FastFedCablingTask.h"
0002 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0003 #include "DataFormats/SiStripCommon/interface/SiStripHistoTitle.h"
0004 #include "DQMServices/Core/interface/DQMStore.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006 #include <algorithm>
0007 #include <sstream>
0008 #include <iomanip>
0009 
0010 using namespace sistrip;
0011 
0012 // -----------------------------------------------------------------------------
0013 //
0014 FastFedCablingTask::FastFedCablingTask(DQMStore* dqm, const FedChannelConnection& conn)
0015     : CommissioningTask(dqm, conn, "FastFedCablingTask"), histo_() {}
0016 
0017 // -----------------------------------------------------------------------------
0018 //
0019 FastFedCablingTask::~FastFedCablingTask() {}
0020 
0021 // -----------------------------------------------------------------------------
0022 //
0023 void FastFedCablingTask::book() {
0024   std::string title = SiStripHistoTitle(sistrip::EXPERT_HISTO,
0025                                         sistrip::FAST_CABLING,
0026                                         sistrip::FED_KEY,
0027                                         fedKey(),
0028                                         sistrip::LLD_CHAN,
0029                                         connection().lldChannel())
0030                           .title();
0031 
0032   uint16_t nbins = 34;
0033   histo_.histo(dqm()->bookProfile(title, title, nbins, -0.5, nbins * 1. - 0.5, 1025, 0., 1025.));
0034 
0035   histo_.vNumOfEntries_.resize(nbins, 0);
0036   histo_.vSumOfContents_.resize(nbins, 0);
0037   histo_.vSumOfSquares_.resize(nbins, 0);
0038 }
0039 
0040 // -----------------------------------------------------------------------------
0041 //
0042 void FastFedCablingTask::fill(const SiStripEventSummary& summary, const edm::DetSet<SiStripRawDigi>& digis) {
0043   if (digis.data.empty()) {
0044     edm::LogWarning(mlDqmSource_) << "[FastFedCablingTask::" << __func__ << "]"
0045                                   << " No digis found!";
0046     return;
0047   }
0048 
0049   uint32_t bin = summary.binNumber();
0050   for (uint16_t ibin = 0; ibin < digis.data.size(); ibin++) {
0051     updateHistoSet(histo_, bin, digis.data[ibin].adc());
0052   }
0053 }
0054 
0055 // -----------------------------------------------------------------------------
0056 //
0057 void FastFedCablingTask::update() { updateHistoSet(histo_); }