CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecoTauPiZeroTrivialPlugin.cc
Go to the documentation of this file.
1 /*
2  * RecoTauPiZeroTrivialPlugin
3  *
4  * Author: Evan K. Friis (UC Davis)
5  *
6  * Given an input PFJet, produces collection of trivial 'un-merged' PiZero
7  * RecoTauPiZeros. Each PiZero is composed of only one photon from
8  * the jet.
9  *
10  *
11  */
12 
18 
21 
22 #include <boost/foreach.hpp>
23 
24 namespace reco { namespace tau {
25 
27  public:
30  return_type operator()(const reco::PFJet& jet) const override;
31  private:
33 };
34 
36  const edm::ParameterSet& pset, edm::ConsumesCollector &&iC):RecoTauPiZeroBuilderPlugin(pset,std::move(iC)),
37  qcuts_(pset.getParameterSet(
38  "qualityCuts").getParameterSet("signalQualityCuts")) {}
39 
41  const reco::PFJet& jet) const {
42  std::vector<PFCandidatePtr> pfGammaCands = qcuts_.filterCandRefs(pfGammas(jet));
44  output.reserve(pfGammaCands.size());
45 
46  BOOST_FOREACH(const PFCandidatePtr& gamma, pfGammaCands) {
47  std::auto_ptr<RecoTauPiZero> piZero(new RecoTauPiZero(
48  0, (*gamma).p4(), (*gamma).vertex(), 22, 1000, true,
50  piZero->addDaughter(gamma);
51  output.push_back(piZero);
52  }
53  return output.release();
54 }
55 
56 }} // end reco::tau
57 
61  "RecoTauPiZeroTrivialPlugin");
RecoTauPiZeroTrivialPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
Coll filterCandRefs(const Coll &refcoll, bool invert=false) const
Filter a ref vector of PFCandidates.
std::vector< PFCandidatePtr > pfGammas(const PFJet &jet, bool sort=true)
Extract all pfGammas from a PFJet.
ParameterSet const & getParameterSet(ParameterSetID const &id)
Jets made from PFObjects.
Definition: PFJet.h:21
return_type operator()(const reco::PFJet &jet) const override
Build a collection of piZeros from objects in the input jet.
std::auto_ptr< PiZeroVector > return_type
boost::ptr_vector< RecoTauPiZero > PiZeroVector
#define DEFINE_EDM_PLUGIN(factory, type, name)