CMS 3D CMS Logo

SiStripCommissioningOfflineDbClient Class Reference

Author:
R.Bainbridge, M.Wingham
More...

#include <DQM/SiStripCommissioningDbClients/plugins/SiStripCommissioningOfflineDbClient.h>

Inheritance diagram for SiStripCommissioningOfflineDbClient:

SiStripCommissioningOfflineClient edm::EDAnalyzer

List of all members.

Public Member Functions

 SiStripCommissioningOfflineDbClient (const edm::ParameterSet &)
virtual ~SiStripCommissioningOfflineDbClient ()

Protected Member Functions

void createHistos (const edm::ParameterSet &, const edm::EventSetup &)
void uploadToConfigDb ()

Private Attributes

bool disableDevices_
bool uploadAnal_
bool uploadConf_
bool uploadFecSettings_
bool uploadFedSettings_
bool uploadToDb_


Detailed Description

Author:
R.Bainbridge, M.Wingham

Class which reads a root file containing "commissioning histograms", analyzes the histograms to extract "monitorables", creates summary histograms, and uploads to DB.

Definition at line 18 of file SiStripCommissioningOfflineDbClient.h.


Constructor & Destructor Documentation

SiStripCommissioningOfflineDbClient::SiStripCommissioningOfflineDbClient ( const edm::ParameterSet pset  ) 

Definition at line 27 of file SiStripCommissioningOfflineDbClient.cc.

References LogTrace, sistrip::mlDqmClient_, uploadAnal_, and uploadConf_.

00028   : SiStripCommissioningOfflineClient(pset),
00029     uploadAnal_( pset.getUntrackedParameter<bool>("UploadAnalyses",false) ),
00030     uploadConf_( pset.getUntrackedParameter<bool>("UploadHwConfig",false) ),
00031     uploadFecSettings_( pset.getUntrackedParameter<bool>("UploadFecSettings",true) ),
00032     uploadFedSettings_( pset.getUntrackedParameter<bool>("UploadFedSettings",true) ),
00033     disableDevices_( pset.getUntrackedParameter<bool>("DisableDevices",false) )
00034 {
00035   LogTrace(mlDqmClient_)
00036     << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00037     << " Constructing object...";
00038   if ( !uploadConf_ ) {
00039     edm::LogWarning(mlDqmClient_) 
00040       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00041       << " ===> TEST only! No hardware configurations"
00042       << " will be uploaded to the DB...";
00043   }
00044   if ( !uploadAnal_ ) {
00045     edm::LogWarning(mlDqmClient_) 
00046       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00047       << " ===> TEST only! No analysis descriptions"
00048       << " will be uploaded to the DB...";
00049   }
00050   
00051 }

SiStripCommissioningOfflineDbClient::~SiStripCommissioningOfflineDbClient (  )  [virtual]

Definition at line 55 of file SiStripCommissioningOfflineDbClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

00055                                                                           {
00056   LogTrace(mlDqmClient_)
00057     << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00058     << " Destructing object...";
00059 }


Member Function Documentation

void SiStripCommissioningOfflineDbClient::createHistos ( const edm::ParameterSet pset,
const edm::EventSetup setup 
) [protected, virtual]

Reimplemented from SiStripCommissioningOfflineClient.

Definition at line 63 of file SiStripCommissioningOfflineDbClient.cc.

References sistrip::APV_LATENCY, sistrip::APV_TIMING, sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, CommissioningHistograms::configure(), archive::db, CommissioningHistosUsingDb::disableDevices(), disableDevices_, CommissioningHistosUsingDb::doUploadAnal(), CommissioningHistosUsingDb::doUploadConf(), lat::endl(), sistrip::FAST_CABLING, sistrip::FINE_DELAY, DQMOldReceiver::getBEInterface(), SiStripCommissioningOfflineClient::histos_, LogTrace, sistrip::mlCabling_, sistrip::mlDqmClient_, SiStripCommissioningOfflineClient::mui_, sistrip::NOISE, sistrip::OPTO_SCAN, sistrip::PEDESTALS, sistrip::PEDS_ONLY, SiStripCommissioningOfflineClient::runType_, ss, pyDBSRunClass::temp, tmp, sistrip::UNDEFINED_RUN_TYPE, sistrip::UNKNOWN_RUN_TYPE, uploadAnal_, uploadConf_, uploadFecSettings_, ApvTimingHistosUsingDb::uploadFedSettings(), uploadFedSettings_, ApvTimingHistosUsingDb::uploadPllSettings(), and sistrip::VPSP_SCAN.

