CMS 3D CMS Logo

CommissioningTask Class Reference

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

Inheritance diagram for CommissioningTask:

ApvTimingTask CalibrationScanTask CalibrationTask DaqScopeModeTask FastFedCablingTask FedCablingTask FedTimingTask FineDelayTask LatencyTask NoiseTask OptoScanTask PedestalsTask PedsOnlyTask VpspScanTask

List of all members.

Public Member Functions

void bookHistograms ()
 Books histograms and constructs HistoSet cache.
 CommissioningTask (DQMStore *, const FedChannelConnection &, const std::string &my_name)
void eventSetup (const edm::EventSetup *)
 Define access to the EventSetup.
const uint32_t & fillCntr () const
 Get histogram filled counter.
void fillHistograms (const SiStripEventSummary &, const uint16_t &fed_id, const std::map< uint16_t, float > &fed_ch)
 Fill HistoSet cache for FED cabling (special case).
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &)
 Fills HistoSet cache.
const std::string & myName () const
 Returns the name of this commissioning task.
void updateFreq (const uint32_t &)
 Set histogram update frequency.
const uint32_t & updateFreq () const
 Get histogram update frequency.
void updateHistograms ()
 Updates histograms using HistoSet cache.
virtual ~CommissioningTask ()

Protected Member Functions

const FedChannelConnectionconnection () const
DQMStore *const dqm () const
 Returns const pointer to DQM back-end interface object.
const edm::EventSetup *const eventSetup () const
 Access to the EventSetup.
const uint32_t & fecKey () const
 Returns FEC key.
const uint32_t & fedKey () const
 Returns FED key.
void updateHistoSet (HistoSet &)
 Updates the MonitorElements of HistoSet.
void updateHistoSet (HistoSet &, const float &value)
 Updates the vectors of HistoSet.
void updateHistoSet (HistoSet &, const uint32_t &bin)
 Updates the vectors of HistoSet.
void updateHistoSet (HistoSet &, const uint32_t &bin, const float &value)
 Updates the vectors of HistoSet.

Private Member Functions

virtual void book ()
 CommissioningTask ()
virtual void fill (const SiStripEventSummary &, const uint16_t &fed_id, const std::map< uint16_t, float > &fed_ch)
virtual void fill (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &)
virtual void update ()

Private Attributes

bool booked_
FedChannelConnection connection_
DQMStoredqm_
const edm::EventSetupeventSetup_
uint32_t fecKey_
uint32_t fedKey_
uint32_t fillCntr_
std::string myName_
uint32_t updateFreq_

Classes

class  HistoSet
 Simple container class holding pointer to root histogram, and vectors in which data are cached and used to update histo. More...


Detailed Description

Definition at line 21 of file CommissioningTask.h.


Constructor & Destructor Documentation

CommissioningTask::CommissioningTask ( DQMStore dqm,
const FedChannelConnection conn,
const std::string &  my_name 
)

Definition at line 17 of file CommissioningTask.cc.

References FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), connection_, FedChannelConnection::fecCrate(), SiStripFedKey::feChan(), fecKey_, FedChannelConnection::fecRing(), FedChannelConnection::fecSlot(), FedChannelConnection::fedCh(), FedChannelConnection::fedId(), fedKey_, SiStripFedKey::feUnit(), getDQMSummary::key, FedChannelConnection::lldChannel(), LogTrace, sistrip::mlDqmSource_, and myName_.

00019                                                                  :
00020   dqm_(dqm),
00021   updateFreq_(0),
00022   fillCntr_(0),
00023   connection_(conn),
00024   fedKey_(0),
00025   fecKey_(0),
00026   booked_(false),
00027   myName_(my_name),
00028   eventSetup_(0)
00029 {
00030   uint16_t fed_ch = connection_.fedCh();
00031   fedKey_ = SiStripFedKey( connection_.fedId(), 
00032                            SiStripFedKey::feUnit(fed_ch),
00033                            SiStripFedKey::feChan(fed_ch) ).key();
00034   fecKey_ = SiStripFecKey( connection_.fecCrate(),
00035                            connection_.fecSlot(),
00036                            connection_.fecRing(),
00037                            connection_.ccuAddr(),
00038                            connection_.ccuChan(),
00039                            connection_.lldChannel() ).key();
00040   
00041   LogTrace(mlDqmSource_)
00042     << "[CommissioningTask::" << __func__ << "]" 
00043     << " Constructing '" << myName_
00044     << "' object for FecKey/FedKey: "
00045     << "0x" << std::hex << std::setw(8) << std::setfill('0') << fecKey_ << std::dec
00046     << "/"
00047     << "0x" << std::hex << std::setw(8) << std::setfill('0') << fedKey_ << std::dec
00048     << " and Crate/FEC/ring/CCU/module/LLDchan: " 
00049     << connection_.fecCrate() << "/"
00050     << connection_.fecSlot() << "/" 
00051     << connection_.fecRing() << "/" 
00052     << connection_.ccuAddr() << "/" 
00053     << connection_.ccuChan() << "/" 
00054     << connection_.lldChannel() 
00055     << " and FedId/Ch: " 
00056     << connection_.fedId() << "/" 
00057     << connection_.fedCh();
00058 }

