CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
PerformanceAnalyzer Class Reference

#include <PerformanceAnalyzer.h>

Inheritance diagram for PerformanceAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 
 PerformanceAnalyzer (const edm::ParameterSet &)
 
 ~PerformanceAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 13 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(), eventTime_Token_, fDBE, fEcalUnsuppDigis, fEcalZeroSuppDigis, fg4SimHits, fHcalUnsuppDigis, fMixing, fMuonCSCDigis, fMuonDTDigis, fMuonRPCDigis, fPreShwZeroSuppDigis, fSiPixelDigis, fSiStripDigis, fVtxSmeared, NULL, and DQMStore::setCurrentFolder().

20  fOutputFile( ps.getUntrackedParameter<std::string>("outputFile", "") )
21 {
22  eventTime_Token_ = consumes<edm::EventTime> (
23  edm::InputTag("cputest"));
24 
25  if ( fDBE != NULL )
26  {
27  fDBE->setCurrentFolder("PerformanceV/CPUPerformanceTask");
28 
29  // is there any way to record CPU Info ???
30  // if so, it can be done once - via beginJob()
31 
32  fVtxSmeared = fDBE->book1D( "VtxSmeared", "VtxSmeared", 100, 0., 0.1 ) ;
33  fg4SimHits = fDBE->book1D( "g4SimHits", "g4SimHits", 100, 0., 500. ) ;
34  fMixing = fDBE->book1D( "Mixing", "Mixing", 100, 0., 0.5 ) ;
35  fSiPixelDigis = fDBE->book1D( "SiPixelDigis","SiPixelDigis", 100, 0., 0.5 ) ;
36  fSiStripDigis = fDBE->book1D( "SiStripDigis","SiStripDigis", 100, 0., 2. ) ;
37  fEcalUnsuppDigis = fDBE->book1D( "EcalUnsuppDigis","EcalUnsuppDigis", 100, 0., 2. ) ;
38  fEcalZeroSuppDigis = fDBE->book1D( "EcalZeroSuppDigis","EcalZeroSuppDigis", 100, 0., 2. ) ;
39  fPreShwZeroSuppDigis = fDBE->book1D( "PreShwZeroSuppDigis","PreShwZeroSuppDigis", 100, 0., 0.1 ) ;
40  fHcalUnsuppDigis = fDBE->book1D( "HcalUnsuppDigis","HcalUnsuppDigis", 100, 0., 0.5 ) ;
41  fMuonCSCDigis = fDBE->book1D( "MuonCSCDigis", "MuonCSCDigis", 100, 0., 0.1 ) ;
42  fMuonDTDigis = fDBE->book1D( "MuonDTDigis", "MuonDTDigis", 100, 0., 0.1 ) ;
43  fMuonRPCDigis = fDBE->book1D( "MuonRPCDigis", "MuonRPCDigis", 100, 0., 0.1 ) ;
44  }
45 }
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
#define NULL
Definition: scimark2.h:8
MonitorElement * fHcalUnsuppDigis
MonitorElement * fMuonRPCDigis
MonitorElement * fEcalUnsuppDigis
MonitorElement * fg4SimHits
edm::EDGetTokenT< edm::EventTime > eventTime_Token_
MonitorElement * fSiStripDigis
MonitorElement * fSiPixelDigis
MonitorElement * fMuonCSCDigis
MonitorElement * fVtxSmeared
MonitorElement * fEcalZeroSuppDigis
MonitorElement * fMuonDTDigis
MonitorElement * fMixing
MonitorElement * fPreShwZeroSuppDigis
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
PerformanceAnalyzer::~PerformanceAnalyzer ( )

Definition at line 48 of file PerfomanceAnalyzer.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 64 of file PerfomanceAnalyzer.cc.

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

65 {
66 
67  if ( e.id().event() == 1) return ; // skip 1st event
68 
70  e.getByToken(eventTime_Token_, EvtTime ) ;
71 
72  for ( unsigned int i=0; i<EvtTime->size(); ++i )
73  {
74  if ( EvtTime->name(i) == "VtxSmeared" ) fVtxSmeared->Fill( EvtTime->time(i) ) ;
75  if ( EvtTime->name(i) == "g4SimHits" ) fg4SimHits->Fill( EvtTime->time(i) ) ;
76  if ( EvtTime->name(i) == "mix" ) fMixing->Fill( EvtTime->time(i) ) ;
77  if ( EvtTime->name(i) == "siPixelDigis" ) fSiPixelDigis->Fill( EvtTime->time(i) ) ;
78  if ( EvtTime->name(i) == "siStripDigis" ) fSiStripDigis->Fill( EvtTime->time(i) ) ;
79  if ( EvtTime->name(i) == "ecalUnsuppressedDigis" ) fEcalUnsuppDigis->Fill( EvtTime->time(i) ) ;
80  if ( EvtTime->name(i) == "ecalDigis") fEcalZeroSuppDigis->Fill( EvtTime->time(i) ) ;
81  if ( EvtTime->name(i) == "ecalPreshowerDigis") fPreShwZeroSuppDigis->Fill( EvtTime->time(i) ) ;
82  if ( EvtTime->name(i) == "hcalDigis" ) fHcalUnsuppDigis->Fill( EvtTime->time(i) ) ;
83  if ( EvtTime->name(i) == "muonCSCDigis" ) fMuonCSCDigis->Fill( EvtTime->time(i) ) ;
84  if ( EvtTime->name(i) == "muonDTDigis" ) fMuonDTDigis->Fill( EvtTime->time(i) ) ;
85  if ( EvtTime->name(i) == "muonRPCDigis" ) fMuonRPCDigis->Fill( EvtTime->time(i) ) ;
86 
87  }
88 
89  return ;
90 
91 }
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
MonitorElement * fHcalUnsuppDigis
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:56
MonitorElement * fMuonDTDigis
MonitorElement * fMixing
MonitorElement * fPreShwZeroSuppDigis
virtual void PerformanceAnalyzer::beginJob ( void  )
inlinevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 20 of file PerformanceAnalyzer.h.

20 {}
void PerformanceAnalyzer::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 54 of file PerfomanceAnalyzer.cc.

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

55 {
56 
57  if ( fOutputFile.size() != 0 && fDBE ) fDBE->save(fOutputFile);
58 
59  return ;
60 
61 }
return(e1-e2)*(e1-e2)+dp *dp
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2485

Member Data Documentation

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

Definition at line 25 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

DQMStore* PerformanceAnalyzer::fDBE
private

Definition at line 26 of file PerformanceAnalyzer.h.

Referenced by endJob(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fEcalUnsuppDigis
private

Definition at line 33 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fEcalZeroSuppDigis
private

Definition at line 34 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fg4SimHits
private

Definition at line 29 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fHcalUnsuppDigis
private

Definition at line 36 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fMixing
private

Definition at line 30 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fMuonCSCDigis
private

Definition at line 37 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fMuonDTDigis
private

Definition at line 38 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fMuonRPCDigis
private

Definition at line 39 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

std::string PerformanceAnalyzer::fOutputFile
private

Definition at line 27 of file PerformanceAnalyzer.h.

Referenced by endJob().

MonitorElement* PerformanceAnalyzer::fPreShwZeroSuppDigis
private

Definition at line 35 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fSiPixelDigis
private

Definition at line 31 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fSiStripDigis
private

Definition at line 32 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().

MonitorElement* PerformanceAnalyzer::fVtxSmeared
private

Definition at line 28 of file PerformanceAnalyzer.h.

Referenced by analyze(), and PerformanceAnalyzer().