CMS 3D CMS Logo

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 
28 
30 
32 
33 #include <algorithm>
34 
35 namespace reco {
36  namespace tau {
37 
39  public:
42  void operator()(PFTau&) const override;
43  void beginEvent() override;
44 
45  private:
46  double dRcone_;
47  };
48 
51  : RecoTauModifierPlugin(cfg, std::move(iC)), dRcone_(cfg.getParameter<double>("dRcone")) {}
52 
54 
56 
58  reco::Candidate::LorentzVector tauAltP4(0., 0., 0., 0.);
59 
60  std::vector<reco::CandidatePtr> pfJetConstituents = tau.jetRef()->getJetConstituents();
61  for (std::vector<reco::CandidatePtr>::const_iterator pfJetConstituent = pfJetConstituents.begin();
62  pfJetConstituent != pfJetConstituents.end();
63  ++pfJetConstituent) {
64  double dR = deltaR((*pfJetConstituent)->p4(), tau.p4());
65  if (dR < dRcone_)
66  tauAltP4 += (*pfJetConstituent)->p4();
67  }
68 
69  tau.setalternatLorentzVect(tauAltP4);
70  }
71 
72  } // namespace tau
73 } // namespace reco
74 
78  "RecoTauEnergyRecoveryPlugin2");
reco::tau::RecoTauEnergyRecoveryPlugin2::~RecoTauEnergyRecoveryPlugin2
~RecoTauEnergyRecoveryPlugin2() override
Definition: RecoTauEnergyRecoveryPlugin2.cc:53
reco::tau::RecoTauEnergyRecoveryPlugin2
Definition: RecoTauEnergyRecoveryPlugin2.cc:38
ESHandle.h
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:55
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
MakerMacros.h
Track.h
reco::tau::RecoTauEnergyRecoveryPlugin2::RecoTauEnergyRecoveryPlugin2
RecoTauEnergyRecoveryPlugin2(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
Definition: RecoTauEnergyRecoveryPlugin2.cc:49
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
Vertex.h
RecoTauQualityCuts.h
edm::ParameterSet
Definition: ParameterSet.h:47
deltaR.h
edmplugin::PluginFactory
Definition: PluginFactory.h:34
GsfTrack.h
looper.cfg
cfg
Definition: looper.py:297
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
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:57
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:46
PFCandidateFwd.h