Main Page
Namespaces
Classes
Package Documentation
CVS Directory
WorkBook
Offline Guide
Release schedule
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
Validation
CTPPS
plugins
CTPPSLHCInfoPlotter.cc
Go to the documentation of this file.
1
/****************************************************************************
2
* Authors:
3
* Jan Kašpar
4
****************************************************************************/
5
6
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
7
#include "
FWCore/Framework/interface/EventSetup.h
"
8
#include "
FWCore/Framework/interface/ESHandle.h
"
9
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
10
11
#include "
FWCore/Framework/interface/Event.h
"
12
#include "
FWCore/Framework/interface/MakerMacros.h
"
13
14
#include "
CondFormats/RunInfo/interface/LHCInfo.h
"
15
#include "
CondFormats/DataRecord/interface/LHCInfoRcd.h
"
16
17
#include "TFile.h"
18
#include "TH1D.h"
19
20
//----------------------------------------------------------------------------------------------------
21
22
class
CTPPSLHCInfoPlotter
:
public
edm::one::EDAnalyzer
<> {
23
public
:
24
explicit
CTPPSLHCInfoPlotter
(
const
edm::ParameterSet
&);
25
26
private
:
27
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
28
void
endJob
()
override
;
29
30
std::string
lhcInfoLabel_
;
31
32
std::string
outputFile_
;
33
34
TH1D *
h_beamEnergy_
;
35
TH1D *
h_xangle_
;
36
TH1D *
h_betaStar_
;
37
};
38
39
//----------------------------------------------------------------------------------------------------
40
41
using namespace
std
;
42
using namespace
edm
;
43
44
//----------------------------------------------------------------------------------------------------
45
46
CTPPSLHCInfoPlotter::CTPPSLHCInfoPlotter
(
const
edm::ParameterSet
&iConfig)
47
:
lhcInfoLabel_
(iConfig.getParameter<
std
::
string
>(
"lhcInfoLabel"
)),
48
outputFile_
(iConfig.getParameter<
string
>(
"outputFile"
)),
49
50
h_beamEnergy_
(new TH1D(
"h_beamEnergy"
,
";beam energy (GeV)"
, 81, -50., 8050.)),
51
h_xangle_
(new TH1D(
"h_xangle"
,
";(half) crossing angle (#murad)"
, 201, -0.5, 200.5)),
52
h_betaStar_
(new TH1D(
"h_betaStar"
,
";#beta^{*} (m)"
, 101, -0.005, 1.005)) {}
53
54
//----------------------------------------------------------------------------------------------------
55
56
void
CTPPSLHCInfoPlotter::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
&iSetup) {
57
edm::ESHandle<LHCInfo>
hLHCInfo;
58
iSetup.
get
<
LHCInfoRcd
>().
get
(
lhcInfoLabel_
, hLHCInfo);
59
60
h_beamEnergy_
->Fill(hLHCInfo->
energy
());
61
h_xangle_
->Fill(hLHCInfo->
crossingAngle
());
62
h_betaStar_
->Fill(hLHCInfo->
betaStar
());
63
}
64
65
//----------------------------------------------------------------------------------------------------
66
67
void
CTPPSLHCInfoPlotter::endJob
() {
68
auto
f_out = std::make_unique<TFile>(
outputFile_
.c_str(),
"recreate"
);
69
70
h_beamEnergy_
->Write();
71
h_xangle_
->Write();
72
h_betaStar_
->Write();
73
}
74
75
//----------------------------------------------------------------------------------------------------
76
77
DEFINE_FWK_MODULE
(
CTPPSLHCInfoPlotter
);
CTPPSLHCInfoPlotter::h_betaStar_
TH1D * h_betaStar_
Definition:
CTPPSLHCInfoPlotter.cc:36
CTPPSLHCInfoPlotter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
CTPPSLHCInfoPlotter.cc:56
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
Event.h
MakerMacros.h
EventSetup.h
std
Definition:
JetResolutionObject.h:80
LHCInfo.h
Frameworkfwd.h
LHCInfoRcd.h
CTPPSLHCInfoPlotter::lhcInfoLabel_
std::string lhcInfoLabel_
Definition:
CTPPSLHCInfoPlotter.cc:30
LHCInfo::crossingAngle
float const crossingAngle() const
Definition:
LHCInfo.cc:176
iEvent
int iEvent
Definition:
GenABIO.cc:224
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ESHandle
Definition:
DTSurvey.h:22
CTPPSLHCInfoPlotter::CTPPSLHCInfoPlotter
CTPPSLHCInfoPlotter(const edm::ParameterSet &)
Definition:
CTPPSLHCInfoPlotter.cc:46
ESHandle.h
LHCInfoRcd
Definition:
LHCInfoRcd.h:24
edm::EventSetup
Definition:
EventSetup.h:57
CTPPSLHCInfoPlotter::h_xangle_
TH1D * h_xangle_
Definition:
CTPPSLHCInfoPlotter.cc:35
CTPPSLHCInfoPlotter::h_beamEnergy_
TH1D * h_beamEnergy_
Definition:
CTPPSLHCInfoPlotter.cc:34
EDAnalyzer.h
CTPPSLHCInfoPlotter::endJob
void endJob() override
Definition:
CTPPSLHCInfoPlotter.cc:67
edm
HLT enums.
Definition:
AlignableModifier.h:17
LHCInfo::betaStar
float const betaStar() const
Definition:
LHCInfo.cc:180
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:71
LHCInfo::energy
float const energy() const
Definition:
LHCInfo.cc:192
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:71
CTPPSLHCInfoPlotter
Definition:
CTPPSLHCInfoPlotter.cc:22
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
CTPPSLHCInfoPlotter::outputFile_
std::string outputFile_
Definition:
CTPPSLHCInfoPlotter.cc:32
Generated for CMSSW Reference Manual by
1.8.11