CMS 3D CMS Logo

VpspScanTask Class Reference

#include <DQM/SiStripCommissioningSources/interface/VpspScanTask.h>

Inheritance diagram for VpspScanTask:

CommissioningTask

List of all members.

Public Member Functions

 VpspScanTask (DQMStore *, const FedChannelConnection &)
virtual ~VpspScanTask ()

Private Member Functions

virtual void book ()
virtual void fill (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &)
virtual void update ()

Private Attributes

std::vector< HistoSetvpsp_


Detailed Description

Definition at line 9 of file VpspScanTask.h.


Constructor & Destructor Documentation

VpspScanTask::VpspScanTask ( DQMStore dqm,
const FedChannelConnection conn 
)

Definition at line 13 of file VpspScanTask.cc.

00014                                                                :
00015   CommissioningTask( dqm, conn, "VpspScanTask" ),
00016   vpsp_()
00017 {}

VpspScanTask::~VpspScanTask (  )  [virtual]

Definition at line 21 of file VpspScanTask.cc.

00021                             {
00022 }


Member Function Documentation

void VpspScanTask::book (  )  [private, virtual]

Reimplemented from CommissioningTask.

Definition at line 26 of file VpspScanTask.cc.

References sistrip::apv_, CommissioningTask::connection(), CommissioningTask::dqm(), sistrip::EXPERT_HISTO, sistrip::FED_KEY, CommissioningTask::fedKey(), sistrip::LLD_CHAN, indexGen::title, vpsp_, and sistrip::VPSP_SCAN.

00026                         {
00027   
00028   uint16_t nbins = 60;
00029  
00030   std::string title;
00031 
00032   vpsp_.resize(2);
00033   for ( uint16_t iapv = 0; iapv < 2; iapv++ ) {
00034     if ( connection().i2cAddr(iapv) ) { 
00035 
00036       std::stringstream extra_info; 
00037       extra_info << sistrip::apv_ << iapv;
00038       
00039       title = SiStripHistoTitle( sistrip::EXPERT_HISTO, 
00040                                  sistrip::VPSP_SCAN, 
00041                                  sistrip::FED_KEY, 
00042                                  fedKey(),
00043                                  sistrip::LLD_CHAN, 
00044                                  connection().lldChannel(),
00045                                  extra_info.str() ).title();
00046       
00047       vpsp_[iapv].histo( dqm()->bookProfile( title, title, 
00048                                              nbins, -0.5, nbins*1.-0.5,
00049                                              1025, 0., 1025. ) );
00050       
00051       vpsp_[iapv].vNumOfEntries_.resize(nbins,0);
00052       vpsp_[iapv].vSumOfContents_.resize(nbins,0);
00053       vpsp_[iapv].vSumOfSquares_.resize(nbins,0);
00054       
00055     }
00056   }
00057   
00058 }

void VpspScanTask::fill ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis 
) [private, virtual]

Reimplemented from CommissioningTask.

Definition at line 62 of file VpspScanTask.cc.

References edm::DetSet< T >::data, CommissioningTask::fecKey(), index, sistrip::mlDqmSource_, python::multivaluedict::sort(), CommissioningTask::updateHistoSet(), and vpsp_.

00063                                                                   {
00064 
00065   // Retrieve VPSP setting and CCU channel
00066   uint32_t vpsp = const_cast<SiStripEventSummary&>(summary).vpsp();
00067   uint32_t ccu_chan = const_cast<SiStripEventSummary&>(summary).vpspCcuChan();
00068 
00069   // Check CCU channel from EventSummary is consistent with this module
00070   if ( SiStripFecKey( fecKey() ).ccuChan() != ccu_chan ) { return; }
00071 
00072   if ( digis.data.size() != 256 ) {
00073     edm::LogWarning(mlDqmSource_)
00074       << "[VpspScanTask::" << __func__ << "]"
00075       << " Unexpected number of digis! " 
00076       << digis.data.size(); 
00077     return;
00078   }
00079 
00080   // Fill histo with baseline(calc'ed from median value of data)
00081   for ( uint16_t iapv = 0; iapv < 2; iapv++ ) {
00082     
00083     if ( vpsp >= vpsp_[iapv].vNumOfEntries_.size() ) { 
00084       edm::LogWarning(mlDqmSource_)
00085         << "[VpspScanTask::" << __func__ << "]"
00086         << " Unexpected VPSP value! " << vpsp;
00087       return;
00088     }
00089     
00090     std::vector<uint16_t> baseline;
00091     baseline.reserve(128); 
00092     for ( uint16_t idigi = 128*iapv; idigi < 128*(iapv+1); idigi++ ) {
00093       baseline.push_back( digis.data[idigi].adc() ); 
00094     }
00095     sort( baseline.begin(), baseline.end() ); 
00096     uint16_t index = baseline.size()%2 ? baseline.size()/2 : baseline.size()/2-1;
00097     
00098     if ( !baseline.empty() ) { 
00099       updateHistoSet( vpsp_[iapv], vpsp, baseline[index] );
00100     }
00101     
00102   }
00103 
00104 }

void VpspScanTask::update (  )  [private, virtual]

Reimplemented from CommissioningTask.

Definition at line 108 of file VpspScanTask.cc.

References CommissioningTask::updateHistoSet(), and vpsp_.

00108                           {
00109   for ( uint32_t iapv = 0; iapv < vpsp_.size(); iapv++ ) {
00110     updateHistoSet( vpsp_[iapv] );
00111   }
00112 }


Member Data Documentation

std::vector<HistoSet> VpspScanTask::vpsp_ [private]

Definition at line 23 of file VpspScanTask.h.

Referenced by book(), fill(), and update().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:35:53 2009 for CMSSW by  doxygen 1.5.4