CMS 3D CMS Logo

SiStripPerformanceSummaryBuilder Class Reference

Description: <one line="" class="" summary>=""> Implementation: <Notes on="" implementation>="">. More...

#include <CondTools/SiStrip/test/SiStripPerformanceSummaryBuilder.cc>

Inheritance diagram for SiStripPerformanceSummaryBuilder:

edm::EDAnalyzer

List of all members.

Public Member Functions

 SiStripPerformanceSummaryBuilder (const edm::ParameterSet &)
 ~SiStripPerformanceSummaryBuilder ()

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)

Private Attributes

edm::FileInPath fp_
uint32_t printdebug_


Detailed Description

Description: <one line="" class="" summary>=""> Implementation: <Notes on="" implementation>="">.

Definition at line 26 of file SiStripPerformanceSummaryBuilder.h.


Constructor & Destructor Documentation

SiStripPerformanceSummaryBuilder::SiStripPerformanceSummaryBuilder ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 6 of file SiStripPerformanceSummaryBuilder.cc.

00006                                                                                                 :
00007   fp_(iConfig.getUntrackedParameter<edm::FileInPath>("file",edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
00008   printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug",1)){}

SiStripPerformanceSummaryBuilder::~SiStripPerformanceSummaryBuilder (  )  [inline]

Definition at line 29 of file SiStripPerformanceSummaryBuilder.h.

00029 {};


Member Function Documentation

void SiStripPerformanceSummaryBuilder::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 10 of file SiStripPerformanceSummaryBuilder.cc.

References lat::endl(), fp_, edm::FileInPath::fullPath(), edm::Service< T >::isAvailable(), SiStripPerformanceSummary::print(), SiStripPerformanceSummary::setClusterCharge(), SiStripPerformanceSummary::setClusterSize(), SiStripPerformanceSummary::setOccupancy(), SiStripPerformanceSummary::setPercentNoisyStrips(), and SiStripPerformanceSummary::setTimeValue().

00010                                                                                                   {
00011   SiStripPerformanceSummary* psummary = new SiStripPerformanceSummary();
00012   // fill object
00013 
00014   SiStripDetInfoFileReader reader(fp_.fullPath());
00015 
00016  
00017   for(std::vector<uint32_t>::const_iterator idet = reader.getAllDetIds().begin(); idet != reader.getAllDetIds().end(); ++idet){
00018     // generate random values for each detId
00019     float clusterSizeMean = (float) RandGauss::shoot(4.,2.);
00020     float clusterSizeRMS  = (float) RandGauss::shoot(2.,1.);
00021     float clusterChargeMean = (float) RandGauss::shoot(70.,10.);
00022     float clusterChargeRMS  = (float) RandGauss::shoot(10.,1.);
00023     float occupancyMean = (float) RandGauss::shoot(50.,20.);
00024     float occupancyRMS  = (float) RandGauss::shoot(20.,4.);
00025     float noisyStrips = (float) RandGauss::shoot(7.,1.);
00026     // set values
00027     psummary->setClusterSize(*idet, clusterSizeMean, clusterSizeRMS);
00028     psummary->setClusterCharge(*idet, clusterChargeMean, clusterChargeRMS);
00029     psummary->setOccupancy(*idet, occupancyMean, occupancyRMS);
00030     psummary->setPercentNoisyStrips(*idet, noisyStrips);
00031   }
00032   clock_t presentTime = clock();
00033   psummary->setTimeValue((unsigned long long)presentTime);
00034   psummary->print();
00035   // Write to DB
00036   edm::Service<cond::service::PoolDBOutputService> poolDbService;
00037   if( poolDbService.isAvailable() ){
00038     if ( poolDbService->isNewTagRequest( "SiStripPerformanceSummaryRcd" ) ){
00039       edm::LogInfo("Tag")<<" is new tag request.";
00040       poolDbService->createNewIOV<SiStripPerformanceSummary>( psummary, poolDbService->beginOfTime(),poolDbService->endOfTime(),"SiStripPerformanceSummaryRcd"  );
00041     }else{
00042       edm::LogInfo("Tag")<<" tag exists already.";
00043       poolDbService->appendSinceTime<SiStripPerformanceSummary>( psummary, poolDbService->currentTime(),"SiStripPerformanceSummaryRcd" );
00044     }
00045   }else{
00046     edm::LogError("PoolDBOutputService")<<" Service is unavailable"<<std::endl;
00047   }
00048 }


Member Data Documentation

edm::FileInPath SiStripPerformanceSummaryBuilder::fp_ [private]

Definition at line 35 of file SiStripPerformanceSummaryBuilder.h.

Referenced by analyze().

uint32_t SiStripPerformanceSummaryBuilder::printdebug_ [private]

Definition at line 36 of file SiStripPerformanceSummaryBuilder.h.


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