CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RecoTauBuilderPlugins.h
Go to the documentation of this file.
1 #ifndef RecoTauTag_RecoTau_RecoTauBuilderPlugin_h
2 #define RecoTauTag_RecoTau_RecoTauBuilderPlugin_h
3 
4 /*
5  * RecoTauBuilderPlugins
6  *
7  * Author: Evan K. Friis (UC Davis)
8  *
9  * Classes for building new and modifying existing PFTaus from PFJets and
10  * reconstructed PiZeros.
11  *
12  * RecoTauBuilderPlugin is the base class for any algorithm that constructs
13  * taus. Algorithms should override the abstract function
14  *
15  * std::vector<PFTau> operator()(const PFJet&, const
16  * std::vector<RecoTauPiZero>&) const;
17  *
18  * implementing it such that a list of taus a produced for a given jet and its
19  * associated collection of PiZeros.
20  *
21  * RecoTauModifierPlugin takes an input tau and modifies it.
22  *
23  * Both plugins inherit from RecoTauEventHolderPlugin, which provides the
24  * methods
25  *
26  * const edm::Event* evt() const; const edm::EventSetup* evtSetup()
27  *
28  * to retrieve the current event if necessary.
29  *
30  *
31  */
32 
35 
43 
46 
47 #include <vector>
48 
49 namespace reco {
50  namespace tau {
51 
52  /* Class that constructs PFTau(s) from a Jet and its associated PiZeros */
54  public:
55  typedef std::vector<std::unique_ptr<reco::PFTau>> output_type;
57 
60  // The vertex association configuration is specified with the quality cuts.
61  vertexAssociator_(pset.getParameter<edm::ParameterSet>("qualityCuts"), std::move(iC)) {
62  pfCandSrc_ = pset.getParameter<edm::InputTag>("pfCandSrc");
64  };
65 
66  ~RecoTauBuilderPlugin() override {}
67 
72  const std::vector<reco::PFRecoTauChargedHadron>&,
73  const std::vector<reco::RecoTauPiZero>&,
74  const std::vector<CandidatePtr>&) const = 0;
75 
78 
82  }
84  reco::VertexRef primaryVertex(const reco::PFTau& tau, bool useJet = false) const {
85  return vertexAssociator_.associatedVertex(tau, useJet);
86  }
87 
88  // Hook called by base class at the beginning of each event. Used to update
89  // handle to PFCandidates
90  void beginEvent() override;
91 
92  private:
94  // Handle to PFCandidates needed to build Refs
98  };
99 
100  /* Class that updates a PFTau's members (i.e. electron variables) */
102  public:
104  : RecoTauEventHolderPlugin(pset) {}
106  // Modify an existing PFTau (i.e. add electron rejection, etc)
107  virtual void operator()(PFTau&) const = 0;
108  void beginEvent() override {}
109  virtual void endEvent() {}
110  };
111 
112  /* Class that returns a double value indicating the quality of a given tau */
114  public:
116  : RecoTauEventHolderPlugin(pset) {}
117  ~RecoTauCleanerPlugin() override {}
118  // Modify an existing PFTau (i.e. add electron rejection, etc)
119  virtual double operator()(const PFTauRef&) const = 0;
120  void beginEvent() override {}
121  };
122  } // namespace tau
123 } // namespace reco
124 
126 
134 
135 #endif
reco::VertexRef primaryVertex(const reco::JetBaseRef &jet) const
Get primary vertex associated to this jet.
virtual double operator()(const PFTauRef &) const =0
std::vector< std::unique_ptr< reco::PFTau > > output_type
virtual void operator()(PFTau &) const =0
edm::Handle< edm::View< reco::Candidate > > pfCands_
reco::VertexRef primaryVertex(const reco::PFTau &tau, bool useJet=false) const
Get primary vertex associated to this tau.
edm::EDGetTokenT< edm::View< reco::Candidate > > pfCand_token
edmplugin::PluginFactory< reco::tau::RecoTauCleanerPlugin *(const edm::ParameterSet &, edm::ConsumesCollector &&iC)> RecoTauCleanerPluginFactory
edmplugin::PluginFactory< reco::tau::RecoTauBuilderPlugin *(const edm::ParameterSet &, edm::ConsumesCollector &&iC)> RecoTauBuilderPluginFactory
def move
Definition: eostools.py:511
RecoTauCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::VertexRef associatedVertex(const Jet &jet) const
RecoTauBuilderPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
reco::tau::RecoTauVertexAssociator vertexAssociator_
const edm::Handle< edm::View< reco::Candidate > > & getPFCands() const
Hack to be able to convert Ptrs to Refs.
virtual return_type operator()(const reco::JetBaseRef &, const std::vector< reco::PFRecoTauChargedHadron > &, const std::vector< reco::RecoTauPiZero > &, const std::vector< CandidatePtr > &) const =0
RecoTauModifierPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)