00063                                                                                                                {
00064 
00065   // Check pointer
00066   if ( histos_ ) {
00067     edm::LogError(mlDqmClient_)
00068       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00069       << " CommissioningHistogram object already exists!"
00070       << " Aborting...";
00071     return;
00072   } 
00073 
00074   // Check pointer to MUI
00075   if ( !mui_ ) {
00076     edm::LogError(mlDqmClient_)
00077       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00078       << " NULL pointer to DQMOldReceiver!";
00079     return;
00080   }
00081 
00082   // Check pointer to BEI
00083   DQMStore* bei = mui_->getBEInterface();
00084   if ( !bei ) {
00085     edm::LogError(mlDqmClient_)
00086       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00087       << " NULL pointer to DQMStore!";
00088     return;
00089   }
00090 
00091   // Create DB connection
00092   SiStripConfigDb* db = edm::Service<SiStripConfigDb>().operator->(); //@@ NOT GUARANTEED TO BE THREAD SAFE! 
00093   LogTrace(mlCabling_) 
00094     << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00095     << " Nota bene: using the SiStripConfigDb API"
00096     << " as a \"service\" does not presently guarantee"
00097     << " thread-safe behaviour!...";
00098   
00099   // Check DB connection
00100   if ( !db ) {
00101     edm::LogError(mlCabling_) 
00102       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00103       << " NULL pointer to SiStripConfigDb!"
00104       << " Aborting...";
00105     return;
00106   } 
00107   
00108   // Create corresponding "commissioning histograms" object 
00109   if      ( runType_ == sistrip::FAST_CABLING ) { histos_ = new FastFedCablingHistosUsingDb( mui_, db ); }
00110   else if ( runType_ == sistrip::APV_TIMING )   { histos_ = new ApvTimingHistosUsingDb( mui_, db ); }
00111   else if ( runType_ == sistrip::OPTO_SCAN )    { histos_ = new OptoScanHistosUsingDb( mui_, db ); }
00112   else if ( runType_ == sistrip::VPSP_SCAN )    { histos_ = new VpspScanHistosUsingDb( mui_, db ); }
00113   else if ( runType_ == sistrip::PEDESTALS )    { histos_ = new PedestalsHistosUsingDb( mui_, db ); }
00114   else if ( runType_ == sistrip::PEDS_ONLY )    { histos_ = new PedsOnlyHistosUsingDb( mui_, db ); }
00115   else if ( runType_ == sistrip::NOISE )        { histos_ = new NoiseHistosUsingDb( mui_, db ); }
00116   else if ( runType_ == sistrip::APV_LATENCY )  { histos_ = new LatencyHistosUsingDb( mui_, db ); }
00117   else if ( runType_ == sistrip::FINE_DELAY )   { histos_ = new FineDelayHistosUsingDb( mui_, db ); }
00118   else if ( runType_ == sistrip::CALIBRATION ||
00119             runType_ == sistrip::CALIBRATION_DECO ||
00120             runType_ == sistrip::CALIBRATION_SCAN ||
00121             runType_ == sistrip::CALIBRATION_SCAN_DECO)
00122                                                 { histos_ = new CalibrationHistosUsingDb( mui_, db, runType_ ); }
00123   else if ( runType_ == sistrip::UNDEFINED_RUN_TYPE ) { 
00124     histos_ = 0; 
00125     edm::LogError(mlDqmClient_)
00126       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00127       << " Undefined run type!";
00128     return;
00129   } else if ( runType_ == sistrip::UNKNOWN_RUN_TYPE ) {
00130     histos_ = 0;
00131     edm::LogError(mlDqmClient_)
00132       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00133       << " Unknown run type!";
00134     return;
00135   }
00136   histos_->configure(pset,setup);
00137 
00138   CommissioningHistosUsingDb* tmp = dynamic_cast<CommissioningHistosUsingDb*>(histos_);
00139   if ( tmp ) { 
00140     tmp->doUploadConf( uploadConf_ ); 
00141     tmp->doUploadAnal( uploadAnal_ ); 
00142     tmp->disableDevices( disableDevices_ );
00143     std::stringstream ss;
00144     ss << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]" 
00145        << std::endl
00146        << " Uploading hardware configurations?    : " 
00147        << ( tmp->doUploadConf() ? "true" : "false" )
00148        << std::endl
00149        << " Uploading calibrations from analysis? : " 
00150        << ( tmp->doUploadAnal() ? "true" : "false" )
00151        << std::endl
00152        << " Disable problematic devices?          : " 
00153        << ( tmp->disableDevices() ? "true" : "false" );
00154     edm::LogVerbatim(mlDqmClient_) << ss.str();
00155   } else {
00156     edm::LogError(mlDqmClient_) 
00157       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00158       << " NULL pointer to CommissioningHistosUsingDb!";
00159   }
00160   
00161   // Flags specific to APV timing task 
00162   ApvTimingHistosUsingDb* temp = dynamic_cast<ApvTimingHistosUsingDb*>(histos_);
00163   if ( temp ) { 
00164     temp->uploadPllSettings( uploadFecSettings_ );
00165     temp->uploadFedSettings( uploadFedSettings_ );
00166   }
00167   
00168 }

