CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PerformanceAnalyzer Class Reference

#include <PerformanceAnalyzer.h>

Inheritance diagram for PerformanceAnalyzer:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 PerformanceAnalyzer (const edm::ParameterSet &)
 
 ~PerformanceAnalyzer () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::EDGetTokenT< edm::EventTimeeventTime_Token_
 
MonitorElementfEcalUnsuppDigis
 
MonitorElementfEcalZeroSuppDigis
 
MonitorElementfg4SimHits
 
MonitorElementfHcalUnsuppDigis
 
MonitorElementfMixing
 
MonitorElementfMuonCSCDigis
 
MonitorElementfMuonDTDigis
 
MonitorElementfMuonRPCDigis
 
std::string fOutputFile
 
MonitorElementfPreShwZeroSuppDigis
 
MonitorElementfSiPixelDigis
 
MonitorElementfSiStripDigis
 
MonitorElementfVtxSmeared
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 12 of file PerformanceAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file PerfomanceAnalyzer.cc.

References eventTime_Token_.

17  : fOutputFile( ps.getUntrackedParameter<std::string>("outputFile", "") )
18 {
19  eventTime_Token_ = consumes<edm::EventTime> (edm::InputTag("cputest"));
20 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::EventTime > eventTime_Token_
PerformanceAnalyzer::~PerformanceAnalyzer ( )
override

Definition at line 22 of file PerfomanceAnalyzer.cc.

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

Member Function Documentation

void PerformanceAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup eventSetup 
)
override

Definition at line 45 of file PerfomanceAnalyzer.cc.

References DEFINE_FWK_MODULE, edm::EventID::event(), eventTime_Token_, fEcalUnsuppDigis, fEcalZeroSuppDigis, fg4SimHits, fHcalUnsuppDigis, MonitorElement::Fill(), fMixing, fMuonCSCDigis, fMuonDTDigis, fMuonRPCDigis, fPreShwZeroSuppDigis, fSiPixelDigis, fSiStripDigis, fVtxSmeared, edm::Event::getByToken(), mps_fire::i, edm::EventBase::id(), edm::EventTime::name(), reco::return(), edm::EventTime::size(), and edm::EventTime::time().

46 {
47  if ( e.id().event() == 1) return ; // skip 1st event
48 
50  e.getByToken(eventTime_Token_, EvtTime ) ;
51 
52  for ( unsigned int i=0; i<EvtTime->size(); ++i )
53  {
54  if ( EvtTime->name(i) == "VtxSmeared" ) fVtxSmeared->Fill( EvtTime->time(i) ) ;
55  if ( EvtTime->name(i) == "g4SimHits" ) fg4SimHits->Fill( EvtTime->time(i) ) ;
56  if ( EvtTime->name(i) == "mix" ) fMixing->Fill( EvtTime->time(i) ) ;
57  if ( EvtTime->name(i) == "siPixelDigis" ) fSiPixelDigis->Fill( EvtTime->time(i) ) ;
58  if ( EvtTime->name(i) == "siStripDigis" ) fSiStripDigis->Fill( EvtTime->time(i) ) ;
59  if ( EvtTime->name(i) == "ecalUnsuppressedDigis" ) fEcalUnsuppDigis->Fill( EvtTime->time(i) ) ;
60  if ( EvtTime->name(i) == "ecalDigis") fEcalZeroSuppDigis->Fill( EvtTime->time(i) ) ;
61  if ( EvtTime->name(i) == "ecalPreshowerDigis") fPreShwZeroSuppDigis->Fill( EvtTime->time(i) ) ;
62  if ( EvtTime->name(i) == "hcalDigis" ) fHcalUnsuppDigis->Fill( EvtTime->time(i) ) ;
63  if ( EvtTime->name(i) == "muonCSCDigis" ) fMuonCSCDigis->Fill( EvtTime->time(i) ) ;
64  if ( EvtTime->name(i) == "muonDTDigis" ) fMuonDTDigis->Fill( EvtTime->time(i) ) ;
65  if ( EvtTime->name(i) == "muonRPCDigis" ) fMuonRPCDigis->Fill( EvtTime->time(i) ) ;
66  }
67  return ;
68 }
EventNumber_t event() const
Definition: EventID.h:41
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
unsigned size() const
Definition: ModuleTiming.h:39
MonitorElement * fHcalUnsuppDigis
double time(unsigned i) const
Definition: ModuleTiming.h:53
void Fill(long long x)
MonitorElement * fMuonRPCDigis
MonitorElement * fEcalUnsuppDigis
MonitorElement * fg4SimHits
edm::EDGetTokenT< edm::EventTime > eventTime_Token_
MonitorElement * fSiStripDigis
MonitorElement * fSiPixelDigis
MonitorElement * fMuonCSCDigis
MonitorElement * fVtxSmeared
MonitorElement * fEcalZeroSuppDigis
return(e1-e2)*(e1-e2)+dp *dp
edm::EventID id() const
Definition: EventBase.h:60
MonitorElement * fMuonDTDigis
std::string name(unsigned i) const
Definition: ModuleTiming.h:48
MonitorElement * fMixing
MonitorElement * fPreShwZeroSuppDigis
void PerformanceAnalyzer::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 27 of file PerfomanceAnalyzer.cc.

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

