PhysicsTools
PatUtils
plugins
ShiftedJetProducerByMatchedObject.h
Go to the documentation of this file.
1
#ifndef PhysicsTools_PatUtils_ShiftedJetProducerByMatchedObject_h
2
#define PhysicsTools_PatUtils_ShiftedJetProducerByMatchedObject_h
3
13
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
14
#include "
FWCore/Framework/interface/Event.h
"
15
#include "
FWCore/Framework/interface/EventSetup.h
"
16
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
17
#include "
FWCore/Utilities/interface/InputTag.h
"
18
19
#include "
DataFormats/Candidate/interface/Candidate.h
"
20
#include "
DataFormats/Candidate/interface/CandidateFwd.h
"
21
22
#include <string>
23
#include <vector>
24
25
template
<
typename
T>
26
class
ShiftedJetProducerByMatchedObjectT
:
public
edm::stream::EDProducer
<> {
27
typedef
std::vector<T>
JetCollection
;
28
29
public
:
30
explicit
ShiftedJetProducerByMatchedObjectT
(
const
edm::ParameterSet
&);
31
~ShiftedJetProducerByMatchedObjectT
()
override
;
32
33
private
:
34
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
35
36
std::string
moduleLabel_
;
37
38
edm::EDGetTokenT<JetCollection>
srcJets_
;
39
edm::EDGetTokenT<edm::View<reco::Candidate>
>
srcUnshiftedObjects_
;
40
edm::EDGetTokenT<edm::View<reco::Candidate>
>
srcShiftedObjects_
;
41
42
double
dRmatch_Jet_
;
43
double
dRmatch_Object_
;
44
45
double
dR2match_Jet_
;
46
double
dR2match_Object_
;
47
48
struct
objectEntryType
{
49
objectEntryType
(
const
reco::Candidate::LorentzVector
& shiftedObjectP4,
50
const
reco::Candidate::LorentzVector
& unshiftedObjectP4,
51
double
dRmatch)
52
:
shiftedObjectP4_
(shiftedObjectP4),
53
unshiftedObjectP4_
(unshiftedObjectP4),
54
dRmatch_
(dRmatch),
55
isValidMatch_
(
false
) {
56
if
(unshiftedObjectP4.energy() > 0.) {
57
shift_
= (shiftedObjectP4.energy() / unshiftedObjectP4.energy()) - 1.;
58
isValidMatch_
=
true
;
59
}
60
}
61
~objectEntryType
() {}
62
reco::Candidate::LorentzVector
shiftedObjectP4_
;
63
reco::Candidate::LorentzVector
unshiftedObjectP4_
;
64
double
shift_
;
65
double
dRmatch_
;
66
bool
isValidMatch_
;
67
};
68
69
std::vector<objectEntryType>
objects_
;
70
};
71
72
#endif
ShiftedJetProducerByMatchedObjectT::srcJets_
edm::EDGetTokenT< JetCollection > srcJets_
Definition:
ShiftedJetProducerByMatchedObject.h:38
funct::false
false
Definition:
Factorize.h:34
ShiftedJetProducerByMatchedObjectT::ShiftedJetProducerByMatchedObjectT
ShiftedJetProducerByMatchedObjectT(const edm::ParameterSet &)
Definition:
ShiftedJetProducerByMatchedObject.cc:10
ShiftedJetProducerByMatchedObjectT::objectEntryType::shiftedObjectP4_
reco::Candidate::LorentzVector shiftedObjectP4_
Definition:
ShiftedJetProducerByMatchedObject.h:62
edm::EDGetTokenT< JetCollection >
EDProducer.h
ShiftedJetProducerByMatchedObjectT::objectEntryType::unshiftedObjectP4_
reco::Candidate::LorentzVector unshiftedObjectP4_
Definition:
ShiftedJetProducerByMatchedObject.h:63
CandidateFwd.h
ShiftedJetProducerByMatchedObjectT::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
ShiftedJetProducerByMatchedObject.cc:31
ShiftedJetProducerByMatchedObjectT::objectEntryType::isValidMatch_
bool isValidMatch_
Definition:
ShiftedJetProducerByMatchedObject.h:66
ShiftedJetProducerByMatchedObjectT::objectEntryType::~objectEntryType
~objectEntryType()
Definition:
ShiftedJetProducerByMatchedObject.h:61
ShiftedJetProducerByMatchedObjectT::dRmatch_Jet_
double dRmatch_Jet_
Definition:
ShiftedJetProducerByMatchedObject.h:42
ShiftedJetProducerByMatchedObjectT::srcShiftedObjects_
edm::EDGetTokenT< edm::View< reco::Candidate > > srcShiftedObjects_
Definition:
ShiftedJetProducerByMatchedObject.h:40
ShiftedJetProducerByMatchedObjectT::JetCollection
std::vector< T > JetCollection
Definition:
ShiftedJetProducerByMatchedObject.h:27
ShiftedJetProducerByMatchedObjectT::dR2match_Jet_
double dR2match_Jet_
Definition:
ShiftedJetProducerByMatchedObject.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:36
ShiftedJetProducerByMatchedObjectT::objectEntryType
Definition:
ShiftedJetProducerByMatchedObject.h:48
Event.h
ShiftedJetProducerByMatchedObjectT::srcUnshiftedObjects_
edm::EDGetTokenT< edm::View< reco::Candidate > > srcUnshiftedObjects_
Definition:
ShiftedJetProducerByMatchedObject.h:39
edm::stream::EDProducer
Definition:
EDProducer.h:38
ShiftedJetProducerByMatchedObjectT::~ShiftedJetProducerByMatchedObjectT
~ShiftedJetProducerByMatchedObjectT() override
Definition:
ShiftedJetProducerByMatchedObject.cc:26
edm::EventSetup
Definition:
EventSetup.h:57
ShiftedJetProducerByMatchedObjectT::dRmatch_Object_
double dRmatch_Object_
Definition:
ShiftedJetProducerByMatchedObject.h:43
ShiftedJetProducerByMatchedObjectT
Definition:
ShiftedJetProducerByMatchedObject.h:26
InputTag.h
ShiftedJetProducerByMatchedObjectT::objects_
std::vector< objectEntryType > objects_
Definition:
ShiftedJetProducerByMatchedObject.h:69
ShiftedJetProducerByMatchedObjectT::objectEntryType::shift_
double shift_
Definition:
ShiftedJetProducerByMatchedObject.h:64
ShiftedJetProducerByMatchedObjectT::dR2match_Object_
double dR2match_Object_
Definition:
ShiftedJetProducerByMatchedObject.h:46
EventSetup.h
Candidate.h
ParameterSet.h
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Candidate.h:36
edm::Event
Definition:
Event.h:73
ShiftedJetProducerByMatchedObjectT::objectEntryType::objectEntryType
objectEntryType(const reco::Candidate::LorentzVector &shiftedObjectP4, const reco::Candidate::LorentzVector &unshiftedObjectP4, double dRmatch)
Definition:
ShiftedJetProducerByMatchedObject.h:49
ShiftedJetProducerByMatchedObjectT::moduleLabel_
std::string moduleLabel_
Definition:
ShiftedJetProducerByMatchedObject.h:36
ShiftedJetProducerByMatchedObjectT::objectEntryType::dRmatch_
double dRmatch_
Definition:
ShiftedJetProducerByMatchedObject.h:65
Generated for CMSSW Reference Manual by
1.8.16