CondTools
CTPPS
plugins
RetrieveCTPPSBeamParameters.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Class: RetrieveCTPPSBeamParameters
4
//
5
// Description: Test analyzer for reading CTPPS beam parameters condition data
6
//
7
// Simple analyzer that retrieves CTTPSBeamParameters record from a sql
8
// database file, as a test of offline conditions implementation.
9
//
10
// Original Author: Wagner De Paula Carvalho
11
// Created: Wed, 21 Nov 2018 17:35:07 GMT
12
//
13
//==================================================================================
14
15
#include <memory>
16
17
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
18
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
19
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
20
21
#include "
FWCore/Framework/interface/Event.h
"
22
#include "
FWCore/Framework/interface/EventSetup.h
"
23
#include "
FWCore/Framework/interface/MakerMacros.h
"
24
25
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
26
#include "
FWCore/Framework/interface/ESHandle.h
"
27
#include "
FWCore/ServiceRegistry/interface/Service.h
"
28
29
#include "
CondFormats/PPSObjects/interface/CTPPSBeamParameters.h
"
30
#include "
CondFormats/DataRecord/interface/CTPPSBeamParametersRcd.h
"
31
32
#include <cstdint>
33
34
class
RetrieveCTPPSBeamParameters
:
public
edm::one::EDAnalyzer
<> {
35
public
:
36
explicit
RetrieveCTPPSBeamParameters
(
const
edm::ParameterSet
& ps)
37
:
label_
(ps.getParameter<
std
::
string
>(
"label"
)),
38
tokenBeamParameters_
(
esConsumes
<
CTPPSBeamParameters
,
CTPPSBeamParametersRcd
>(
edm
::
ESInputTag
(
""
,
label_
))) {}
39
40
~RetrieveCTPPSBeamParameters
()
override
=
default
;
41
42
private
:
43
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
44
std::string
label_
;
45
46
edm::ESGetToken<CTPPSBeamParameters, CTPPSBeamParametersRcd>
tokenBeamParameters_
;
47
};
48
49
//---------------------------------------------------------------------------------------
50
51
void
RetrieveCTPPSBeamParameters::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
52
edm::LogInfo
(
"CTPPSBeamParameters"
) <<
"\n"
<< iSetup.
getData
(
tokenBeamParameters_
) <<
"\n"
;
53
}
54
55
DEFINE_FWK_MODULE
(
RetrieveCTPPSBeamParameters
);
CTPPSBeamParameters
Definition:
CTPPSBeamParameters.h:22
CTPPSBeamParameters.h
RetrieveCTPPSBeamParameters::label_
std::string label_
Definition:
RetrieveCTPPSBeamParameters.cc:44
EDAnalyzer.h
CTPPSBeamParametersRcd.h
MessageLogger.h
ESHandle.h
ESInputTag
edm
HLT enums.
Definition:
AlignableModifier.h:19
RetrieveCTPPSBeamParameters
Definition:
RetrieveCTPPSBeamParameters.cc:34
RetrieveCTPPSBeamParameters::tokenBeamParameters_
edm::ESGetToken< CTPPSBeamParameters, CTPPSBeamParametersRcd > tokenBeamParameters_
Definition:
RetrieveCTPPSBeamParameters.cc:46
edm::LogInfo
Log< level::Info, false > LogInfo
Definition:
MessageLogger.h:125
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
MakerMacros.h
RetrieveCTPPSBeamParameters::~RetrieveCTPPSBeamParameters
~RetrieveCTPPSBeamParameters() override=default
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Service.h
RetrieveCTPPSBeamParameters::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
RetrieveCTPPSBeamParameters.cc:51
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:58
edm::ESGetToken< CTPPSBeamParameters, CTPPSBeamParametersRcd >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
RetrieveCTPPSBeamParameters::RetrieveCTPPSBeamParameters
RetrieveCTPPSBeamParameters(const edm::ParameterSet &ps)
Definition:
RetrieveCTPPSBeamParameters.cc:36
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition:
EventSetup.h:127
CTPPSBeamParametersRcd
Definition:
CTPPSBeamParametersRcd.h:14
std
Definition:
JetResolutionObject.h:76
Frameworkfwd.h
EventSetup.h
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition:
EDConsumerBase.h:206
ParameterSet.h
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.16