SimGeneral
MixingModule
plugins
MixingWorker.cc
Go to the documentation of this file.
1
#include "
SimDataFormats/Track/interface/SimTrackContainer.h
"
2
#include "
SimDataFormats/Vertex/interface/SimVertexContainer.h
"
3
#include "
SimDataFormats/TrackingHit/interface/PSimHitContainer.h
"
4
#include "
SimDataFormats/GeneratorProducts/interface/HepMCProduct.h
"
5
#include "
SimDataFormats/CrossingFrame/interface/PCrossingFrame.h
"
6
#include "
MixingWorker.h
"
7
8
#include <memory>
9
10
namespace
edm
{
11
template
<>
12
void
MixingWorker<HepMCProduct>::addPileups
(
const
EventPrincipal&
ep
,
13
ModuleCallingContext
const
* mcc,
14
unsigned
int
eventNr) {
15
// HepMCProduct does not come as a vector....
16
for
(
InputTag
const
&
tag
: allTags_) {
17
std::shared_ptr<Wrapper<HepMCProduct>
const
> shPtr = getProductByTag<HepMCProduct>(
ep
,
tag
, mcc);
18
if
(shPtr) {
19
LogDebug
(
"MixingModule"
) <<
"HepMC pileup objects added, eventNr "
<< eventNr <<
" Tag "
<<
tag
<< std::endl;
20
crFrame_->setPileupPtr(shPtr);
21
crFrame_->addPileups(*shPtr->product());
22
break
;
23
}
24
}
25
}
26
27
template
<>
28
void
MixingWorker<HepMCProduct>::addSignals
(
const
Event
&
e
) {
29
//HepMC - here the interface is different!!!
30
bool
got =
false
;
31
Handle<HepMCProduct>
result_t;
32
for
(
InputTag
const
&
tag
: allTags_) {
33
got =
e
.getByLabel(
tag
, result_t);
34
if
(got) {
35
LogDebug
(
"MixingModule"
) <<
"adding HepMCProduct from signal event with "
<<
tag
;
36
crFrame_->addSignals(result_t.product(),
e
.id());
37
break
;
38
}
39
}
40
if
(!got) {
41
LogInfo
(
"MixingModule"
) <<
"!!!!!!! Did not get any signal data for HepMCProduct with "
<< allTags_[0];
42
}
43
}
44
45
template
<>
46
bool
MixingWorker<HepMCProduct>::checkSignal
(
const
Event
&
e
) {
47
bool
got =
false
;
48
Handle<HepMCProduct>
result_t;
49
for
(
InputTag
const
&
tag
: allTags_) {
50
got =
e
.getByLabel(
tag
, result_t);
51
if
(got) {
52
InputTag
t
=
InputTag
(
tag
.label(),
tag
.instance());
53
LogInfo
(
"MixingModule"
) <<
" Will create a CrossingFrame for HepMCProduct with "
54
<<
" with InputTag= "
<<
t
.encode();
55
break
;
56
}
57
}
58
return
got;
59
}
60
}
//namespace edm
Handle
edm
HLT enums.
Definition:
AlignableModifier.h:19
PSimHitContainer.h
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89285
edm::LogInfo
Log< level::Info, false > LogInfo
Definition:
MessageLogger.h:125
edm::MixingWorker::addSignals
void addSignals(const edm::Event &e) override
Definition:
MixingWorker.h:139
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition:
GlobalPosition_Frontier_DevDB_cff.py:11
Event
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:233
PCrossingFrame.h
edm::MixingWorker::checkSignal
bool checkSignal(const edm::Event &e) override
Definition:
MixingWorker.h:121
MixingWorker.h
HepMCProduct.h
edm::MixingWorker::addPileups
void addPileups(const EventPrincipal &ep, ModuleCallingContext const *, unsigned int eventNr) override
Definition:
MixingWorker.h:187
submitPVValidationJobs.t
string t
Definition:
submitPVValidationJobs.py:644
SimTrackContainer.h
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition:
SiStripBadComponentsDQMServiceTemplate_cfg.py:86
SimVertexContainer.h
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16