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
JetMETCorrections
JetVertexAssociation
src
JetVertexAssociation.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: JetVertexAssociation
4
// Class: JetVertexAssociation
5
//
13
//
14
// Original Author: Natalia Ilina
15
// Modified by Eduardo Luiggi
16
//
17
// Created: Tue Oct 31 10:52:41 CET 2006
18
//
19
//
20
32
#include <memory>
33
#include <iostream>
34
#include <iomanip>
35
#include <cmath>
36
37
38
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
39
#include "
FWCore/Framework/interface/EDProducer.h
"
40
#include "
FWCore/Framework/interface/Event.h
"
41
42
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
43
#include "
FWCore/Framework/interface/MakerMacros.h
"
44
45
#include "
DataFormats/Common/interface/Handle.h
"
46
#include "
FWCore/Framework/interface/EventSetup.h
"
47
#include "
DataFormats/JetReco/interface/CaloJetCollection.h
"
48
#include "
DataFormats/JetReco/interface/CaloJet.h
"
49
#include "
DataFormats/TrackReco/interface/Track.h
"
50
#include "
DataFormats/VertexReco/interface/Vertex.h
"
51
#include "
DataFormats/VertexReco/interface/VertexFwd.h
"
52
53
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
54
#include "
JetMETCorrections/JetVertexAssociation/interface/JetVertexAssociation.h
"
55
#include "
JetMETCorrections/JetVertexAssociation/interface/JetVertexMain.h
"
56
57
using namespace
std;
58
using namespace
reco
;
59
namespace
cms{
60
61
JetVertexAssociation::JetVertexAssociation(
const
edm::ParameterSet
& iConfig): m_algo(iConfig),
62
jet_algo(iConfig.getParameter<std::
string
>(
"JET_ALGO"
)),
63
track_algo(iConfig.getParameter<std::
string
>(
"TRACK_ALGO"
)),
64
vertex_algo(iConfig.getParameter<std::
string
>(
"VERTEX_ALGO"
)) {
65
66
67
68
produces<ResultCollection1>(
"Var"
);
69
produces<ResultCollection2>(
"JetType"
);
70
71
72
}
73
74
void
JetVertexAssociation::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup){
75
76
edm::Handle<CaloJetCollection>
jets
;
77
iEvent.
getByLabel
(
jet_algo
, jets);
78
79
edm::Handle<TrackCollection>
tracks
;
80
iEvent.
getByLabel
(
track_algo
, tracks);
81
82
edm::Handle<VertexCollection>
vertexes;
83
iEvent.
getByLabel
(
vertex_algo
, vertexes);
84
85
double
SIGNAL_V_Z = 0.;
86
double
SIGNAL_V_Z_ERROR = 0.;
87
double
ptmax = -100.;
88
89
VertexCollection::const_iterator vert = vertexes->begin ();
90
if
(vertexes->size() > 0 ) {
91
for
(; vert != vertexes->end (); vert++) {
92
93
SIGNAL_V_Z = vert->z();
94
double
pt
= 0.;
95
reco::Vertex::trackRef_iterator
tr = vert->tracks_begin();
96
for
(; tr != vert->tracks_end(); tr++) pt += (*tr)->pt();
97
if
( pt >= ptmax ){
98
99
ptmax =
pt
;
100
SIGNAL_V_Z = vert->z();
101
SIGNAL_V_Z_ERROR = vert->zError();
102
103
}
104
105
}
106
}
107
108
pair<double, bool>
result
;
109
std::auto_ptr<ResultCollection1> result1 (
new
ResultCollection1
) ;
110
std::auto_ptr<ResultCollection2> result2 (
new
ResultCollection2
) ;
111
112
CaloJetCollection::const_iterator
jet
= jets->begin ();
113
114
if
(jets->size() > 0 ) {
115
for
(; jet != jets->end (); jet++) {
116
result =
m_algo
.
Main
(*jet, tracks, SIGNAL_V_Z, SIGNAL_V_Z_ERROR);
117
result1->push_back(result.first);
118
result2->push_back(result.second);
119
120
}
121
}
122
123
iEvent.
put
(result1,
"Var"
);
124
iEvent.
put
(result2,
"JetType"
);
125
126
}
127
}
metsig::jet
Definition:
SignAlgoResolutions.h:40
JetVertexMain::Main
std::pair< double, bool > Main(const reco::CaloJet &jet, edm::Handle< reco::TrackCollection > tracks, double SIGNAL_V_Z, double SIGNAL_V_Z_Error)
Definition:
JetVertexMain.cc:24
cms::JetVertexAssociation::produce
void produce(edm::Event &e, const edm::EventSetup &c)
Definition:
JetVertexAssociation.cc:74
cms::JetVertexAssociation::ResultCollection1
std::vector< double > ResultCollection1
Definition:
JetVertexAssociation.h:35
Event.h
CaloJetCollection.h
MakerMacros.h
EventSetup.h
cms::JetVertexAssociation::jet_algo
std::string jet_algo
Definition:
JetVertexAssociation.h:39
VertexFwd.h
Handle.h
edm::Handle
Definition:
AssociativeIterator.h:47
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:105
Frameworkfwd.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
ParameterSet.h
iEvent
int iEvent
Definition:
GenABIO.cc:243
edm::Event::put
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition:
Event.h:116
RecoTauCleanerPlugins.pt
tuple pt
Definition:
RecoTauCleanerPlugins.py:53
fwrapper::jets
vector< PseudoJet > jets
Definition:
fastjetfortran_madfks.cc:42
query.result
tuple result
Definition:
query.py:137
cms::JetVertexAssociation::ResultCollection2
std::vector< bool > ResultCollection2
Definition:
JetVertexAssociation.h:36
edm::EventSetup
Definition:
EventSetup.h:44
cms::JetVertexAssociation::track_algo
std::string track_algo
Definition:
JetVertexAssociation.h:40
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:390
Vertex.h
JetVertexAssociation.h
EDProducer.h
testEve_cfg.tracks
tuple tracks
Definition:
testEve_cfg.py:39
reco::Vertex::trackRef_iterator
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition:
Vertex.h:37
edm::ParameterSet
Definition:
ParameterSet.h:35
CaloJet.h
edm::Event
Definition:
Event.h:62
Track.h
ModuleDef.h
cms::JetVertexAssociation::vertex_algo
std::string vertex_algo
Definition:
JetVertexAssociation.h:41
JetVertexMain.h
cms::JetVertexAssociation::m_algo
JetVertexMain m_algo
Definition:
JetVertexAssociation.h:38
Generated for CMSSW Reference Manual by
1.8.5