CMS 3D CMS Logo

Public Member Functions | Private Attributes

PerformanceAnalyzer Class Reference

#include <PerformanceAnalyzer.h>

Inheritance diagram for PerformanceAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void endJob ()
 PerformanceAnalyzer (const edm::ParameterSet &)
 ~PerformanceAnalyzer ()

Private Attributes

DQMStorefDBE
MonitorElementfEcalUnsuppDigis
MonitorElementfEcalZeroSuppDigis
MonitorElementfg4SimHits
MonitorElementfHcalUnsuppDigis
MonitorElementfMixing
MonitorElementfMuonCSCDigis
MonitorElementfMuonDTDigis
MonitorElementfMuonRPCDigis
std::string fOutputFile
MonitorElementfPreShwZeroSuppDigis
MonitorElementfSiPixelDigis
MonitorElementfSiStripDigis
MonitorElementfVtxSmeared

Detailed Description

Definition at line 11 of file PerformanceAnalyzer.h.


Constructor & Destructor Documentation

PerformanceAnalyzer::PerformanceAnalyzer ( const edm::ParameterSet ps) [explicit]

Definition at line 18 of file PerfomanceAnalyzer.cc.

References DQMStore::book1D(), fDBE, fEcalUnsuppDigis, fEcalZeroSuppDigis, fg4SimHits, fHcalUnsuppDigis, fMixing, fMuonCSCDigis, fMuonDTDigis, fMuonRPCDigis, fPreShwZeroSuppDigis, fSiPixelDigis, fSiStripDigis, fVtxSmeared, NULL, and DQMStore::setCurrentFolder().

   : fDBE( edm::Service<DQMStore>().operator->() ),
     fOutputFile( ps.getUntrackedParameter<std::string>("outputFile", "") )
{
   
   if ( fDBE != NULL )
   {
      fDBE->setCurrentFolder("PerformanceV/CPUPerformanceTask");
      
      // is there any way to record CPU Info ???
      // if so, it can be done once - via beginJob() 
      
      fVtxSmeared   = fDBE->book1D( "VtxSmeared",  "VtxSmeared",   100, 0., 0.1 ) ;
      fg4SimHits    = fDBE->book1D( "g4SimHits",   "g4SimHits",    100, 0., 500. ) ;
      fMixing       = fDBE->book1D( "Mixing",      "Mixing",       100, 0., 0.5 ) ;
      fSiPixelDigis = fDBE->book1D( "SiPixelDigis","SiPixelDigis", 100, 0., 0.5 ) ;
      fSiStripDigis = fDBE->book1D( "SiStripDigis","SiStripDigis", 100, 0., 2. ) ;
      fEcalUnsuppDigis = fDBE->book1D( "EcalUnsuppDigis","EcalUnsuppDigis", 100, 0., 2. ) ;
      fEcalZeroSuppDigis = fDBE->book1D( "EcalZeroSuppDigis","EcalZeroSuppDigis", 100, 0., 2. ) ;
      fPreShwZeroSuppDigis = fDBE->book1D( "PreShwZeroSuppDigis","PreShwZeroSuppDigis", 100, 0., 0.1 ) ; 
      fHcalUnsuppDigis = fDBE->book1D( "HcalUnsuppDigis","HcalUnsuppDigis", 100, 0., 0.5 ) ;
      fMuonCSCDigis = fDBE->book1D( "MuonCSCDigis", "MuonCSCDigis", 100, 0., 0.1 ) ;
      fMuonDTDigis  = fDBE->book1D( "MuonDTDigis",  "MuonDTDigis",  100, 0., 0.1 ) ;
      fMuonRPCDigis = fDBE->book1D( "MuonRPCDigis", "MuonRPCDigis", 100, 0., 0.1 ) ;
   }
}
PerformanceAnalyzer::~PerformanceAnalyzer ( )

Definition at line 46 of file PerfomanceAnalyzer.cc.

{
   // don't try to delete any pointers - they're handled by DQM machinery
}

Member Function Documentation

void PerformanceAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup eventSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 62 of file PerfomanceAnalyzer.cc.

References edm::EventID::event(), fEcalUnsuppDigis, fEcalZeroSuppDigis, fg4SimHits, fHcalUnsuppDigis, MonitorElement::Fill(), fMixing, fMuonCSCDigis, fMuonDTDigis, fMuonRPCDigis, fPreShwZeroSuppDigis, fSiPixelDigis, fSiStripDigis, fVtxSmeared, edm::Event::getByLabel(), i, and edm::EventBase::id().

{

   if ( e.id().event() == 1) return ; // skip 1st event
   
   edm::Handle<edm::EventTime> EvtTime;
   e.getByLabel( "cputest", EvtTime ) ;
   
   for ( unsigned int i=0; i<EvtTime->size(); ++i )
   {
      if ( EvtTime->name(i) == "VtxSmeared" )   fVtxSmeared->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "g4SimHits"  )   fg4SimHits->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "mix" )          fMixing->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "siPixelDigis" ) fSiPixelDigis->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "siStripDigis" ) fSiStripDigis->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "ecalUnsuppressedDigis" ) fEcalUnsuppDigis->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "ecalDigis")     fEcalZeroSuppDigis->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "ecalPreshowerDigis") fPreShwZeroSuppDigis->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "hcalDigis" )    fHcalUnsuppDigis->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "muonCSCDigis" ) fMuonCSCDigis->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "muonDTDigis" )  fMuonDTDigis->Fill( EvtTime->time(i) ) ;
      if ( EvtTime->name(i) == "muonRPCDigis" ) fMuonRPCDigis->Fill( EvtTime->time(i) ) ;
      
   }
      
   return ;
   
}
virtual void PerformanceAnalyzer::beginJob ( void  ) [inline, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 18 of file PerformanceAnalyzer.h.

{} 
void PerformanceAnalyzer::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 52 of file PerfomanceAnalyzer.cc.

References fDBE, fOutputFile, and DQMStore::save().

{

  if ( fOutputFile.size() != 0 && fDBE ) fDBE->save(fOutputFile);

  return ;

}

Member Data Documentation

Definition at line 23 of file PerformanceAnalyzer.h.

Referenced by endJob(), and PerformanceAnalyzer().

Definition at line 30 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

Definition at line 31 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

Definition at line 26 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

Definition at line 33 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

Definition at line 27 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

Definition at line 34 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

Definition at line 35 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

Definition at line 36 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

std::string PerformanceAnalyzer::fOutputFile [private]

Definition at line 24 of file PerformanceAnalyzer.h.

Referenced by endJob().

Definition at line 32 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

Definition at line 28 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

Definition at line 29 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

Definition at line 25 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().