src
CondCore
CTPPSPlugins
interface
PPSAlignmentConfigurationHelper.h
Go to the documentation of this file.
1
/****************************************************************************
2
*
3
* This is a part of PPS PI software.
4
*
5
****************************************************************************/
6
7
#ifndef CONDCORE_CTPPSPLUGINS_PPSALIGNMENTCONFIGURATIONHELPER_H
8
#define CONDCORE_CTPPSPLUGINS_PPSALIGNMENTCONFIGURATIONHELPER_H
9
10
// User includes
11
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
12
#include "
CondCore/Utilities/interface/PayloadInspectorModule.h
"
13
#include "
CondCore/Utilities/interface/PayloadInspector.h
"
14
#include "
CondCore/CondDB/interface/Time.h
"
15
#include "
CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h
"
16
17
// system includes
18
#include <memory>
19
#include <sstream>
20
#include <fstream>
21
22
// ROOT includes
23
#include "TCanvas.h"
24
#include "TStyle.h"
25
#include "TH2F.h"
26
#include "TLatex.h"
27
#include "TGraph.h"
28
29
template
<
class
PayloadType>
30
class
AlignmentPayloadInfo
:
public
cond::payloadInspector::PlotImage
<PayloadType, cond::payloadInspector::SINGLE_IOV> {
31
public
:
32
AlignmentPayloadInfo
()
33
:
cond
::payloadInspector::
PlotImage
<PayloadType,
cond
::payloadInspector::
SINGLE_IOV
>(
34
"PPSAlignmentConfiguration payload information"
) {}
35
36
bool
fill
()
override
{
37
auto
tag
= cond::payloadInspector::PlotBase::getTag<0>();
38
auto
tagname
=
tag
.name;
39
auto
iov =
tag
.iovs.back();
40
auto
m_payload = this->
fetchPayload
(std::get<1>(iov));
41
42
if
(m_payload !=
nullptr
) {
43
std::string
line
;
44
std::vector<std::string>
lines
;
45
std::stringstream
ss
;
46
ss
<< *m_payload;
47
while
(getline(
ss
,
line
)) {
48
lines
.push_back(
line
);
49
}
50
51
TCanvas
canvas
(
52
"PPSAlignmentConfiguration payload information"
,
"PPSAlignmentConfiguration payload information"
, 1000, 1400);
53
canvas
.cd(1);
54
TLatex
t
;
55
t
.SetTextSize(0.018);
56
57
int
index
= 0;
58
for
(
float
y
= 0.98;
index
<
int
(
lines
.size());
y
-= 0.02) {
59
if
(
index
<
int
(
lines
.size() / 2) + 3)
60
t
.DrawLatex(0.02,
y
,
lines
[
index
++].c_str());
61
else
if
(
index
==
int
(
lines
.size() / 2) + 3) {
62
y
= 0.98;
63
t
.DrawLatex(0.5,
y
,
lines
[
index
++].c_str());
64
}
else
65
t
.DrawLatex(0.5,
y
,
lines
[
index
++].c_str());
66
}
67
t
.Draw();
68
69
std::string
fileName
(this->
m_imageFileName
);
70
canvas.SaveAs(
fileName
.c_str());
71
72
return
true
;
73
}
else
{
74
return
false
;
75
}
76
}
77
};
78
79
#endif
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::m_imageFileName
std::string m_imageFileName
Definition:
PayloadInspector.h:914
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::PlotImage
PlotImage(const std::string &title)
Definition:
PayloadInspector.h:901
cond::payloadInspector::SINGLE_IOV
Definition:
PayloadInspector.h:299
MessageLogger.h
submitPVValidationJobs.t
string t
Definition:
submitPVValidationJobs.py:650
PPSAlignmentConfiguration.h
contentValuesCheck.ss
ss
Definition:
contentValuesCheck.py:33
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
AlignmentPayloadInfo::fill
bool fill() override
Definition:
PPSAlignmentConfigurationHelper.h:36
groupFilesInBlocks.lines
lines
Definition:
groupFilesInBlocks.py:95
createfilelist.int
int
Definition:
createfilelist.py:10
AlignmentPI::index
index
Definition:
AlignmentPayloadInspectorHelper.h:72
makeGlobalPositionRcd_cfg.tag
tag
Definition:
makeGlobalPositionRcd_cfg.py:6
mps_splice.line
line
Definition:
mps_splice.py:76
AlignmentPayloadInfo::AlignmentPayloadInfo
AlignmentPayloadInfo()
Definition:
PPSAlignmentConfigurationHelper.h:32
AlignmentPayloadInfo
Definition:
PPSAlignmentConfigurationHelper.h:30
MillePedeFileConverter_cfg.fileName
fileName
Definition:
MillePedeFileConverter_cfg.py:32
PayloadInspector.h
cond
Definition:
plugin.cc:23
DDAxes::y
svgfig.canvas
def canvas(sub, attr)
Definition:
svgfig.py:482
PayloadInspectorModule.h
createPayload.tagname
tagname
Definition:
createPayload.py:183
Time.h
cond::payloadInspector::PlotImage
Definition:
PayloadInspector.h:898
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::fetchPayload
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
Definition:
PayloadInspector.h:909
Generated for CMSSW Reference Manual by
1.8.14