Go to the documentation of this file.00001 #include "DQM/SiStripCommissioningSources/interface/ApvTimingTask.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
00007 using namespace sistrip;
00008
00009
00010
00011 ApvTimingTask::ApvTimingTask( DQMStore* dqm,
00012 const FedChannelConnection& conn ) :
00013 CommissioningTask( dqm, conn, "ApvTimingTask" ),
00014 timing_(),
00015 nSamples_(40),
00016 nFineDelays_(24),
00017 nBins_(40)
00018 {}
00019
00020
00021
00022 ApvTimingTask::~ApvTimingTask() {
00023 }
00024
00025
00026
00027 void ApvTimingTask::book() {
00028
00029 uint16_t nbins = 24 * nBins_;
00030
00031 std::string title = SiStripHistoTitle( sistrip::EXPERT_HISTO,
00032 sistrip::APV_TIMING,
00033 sistrip::FED_KEY,
00034 fedKey(),
00035 sistrip::LLD_CHAN,
00036 connection().lldChannel() ).title();
00037
00038 timing_.histo( dqm()->bookProfile( title, title,
00039 nbins, -0.5, nBins_*25.-0.5,
00040 1025, 0., 1025. ) );
00041
00042 timing_.vNumOfEntries_.resize(nbins,0);
00043 timing_.vSumOfContents_.resize(nbins,0);
00044 timing_.vSumOfSquares_.resize(nbins,0);
00045
00046 }
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 void ApvTimingTask::fill( const SiStripEventSummary& summary,
00059 const edm::DetSet<SiStripRawDigi>& digis ) {
00060
00061 if ( digis.data.size() < nBins_ ) {
00062 edm::LogWarning(mlDqmSource_)
00063 << "[ApvTimingTask::" << __func__ << "]"
00064 << " Unexpected number of digis! "
00065 << digis.data.size();
00066 return;
00067 }
00068
00069 uint32_t pll_fine = summary.pllFine();
00070 for ( uint16_t coarse = 0; coarse < nBins_; coarse++ ) {
00071 uint16_t fine = (coarse+1)*24 - (pll_fine+1);
00072 updateHistoSet( timing_, fine, digis.data[coarse].adc() );
00073 }
00074
00075 }
00076
00077
00078
00079 void ApvTimingTask::update() {
00080 updateHistoSet( timing_ );
00081 }
00082
00083