Main Page
Namespaces
Classes
Package Documentation
GIT Directory
WorkBook
Offline Guide
Release schedule
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
20
// system include files
21
#include <memory>
22
23
// user include files
24
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
25
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
26
27
#include "
FWCore/Framework/interface/Event.h
"
28
#include "
FWCore/Framework/interface/MakerMacros.h
"
29
30
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
31
32
33
#include "
DataFormats/Provenance/interface/ProductID.h
"
34
#include "
DataFormats/Common/interface/Handle.h
"
35
36
#include "
FWCore/Utilities/interface/InputTag.h
"
37
38
#include "
InputAnalyzer.h
"
39
40
#include "
SimDataFormats/Track/interface/SimTrackContainer.h
"
41
#include "
SimDataFormats/CrossingFrame/interface/PCrossingFrame.h
"
42
43
//
44
// constructors and destructor
45
//
46
namespace
edm
47
{
48
49
InputAnalyzer::InputAnalyzer
(
const
edm::ParameterSet
& iConfig)
50
{
51
52
dataStep2_
= iConfig.
getParameter
<
bool
>(
"dataStep2"
);
53
54
if
(
dataStep2_
)
55
// The data file contain the PCrossingFrame<SimTrack>
56
label_
= iConfig.
getParameter
<
edm::InputTag
>(
"collPCF"
);
57
else
58
// The data file contain the SimTrack
59
label_
= iConfig.
getParameter
<
edm::InputTag
>(
"collSimTrack"
);
60
}
61
62
63
InputAnalyzer::~InputAnalyzer
()
64
{
65
}
66
67
68
//
69
// member functions
70
//
71
72
// ------------ method called to for each event ------------
73
void
74
InputAnalyzer::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
75
{
76
std::cout
<<
" dataStep2_ = "
<<
dataStep2_
<< std::endl;
77
78
if
(!
dataStep2_
){
79
// Get the SimTrack collection
80
81
//double simPt=0;
82
int
i
=0;
83
84
// Get the SimTrack collection from the event
85
edm::Handle<SimTrackContainer>
simTracks;
86
bool
gotTracks = iEvent.
getByLabel
(
label_
,simTracks);
87
88
if
(!gotTracks)
89
{
90
std::cout
<<
"-> Could not read SimTracks !!!!"
<<std::endl;
91
}
92
else
{
93
std::cout
<<
"-> Could read SimTracks !!!!"
<<std::endl;
94
95
}
96
97
98
// Loop over the tracks
99
SimTrackContainer::const_iterator simTrack;
100
for
(simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack){
101
i++;
102
103
//simPt=(*simTrack).momentum().Pt();
104
//std::cout << " # i = " << i << " simPt = " << simPt << std::endl;
105
106
}
107
108
109
}
110
else
{
111
// Get the PCrossingFrame collection given as signal
112
113
edm::Handle<PCrossingFrame<SimTrack>
> cf_simtrack;
114
bool
gotTracks = iEvent.
getByLabel
(
"CFWriter"
,
"g4SimHits"
,cf_simtrack);
115
116
if
(!gotTracks)
117
{
118
std::cout
<<
"-> Could not read PCrossingFrame<SimTracks> !!!!"
<<std::endl;
119
}
120
else
121
std::cout
<<
"-> Could read PCrossingFrame<SimTracks> !!!!"
<<std::endl;
122
123
}
124
}
125
126
127
// ------------ method called once each job just before starting event loop ------------
128
void
InputAnalyzer::beginJob
()
129
{
130
}
131
132
// ------------ method called once each job just after ending the event loop ------------
133
void
134
InputAnalyzer::endJob
() {
135
}
136
137
}
//edm
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
i
int i
Definition:
DBlmapReader.cc:9
Event.h
MakerMacros.h
Handle.h
edm::InputAnalyzer::label_
edm::InputTag label_
Definition:
InputAnalyzer.h:46
edm::Handle
Definition:
AssociativeIterator.h:47
ProductID.h
Frameworkfwd.h
InputAnalyzer.h
ParameterSet.h
edm::InputAnalyzer::dataStep2_
bool dataStep2_
Definition:
InputAnalyzer.h:45
iEvent
int iEvent
Definition:
GenABIO.cc:243
edm::InputAnalyzer::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
InputAnalyzer.cc:74
edm::InputAnalyzer::~InputAnalyzer
~InputAnalyzer()
Definition:
InputAnalyzer.cc:63
edm::EventSetup
Definition:
EventSetup.h:44
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:390
EDAnalyzer.h
edm::InputAnalyzer::InputAnalyzer
InputAnalyzer(const edm::ParameterSet &)
Definition:
InputAnalyzer.cc:49
PCrossingFrame.h
edm::InputAnalyzer::beginJob
virtual void beginJob()
Definition:
InputAnalyzer.cc:128
edm::InputAnalyzer::endJob
virtual void endJob()
Definition:
InputAnalyzer.cc:134
SimTrackContainer.h
edm::InputTag
Definition:
InputTag.h:17
InputTag.h
edm::ParameterSet
Definition:
ParameterSet.h:35
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
edm::Event
Definition:
Event.h:62
Generated for CMSSW Reference Manual by
1.8.5