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 
36 
44 
47 
48 #include <vector>
49 
50 namespace reco {
51  namespace tau {
52 
53  /* Class that constructs PFTau(s) from a Jet and its associated PiZeros */
55  public:
56  typedef std::vector<std::unique_ptr<reco::PFTau>> output_type;
58 
61  // The vertex association configuration is specified with the quality cuts.
62  vertexAssociator_(pset.getParameter<edm::ParameterSet>("qualityCuts"), std::move(iC)) {
63  pfCandSrc_ = pset.getParameter<edm::InputTag>("pfCandSrc");
65  };
66 
67  ~RecoTauBuilderPlugin() override {}
68 
73  const std::vector<reco::PFRecoTauChargedHadron>&,
74  const std::vector<reco::RecoTauPiZero>&,
75  const std::vector<CandidatePtr>&) const = 0;
76 
79 
83  }
85  reco::VertexRef primaryVertex(const reco::PFTau& tau, bool useJet = false) const {
86  return vertexAssociator_.associatedVertex(tau, useJet);
87  }
88 
89  // Hook called by base class at the beginning of each event. Used to update
90  // handle to PFCandidates
91  void beginEvent() override;
92 
93  private:
95  // Handle to PFCandidates needed to build Refs
99  };
100 
101  /* Class that updates a PFTau's members (i.e. electron variables) */
103  public:
105  : RecoTauEventHolderPlugin(pset) {}
107  // Modify an existing PFTau (i.e. add electron rejection, etc)
108  virtual void operator()(PFTau&) const = 0;
109  void beginEvent() override {}
110  virtual void endEvent() {}
111  };
112 
113  /* Class that returns a double value indicating the quality of a given tau */
115  public:
117  : RecoTauEventHolderPlugin(pset) {}
118  ~RecoTauCleanerPlugin() override {}
119  // Modify an existing PFTau (i.e. add electron rejection, etc)
120  virtual double operator()(const PFTauRef&) const = 0;
121  void beginEvent() override {}
122  };
123  } // namespace tau
124 } // namespace reco
125 
127 
135 
136 #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)