CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DQM/SiStripCommissioningSources/src/FastFedCablingTask.cc

Go to the documentation of this file.
00001 #include "DQM/SiStripCommissioningSources/interface/FastFedCablingTask.h"
00002 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
00003 #include "DataFormats/SiStripCommon/interface/SiStripHistoTitle.h"
00004 #include "DQMServices/Core/interface/DQMStore.h"
00005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00006 #include <algorithm>
00007 #include <sstream>
00008 #include <iomanip>
00009 
00010 using namespace sistrip;
00011 
00012 // -----------------------------------------------------------------------------
00013 //
00014 FastFedCablingTask::FastFedCablingTask( DQMStore* dqm,
00015                                         const FedChannelConnection& conn ) :
00016   CommissioningTask( dqm, conn, "FastFedCablingTask" ),
00017   histo_()
00018 {}
00019 
00020 // -----------------------------------------------------------------------------
00021 //
00022 FastFedCablingTask::~FastFedCablingTask() {
00023 }
00024 
00025 // -----------------------------------------------------------------------------
00026 //
00027 void FastFedCablingTask::book() {
00028   
00029   std::string title = SiStripHistoTitle( sistrip::EXPERT_HISTO, 
00030                                          sistrip::FAST_CABLING,
00031                                          sistrip::FED_KEY, 
00032                                          fedKey(),
00033                                          sistrip::LLD_CHAN, 
00034                                          connection().lldChannel() ).title();
00035   
00036   uint16_t nbins = 34;
00037   histo_.histo( dqm()->bookProfile( title, title, 
00038                                     nbins, -0.5, nbins*1.-0.5,
00039                                     1025, 0., 1025. ) );
00040   
00041   histo_.vNumOfEntries_.resize(nbins,0);
00042   histo_.vSumOfContents_.resize(nbins,0);
00043   histo_.vSumOfSquares_.resize(nbins,0);
00044   
00045 }
00046 
00047 // -----------------------------------------------------------------------------
00048 //
00049 void FastFedCablingTask::fill( const SiStripEventSummary& summary,
00050                                const edm::DetSet<SiStripRawDigi>& digis ) {
00051 
00052   if ( digis.data.empty() ) {
00053     edm::LogWarning(mlDqmSource_)
00054       << "[FastFedCablingTask::" << __func__ << "]"
00055       << " No digis found!"; 
00056     return;
00057   }
00058 
00059   uint32_t bin = summary.binNumber();
00060   for ( uint16_t ibin = 0; ibin < digis.data.size(); ibin++ ) {
00061     updateHistoSet( histo_, bin, digis.data[ibin].adc() );
00062   }
00063   
00064 }
00065 
00066 // -----------------------------------------------------------------------------
00067 //
00068 void FastFedCablingTask::update() {
00069   updateHistoSet( histo_ );
00070 }