Geometry
HcalTestBeamData
plugins
HcalTBParameterTester.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <map>
3
4
#include "
FWCore/Framework/interface/Event.h
"
5
#include "
FWCore/Framework/interface/EventSetup.h
"
6
#include "
FWCore/Framework/interface/MakerMacros.h
"
7
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
8
9
#include "
Geometry/HcalTestBeamData/interface/HcalTB02Parameters.h
"
10
#include "
Geometry/HcalTestBeamData/interface/HcalTB06BeamParameters.h
"
11
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
12
13
class
HcalTBParameterTester
:
public
edm::one::EDAnalyzer
<> {
14
public
:
15
explicit
HcalTBParameterTester
(
const
edm::ParameterSet
&);
16
~HcalTBParameterTester
()
override
{}
17
18
void
beginJob
()
override
{}
19
void
analyze
(
edm::Event
const
&
iEvent
,
edm::EventSetup
const
&)
override
;
20
void
endJob
()
override
{}
21
22
private
:
23
const
std::string
name_
;
24
edm::ESGetToken<HcalTB02Parameters, IdealGeometryRecord>
token1_
;
25
edm::ESGetToken<HcalTB06BeamParameters, IdealGeometryRecord>
token2_
;
26
const
int
mode_
;
27
};
28
29
HcalTBParameterTester::HcalTBParameterTester
(
const
edm::ParameterSet
& ic)
30
: name_(ic.getUntrackedParameter<
std
::
string
>(
"Name"
)),
31
token1_(esConsumes<
HcalTB02Parameters
,
IdealGeometryRecord
>(
edm
::
ESInputTag
{
""
,
name_
})),
32
token2_(esConsumes<HcalTB06BeamParameters, IdealGeometryRecord>(
edm::ESInputTag
{})),
33
mode_(ic.getUntrackedParameter<
int
>(
"Mode"
)) {}
34
35
void
HcalTBParameterTester::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
36
if
(
mode_
== 0) {
37
const
auto
& hcp = iSetup.
getData
(
token1_
);
38
const
auto
* php = &hcp;
39
std::cout
<<
"TB02Parameters for "
<<
name_
<<
"\n"
;
40
std::cout
<<
"Length map with "
<< php->lengthMap_.size() <<
" elements\n"
;
41
std::map<std::string, double>::const_iterator
itr
= php->lengthMap_.begin();
42
int
i
(0);
43
for
(;
itr
!= php->lengthMap_.end(); ++
itr
, ++
i
)
44
std::cout
<<
"["
<<
i
<<
"] "
<<
itr
->first <<
" "
<<
itr
->second <<
" mm\n"
;
45
}
else
{
46
const
auto
& hcp = iSetup.
getData
(
token2_
);
47
const
auto
* php = &hcp;
48
std::cout
<<
"TB06BeamParameters:: Material "
<< php->material_ <<
"\n"
;
49
std::cout
<<
"TB06BeamParameters:: "
<< php->wchambers_.size() <<
" wire chambers:\n"
;
50
for
(
unsigned
int
k
= 0;
k
< php->wchambers_.size(); ++
k
)
51
std::cout
<<
"["
<<
k
<<
"] "
<< php->wchambers_[
k
] <<
"\n"
;
52
}
53
}
54
55
DEFINE_FWK_MODULE
(
HcalTBParameterTester
);
HcalTBParameterTester::~HcalTBParameterTester
~HcalTBParameterTester() override
Definition:
HcalTBParameterTester.cc:16
EDAnalyzer.h
mps_fire.i
i
Definition:
mps_fire.py:355
edm::ESInputTag
Definition:
ESInputTag.h:87
HcalTBParameterTester::endJob
void endJob() override
Definition:
HcalTBParameterTester.cc:20
ESInputTag
edm
HLT enums.
Definition:
AlignableModifier.h:19
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
HcalTBParameterTester::name_
const std::string name_
Definition:
HcalTBParameterTester.cc:23
HcalTB02Parameters
Definition:
HcalTB02Parameters.h:9
MakerMacros.h
HcalTBParameterTester::analyze
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
Definition:
HcalTBParameterTester.cc:35
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
HcalTBParameterTester::token2_
edm::ESGetToken< HcalTB06BeamParameters, IdealGeometryRecord > token2_
Definition:
HcalTBParameterTester.cc:25
HcalTB06BeamParameters.h
dqmdumpme.k
k
Definition:
dqmdumpme.py:60
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
HcalTBParameterTester::beginJob
void beginJob() override
Definition:
HcalTBParameterTester.cc:18
iEvent
int iEvent
Definition:
GenABIO.cc:224
IdealGeometryRecord.h
edm::EventSetup
Definition:
EventSetup.h:57
itr
std::vector< std::pair< float, float > >::iterator itr
Definition:
HGCDigitizer.cc:28
edm::ESGetToken< HcalTB02Parameters, IdealGeometryRecord >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition:
EventSetup.h:113
HcalTBParameterTester::HcalTBParameterTester
HcalTBParameterTester(const edm::ParameterSet &)
Definition:
HcalTBParameterTester.cc:29
std
Definition:
JetResolutionObject.h:76
HcalTB02Parameters.h
HcalTBParameterTester::mode_
const int mode_
Definition:
HcalTBParameterTester.cc:26
EventSetup.h
HcalTBParameterTester
Definition:
HcalTBParameterTester.cc:13
edm::Event
Definition:
Event.h:73
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:27
HcalTBParameterTester::token1_
edm::ESGetToken< HcalTB02Parameters, IdealGeometryRecord > token1_
Definition:
HcalTBParameterTester.cc:24
Generated for CMSSW Reference Manual by
1.8.16