CommissioningTask::~CommissioningTask (  )  [virtual]

Definition at line 62 of file CommissioningTask.cc.

References FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), connection_, FedChannelConnection::fecCrate(), fecKey_, FedChannelConnection::fecRing(), FedChannelConnection::fecSlot(), FedChannelConnection::fedCh(), FedChannelConnection::fedId(), fedKey_, FedChannelConnection::lldChannel(), LogTrace, sistrip::mlDqmSource_, and myName_.

00062                                       {
00063   LogTrace(mlDqmSource_)
00064     << "[CommissioningTask::" << __func__ << "]" 
00065     << " Destructing object for FED id/ch " 
00066     << " Constructing '" << myName_
00067     << "' object for FecKey/FedKey: "
00068     << "0x" << std::hex << std::setw(8) << std::setfill('0') << fecKey_ << std::dec
00069     << "/"
00070     << "0x" << std::hex << std::setw(8) << std::setfill('0') << fedKey_ << std::dec
00071     << " and Crate/FEC/ring/CCU/module/LLDchan: " 
00072     << connection_.fecCrate() << "/"
00073     << connection_.fecSlot() << "/" 
00074     << connection_.fecRing() << "/" 
00075     << connection_.ccuAddr() << "/" 
00076     << connection_.ccuChan() << "/" 
00077     << connection_.lldChannel() 
00078     << " and FedId/Ch: " 
00079     << connection_.fedId() << "/" 
00080     << connection_.fedCh();
00081   //@@ do not delete EventSetup pointer!
00082 }

CommissioningTask::CommissioningTask (  )  [inline, private]

Definition at line 119 of file CommissioningTask.h.

00119 {;}


Member Function Documentation

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

Reimplemented in ApvTimingTask, CalibrationScanTask, CalibrationTask, DaqScopeModeTask, FastFedCablingTask, FedCablingTask, FedTimingTask, FineDelayTask, LatencyTask, NoiseTask, OptoScanTask, PedestalsTask, PedsOnlyTask, and VpspScanTask.

Definition at line 125 of file CommissioningTask.cc.

References sistrip::mlDqmSource_.

Referenced by bookHistograms().

00125                              {
00126   edm::LogWarning(mlDqmSource_)
00127     << "[CommissioningTask::" << __func__ << "]"
00128     << " No derived implementation exists!";
00129 }

void CommissioningTask::bookHistograms (  ) 

Books histograms and constructs HistoSet cache.

Definition at line 160 of file CommissioningTask.cc.

References book(), and booked_.

00160                                        {
00161   book();
00162   booked_ = true;
00163 }

const FedChannelConnection & CommissioningTask::connection (  )  const [inline, protected]

Definition at line 162 of file CommissioningTask.h.

References connection_.

Referenced by FedTimingTask::book(), DaqScopeModeTask::book(), CalibrationTask::book(), OptoScanTask::book(), LatencyTask::book(), PedestalsTask::book(), CalibrationScanTask::book(), VpspScanTask::book(), PedsOnlyTask::book(), NoiseTask::book(), FastFedCablingTask::book(), ApvTimingTask::book(), FedCablingTask::book(), CalibrationTask::checkAndSave(), CalibrationScanTask::checkAndSave(), PedsOnlyTask::fill(), NoiseTask::fill(), PedsOnlyTask::update(), and NoiseTask::update().

00162 { return connection_; }

DQMStore *const CommissioningTask::dqm (  )  const [inline, protected]

Returns const pointer to DQM back-end interface object.

Definition at line 161 of file CommissioningTask.h.

References dqm_.

