CondTools
CTPPS
plugins
PPSTimingCalibrationAnalyzer.cc
Go to the documentation of this file.
1
/****************************************************************************
2
*
3
* This is a part of TOTEM/PPS offline software.
4
* Author:
5
* Laurent Forthomme (laurent.forthomme@cern.ch)
6
*
7
****************************************************************************/
8
9
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
10
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
11
#include "
FWCore/Framework/interface/Event.h
"
12
#include "
FWCore/Framework/interface/EventSetup.h
"
13
#include "
FWCore/Framework/interface/ESHandle.h
"
14
#include "
FWCore/Framework/interface/ESWatcher.h
"
15
#include "
FWCore/Framework/interface/MakerMacros.h
"
16
17
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
18
#include "
FWCore/ServiceRegistry/interface/Service.h
"
19
20
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
21
22
#include "
CondFormats/PPSObjects/interface/PPSTimingCalibration.h
"
23
#include "
CondFormats/DataRecord/interface/PPSTimingCalibrationRcd.h
"
24
25
#include <memory>
26
27
class
PPSTimingCalibrationAnalyzer
:
public
edm::one::EDAnalyzer
<> {
28
public
:
29
explicit
PPSTimingCalibrationAnalyzer
(
const
edm::ParameterSet
&)
30
:
tokenCalibration_
(esConsumes<PPSTimingCalibration, PPSTimingCalibrationRcd>()) {}
31
32
private
:
33
void
beginJob
()
override
{}
34
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
35
void
endJob
()
override
{}
36
37
edm::ESWatcher<PPSTimingCalibrationRcd>
calibWatcher_
;
38
39
edm::ESGetToken<PPSTimingCalibration, PPSTimingCalibrationRcd>
tokenCalibration_
;
40
};
41
42
void
PPSTimingCalibrationAnalyzer::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
43
// get timing calibration parameters
44
if
(
calibWatcher_
.
check
(iSetup)) {
45
edm::LogInfo
(
"PPSTimingCalibrationAnalyzer"
) <<
"Calibrations retrieved:\n"
<< iSetup.
getData
(
tokenCalibration_
);
46
}
47
}
48
49
DEFINE_FWK_MODULE
(
PPSTimingCalibrationAnalyzer
);
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition:
ESWatcher.h:57
EDAnalyzer.h
edm::ESWatcher< PPSTimingCalibrationRcd >
ESHandle.h
PPSTimingCalibrationAnalyzer::beginJob
void beginJob() override
Definition:
PPSTimingCalibrationAnalyzer.cc:37
PPSTimingCalibrationAnalyzer
Definition:
PPSTimingCalibrationAnalyzer.cc:26
edm::LogInfo
Log< level::Info, false > LogInfo
Definition:
MessageLogger.h:125
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
PPSTimingCalibrationAnalyzer::endJob
void endJob() override
Definition:
PPSTimingCalibrationAnalyzer.cc:39
MakerMacros.h
PoolDBOutputService.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Service.h
PPSTimingCalibrationAnalyzer::PPSTimingCalibrationAnalyzer
PPSTimingCalibrationAnalyzer(const edm::ParameterSet &)
Definition:
PPSTimingCalibrationAnalyzer.cc:33
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
PPSTimingCalibrationAnalyzer::calibWatcher_
edm::ESWatcher< PPSTimingCalibrationRcd > calibWatcher_
Definition:
PPSTimingCalibrationAnalyzer.cc:41
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:58
PPSTimingCalibration.h
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcd >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition:
EventSetup.h:127
PPSTimingCalibrationAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
PPSTimingCalibrationAnalyzer.cc:41
Frameworkfwd.h
ESWatcher.h
PPSTimingCalibrationRcd.h
EventSetup.h
ParameterSet.h
edm::Event
Definition:
Event.h:73
PPSTimingCalibrationAnalyzer::tokenCalibration_
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcd > tokenCalibration_
Definition:
PPSTimingCalibrationAnalyzer.cc:43
Generated for CMSSW Reference Manual by
1.8.16