00001 #ifndef RecoTauTag_RecoTau_RecoTauPiZeroPlugins_h 00002 #define RecoTauTag_RecoTau_RecoTauPiZeroPlugins_h 00003 00004 /* 00005 * RecoTauPiZeroPlugins 00006 * 00007 * Author: Evan K. Friis (UC Davis) 00008 * 00009 * Base classes for plugins that construct and rank RecoTauPiZero 00010 * objects from a jet. The builder plugin has an abstract function 00011 * that takes a PFJet and returns a list of reconstructed photons in 00012 * the jet. 00013 * 00014 * The quality plugin has an abstract function that takes a reference 00015 * to a RecoTauPiZero and returns a double indicating the quality of 00016 * the candidate. Lower numbers are better. 00017 * 00018 * $Id $ 00019 */ 00020 00021 #include <vector> 00022 #include <boost/ptr_container/ptr_vector.hpp> 00023 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" 00024 #include "RecoTauTag/RecoTau/interface/RecoTauPluginsCommon.h" 00025 00026 namespace reco { 00027 // Forward declarations 00028 class PFJet; 00029 class RecoTauPiZero; 00030 namespace tau { 00031 00032 class RecoTauPiZeroBuilderPlugin : public RecoTauEventHolderPlugin { 00033 public: 00034 // Return a vector of pointers 00035 typedef boost::ptr_vector<RecoTauPiZero> PiZeroVector; 00036 // Storing the result in an auto ptr on function return allows 00037 // allows us to safely release the ptr_vector in the virtual function 00038 typedef std::auto_ptr<PiZeroVector> return_type; 00039 explicit RecoTauPiZeroBuilderPlugin(const edm::ParameterSet& pset): 00040 RecoTauEventHolderPlugin(pset) {} 00041 virtual ~RecoTauPiZeroBuilderPlugin() {} 00043 virtual return_type operator()(const PFJet&) const = 0; 00045 virtual void beginEvent() {}; 00046 }; 00047 00048 class RecoTauPiZeroQualityPlugin : public RecoTauNamedPlugin { 00049 public: 00050 explicit RecoTauPiZeroQualityPlugin(const edm::ParameterSet& pset): 00051 RecoTauNamedPlugin(pset) {} 00052 virtual ~RecoTauPiZeroQualityPlugin() {} 00054 virtual double operator()(const RecoTauPiZero&) const = 0; 00055 }; 00056 }} // end namespace reco::tau 00057 00058 #include "FWCore/PluginManager/interface/PluginFactory.h" 00059 typedef edmplugin::PluginFactory<reco::tau::RecoTauPiZeroQualityPlugin* 00060 (const edm::ParameterSet&)> RecoTauPiZeroQualityPluginFactory; 00061 typedef edmplugin::PluginFactory<reco::tau::RecoTauPiZeroBuilderPlugin* 00062 (const edm::ParameterSet&)> RecoTauPiZeroBuilderPluginFactory; 00063 #endif