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  *
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  virtual ~RecoTauBuilderPlugin() {}
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 
86 
87  // Hook called by base class at the beginning of each event. Used to update
88  // handle to PFCandidates
89  virtual void beginEvent();
90 
91  private:
93  // Handle to PFCandidates needed to build Refs
97 };
98 
99 /* Class that updates a PFTau's members (i.e. electron variables) */
101 {
102  public:
105  {}
107  // Modify an existing PFTau (i.e. add electron rejection, etc)
108  virtual void operator()(PFTau&) const = 0;
109  virtual void beginEvent() {}
110  virtual void endEvent() {}
111 };
112 
113 /* Class that returns a double value indicating the quality of a given tau */
115 {
116  public:
119  {}
121  // Modify an existing PFTau (i.e. add electron rejection, etc)
122  virtual double operator()(const PFTauRef&) const = 0;
123  virtual void beginEvent() {}
124 };
125 } } // end namespace reco::tau
126 
128 
132 
133 #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
edm::Handle< PFCandidateCollection > pfCands_
virtual void operator()(PFTau &) const =0
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.
virtual return_type operator()(const reco::PFJetRef &, const std::vector< reco::PFRecoTauChargedHadron > &, const std::vector< reco::RecoTauPiZero > &, const std::vector< PFCandidatePtr > &) const =0
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
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)