RecoTauTag
RecoTau
plugins
RecoTauEnergyRecoveryPlugin2.cc
Go to the documentation of this file.
1
/*
2
* =============================================================================
3
* Filename: RecoTauEnergyRecoveryPlugin2.cc
4
*
5
* Description: Set tau energy to sum of **all** PFCandidates
6
* (regardless of PFCandidate type and whether
7
* PFCandidate passes or fails quality cuts)
8
*
9
* NOTE: use for testing only,
10
* this code has **not** yet been commissioned !!
11
*
12
* Created: 02/02/2013 17:09:00
13
*
14
* Authors: Christian Veelken (LLR)
15
*
16
* =============================================================================
17
*/
18
19
#include "
RecoTauTag/RecoTau/interface/RecoTauBuilderPlugins.h
"
20
#include "
DataFormats/ParticleFlowCandidate/interface/PFCandidate.h
"
21
#include "
DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h
"
22
#include "
DataFormats/JetReco/interface/PFJet.h
"
23
#include "
DataFormats/GsfTrackReco/interface/GsfTrack.h
"
24
#include "
DataFormats/TrackReco/interface/Track.h
"
25
#include "
DataFormats/VertexReco/interface/Vertex.h
"
26
#include "
DataFormats/VertexReco/interface/VertexFwd.h
"
27
#include "
RecoTauTag/RecoTau/interface/RecoTauQualityCuts.h
"
28
29
#include "
DataFormats/Math/interface/deltaR.h
"
30
31
#include <algorithm>
32
33
namespace
reco
{
34
namespace
tau
{
35
36
class
RecoTauEnergyRecoveryPlugin2
:
public
RecoTauModifierPlugin
{
37
public
:
38
explicit
RecoTauEnergyRecoveryPlugin2
(
const
edm::ParameterSet
&,
edm::ConsumesCollector
&& iC);
39
~RecoTauEnergyRecoveryPlugin2
()
override
;
40
void
operator()
(
PFTau
&)
const override
;
41
void
beginEvent
()
override
;
42
43
private
:
44
double
dRcone_
;
45
};
46
47
RecoTauEnergyRecoveryPlugin2::RecoTauEnergyRecoveryPlugin2
(
const
edm::ParameterSet
&
cfg
,
48
edm::ConsumesCollector
&& iC)
49
:
RecoTauModifierPlugin
(
cfg
,
std
::
move
(iC)), dRcone_(
cfg
.getParameter<double>(
"dRcone"
)) {}
50
51
RecoTauEnergyRecoveryPlugin2::~RecoTauEnergyRecoveryPlugin2
() {}
52
53
void
RecoTauEnergyRecoveryPlugin2::beginEvent
() {}
54
55
void
RecoTauEnergyRecoveryPlugin2::operator()
(
PFTau
&
tau
)
const
{
56
reco::Candidate::LorentzVector
tauAltP4(0., 0., 0., 0.);
57
58
std::vector<reco::CandidatePtr> pfJetConstituents =
tau
.jetRef()->getJetConstituents();
59
for
(std::vector<reco::CandidatePtr>::const_iterator pfJetConstituent = pfJetConstituents.begin();
60
pfJetConstituent != pfJetConstituents.end();
61
++pfJetConstituent) {
62
double
dR
=
deltaR
((*pfJetConstituent)->p4(),
tau
.p4());
63
if
(
dR
<
dRcone_
)
64
tauAltP4 += (*pfJetConstituent)->p4();
65
}
66
67
tau
.setalternatLorentzVect(tauAltP4);
68
}
69
70
}
// namespace tau
71
}
// namespace reco
72
73
#include "
FWCore/Framework/interface/MakerMacros.h
"
74
DEFINE_EDM_PLUGIN
(
RecoTauModifierPluginFactory
,
75
reco::tau::RecoTauEnergyRecoveryPlugin2
,
76
"RecoTauEnergyRecoveryPlugin2"
);
reco::tau::RecoTauEnergyRecoveryPlugin2::~RecoTauEnergyRecoveryPlugin2
~RecoTauEnergyRecoveryPlugin2() override
Definition:
RecoTauEnergyRecoveryPlugin2.cc:51
reco::tau::RecoTauEnergyRecoveryPlugin2
Definition:
RecoTauEnergyRecoveryPlugin2.cc:36
metsig::tau
Definition:
SignAlgoResolutions.h:49
PFCandidate.h
PFJet.h
reco::PFTau
Definition:
PFTau.h:36
reco::tau::RecoTauEnergyRecoveryPlugin2::beginEvent
void beginEvent() override
Definition:
RecoTauEnergyRecoveryPlugin2.cc:53
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
MakerMacros.h
Track.h
reco::tau::RecoTauEnergyRecoveryPlugin2::RecoTauEnergyRecoveryPlugin2
RecoTauEnergyRecoveryPlugin2(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
Definition:
RecoTauEnergyRecoveryPlugin2.cc:47
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
RecoTauQualityCuts.h
edm::ParameterSet
Definition:
ParameterSet.h:47
deltaR.h
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
GsfTrack.h
looper.cfg
cfg
Definition:
looper.py:296
RecoTauBuilderPlugins.h
VertexFwd.h
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
reco::tau::RecoTauModifierPlugin
Definition:
RecoTauBuilderPlugins.h:104
Vertex.h
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition:
deltaR.h:30
reco::tau::RecoTauEnergyRecoveryPlugin2::operator()
void operator()(PFTau &) const override
Definition:
RecoTauEnergyRecoveryPlugin2.cc:55
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition:
HGC3DClusterGenMatchSelector_cfi.py:7
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Candidate.h:36
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
reco::tau::RecoTauEnergyRecoveryPlugin2::dRcone_
double dRcone_
Definition:
RecoTauEnergyRecoveryPlugin2.cc:44
PFCandidateFwd.h
Generated for CMSSW Reference Manual by
1.8.16