SimGeneral
MixingModule
plugins
InputAnalyzer.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: InputAnalyzer
4
// Class: InputAnalyzer
5
//
13
//
14
// Original Author: Emilia Lubenova Becheva
15
// Created: Mon Apr 20 13:43:06 CEST 2009
16
//
17
//
18
19
// system include files
20
#include <memory>
21
22
// user include files
23
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
24
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
25
26
#include "
FWCore/Framework/interface/Event.h
"
27
#include "
FWCore/Framework/interface/MakerMacros.h
"
28
29
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
30
31
#include "
DataFormats/Provenance/interface/ProductID.h
"
32
#include "
DataFormats/Common/interface/Handle.h
"
33
34
#include "
FWCore/Utilities/interface/InputTag.h
"
35
36
#include "
InputAnalyzer.h
"
37
38
//
39
// constructors and destructor
40
//
41
namespace
edm
{
42
43
InputAnalyzer::InputAnalyzer
(
const
edm::ParameterSet
& iConfig) {
44
dataStep2_
= iConfig.
getParameter
<
bool
>(
"dataStep2"
);
45
46
labelPCF_
= consumes<PCrossingFrame<SimTrack>>(iConfig.
getParameter
<
edm::InputTag
>(
"collPCF"
));
47
48
//will only be needed if not Step2:
49
labelSimTr_
= consumes<SimTrackContainer>(iConfig.
getParameter
<
edm::InputTag
>(
"collSimTrack"
));
50
}
51
52
InputAnalyzer::~InputAnalyzer
() {}
53
54
//
55
// member functions
56
//
57
58
// ------------ method called to for each event ------------
59
void
InputAnalyzer::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
60
std::cout
<<
" dataStep2_ = "
<<
dataStep2_
<< std::endl;
61
62
if
(!
dataStep2_
) {
63
// Get the SimTrack collection
64
65
//double simPt=0;
66
int
i
= 0;
67
68
// Get the SimTrack collection from the event
69
edm::Handle<SimTrackContainer>
simTracks
;
70
bool
gotTracks =
iEvent
.getByToken(
labelSimTr_
,
simTracks
);
71
72
if
(!gotTracks) {
73
std::cout
<<
"-> Could not read SimTracks !!!!"
<< std::endl;
74
}
else
{
75
std::cout
<<
"-> Could read SimTracks !!!!"
<< std::endl;
76
}
77
78
// Loop over the tracks
79
SimTrackContainer::const_iterator
simTrack
;
80
for
(
simTrack
=
simTracks
->begin();
simTrack
!=
simTracks
->end(); ++
simTrack
) {
81
i
++;
82
83
//simPt=(*simTrack).momentum().Pt();
84
//std::cout << " # i = " << i << " simPt = " << simPt << std::endl;
85
}
86
87
}
else
{
88
// Get the PCrossingFrame collection given as signal
89
90
edm::Handle<PCrossingFrame<SimTrack>
> cf_simtrack;
91
bool
gotTracks =
iEvent
.getByToken(
labelPCF_
, cf_simtrack);
92
93
if
(!gotTracks) {
94
std::cout
<<
"-> Could not read PCrossingFrame<SimTracks> !!!!"
<< std::endl;
95
}
else
96
std::cout
<<
"-> Could read PCrossingFrame<SimTracks> !!!!"
<< std::endl;
97
}
98
}
99
100
// ------------ method called once each job just before starting event loop ------------
101
void
InputAnalyzer::beginJob
() {}
102
103
// ------------ method called once each job just after ending the event loop ------------
104
void
InputAnalyzer::endJob
() {}
105
106
}
// namespace edm
Handle.h
cscDigiValidation_cfi.simTrack
simTrack
Definition:
cscDigiValidation_cfi.py:29
mps_fire.i
i
Definition:
mps_fire.py:428
edm::InputAnalyzer::labelPCF_
edm::EDGetTokenT< PCrossingFrame< SimTrack > > labelPCF_
Definition:
InputAnalyzer.h:46
edm::InputAnalyzer::labelSimTr_
edm::EDGetTokenT< SimTrackContainer > labelSimTr_
Definition:
InputAnalyzer.h:47
edm
HLT enums.
Definition:
AlignableModifier.h:19
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
TrackCandidateProducer_cfi.simTracks
simTracks
Definition:
TrackCandidateProducer_cfi.py:15
EDAnalyzer.h
edm::Handle
Definition:
AssociativeIterator.h:50
edm::InputAnalyzer::dataStep2_
bool dataStep2_
Definition:
InputAnalyzer.h:45
MakerMacros.h
edm::InputAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
InputAnalyzer.cc:59
ProductID.h
edm::InputAnalyzer::~InputAnalyzer
~InputAnalyzer() override
Definition:
InputAnalyzer.cc:52
edm::InputAnalyzer::endJob
void endJob() override
Definition:
InputAnalyzer.cc:104
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
InputAnalyzer.h
edm::EventSetup
Definition:
EventSetup.h:58
InputTag.h
edm::InputAnalyzer::beginJob
void beginJob() override
Definition:
InputAnalyzer.cc:101
edm::InputAnalyzer::InputAnalyzer
InputAnalyzer(const edm::ParameterSet &)
Definition:
InputAnalyzer.cc:43
Frameworkfwd.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
ParameterSet.h
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
Generated for CMSSW Reference Manual by
1.8.16