CMS 3D CMS Logo

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 
33 #include <boost/ptr_container/ptr_vector.hpp>
34 
38 
46 
49 
50 #include <vector>
51 
52 namespace reco { namespace tau {
53 
54 /* Class that constructs PFTau(s) from a PFJet and its associated PiZeros */
56 {
57  public:
58  typedef boost::ptr_vector<reco::PFTau> output_type;
59  typedef std::auto_ptr<output_type> return_type;
60 
63  // The vertex association configuration is specified with the quality cuts.
64  vertexAssociator_(pset.getParameter<edm::ParameterSet>("qualityCuts"),std::move(iC))
65  {
66  pfCandSrc_ = pset.getParameter<edm::InputTag>("pfCandSrc");
68  };
69 
70  ~RecoTauBuilderPlugin() override {}
71 
75  virtual return_type operator()(
76  const reco::PFJetRef&, const
77  std::vector<reco::PFRecoTauChargedHadron>&,
78  const std::vector<reco::RecoTauPiZero>&,
79  const std::vector<PFCandidatePtr>&) const = 0;
80 
83 
87  reco::VertexRef primaryVertex(const reco::PFTau& tau, bool useJet=false) const { return vertexAssociator_.associatedVertex(tau, useJet); }
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 {
104  public:
107  {}
109  // Modify an existing PFTau (i.e. add electron rejection, etc)
110  virtual void operator()(PFTau&) const = 0;
111  void beginEvent() override {}
112  virtual void endEvent() {}
113 };
114 
115 /* Class that returns a double value indicating the quality of a given tau */
117 {
118  public:
121  {}
122  ~RecoTauCleanerPlugin() override {}
123  // Modify an existing PFTau (i.e. add electron rejection, etc)
124  virtual double operator()(const PFTauRef&) const = 0;
125  void beginEvent() override {}
126 };
127 } } // end namespace reco::tau
128 
130 
134 
135 #endif
T getParameter(std::string const &) const
const edm::Handle< PFCandidateCollection > & getPFCands() const
Hack to be able to convert Ptrs to Refs.
virtual return_type operator()(const reco::PFJetRef &, const std::vector< reco::PFRecoTauChargedHadron > &, const std::vector< reco::RecoTauPiZero > &, const std::vector< PFCandidatePtr > &) const =0
edm::Handle< PFCandidateCollection > pfCands_
reco::VertexRef primaryVertex(const reco::PFTau &tau, bool useJet=false) const
Get primary vertex associated to this tau.
reco::VertexRef associatedVertex(const PFJet &jet) const
boost::ptr_vector< reco::PFTau > output_type
std::auto_ptr< output_type > return_type
edm::EDGetTokenT< PFCandidateCollection > pfCand_token
edmplugin::PluginFactory< reco::tau::RecoTauBuilderPlugin *(const edm::ParameterSet &, edm::ConsumesCollector &&iC)> RecoTauBuilderPluginFactory
reco::VertexRef primaryVertex(const reco::PFJetRef &jet) const
Get primary vertex associated to this jet.
RecoTauCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
edmplugin::PluginFactory< reco::tau::RecoTauModifierPlugin *(const edm::ParameterSet &, edm::ConsumesCollector &&iC)> RecoTauModifierPluginFactory
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
fixed size matrix
HLT enums.
edmplugin::PluginFactory< reco::tau::RecoTauCleanerPlugin *(const edm::ParameterSet &, edm::ConsumesCollector &&iC)> RecoTauCleanerPluginFactory
RecoTauBuilderPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
reco::tau::RecoTauVertexAssociator vertexAssociator_
RecoTauModifierPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
def move(src, dest)
Definition: eostools.py:511