Referenced by FedTimingTask::book(), FineDelayTask::book(), CalibrationTask::book(), DaqScopeModeTask::book(), OptoScanTask::book(), LatencyTask::book(), PedestalsTask::book(), CalibrationScanTask::book(), PedsOnlyTask::book(), VpspScanTask::book(), NoiseTask::book(), FastFedCablingTask::book(), ApvTimingTask::book(), FedCablingTask::book(), CalibrationTask::checkAndSave(), and CalibrationScanTask::checkAndSave().

00161 { return dqm_; }

const edm::EventSetup *const CommissioningTask::eventSetup (  )  const [inline, protected]

Access to the EventSetup.

Definition at line 168 of file CommissioningTask.h.

References eventSetup_.

Referenced by NoiseTask::book().

00168 { return eventSetup_; }

void CommissioningTask::eventSetup ( const edm::EventSetup setup  )  [inline]

Define access to the EventSetup.

Definition at line 167 of file CommissioningTask.h.

References eventSetup_.

00167 { eventSetup_ = setup; }

const uint32_t & CommissioningTask::fecKey (  )  const [inline, protected]

Returns FEC key.

Definition at line 164 of file CommissioningTask.h.

References fecKey_.

Referenced by VpspScanTask::fill().

00164 { return fecKey_; }

const uint32_t & CommissioningTask::fedKey (  )  const [inline, protected]

Returns FED key.

Definition at line 165 of file CommissioningTask.h.

References fedKey_.

Referenced by FedTimingTask::book(), DaqScopeModeTask::book(), OptoScanTask::book(), PedestalsTask::book(), VpspScanTask::book(), PedsOnlyTask::book(), NoiseTask::book(), FastFedCablingTask::book(), ApvTimingTask::book(), and FedCablingTask::book().

00165 { return fedKey_; }

void CommissioningTask::fill ( const SiStripEventSummary summary,
const uint16_t &  fed_id,
const std::map< uint16_t, float > &  fed_ch 
) [private, virtual]

Reimplemented in FedCablingTask.

Definition at line 142 of file CommissioningTask.cc.

References sistrip::mlDqmSource_.

00144                                                                      {
00145   edm::LogWarning(mlDqmSource_)
00146     << "[CommissioningTask::" << __func__ << "]"
00147     << " No derived implementation exists!";
00148 }

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

Reimplemented in ApvTimingTask, CalibrationScanTask, CalibrationTask, DaqScopeModeTask, FastFedCablingTask, FedTimingTask, FineDelayTask, LatencyTask, NoiseTask, OptoScanTask, PedestalsTask, PedsOnlyTask, and VpspScanTask.

Definition at line 133 of file CommissioningTask.cc.

References sistrip::mlDqmSource_.

Referenced by fillHistograms().

00134                                                                        {
00135   edm::LogWarning(mlDqmSource_)
00136     << "[CommissioningTask::" << __func__ << "]"
00137     << " No derived implementation exists!";
00138 }

const uint32_t & CommissioningTask::fillCntr (  )  const [inline]

Get histogram filled counter.

Definition at line 156 of file CommissioningTask.h.

References fillCntr_.

Referenced by DaqScopeModeTask::fill().

00156 { return fillCntr_; }

void CommissioningTask::fillHistograms ( const SiStripEventSummary summary,
const uint16_t &  fed_id,
const std::map< uint16_t, float > &  fed_ch 
)

Fill HistoSet cache for FED cabling (special case).

Definition at line 185 of file CommissioningTask.cc.

References booked_, fill(), fillCntr_, sistrip::mlDqmSource_, update(), and updateFreq_.

00187                                                                                {
00188   if ( !booked_ ) {
00189     edm::LogWarning(mlDqmSource_)
00190       << "[CommissioningTask::" << __func__ << "]"
00191       << " Attempting to fill histos that haven't been booked yet!";
00192     return;
00193   }
00194   fillCntr_++;
00195   fill( summary, fed_id, fed_ch ); 
00196   if ( updateFreq_ && !(fillCntr_%updateFreq_) ) { 
00197     update(); 
00198   }
00199   
00200 }

void CommissioningTask::fillHistograms ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis 
)

Fills HistoSet cache.

Definition at line 167 of file CommissioningTask.cc.

References booked_, fill(), fillCntr_, sistrip::mlDqmSource_, update(), and updateFreq_.

