CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiStripFedCablingBuilder Class Reference

#include <SiStripFedCablingBuilder.h>

Inheritance diagram for SiStripFedCablingBuilder:
edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
void beginRun (const edm::Run &, const edm::EventSetup &)
 SiStripFedCablingBuilder (const edm::ParameterSet &iConfig)
 ~SiStripFedCablingBuilder ()

Private Attributes

bool printDetCabling_
bool printFecCabling_
bool printRegionCabling_

Detailed Description

Definition at line 9 of file SiStripFedCablingBuilder.h.


Constructor & Destructor Documentation

SiStripFedCablingBuilder::SiStripFedCablingBuilder ( const edm::ParameterSet iConfig)

Definition at line 19 of file SiStripFedCablingBuilder.cc.

                                                                                :
  printFecCabling_( pset.getUntrackedParameter<bool>("PrintFecCabling",false) ),
  printDetCabling_( pset.getUntrackedParameter<bool>("PrintDetCabling",false) ),
  printRegionCabling_( pset.getUntrackedParameter<bool>("PrintRegionCabling",false) )
{;}
SiStripFedCablingBuilder::~SiStripFedCablingBuilder ( ) [inline]

Definition at line 15 of file SiStripFedCablingBuilder.h.

{};

Member Function Documentation

void SiStripFedCablingBuilder::analyze ( const edm::Event ,
const edm::EventSetup  
) [inline, virtual]

Implements edm::EDAnalyzer.

Definition at line 19 of file SiStripFedCablingBuilder.h.

{;}
void SiStripFedCablingBuilder::beginRun ( const edm::Run run,
const edm::EventSetup setup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 27 of file SiStripFedCablingBuilder.cc.

References edm::EventSetup::get(), edm::Service< T >::isAvailable(), edm::ESHandleBase::isValid(), getGTfromDQMFile::obj, printDetCabling_, printFecCabling_, printRegionCabling_, edm::ESHandle< T >::product(), and edm::RunBase::run().

                                                                      {

  edm::LogInfo("SiStripFedCablingBuilder") << "... creating dummy SiStripFedCabling Data for Run " << run.run() << "\n " << std::endl;

  edm::LogVerbatim("SiStripFedCablingBuilder") 
    << "[SiStripFedCablingBuilder::" << __func__ << "]"
    << " Retrieving FED cabling...";
  edm::ESHandle<SiStripFedCabling> fed;
  setup.get<SiStripFedCablingRcd>().get( fed ); 

  edm::LogVerbatim("SiStripFedCablingBuilder") 
    << "[SiStripFedCablingBuilder::" << __func__ << "]"
    << " Retrieving FEC cabling...";
  edm::ESHandle<SiStripFecCabling> fec;
  setup.get<SiStripFecCablingRcd>().get( fec ); 

  edm::LogVerbatim("SiStripFedCablingBuilder") 
    << "[SiStripFedCablingBuilder::" << __func__ << "]"
    << " Retrieving DET cabling...";
  edm::ESHandle<SiStripDetCabling> det;
  setup.get<SiStripDetCablingRcd>().get( det ); 

  edm::LogVerbatim("SiStripFedCablingBuilder") 
    << "[SiStripFedCablingBuilder::" << __func__ << "]"
    << " Retrieving REGION cabling...";
  edm::ESHandle<SiStripRegionCabling> region;
  setup.get<SiStripRegionCablingRcd>().get( region ); 

  if ( !fed.isValid() ) {
    edm::LogError("SiStripFedCablingBuilder") 
      << " Invalid handle to FED cabling object: ";
    return;
  }
  
  {
    std::stringstream ss;
    ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
       << " VERBOSE DEBUG" << std::endl;
    fed->print( ss );
    ss << std::endl;
    if ( printFecCabling_ && fec.isValid() ) { fec->print( ss ); }
    ss << std::endl;
    if ( printDetCabling_ && det.isValid() ) { det->print( ss ); }
    ss << std::endl;
    if ( printRegionCabling_ && region.isValid() ) { region->print( ss ); }
    ss << std::endl;
    edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
  }
  
  {
    std::stringstream ss;
    ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
       << " TERSE DEBUG" << std::endl;
    fed->terse( ss );
    ss << std::endl;
    edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
  }
  
  {
    std::stringstream ss;
    ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
       << " SUMMARY DEBUG" << std::endl;
    fed->summary( ss );
    ss << std::endl;
    edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
  }
  
  edm::LogVerbatim("SiStripFedCablingBuilder") 
    << "[SiStripFedCablingBuilder::" << __func__ << "]"
    << " Copying FED cabling...";
  SiStripFedCabling* obj = new SiStripFedCabling( *( fed.product() ) );
  
  //End now write sistripnoises data in DB
  edm::Service<cond::service::PoolDBOutputService> mydbservice;

  if( mydbservice.isAvailable() ){
    if ( mydbservice->isNewTagRequest("SiStripFedCablingRcd") ){
      mydbservice->createNewIOV<SiStripFedCabling>(obj,mydbservice->beginOfTime(),mydbservice->endOfTime(),"SiStripFedCablingRcd");
    } else {  
      mydbservice->appendSinceTime<SiStripFedCabling>(obj,mydbservice->currentTime(),"SiStripFedCablingRcd");      
    }
  }else{
    edm::LogError("SiStripFedCablingBuilder")<<"Service is unavailable"<<std::endl;
  }
}

Member Data Documentation

Definition at line 24 of file SiStripFedCablingBuilder.h.

Referenced by beginRun().

Definition at line 23 of file SiStripFedCablingBuilder.h.

Referenced by beginRun().

Definition at line 25 of file SiStripFedCablingBuilder.h.

Referenced by beginRun().