Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
#include "
DQMServices/Core/interface/MonitorElement.h
"
12
13
#include <iostream>
14
15
TauDQMSimpleFileSaver::TauDQMSimpleFileSaver
(
const
edm::ParameterSet
& cfg)
16
{
17
//std::cout << "<TauDQMSimpleFileSaver::TauDQMSimpleFileSaver>:" << std::endl;
18
19
cfgError_
= 0;
20
21
outputFileName_
= cfg.
getParameter
<std::string>(
"outputFileName"
);
22
if
(
outputFileName_
==
""
) {
23
edm::LogError
(
"TauDQMSimpleFileSaver"
) <<
" No outputFileName specified --> histograms will NOT be saved !!"
;
24
cfgError_
= 1;
25
}
else
if
(
outputFileName_
.find(
".root"
) == std::string::npos ) {
26
edm::LogError
(
"TauDQMSimpleFileSaver"
) <<
" Invalid outputFileName = "
<<
outputFileName_
<<
" --> histograms will NOT be saved !!"
;
27
cfgError_
= 1;
28
}
29
}
30
31
TauDQMSimpleFileSaver::~TauDQMSimpleFileSaver
()
32
{
33
// nothing to be done yet...
34
}
35
36
void
TauDQMSimpleFileSaver::analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
37
{
38
// nothing to be done yet...
39
}
40
41
void
TauDQMSimpleFileSaver::endJob
()
42
{
43
std::cout
<<
"<TauDQMSimpleFileSaver::endJob>:"
<< std::endl;
44
45
//--- check that configuration parameters contain no errors
46
if
(
cfgError_
) {
47
edm::LogError
(
"endJob"
) <<
" Error in Configuration ParameterSet --> histograms will NOT be saved !!"
;
48
return
;
49
}
50
51
//--- check that DQMStore service is available
52
if
( !
edm::Service<DQMStore>
().isAvailable() ) {
53
edm::LogError
(
"endJob"
) <<
" Failed to access dqmStore --> histograms will NOT be saved !!"
;
54
return
;
55
}
56
57
DQMStore
& dqmStore = (*
edm::Service<DQMStore>
());
58
dqmStore.
save
(
outputFileName_
);
59
}
60
61
#include "
FWCore/Framework/interface/MakerMacros.h
"
62
63
DEFINE_FWK_MODULE
(
TauDQMSimpleFileSaver
);
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
MessageLogger.h
edm::Service< DQMStore >
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
DQMStore::save
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
MakerMacros.h
Frameworkfwd.h
TauDQMSimpleFileSaver::outputFileName_
std::string outputFileName_
Definition:
DQMSimpleFileSaver.h:31
edm::LogError
Definition:
MessageLogger.h:164
DQMStore
Definition:
DQMStore.h:67
TauDQMSimpleFileSaver::~TauDQMSimpleFileSaver
virtual ~TauDQMSimpleFileSaver()
Definition:
DQMSimpleFileSaver.cc:31
DQMStore.h
TauDQMSimpleFileSaver
Definition:
DQMSimpleFileSaver.h:22
Service.h
edm::EventSetup
Definition:
EventSetup.h:44
TauDQMSimpleFileSaver::TauDQMSimpleFileSaver
TauDQMSimpleFileSaver(const edm::ParameterSet &)
Definition:
DQMSimpleFileSaver.cc:15
TauDQMSimpleFileSaver::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition:
DQMSimpleFileSaver.cc:36
TauDQMSimpleFileSaver::endJob
virtual void endJob()
Definition:
DQMSimpleFileSaver.cc:41
TauDQMSimpleFileSaver::cfgError_
int cfgError_
Definition:
DQMSimpleFileSaver.h:32
DQMSimpleFileSaver.h
MonitorElement.h
edm::ParameterSet
Definition:
ParameterSet.h:35
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
edm::Event
Definition:
Event.h:50
Generated for CMSSW Reference Manual by
1.8.5