00168                                                                                  {
00169   if ( !booked_ ) {
00170     edm::LogWarning(mlDqmSource_)
00171       << "[CommissioningTask::" << __func__ << "]"
00172       << " Attempting to fill histos that haven't been booked yet!";
00173     return;
00174   }
00175   fillCntr_++;
00176   fill( summary, digis ); 
00177   if ( updateFreq_ && !(fillCntr_%updateFreq_) ) { 
00178     update(); 
00179   }
00180   
00181 }

const std::string & CommissioningTask::myName ( void   )  const [inline]

Returns the name of this commissioning task.

Definition at line 159 of file CommissioningTask.h.

References myName_.

00159 { return myName_; }

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

Reimplemented in ApvTimingTask, CalibrationScanTask, CalibrationTask, DaqScopeModeTask, FastFedCablingTask, FedCablingTask, FedTimingTask, FineDelayTask, LatencyTask, NoiseTask, OptoScanTask, PedestalsTask, PedsOnlyTask, and VpspScanTask.

Definition at line 152 of file CommissioningTask.cc.

References sistrip::mlDqmSource_.

Referenced by fillHistograms(), and updateHistograms().

00152                                {
00153   edm::LogWarning(mlDqmSource_)
00154     << "[CommissioningTask::" << __func__ << "]"
00155     << " No derived implementation exists!";
00156 }

void CommissioningTask::updateFreq ( const uint32_t &  freq  )  [inline]

Set histogram update frequency.

Definition at line 158 of file CommissioningTask.h.

References updateFreq_.

00158 { updateFreq_ = freq; }

const uint32_t & CommissioningTask::updateFreq (  )  const [inline]

Get histogram update frequency.

Definition at line 157 of file CommissioningTask.h.

References updateFreq_.

Referenced by DaqScopeModeTask::fill().

00157 { return updateFreq_; }

void CommissioningTask::updateHistograms (  ) 

Updates histograms using HistoSet cache.

Definition at line 204 of file CommissioningTask.cc.

References update().

00204                                          {
00205   update();
00206 }

void CommissioningTask::updateHistoSet ( HistoSet histo_set  )  [protected]

Updates the MonitorElements of HistoSet.

Definition at line 265 of file CommissioningTask.cc.

References extract(), CommissioningTask::HistoSet::histo(), CommissioningTask::HistoSet::isProfile_, sistrip::mlDqmSource_, profilereader::profile, CommissioningTask::HistoSet::vNumOfEntries_, CommissioningTask::HistoSet::vSumOfContents_, and CommissioningTask::HistoSet::vSumOfSquares_.

00265                                                             {
00266   
00267   // Check if histo exists
00268   if ( !histo_set.histo() ) {
00269     edm::LogWarning(mlDqmSource_)
00270       << "[CommissioningTask::" << __func__ << "]"
00271       << " NULL pointer to MonitorElement!";
00272     return;
00273   }
00274 
00275   if ( histo_set.isProfile_ ) {
00276 
00277     TProfile* prof = ExtractTObject<TProfile>().extract( histo_set.histo() );
00278     // if ( prof ) { prof->SetErrorOption("s"); } //@@ necessary?
00279     static UpdateTProfile profile;
00280     for ( uint32_t ibin = 0; ibin < histo_set.vNumOfEntries_.size(); ibin++ ) {
00281       profile.setBinContents( prof,
00282                               ibin+1, 
00283                               histo_set.vNumOfEntries_[ibin],
00284                               histo_set.vSumOfContents_[ibin],
00285                               histo_set.vSumOfSquares_[ibin] );
00286     }
00287 
00288   } else {
00289 
00290     for ( uint32_t ibin = 0; ibin < histo_set.vNumOfEntries_.size(); ibin++ ) {
00291       histo_set.histo()->setBinContent( ibin+1, histo_set.vNumOfEntries_[ibin] );
00292     }
00293     
00294   }
00295   
00296 }

void CommissioningTask::updateHistoSet ( HistoSet histo_set,
const float &  value 
) [protected]

Updates the vectors of HistoSet.

Definition at line 218 of file CommissioningTask.cc.

References CommissioningTask::HistoSet::bin(), updateHistoSet(), and weight.

00219                                                              {
00220   float weight = 1.;
00221   updateHistoSet( histo_set, histo_set.bin(value), weight );
00222 }

void CommissioningTask::updateHistoSet ( HistoSet histo_set,
const uint32_t &  bin 
) [protected]

