CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

SiStripCommissioningOfflineDbClient Class Reference

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

#include <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 uploadAnal_
bool uploadConf_
bool uploadToDb_

Detailed Description

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

Author:
R.Bainbridge, M.Wingham

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_.

  : SiStripCommissioningOfflineClient(pset),
    uploadAnal_( pset.getUntrackedParameter<bool>("UploadAnalyses",false) ),
    uploadConf_( pset.getUntrackedParameter<bool>("UploadHwConfig",false) )
{
  LogTrace(mlDqmClient_)
    << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
    << " Constructing object...";
  if ( !uploadConf_ ) {
    edm::LogWarning(mlDqmClient_) 
      << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
      << " ===> TEST only! No hardware configurations"
      << " will be uploaded to the DB...";
  }
  if ( !uploadAnal_ ) {
    edm::LogWarning(mlDqmClient_) 
      << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
      << " ===> TEST only! No analysis descriptions"
      << " will be uploaded to the DB...";
  }
  
}
SiStripCommissioningOfflineDbClient::~SiStripCommissioningOfflineDbClient ( ) [virtual]

Definition at line 52 of file SiStripCommissioningOfflineDbClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

                                                                          {
  LogTrace(mlDqmClient_)
    << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
    << " Destructing object...";
}

Member Function Documentation

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

Reimplemented from SiStripCommissioningOfflineClient.

Definition at line 60 of file SiStripCommissioningOfflineDbClient.cc.

References sistrip::APV_LATENCY, sistrip::APV_TIMING, SiStripCommissioningOfflineClient::bei_, sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, CommissioningHistograms::configure(), EcalCondDB::db, CommissioningHistosUsingDb::doUploadAnal(), CommissioningHistosUsingDb::doUploadConf(), sistrip::FAST_CABLING, sistrip::FINE_DELAY, SiStripCommissioningOfflineClient::histos_, LogTrace, sistrip::mlCabling_, sistrip::mlDqmClient_, sistrip::NOISE, cppFunctionSkipper::operator, sistrip::OPTO_SCAN, sistrip::PEDESTALS, sistrip::PEDS_FULL_NOISE, sistrip::PEDS_ONLY, SiStripCommissioningOfflineClient::runType_, tmp, sistrip::UNDEFINED_RUN_TYPE, sistrip::UNKNOWN_RUN_TYPE, uploadAnal_, uploadConf_, and sistrip::VPSP_SCAN.

                                                                                                               {

  // Check pointer
  if ( histos_ ) {
    edm::LogError(mlDqmClient_)
      << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
      << " CommissioningHistogram object already exists!"
      << " Aborting...";
    return;
  } 

  // Check pointer to BEI
  // is this needed here? bei_ = edm::Service<DQMStore>().operator->();
  if ( !bei_ ) {
    edm::LogError(mlDqmClient_)
      << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
      << " NULL pointer to DQMStore!";
    return;
  }

  // Create DB connection
  SiStripConfigDb* db = edm::Service<SiStripConfigDb>().operator->(); //@@ NOT GUARANTEED TO BE THREAD SAFE! 
  LogTrace(mlCabling_) 
    << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
    << " Nota bene: using the SiStripConfigDb API"
    << " as a \"service\" does not presently guarantee"
    << " thread-safe behaviour!...";
  
  // Check DB connection
  if ( !db ) {
    edm::LogError(mlCabling_) 
      << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
      << " NULL pointer to SiStripConfigDb!"
      << " Aborting...";
    return;
  } 
  
  // Create corresponding "commissioning histograms" object 
  if      ( runType_ == sistrip::FAST_CABLING ) { histos_ = new FastFedCablingHistosUsingDb( pset, bei_, db ); }
  else if ( runType_ == sistrip::APV_TIMING )   { histos_ = new ApvTimingHistosUsingDb( pset, bei_, db ); }
  else if ( runType_ == sistrip::OPTO_SCAN )    { histos_ = new OptoScanHistosUsingDb( pset, bei_, db ); }
  else if ( runType_ == sistrip::VPSP_SCAN )    { histos_ = new VpspScanHistosUsingDb( pset, bei_, db ); }
  else if ( runType_ == sistrip::PEDESTALS )    { histos_ = new PedestalsHistosUsingDb( pset, bei_, db ); }
  else if ( runType_ == sistrip::PEDS_ONLY )    { histos_ = new PedsOnlyHistosUsingDb( pset, bei_, db ); }
  else if ( runType_ == sistrip::PEDS_FULL_NOISE ) { histos_ = new PedsFullNoiseHistosUsingDb( pset, bei_, db ); }
  else if ( runType_ == sistrip::NOISE )        { histos_ = new NoiseHistosUsingDb( pset, bei_, db ); }
  else if ( runType_ == sistrip::APV_LATENCY )  { histos_ = new LatencyHistosUsingDb( pset, bei_, db ); }
  else if ( runType_ == sistrip::FINE_DELAY )   { histos_ = new FineDelayHistosUsingDb( pset, bei_, db ); }
  else if ( runType_ == sistrip::CALIBRATION ||
            runType_ == sistrip::CALIBRATION_DECO ||
            runType_ == sistrip::CALIBRATION_SCAN ||
            runType_ == sistrip::CALIBRATION_SCAN_DECO)
                                                { histos_ = new CalibrationHistosUsingDb( pset, bei_, db, runType_ ); }
  else if ( runType_ == sistrip::UNDEFINED_RUN_TYPE ) { 
    histos_ = 0; 
    edm::LogError(mlDqmClient_)
      << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
      << " Undefined run type!";
    return;
  } else if ( runType_ == sistrip::UNKNOWN_RUN_TYPE ) {
    histos_ = 0;
    edm::LogError(mlDqmClient_)
      << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
      << " Unknown run type!";
    return;
  }
  histos_->configure(pset,setup);

  CommissioningHistosUsingDb* tmp = dynamic_cast<CommissioningHistosUsingDb*>(histos_);
  if ( tmp ) { 
    tmp->doUploadConf( uploadConf_ ); 
    tmp->doUploadAnal( uploadAnal_ ); 
    std::stringstream ss;
    ss << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]" 
       << std::endl
       << " Uploading hardware configurations?    : " 
       << ( tmp->doUploadConf() ? "true" : "false" )
       << std::endl
       << " Uploading calibrations from analysis? : " 
       << ( tmp->doUploadAnal() ? "true" : "false" )
       << std::endl;
    edm::LogVerbatim(mlDqmClient_) << ss.str();
  } else {
    edm::LogError(mlDqmClient_) 
      << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
      << " NULL pointer to CommissioningHistosUsingDb!";
  }

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

Reimplemented from SiStripCommissioningOfflineClient.

Definition at line 152 of file SiStripCommissioningOfflineDbClient.cc.

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

                                                           {
  edm::LogVerbatim(mlDqmClient_)
    << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
    << " Uploading parameters to database...";
  CommissioningHistosUsingDb* tmp = dynamic_cast<CommissioningHistosUsingDb*>(histos_);
  if ( tmp ) { 
    tmp->uploadToConfigDb(); 
    edm::LogVerbatim(mlDqmClient_)
      << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
      << " Uploaded parameters to database!";
  } else {
    edm::LogError(mlDqmClient_)
      << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
      << " NULL pointer to CommissioningHistosUsingDb object!"
      << " Upload aborted!...";
  }
}

Member Data Documentation

Reimplemented from SiStripCommissioningOfflineClient.

Definition at line 34 of file SiStripCommissioningOfflineDbClient.h.