PhysicsTools
PatUtils
plugins
ShiftedPFCandidateProducerByMatchedObject.h
Go to the documentation of this file.
1
#ifndef PhysicsTools_PatUtils_ShiftedPFCandidateProducerByMatchedObject_h
2
#define PhysicsTools_PatUtils_ShiftedPFCandidateProducerByMatchedObject_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
21
#include "
DataFormats/ParticleFlowCandidate/interface/PFCandidate.h
"
22
#include "
DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h
"
23
24
#include "
DataFormats/Common/interface/Handle.h
"
25
#include "
DataFormats/Common/interface/View.h
"
26
#include "
DataFormats/Math/interface/deltaR.h
"
27
28
#include <string>
29
#include <vector>
30
31
class
ShiftedPFCandidateProducerByMatchedObject
:
public
edm::stream::EDProducer
<> {
32
public
:
33
explicit
ShiftedPFCandidateProducerByMatchedObject
(
const
edm::ParameterSet
&);
34
~ShiftedPFCandidateProducerByMatchedObject
()
override
;
35
36
private
:
37
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
38
39
edm::EDGetTokenT<reco::PFCandidateCollection>
srcPFCandidates_
;
40
edm::EDGetTokenT<edm::View<reco::Candidate>
>
srcUnshiftedObjects_
;
41
edm::EDGetTokenT<edm::View<reco::Candidate>
>
srcShiftedObjects_
;
42
43
double
dRmatch_PFCandidate_
;
44
double
dR2match_PFCandidate_
;
45
double
dRmatch_Object_
;
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
dRmatch_
;
65
double
shift_
;
66
bool
isValidMatch_
;
67
};
68
69
std::vector<objectEntryType>
objects_
;
70
};
71
72
#endif
Handle.h
ShiftedPFCandidateProducerByMatchedObject::objectEntryType
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:48
funct::false
false
Definition:
Factorize.h:29
PFCandidate.h
ShiftedPFCandidateProducerByMatchedObject::dR2match_PFCandidate_
double dR2match_PFCandidate_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:44
edm::EDGetTokenT< reco::PFCandidateCollection >
EDProducer.h
ShiftedPFCandidateProducerByMatchedObject::objectEntryType::shiftedObjectP4_
reco::Candidate::LorentzVector shiftedObjectP4_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:62
ShiftedPFCandidateProducerByMatchedObject::objectEntryType::unshiftedObjectP4_
reco::Candidate::LorentzVector unshiftedObjectP4_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:63
ShiftedPFCandidateProducerByMatchedObject::objectEntryType::~objectEntryType
~objectEntryType()
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:61
ShiftedPFCandidateProducerByMatchedObject::~ShiftedPFCandidateProducerByMatchedObject
~ShiftedPFCandidateProducerByMatchedObject() override
Definition:
ShiftedPFCandidateProducerByMatchedObject.cc:17
ShiftedPFCandidateProducerByMatchedObject::srcShiftedObjects_
edm::EDGetTokenT< edm::View< reco::Candidate > > srcShiftedObjects_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:41
ShiftedPFCandidateProducerByMatchedObject::dRmatch_PFCandidate_
double dRmatch_PFCandidate_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:43
ShiftedPFCandidateProducerByMatchedObject::dRmatch_Object_
double dRmatch_Object_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:45
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
deltaR.h
ShiftedPFCandidateProducerByMatchedObject::objectEntryType::objectEntryType
objectEntryType(const reco::Candidate::LorentzVector &shiftedObjectP4, const reco::Candidate::LorentzVector &unshiftedObjectP4, double dRmatch)
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:49
ShiftedPFCandidateProducerByMatchedObject::srcPFCandidates_
edm::EDGetTokenT< reco::PFCandidateCollection > srcPFCandidates_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:39
ShiftedPFCandidateProducerByMatchedObject::objectEntryType::dRmatch_
double dRmatch_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:64
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:58
ShiftedPFCandidateProducerByMatchedObject
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:31
InputTag.h
ShiftedPFCandidateProducerByMatchedObject::objects_
std::vector< objectEntryType > objects_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:69
ShiftedPFCandidateProducerByMatchedObject::srcUnshiftedObjects_
edm::EDGetTokenT< edm::View< reco::Candidate > > srcUnshiftedObjects_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:40
ShiftedPFCandidateProducerByMatchedObject::dR2match_Object_
double dR2match_Object_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:46
ShiftedPFCandidateProducerByMatchedObject::objectEntryType::isValidMatch_
bool isValidMatch_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:66
EventSetup.h
Candidate.h
View.h
ParameterSet.h
ShiftedPFCandidateProducerByMatchedObject::ShiftedPFCandidateProducerByMatchedObject
ShiftedPFCandidateProducerByMatchedObject(const edm::ParameterSet &)
Definition:
ShiftedPFCandidateProducerByMatchedObject.cc:5
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Candidate.h:36
ShiftedPFCandidateProducerByMatchedObject::objectEntryType::shift_
double shift_
Definition:
ShiftedPFCandidateProducerByMatchedObject.h:65
edm::Event
Definition:
Event.h:73
ShiftedPFCandidateProducerByMatchedObject::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
ShiftedPFCandidateProducerByMatchedObject.cc:21
PFCandidateFwd.h
Generated for CMSSW Reference Manual by
1.8.16