CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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  * $Id $
31  *
32  */
33 
34 #include <boost/ptr_container/ptr_vector.hpp>
35 
37 
44 
47 
48 #include <vector>
49 
50 namespace reco { namespace tau {
51 
52 /* Class that constructs PFTau(s) from a PFJet and its associated PiZeros */
54  public:
55  typedef boost::ptr_vector<reco::PFTau> output_type;
56  typedef std::auto_ptr<output_type> return_type;
57 
58  explicit RecoTauBuilderPlugin(const edm::ParameterSet& pset):
60  // The vertex association configuration is specified with the
61  // quality cuts.
62  vertexAssociator_(pset.getParameter<edm::ParameterSet>("qualityCuts")) {
63  pfCandSrc_ = pset.getParameter<edm::InputTag>("pfCandSrc");
64  };
65 
66  virtual ~RecoTauBuilderPlugin() {}
67 
72  const std::vector<reco::RecoTauPiZero>& piZeros,
73  const std::vector<PFCandidatePtr>& regionalExtras) const = 0;
74 
77  return pfCands_; };
78 
82  }
83 
84  // Hook called by base class at the beginning of each event. Used to update
85  // handle to PFCandidates
86  virtual void beginEvent();
87 
88  private:
90  // Handle to PFCandidates needed to build Refs
93 
94 };
95 
96 /* Class that updates a PFTau's members (i.e. electron variables) */
98  public:
100  RecoTauEventHolderPlugin(pset){};
102  // Modify an existing PFTau (i.e. add electron rejection, etc)
103  virtual void operator()(PFTau&) const = 0;
104  virtual void beginEvent() {}
105 };
106 
107 /* Class that returns a double value indicating the quality of a given tau */
109  public:
111  RecoTauEventHolderPlugin(pset){};
113  // Modify an existing PFTau (i.e. add electron rejection, etc)
114  virtual double operator()(const PFTauRef&) const = 0;
115  virtual void beginEvent() {}
116 };
117 } } // end namespace reco::tau
118 
126 
127 #endif
T getParameter(std::string const &) const
const edm::Handle< PFCandidateCollection > & getPFCands() const
Hack to be able to convert Ptrs to Refs.
virtual double operator()(const PFTauRef &) const =0
reco::VertexRef associatedVertex(const PFJet &tau) const
edm::Handle< PFCandidateCollection > pfCands_
virtual void operator()(PFTau &) const =0
RecoTauCleanerPlugin(const edm::ParameterSet &pset)
boost::ptr_vector< reco::PFTau > output_type
std::auto_ptr< output_type > return_type
RecoTauModifierPlugin(const edm::ParameterSet &pset)
reco::VertexRef primaryVertex(const reco::PFJetRef &jet) const
Get primary vertex associated to this jet.
virtual return_type operator()(const reco::PFJetRef &jet, const std::vector< reco::RecoTauPiZero > &piZeros, const std::vector< PFCandidatePtr > &regionalExtras) const =0
reco::tau::RecoTauVertexAssociator vertexAssociator_
RecoTauBuilderPlugin(const edm::ParameterSet &pset)