CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PerfomanceAnalyzer.cc
Go to the documentation of this file.
1 
3 
5 // #include "DataFormats/Common/interface/Handle.h"
7 
9 //#include "DataFormats/Common/interface/ModuleDescription.h"
12 
14 
15 #include <iostream>
17 
19  : fDBE( edm::Service<DQMStore>().operator->() ),
20  fOutputFile( ps.getUntrackedParameter<std::string>("outputFile", "") )
21 {
22 
23  if ( fDBE != NULL )
24  {
25  fDBE->setCurrentFolder("PerformanceV/CPUPerformanceTask");
26 
27  // is there any way to record CPU Info ???
28  // if so, it can be done once - via beginJob()
29 
30  fVtxSmeared = fDBE->book1D( "VtxSmeared", "VtxSmeared", 100, 0., 0.1 ) ;
31  fg4SimHits = fDBE->book1D( "g4SimHits", "g4SimHits", 100, 0., 500. ) ;
32  fMixing = fDBE->book1D( "Mixing", "Mixing", 100, 0., 0.5 ) ;
33  fSiPixelDigis = fDBE->book1D( "SiPixelDigis","SiPixelDigis", 100, 0., 0.5 ) ;
34  fSiStripDigis = fDBE->book1D( "SiStripDigis","SiStripDigis", 100, 0., 2. ) ;
35  fEcalUnsuppDigis = fDBE->book1D( "EcalUnsuppDigis","EcalUnsuppDigis", 100, 0., 2. ) ;
36  fEcalZeroSuppDigis = fDBE->book1D( "EcalZeroSuppDigis","EcalZeroSuppDigis", 100, 0., 2. ) ;
37  fPreShwZeroSuppDigis = fDBE->book1D( "PreShwZeroSuppDigis","PreShwZeroSuppDigis", 100, 0., 0.1 ) ;
38  fHcalUnsuppDigis = fDBE->book1D( "HcalUnsuppDigis","HcalUnsuppDigis", 100, 0., 0.5 ) ;
39  fMuonCSCDigis = fDBE->book1D( "MuonCSCDigis", "MuonCSCDigis", 100, 0., 0.1 ) ;
40  fMuonDTDigis = fDBE->book1D( "MuonDTDigis", "MuonDTDigis", 100, 0., 0.1 ) ;
41  fMuonRPCDigis = fDBE->book1D( "MuonRPCDigis", "MuonRPCDigis", 100, 0., 0.1 ) ;
42  }
43 }
44 
45 
47 {
48  // don't try to delete any pointers - they're handled by DQM machinery
49 }
50 
51 
53 {
54 
55  if ( fOutputFile.size() != 0 && fDBE ) fDBE->save(fOutputFile);
56 
57  return ;
58 
59 }
60 
61 
63 {
64 
65  if ( e.id().event() == 1) return ; // skip 1st event
66 
68  e.getByLabel( "cputest", EvtTime ) ;
69 
70  for ( unsigned int i=0; i<EvtTime->size(); ++i )
71  {
72  if ( EvtTime->name(i) == "VtxSmeared" ) fVtxSmeared->Fill( EvtTime->time(i) ) ;
73  if ( EvtTime->name(i) == "g4SimHits" ) fg4SimHits->Fill( EvtTime->time(i) ) ;
74  if ( EvtTime->name(i) == "mix" ) fMixing->Fill( EvtTime->time(i) ) ;
75  if ( EvtTime->name(i) == "siPixelDigis" ) fSiPixelDigis->Fill( EvtTime->time(i) ) ;
76  if ( EvtTime->name(i) == "siStripDigis" ) fSiStripDigis->Fill( EvtTime->time(i) ) ;
77  if ( EvtTime->name(i) == "ecalUnsuppressedDigis" ) fEcalUnsuppDigis->Fill( EvtTime->time(i) ) ;
78  if ( EvtTime->name(i) == "ecalDigis") fEcalZeroSuppDigis->Fill( EvtTime->time(i) ) ;
79  if ( EvtTime->name(i) == "ecalPreshowerDigis") fPreShwZeroSuppDigis->Fill( EvtTime->time(i) ) ;
80  if ( EvtTime->name(i) == "hcalDigis" ) fHcalUnsuppDigis->Fill( EvtTime->time(i) ) ;
81  if ( EvtTime->name(i) == "muonCSCDigis" ) fMuonCSCDigis->Fill( EvtTime->time(i) ) ;
82  if ( EvtTime->name(i) == "muonDTDigis" ) fMuonDTDigis->Fill( EvtTime->time(i) ) ;
83  if ( EvtTime->name(i) == "muonRPCDigis" ) fMuonRPCDigis->Fill( EvtTime->time(i) ) ;
84 
85  }
86 
87  return ;
88 
89 }
90 
92 
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
#define NULL
Definition: scimark2.h:8
MonitorElement * fHcalUnsuppDigis
void Fill(long long x)
MonitorElement * fMuonRPCDigis
MonitorElement * fEcalUnsuppDigis
MonitorElement * fg4SimHits
MonitorElement * fSiStripDigis
MonitorElement * fSiPixelDigis
MonitorElement * fMuonCSCDigis
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
MonitorElement * fVtxSmeared
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * fEcalZeroSuppDigis
PerformanceAnalyzer(const edm::ParameterSet &)
edm::EventID id() const
Definition: EventBase.h:56
MonitorElement * fMuonDTDigis
MonitorElement * fMixing
MonitorElement * fPreShwZeroSuppDigis
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429