CMS 3D CMS Logo

Public Member Functions | Private Attributes

PFTauViewRefSelector Class Reference

Inheritance diagram for PFTauViewRefSelector:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

bool filter (edm::Event &evt, const edm::EventSetup &es)
 PFTauViewRefSelector (const edm::ParameterSet &pset)
 ~PFTauViewRefSelector ()

Private Attributes

std::string cut_
bool filter_
std::auto_ptr
< StringCutObjectSelector
< reco::PFTau > > 
outputSelector_
edm::InputTag src_

Detailed Description

Definition at line 32 of file PFTauViewRefSelector.cc.


Constructor & Destructor Documentation

PFTauViewRefSelector::PFTauViewRefSelector ( const edm::ParameterSet pset) [explicit]

Definition at line 44 of file PFTauViewRefSelector.cc.

References GOODCOLL_filter_cfg::cut, edm::ParameterSet::exists(), filter_, edm::ParameterSet::getParameter(), outputSelector_, and src_.

                                                                      {
  src_ = pset.getParameter<edm::InputTag>("src");
  std::string cut = pset.getParameter<std::string>("cut");
  filter_ = pset.exists("filter") ? pset.getParameter<bool>("filter") : false;
  outputSelector_.reset(new StringCutObjectSelector<reco::PFTau>(cut));
  produces<reco::PFTauRefVector>();
}
PFTauViewRefSelector::~PFTauViewRefSelector ( ) [inline]

Definition at line 35 of file PFTauViewRefSelector.cc.

{}

Member Function Documentation

bool PFTauViewRefSelector::filter ( edm::Event evt,
const edm::EventSetup es 
) [virtual]

Implements edm::EDFilter.

Definition at line 53 of file PFTauViewRefSelector.cc.

References filter_, edm::Event::getByLabel(), LaserDQM_cfg::input, convertSQLitetoXML_cfg::output, outputSelector_, edm::RefVector< C, T, F >::push_back(), edm::Event::put(), src_, and metsig::tau.

                                                                   {
  std::auto_ptr<reco::PFTauRefVector> output(new reco::PFTauRefVector());
  // Get the input collection to clean
  edm::Handle<reco::CandidateView> input;
  evt.getByLabel(src_, input);
  // Cast the input candidates to Refs to real taus
  reco::PFTauRefVector inputRefs =
      reco::tau::castView<reco::PFTauRefVector>(input);

  BOOST_FOREACH(const reco::PFTauRef &tau, inputRefs) {
    if (outputSelector_.get() && (*outputSelector_)(*tau)) {
      output->push_back(tau);
    }
  }
  size_t outputSize = output->size();
  evt.put(output);
  // Filter if desired and no objects passed our cut
  return !(filter_ && outputSize == 0);
}

Member Data Documentation

std::string PFTauViewRefSelector::cut_ [private]

Definition at line 39 of file PFTauViewRefSelector.cc.

Definition at line 41 of file PFTauViewRefSelector.cc.

Referenced by filter(), and PFTauViewRefSelector().

Definition at line 40 of file PFTauViewRefSelector.cc.

Referenced by filter(), and PFTauViewRefSelector().

Definition at line 38 of file PFTauViewRefSelector.cc.

Referenced by filter(), and PFTauViewRefSelector().