Updates the vectors of HistoSet.

Definition at line 210 of file CommissioningTask.cc.

References updateHistoSet(), and value.

00211                                                               {
00212   float value = 1.;
00213   updateHistoSet( histo_set, bin, value );
00214 }

void CommissioningTask::updateHistoSet ( HistoSet histo_set,
const uint32_t &  bin,
const float &  value 
) [protected]

Updates the vectors of HistoSet.

Definition at line 226 of file CommissioningTask.cc.

References CommissioningTask::HistoSet::isProfile_, sistrip::mlDqmSource_, CommissioningTask::HistoSet::vNumOfEntries_, CommissioningTask::HistoSet::vSumOfContents_, and CommissioningTask::HistoSet::vSumOfSquares_.

Referenced by FedCablingTask::fill(), ApvTimingTask::fill(), OptoScanTask::fill(), DaqScopeModeTask::fill(), LatencyTask::fill(), FedTimingTask::fill(), CalibrationScanTask::fill(), FineDelayTask::fill(), PedestalsTask::fill(), CalibrationTask::fill(), VpspScanTask::fill(), FastFedCablingTask::fill(), PedestalsTask::update(), FedTimingTask::update(), OptoScanTask::update(), CalibrationTask::update(), VpspScanTask::update(), FastFedCablingTask::update(), NoiseTask::update(), FedCablingTask::update(), CalibrationScanTask::update(), LatencyTask::update(), FineDelayTask::update(), DaqScopeModeTask::update(), ApvTimingTask::update(), and updateHistoSet().

00228                                                              {
00229   
00230   // Check bin number
00231   if ( bin >= histo_set.vNumOfEntries_.size() ) { 
00232     edm::LogWarning(mlDqmSource_)
00233       << "[CommissioningTask::" << __func__ << "]"
00234       << " Unexpected bin number " << bin 
00235       << " when filling histogram of size " << histo_set.vNumOfEntries_.size();
00236     return;
00237   }
00238   
00239   // Check if histo is TProfile or not
00240   if ( !histo_set.isProfile_ ) {
00241     // Set entries
00242     histo_set.vNumOfEntries_[bin]+=value;
00243   } else {
00244     // Set entries
00245     histo_set.vNumOfEntries_[bin]++;
00246     
00247     // Check bin number
00248     if ( bin >= histo_set.vSumOfContents_.size() || 
00249          bin >= histo_set.vSumOfSquares_.size() ) { 
00250       edm::LogWarning(mlDqmSource_)
00251         << "[CommissioningTask::" << __func__ << "]"
00252         << " Unexpected bin when filling histogram: " << bin;
00253       return;
00254     }
00255     
00256     // Set sum of contents and squares
00257     histo_set.vSumOfContents_[bin] += value;
00258     histo_set.vSumOfSquares_[bin] += value*value;
00259   }
00260 
00261 }


Member Data Documentation

bool CommissioningTask::booked_ [private]

Definition at line 146 of file CommissioningTask.h.

Referenced by bookHistograms(), and fillHistograms().

FedChannelConnection CommissioningTask::connection_ [private]

Definition at line 140 of file CommissioningTask.h.

Referenced by CommissioningTask(), connection(), and ~CommissioningTask().

DQMStore* CommissioningTask::dqm_ [private]

Definition at line 134 of file CommissioningTask.h.

Referenced by dqm().

const edm::EventSetup* CommissioningTask::eventSetup_ [private]

Definition at line 150 of file CommissioningTask.h.

Referenced by eventSetup().

uint32_t CommissioningTask::fecKey_ [private]

Definition at line 144 of file CommissioningTask.h.

Referenced by CommissioningTask(), fecKey(), and ~CommissioningTask().

uint32_t CommissioningTask::fedKey_ [private]

Definition at line 142 of file CommissioningTask.h.

Referenced by CommissioningTask(), fedKey(), and ~CommissioningTask().

uint32_t CommissioningTask::fillCntr_ [private]

Definition at line 138 of file CommissioningTask.h.

Referenced by fillCntr(), and fillHistograms().

std::string CommissioningTask::myName_ [private]

Definition at line 148 of file CommissioningTask.h.

Referenced by CommissioningTask(), myName(), and ~CommissioningTask().

uint32_t CommissioningTask::updateFreq_ [private]

Definition at line 136 of file CommissioningTask.h.

Referenced by fillHistograms(), and updateFreq().


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