28 {
29  iBooker.setCurrentFolder("PerformanceV/CPUPerformanceTask");
30 
31  fVtxSmeared = iBooker.book1D("VtxSmeared", "VtxSmeared", 100, 0., 0.1 );
32  fg4SimHits = iBooker.book1D("g4SimHits", "g4SimHits", 100, 0., 500.);
33  fMixing = iBooker.book1D("Mixing", "Mixing", 100, 0., 0.5 );
34  fSiPixelDigis = iBooker.book1D("SiPixelDigis", "SiPixelDigis", 100, 0., 0.5 );
35  fSiStripDigis = iBooker.book1D("SiStripDigis", "SiStripDigis", 100, 0., 2. );
36  fEcalUnsuppDigis = iBooker.book1D("EcalUnsuppDigis", "EcalUnsuppDigis", 100, 0., 2. );
37  fEcalZeroSuppDigis = iBooker.book1D("EcalZeroSuppDigis", "EcalZeroSuppDigis", 100, 0., 2. );
38  fPreShwZeroSuppDigis = iBooker.book1D("PreShwZeroSuppDigis", "PreShwZeroSuppDigis", 100, 0., 0.1 );
39  fHcalUnsuppDigis = iBooker.book1D("HcalUnsuppDigis", "HcalUnsuppDigis", 100, 0., 0.5 );
40  fMuonCSCDigis = iBooker.book1D("MuonCSCDigis", "MuonCSCDigis", 100, 0., 0.1 );
41  fMuonDTDigis = iBooker.book1D("MuonDTDigis", "MuonDTDigis", 100, 0., 0.1 );
42  fMuonRPCDigis = iBooker.book1D("MuonRPCDigis", "MuonRPCDigis", 100, 0., 0.1 );
43 }
MonitorElement * fHcalUnsuppDigis
MonitorElement * fMuonRPCDigis
MonitorElement * fEcalUnsuppDigis
MonitorElement * fg4SimHits
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
MonitorElement * fSiStripDigis
MonitorElement * fSiPixelDigis
MonitorElement * fMuonCSCDigis
MonitorElement * fVtxSmeared
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * fEcalZeroSuppDigis
MonitorElement * fMuonDTDigis
MonitorElement * fMixing
MonitorElement * fPreShwZeroSuppDigis

Member Data Documentation

edm::EDGetTokenT<edm::EventTime> PerformanceAnalyzer::eventTime_Token_
private

Definition at line 22 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fEcalUnsuppDigis
private

Definition at line 29 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PerformanceAnalyzer::fEcalZeroSuppDigis
private

Definition at line 30 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PerformanceAnalyzer::fg4SimHits
private

Definition at line 25 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PerformanceAnalyzer::fHcalUnsuppDigis
private

Definition at line 32 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PerformanceAnalyzer::fMixing
private

Definition at line 26 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PerformanceAnalyzer::fMuonCSCDigis
private

Definition at line 33 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PerformanceAnalyzer::fMuonDTDigis
private

Definition at line 34 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PerformanceAnalyzer::fMuonRPCDigis
private

Definition at line 35 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

std::string PerformanceAnalyzer::fOutputFile
private

Definition at line 23 of file PerformanceAnalyzer.h.

MonitorElement* PerformanceAnalyzer::fPreShwZeroSuppDigis
private

Definition at line 31 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PerformanceAnalyzer::fSiPixelDigis
private

Definition at line 27 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PerformanceAnalyzer::fSiStripDigis
private

Definition at line 28 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PerformanceAnalyzer::fVtxSmeared
private

Definition at line 24 of file PerformanceAnalyzer.h.

Referenced by analyze(), and bookHistograms().