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 {
53  namespace tau {
54 
55  /* Class that constructs PFTau(s) from a Jet and its associated PiZeros */
57  public:
58  typedef boost::ptr_vector<reco::PFTau> output_type;
59  typedef std::unique_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  pfCandSrc_ = pset.getParameter<edm::InputTag>("pfCandSrc");
67  };
68 
69  ~RecoTauBuilderPlugin() override {}
70 
75  const std::vector<reco::PFRecoTauChargedHadron>&,
76  const std::vector<reco::RecoTauPiZero>&,
77  const std::vector<CandidatePtr>&) const = 0;
78 
81 
85  }
87  reco::VertexRef primaryVertex(const reco::PFTau& tau, bool useJet = false) const {
88  return vertexAssociator_.associatedVertex(tau, useJet);
89  }
90 
91  // Hook called by base class at the beginning of each event. Used to update
92  // handle to PFCandidates
93  void beginEvent() override;
94 
95  private:
97  // Handle to PFCandidates needed to build Refs
101  };
102 
103  /* Class that updates a PFTau's members (i.e. electron variables) */
105  public:
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  public:
120  ~RecoTauCleanerPlugin() override {}
121  // Modify an existing PFTau (i.e. add electron rejection, etc)
122  virtual double operator()(const PFTauRef&) const = 0;
123  void beginEvent() override {}
124  };
125  } // namespace tau
126 } // namespace reco
127 
129 
137 
138 #endif
PluginFactory.h
Handle.h
reco::tau::RecoTauBuilderPlugin::operator()
virtual return_type operator()(const reco::JetBaseRef &, const std::vector< reco::PFRecoTauChargedHadron > &, const std::vector< reco::RecoTauPiZero > &, const std::vector< CandidatePtr > &) const =0
EDProducer.h
metsig::tau
Definition: SignAlgoResolutions.h:49
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
reco::tau::RecoTauBuilderPlugin::return_type
std::unique_ptr< output_type > return_type
Definition: RecoTauBuilderPlugins.h:59
reco::tau::RecoTauBuilderPlugin::getPFCands
const edm::Handle< edm::View< reco::Candidate > > & getPFCands() const
Hack to be able to convert Ptrs to Refs.
Definition: RecoTauBuilderPlugins.h:80
reco::tau::RecoTauModifierPlugin::beginEvent
void beginEvent() override
Definition: RecoTauBuilderPlugins.h:111
reco::tau::RecoTauBuilderPlugin
Definition: RecoTauBuilderPlugins.h:56
reco::PFTau
Definition: PFTau.h:36
reco::tau::RecoTauBuilderPlugin::pfCand_token
edm::EDGetTokenT< edm::View< reco::Candidate > > pfCand_token
Definition: RecoTauBuilderPlugins.h:100
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::tau::RecoTauBuilderPlugin::~RecoTauBuilderPlugin
~RecoTauBuilderPlugin() override
Definition: RecoTauBuilderPlugins.h:69
edm::Handle
Definition: AssociativeIterator.h:50
RecoTauPiZero.h
RecoTauVertexAssociator.h
edm::Ref< VertexCollection >
RecoTauPluginsCommon.h
reco::tau::RecoTauVertexAssociator
Definition: RecoTauVertexAssociator.h:50
reco::tau::RecoTauModifierPlugin::RecoTauModifierPlugin
RecoTauModifierPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
Definition: RecoTauBuilderPlugins.h:106
reco::tau::RecoTauBuilderPlugin::output_type
boost::ptr_vector< reco::PFTau > output_type
Definition: RecoTauBuilderPlugins.h:58
EventID.h
reco::tau::RecoTauModifierPlugin::~RecoTauModifierPlugin
~RecoTauModifierPlugin() override
Definition: RecoTauBuilderPlugins.h:108
reco::tau::RecoTauEventHolderPlugin
Definition: RecoTauPluginsCommon.h:41
JetCollection.h
reco::tau::RecoTauModifierPlugin::endEvent
virtual void endEvent()
Definition: RecoTauBuilderPlugins.h:112
edm::View
Definition: CaloClusterFwd.h:14
reco::tau::RecoTauVertexAssociator::associatedVertex
reco::VertexRef associatedVertex(const Jet &jet) const
Definition: RecoTauVertexAssociator.cc:377
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
edmplugin::PluginFactory
Definition: PluginFactory.h:34
reco::tau::RecoTauBuilderPlugin::primaryVertex
reco::VertexRef primaryVertex(const reco::JetBaseRef &jet) const
Get primary vertex associated to this jet.
Definition: RecoTauBuilderPlugins.h:83
reco::tau::RecoTauBuilderPlugin::beginEvent
void beginEvent() override
Definition: RecoTauBuilderPlugins.cc:10
reco::tau::RecoTauCleanerPlugin::RecoTauCleanerPlugin
RecoTauCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
Definition: RecoTauBuilderPlugins.h:118
reco::tau::RecoTauBuilderPlugin::vertexAssociator_
reco::tau::RecoTauVertexAssociator vertexAssociator_
Definition: RecoTauBuilderPlugins.h:99
VertexFwd.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
reco::tau::RecoTauBuilderPlugin::primaryVertex
reco::VertexRef primaryVertex(const reco::PFTau &tau, bool useJet=false) const
Get primary vertex associated to this tau.
Definition: RecoTauBuilderPlugins.h:87
reco::tau::RecoTauModifierPlugin
Definition: RecoTauBuilderPlugins.h:104
metsig::jet
Definition: SignAlgoResolutions.h:47
PFTau.h
edm::RefToBase< Jet >
reco::tau::RecoTauCleanerPlugin
Definition: RecoTauBuilderPlugins.h:116
PFRecoTauChargedHadron.h
reco::tau::RecoTauBuilderPlugin::RecoTauBuilderPlugin
RecoTauBuilderPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
Definition: RecoTauBuilderPlugins.h:61
ConsumesCollector.h
ParameterSet.h
reco::tau::RecoTauModifierPlugin::operator()
virtual void operator()(PFTau &) const =0
reco::tau::RecoTauCleanerPlugin::beginEvent
void beginEvent() override
Definition: RecoTauBuilderPlugins.h:123
reco::tau::RecoTauBuilderPlugin::pfCandSrc_
edm::InputTag pfCandSrc_
Definition: RecoTauBuilderPlugins.h:96
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
reco::tau::RecoTauBuilderPlugin::pfCands_
edm::Handle< edm::View< reco::Candidate > > pfCands_
Definition: RecoTauBuilderPlugins.h:98
reco::tau::RecoTauCleanerPlugin::~RecoTauCleanerPlugin
~RecoTauCleanerPlugin() override
Definition: RecoTauBuilderPlugins.h:120
reco::tau::RecoTauCleanerPlugin::operator()
virtual double operator()(const PFTauRef &) const =0