void SiStripCommissioningOfflineDbClient::uploadToConfigDb (  )  [protected, virtual]

Reimplemented from SiStripCommissioningOfflineClient.

Definition at line 172 of file SiStripCommissioningOfflineDbClient.cc.

References SiStripCommissioningOfflineClient::histos_, sistrip::mlDqmClient_, tmp, and CommissioningHistosUsingDb::uploadToConfigDb().

00172                                                            {
00173   edm::LogVerbatim(mlDqmClient_)
00174     << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00175     << " Uploading parameters to database...";
00176   CommissioningHistosUsingDb* tmp = dynamic_cast<CommissioningHistosUsingDb*>(histos_);
00177   if ( tmp ) { 
00178     tmp->uploadToConfigDb(); 
00179     edm::LogVerbatim(mlDqmClient_)
00180       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00181       << " Uploaded parameters to database!";
00182   } else {
00183     edm::LogError(mlDqmClient_)
00184       << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
00185       << " NULL pointer to CommissioningHistosUsingDb object!"
00186       << " Upload aborted!...";
00187   }
00188 }


Member Data Documentation

bool SiStripCommissioningOfflineDbClient::disableDevices_ [private]

Definition at line 44 of file SiStripCommissioningOfflineDbClient.h.

Referenced by createHistos().

bool SiStripCommissioningOfflineDbClient::uploadAnal_ [private]

Definition at line 36 of file SiStripCommissioningOfflineDbClient.h.

Referenced by createHistos(), and SiStripCommissioningOfflineDbClient().

bool SiStripCommissioningOfflineDbClient::uploadConf_ [private]

Definition at line 38 of file SiStripCommissioningOfflineDbClient.h.

Referenced by createHistos(), and SiStripCommissioningOfflineDbClient().

bool SiStripCommissioningOfflineDbClient::uploadFecSettings_ [private]

Definition at line 40 of file SiStripCommissioningOfflineDbClient.h.

Referenced by createHistos().

bool SiStripCommissioningOfflineDbClient::uploadFedSettings_ [private]

Definition at line 42 of file SiStripCommissioningOfflineDbClient.h.

Referenced by createHistos().

bool SiStripCommissioningOfflineDbClient::uploadToDb_ [private]

Reimplemented from SiStripCommissioningOfflineClient.

Definition at line 34 of file SiStripCommissioningOfflineDbClient.h.


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