CondTools
CTPPS
plugins
CTPPSRPAlignmentInfoReader.cc
Go to the documentation of this file.
1
// system include files
2
#include <memory>
3
#include <iostream>
4
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
5
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
6
#include "
FWCore/Framework/interface/ESHandle.h
"
7
#include "
FWCore/Framework/interface/Event.h
"
8
#include "
FWCore/Framework/interface/EventSetup.h
"
9
#include "
FWCore/Framework/interface/MakerMacros.h
"
10
#include "
CondCore/CondDB/interface/Time.h
"
11
12
#include "
CondFormats/PPSObjects/interface/CTPPSRPAlignmentCorrectionsData.h
"
13
#include "
CondFormats/AlignmentRecord/interface/CTPPSRPAlignmentCorrectionsDataRcd.h
"
14
#include "
CondFormats/AlignmentRecord/interface/RPRealAlignmentRecord.h
"
15
#include "
CondFormats/AlignmentRecord/interface/RPMisalignedAlignmentRecord.h
"
16
17
using namespace
std
;
18
19
class
CTPPSRPAlignmentInfoReader
:
public
edm::one::EDAnalyzer
<> {
20
public
:
21
cond::Time_t
iov_
;
22
std::string
record_
;
23
24
edm::ESGetToken<CTPPSRPAlignmentCorrectionsData, CTPPSRPAlignmentCorrectionsDataRcd>
tokenAlignmentsIdeal_
;
25
edm::ESGetToken<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord>
tokenAlignmentsReal_
;
26
edm::ESGetToken<CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord>
tokenAlignmentsMisaligned_
;
27
28
explicit
CTPPSRPAlignmentInfoReader
(
edm::ParameterSet
const
& iConfig);
29
30
explicit
CTPPSRPAlignmentInfoReader
(
int
i
) {}
31
~CTPPSRPAlignmentInfoReader
()
override
{}
32
void
analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
&
c
)
override
;
33
void
printInfo
(
const
CTPPSRPAlignmentCorrectionsData
& alignments,
const
edm::Event
&
event
);
34
};
35
36
//----------------------------------------------------------------------------------------------------
37
38
CTPPSRPAlignmentInfoReader::CTPPSRPAlignmentInfoReader
(
edm::ParameterSet
const
& iConfig)
39
: iov_(iConfig.getParameter<unsigned long long>(
"iov"
)), record_(iConfig.getParameter<
string
>(
"record"
)) {
40
if
(strcmp(
record_
.c_str(),
"CTPPSRPAlignmentCorrectionsDataRcd"
) == 0) {
41
tokenAlignmentsIdeal_
= esConsumes<CTPPSRPAlignmentCorrectionsData, CTPPSRPAlignmentCorrectionsDataRcd>();
42
}
else
if
(strcmp(
record_
.c_str(),
"RPRealAlignmentRecord"
) == 0) {
43
tokenAlignmentsReal_
= esConsumes<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord>();
44
}
else
{
45
tokenAlignmentsMisaligned_
= esConsumes<CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord>();
46
}
47
}
48
49
//----------------------------------------------------------------------------------------------------
50
51
void
CTPPSRPAlignmentInfoReader::analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
&
context
) {
52
using namespace
edm
;
53
54
//this part gets the handle of the event source and the record (i.e. the Database)
55
if
(
e
.id().run() ==
iov_
) {
56
ESHandle<CTPPSRPAlignmentCorrectionsData>
hAlignments;
57
58
if
(strcmp(
record_
.c_str(),
"CTPPSRPAlignmentCorrectionsDataRcd"
) == 0) {
59
hAlignments =
context
.getHandle(
tokenAlignmentsIdeal_
);
60
}
else
if
(strcmp(
record_
.c_str(),
"RPRealAlignmentRecord"
) == 0) {
61
hAlignments =
context
.getHandle(
tokenAlignmentsReal_
);
62
}
else
{
63
hAlignments =
context
.getHandle(
tokenAlignmentsMisaligned_
);
64
}
65
66
//std::cout
67
edm::LogPrint
(
"CTPPSRPAlignmentInfoReader"
)
68
<<
"New alignments found in run="
<<
e
.id().run() <<
", event="
<<
e
.id().event() <<
":\n"
69
<< *hAlignments;
70
}
71
}
72
73
DEFINE_FWK_MODULE
(
CTPPSRPAlignmentInfoReader
);
CTPPSRPAlignmentInfoReader::tokenAlignmentsReal_
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord > tokenAlignmentsReal_
Definition:
CTPPSRPAlignmentInfoReader.cc:25
EDAnalyzer.h
mps_fire.i
i
Definition:
mps_fire.py:428
MessageLogger.h
ESHandle.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition:
MessageLogger.h:130
CTPPSRPAlignmentInfoReader::~CTPPSRPAlignmentInfoReader
~CTPPSRPAlignmentInfoReader() override
Definition:
CTPPSRPAlignmentInfoReader.cc:31
CTPPSRPAlignmentInfoReader::iov_
cond::Time_t iov_
Definition:
CTPPSRPAlignmentInfoReader.cc:21
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
RPMisalignedAlignmentRecord.h
CTPPSRPAlignmentInfoReader::CTPPSRPAlignmentInfoReader
CTPPSRPAlignmentInfoReader(int i)
Definition:
CTPPSRPAlignmentInfoReader.cc:30
visDQMUpload.context
context
Definition:
visDQMUpload.py:37
CTPPSRPAlignmentInfoReader::tokenAlignmentsMisaligned_
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord > tokenAlignmentsMisaligned_
Definition:
CTPPSRPAlignmentInfoReader.cc:26
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
RPRealAlignmentRecord.h
edm::ESHandle
Definition:
DTSurvey.h:22
CTPPSRPAlignmentInfoReader::tokenAlignmentsIdeal_
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, CTPPSRPAlignmentCorrectionsDataRcd > tokenAlignmentsIdeal_
Definition:
CTPPSRPAlignmentInfoReader.cc:24
Time.h
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
cond::Time_t
unsigned long long Time_t
Definition:
Time.h:14
CTPPSRPAlignmentInfoReader::CTPPSRPAlignmentInfoReader
CTPPSRPAlignmentInfoReader(edm::ParameterSet const &iConfig)
Definition:
CTPPSRPAlignmentInfoReader.cc:38
analyze
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
objects.IsoTrackAnalyzer.printInfo
def printInfo(self, event)
Definition:
IsoTrackAnalyzer.py:252
edm::EventSetup
Definition:
EventSetup.h:58
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, CTPPSRPAlignmentCorrectionsDataRcd >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSRPAlignmentCorrectionsDataRcd.h
CTPPSRPAlignmentInfoReader::record_
std::string record_
Definition:
CTPPSRPAlignmentInfoReader.cc:22
std
Definition:
JetResolutionObject.h:76
CTPPSRPAlignmentCorrectionsData
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
Definition:
CTPPSRPAlignmentCorrectionsData.h:24
EventSetup.h
CTPPSRPAlignmentCorrectionsData.h
CTPPSRPAlignmentInfoReader::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition:
CTPPSRPAlignmentInfoReader.cc:51
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:56
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
CTPPSRPAlignmentInfoReader
Definition:
CTPPSRPAlignmentInfoReader.cc:19
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16