Validation
RecoTau
plugins
DQMSimpleFileSaver.cc
Go to the documentation of this file.
1
#include "
Validation/RecoTau/plugins/DQMSimpleFileSaver.h
"
2
3
// framework & common header files
4
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
5
#include "
FWCore/Framework/interface/MakerMacros.h
"
6
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
7
8
//DQM services
9
#include "
DQMServices/Core/interface/DQMStore.h
"
10
#include "
FWCore/ServiceRegistry/interface/Service.h
"
11
12
#include <iostream>
13
14
TauDQMSimpleFileSaver::TauDQMSimpleFileSaver
(
const
edm::ParameterSet
&
cfg
) {
15
//std::cout << "<TauDQMSimpleFileSaver::TauDQMSimpleFileSaver>:" << std::endl;
16
17
cfgError_
= 0;
18
19
outputFileName_
=
cfg
.getParameter<
std::string
>(
"outputFileName"
);
20
if
(
outputFileName_
.empty()) {
21
edm::LogError
(
"TauDQMSimpleFileSaver"
) <<
" No outputFileName specified --> histograms will NOT be saved !!"
;
22
cfgError_
= 1;
23
}
else
if
(
outputFileName_
.find(
".root"
) == std::string::npos) {
24
edm::LogError
(
"TauDQMSimpleFileSaver"
)
25
<<
" Invalid outputFileName = "
<<
outputFileName_
<<
" --> histograms will NOT be saved !!"
;
26
cfgError_
= 1;
27
}
28
}
29
30
TauDQMSimpleFileSaver::~TauDQMSimpleFileSaver
() {
31
// nothing to be done yet...
32
}
33
34
void
TauDQMSimpleFileSaver::analyze
(
const
edm::Event
&,
const
edm::EventSetup
&) {
35
// nothing to be done yet...
36
}
37
38
void
TauDQMSimpleFileSaver::endJob
() {
39
std::cout
<<
"<TauDQMSimpleFileSaver::endJob>:"
<< std::endl;
40
41
//--- check that configuration parameters contain no errors
42
if
(
cfgError_
) {
43
edm::LogError
(
"endJob"
) <<
" Error in Configuration ParameterSet --> histograms will NOT be saved !!"
;
44
return
;
45
}
46
47
//--- check that DQMStore service is available
48
if
(!
edm::Service<DQMStore>
().isAvailable()) {
49
edm::LogError
(
"endJob"
) <<
" Failed to access dqmStore --> histograms will NOT be saved !!"
;
50
return
;
51
}
52
53
DQMStore
&
dqmStore
= (*
edm::Service<DQMStore>
());
54
dqmStore
.save(
outputFileName_
);
55
}
56
57
#include "
FWCore/Framework/interface/MakerMacros.h
"
58
59
DEFINE_FWK_MODULE
(
TauDQMSimpleFileSaver
);
MessageLogger.h
DQMSimpleFileSaver.h
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
DQMStore.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
dqm::legacy::DQMStore
Definition:
DQMStore.h:727
Service.h
L1TBPTX_cfi.dqmStore
dqmStore
Definition:
L1TBPTX_cfi.py:6
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
TauDQMSimpleFileSaver::TauDQMSimpleFileSaver
TauDQMSimpleFileSaver(const edm::ParameterSet &)
Definition:
DQMSimpleFileSaver.cc:14
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::LogError
Definition:
MessageLogger.h:183
edm::Service
Definition:
Service.h:30
TauDQMSimpleFileSaver::outputFileName_
std::string outputFileName_
Definition:
DQMSimpleFileSaver.h:33
TauDQMSimpleFileSaver::cfgError_
int cfgError_
Definition:
DQMSimpleFileSaver.h:34
TauDQMSimpleFileSaver
Definition:
DQMSimpleFileSaver.h:22
edm::EventSetup
Definition:
EventSetup.h:57
looper.cfg
cfg
Definition:
looper.py:297
Frameworkfwd.h
TauDQMSimpleFileSaver::~TauDQMSimpleFileSaver
~TauDQMSimpleFileSaver() override
Definition:
DQMSimpleFileSaver.cc:30
TauDQMSimpleFileSaver::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
DQMSimpleFileSaver.cc:34
edm::Event
Definition:
Event.h:73
TauDQMSimpleFileSaver::endJob
void endJob() override
Definition:
DQMSimpleFileSaver.cc:38
Generated for CMSSW Reference Manual by
1.8.16