Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
SimG4CMS
Calo
plugins
EcalSimHitDump.cc
Go to the documentation of this file.
1
#include "
DataFormats/EcalDetId/interface/EBDetId.h
"
2
#include "
DataFormats/EcalDetId/interface/EEDetId.h
"
3
#include "
DataFormats/EcalDetId/interface/ESDetId.h
"
4
#include "
DataFormats/EcalDetId/interface/EcalSubdetector.h
"
5
6
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
7
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
8
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
9
#include "
FWCore/Framework/interface/Event.h
"
10
#include "
FWCore/Framework/interface/EventSetup.h
"
11
#include "
FWCore/Framework/interface/MakerMacros.h
"
12
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
13
#include "
FWCore/Utilities/interface/InputTag.h
"
14
#include "
FWCore/Utilities/interface/transform.h
"
15
16
#include "
SimDataFormats/CaloHit/interface/PCaloHit.h
"
17
#include "
SimDataFormats/CaloHit/interface/PCaloHitContainer.h
"
18
19
#include <string>
20
#include <vector>
21
22
class
EcalSimHitDump
:
public
edm::one::EDAnalyzer
<> {
23
public
:
24
EcalSimHitDump
(
const
edm::ParameterSet
& ps);
25
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
26
27
protected
:
28
void
analyze
(
edm::Event
const
&,
edm::EventSetup
const
&)
override
;
29
30
private
:
31
const
std::string
g4Label_
;
32
const
std::vector<std::string>
hitLab_
;
33
const
std::vector<edm::EDGetTokenT<edm::PCaloHitContainer>>
toksCalo_
;
34
const
std::vector<int>
types_
;
35
const
int
maxEvent_
;
36
int
kount_
;
37
};
38
39
EcalSimHitDump::EcalSimHitDump
(
const
edm::ParameterSet
& ps)
40
: g4Label_(ps.getParameter<
std
::
string
>(
"ModuleLabel"
)),
41
hitLab_(ps.getParameter<
std
::
vector
<
std
::
string
>>(
"HitCollections"
)),
42
toksCalo_{
edm::vector_transform
(
hitLab_
,
43
[
this
](
const
std::string
&
name
) {
44
return
consumes<edm::PCaloHitContainer>(
edm::InputTag
{
g4Label_
,
name
});
45
})},
46
types_(ps.getParameter<std::vector<int>>(
"CollectionTypes"
)),
47
maxEvent_(ps.getParameter<
int
>(
"MaxEvent"
)),
48
kount_(0) {
49
edm::LogVerbatim
(
"HitStudy"
) <<
"Module Label: "
<< g4Label_ <<
" with "
<< hitLab_.size()
50
<<
" collections and maxEvent = "
<< maxEvent_;
51
for
(
unsigned
int
k
= 0;
k
< hitLab_.size(); ++
k
)
52
edm::LogVerbatim
(
"HitStudy"
) <<
"["
<<
k
<<
"] Type "
<< types_[
k
] <<
" Label "
<< hitLab_[
k
];
53
}
54
55
void
EcalSimHitDump::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
56
edm::ParameterSetDescription
desc
;
57
std::vector<std::string> coll = {
"EcalHitsEB"
,
"EcalHitsEE"
,
"EcalHitsES"
};
58
std::vector<int>
type
= {0, 1, 2};
59
desc
.add<
std::string
>(
"ModuleLabel"
,
"g4SimHits"
);
60
desc
.add<std::vector<std::string>>(
"HitCollections"
, coll);
61
desc
.add<std::vector<int>>(
"CollectionTypes"
,
type
);
62
desc
.add<
int
>(
"MaxEvent"
, 10);
63
descriptions.
add
(
"ecalSimHitDump"
,
desc
);
64
}
65
66
void
EcalSimHitDump::analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
&) {
67
++
kount_
;
68
edm::LogVerbatim
(
"HitStudy"
) <<
"["
<<
kount_
<<
"] Run = "
<<
e
.id().run() <<
" Event = "
<<
e
.id().event();
69
70
if
((
kount_
<=
maxEvent_
) || (
maxEvent_
<= 0)) {
71
for
(
unsigned
int
k
= 0;
k
<
toksCalo_
.size(); ++
k
) {
72
edm::Handle<edm::PCaloHitContainer>
hitsCalo;
73
e
.getByToken(
toksCalo_
[
k
], hitsCalo);
74
if
(hitsCalo.
isValid
())
75
edm::LogVerbatim
(
"HitStudy"
) <<
"EcalSimHitDump: Input "
<< hitsCalo->size() <<
" hits of type "
<<
types_
[
k
];
76
unsigned
int
i
(0);
77
for
(
auto
const
&
hit
: *hitsCalo) {
78
double
edep =
hit
.energy();
79
double
time
=
hit
.time();
80
unsigned
int
id
=
hit
.
id
();
81
if
(
types_
[
k
] == 0)
82
edm::LogVerbatim
(
"HitStudy"
) <<
"["
<<
i
<<
"] "
<<
EBDetId
(
id
) <<
" E"
<< edep <<
" T "
<<
time
;
83
else
if
(
types_
[
k
] == 1)
84
edm::LogVerbatim
(
"HitStudy"
) <<
"["
<<
i
<<
"] "
<<
EEDetId
(
id
) <<
" E"
<< edep <<
" T "
<<
time
;
85
else
86
edm::LogVerbatim
(
"HitStudy"
) <<
"["
<<
i
<<
"] "
<<
ESDetId
(
id
) <<
" E"
<< edep <<
" T "
<<
time
;
87
++
i
;
88
}
89
}
90
}
91
}
92
93
//define this as a plug-in
94
DEFINE_FWK_MODULE
(
EcalSimHitDump
);
EDAnalyzer.h
mps_fire.i
i
Definition:
mps_fire.py:428
MessageLogger.h
hit::id
unsigned int id
Definition:
SiStripHitEffFromCalibTree.cc:92
EBDetId
Definition:
EBDetId.h:17
EBDetId.h
EEDetId.h
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
protons_cff.time
time
Definition:
protons_cff.py:39
EcalSimHitDump::EcalSimHitDump
EcalSimHitDump(const edm::ParameterSet &ps)
Definition:
EcalSimHitDump.cc:39
EcalSimHitDump::hitLab_
const std::vector< std::string > hitLab_
Definition:
EcalSimHitDump.cc:32
ESDetId
Definition:
ESDetId.h:15
ESDetId.h
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
edm::Handle
Definition:
AssociativeIterator.h:50
MakerMacros.h
EcalSimHitDump::types_
const std::vector< int > types_
Definition:
EcalSimHitDump.cc:34
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
EcalSimHitDump::toksCalo_
const std::vector< edm::EDGetTokenT< edm::PCaloHitContainer > > toksCalo_
Definition:
EcalSimHitDump.cc:33
dqmdumpme.k
k
Definition:
dqmdumpme.py:60
EcalSimHitDump::g4Label_
const std::string g4Label_
Definition:
EcalSimHitDump.cc:31
EEDetId
Definition:
EEDetId.h:14
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition:
transform.h:11
EcalSubdetector.h
edm::ParameterSet
Definition:
ParameterSet.h:47
EcalSimHitDump::maxEvent_
const int maxEvent_
Definition:
EcalSimHitDump.cc:35
Event.h
type
type
Definition:
SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition:
SiPixelGainCalibHelper.h:40
PCaloHit.h
trackerHitRTTI::vector
Definition:
trackerHitRTTI.h:21
edm::EventSetup
Definition:
EventSetup.h:58
InputTag.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
std
Definition:
JetResolutionObject.h:76
Frameworkfwd.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition:
MessageLogger.h:128
transform.h
EcalSimHitDump
Definition:
EcalSimHitDump.cc:22
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
EventSetup.h
PCaloHitContainer.h
EcalSimHitDump::analyze
void analyze(edm::Event const &, edm::EventSetup const &) override
Definition:
EcalSimHitDump.cc:66
EcalSimHitDump::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
EcalSimHitDump.cc:55
ParameterSet.h
EcalSimHitDump::kount_
int kount_
Definition:
EcalSimHitDump.cc:36
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:70
edm::Event
Definition:
Event.h:73
edm::Log
Definition:
MessageLogger.h:70
edm::InputTag
Definition:
InputTag.h:15
hit
Definition:
SiStripHitEffFromCalibTree.cc:88
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16