CMS 3D CMS Logo

Public Member Functions | Private Types | Private Attributes

RecoTauDiscriminatorRefSelectorImpl< T > Class Template Reference

Inheritance diagram for RecoTauDiscriminatorRefSelectorImpl< T >:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Private Types

typedef T::OutputType OutputType

Private Attributes

double cut_
edm::InputTag discriminatorSrc_
bool filter_
edm::InputTag src_

Detailed Description

template<typename T>
class RecoTauDiscriminatorRefSelectorImpl< T >

Definition at line 52 of file PFTauViewRefDiscriminantSelector.cc.


Member Typedef Documentation

template<typename T >
typedef T::OutputType RecoTauDiscriminatorRefSelectorImpl< T >::OutputType [private]

Definition at line 58 of file PFTauViewRefDiscriminantSelector.cc.


Constructor & Destructor Documentation

template<typename T >
RecoTauDiscriminatorRefSelectorImpl< T >::RecoTauDiscriminatorRefSelectorImpl ( const edm::ParameterSet pset) [explicit]

Definition at line 66 of file PFTauViewRefDiscriminantSelector.cc.

References edm::ParameterSet::getParameter().

                                 {
  src_ = pset.getParameter<edm::InputTag>("src");
  discriminatorSrc_ = pset.getParameter<edm::InputTag>("discriminator");
  cut_ = pset.getParameter<double>("cut");
  filter_ = pset.getParameter<bool>("filter");
  //produces<reco::PFTauRefVector>();
  produces<OutputType>();
}

Definition at line 55 of file PFTauViewRefDiscriminantSelector.cc.

{}

Member Function Documentation

template<typename T >
bool RecoTauDiscriminatorRefSelectorImpl< T >::filter ( edm::Event evt,
const edm::EventSetup es 
) [virtual]

Implements edm::EDFilter.

Definition at line 78 of file PFTauViewRefDiscriminantSelector.cc.

References edm::Event::getByLabel(), collect_tpl::input, reco::modules::make(), convertSQLitetoXML_cfg::output, and edm::Event::put().

                                                                    {
  edm::Handle<reco::CandidateView> input;
  evt.getByLabel(src_, input);
  reco::PFTauRefVector inputRefs =
      reco::tau::castView<reco::PFTauRefVector>(input);

  edm::Handle<reco::PFTauDiscriminator> disc;
  evt.getByLabel(discriminatorSrc_, disc);

//  std::auto_ptr<reco::PFTauRefVector> output(
//      new reco::PFTauRefVector(inputRefs.id()));
  //std::auto_ptr<OutputType> output(
  //    new OutputType(inputRefs.id()));
  std::auto_ptr<OutputType> output(new OutputType);

  BOOST_FOREACH(reco::PFTauRef ref, inputRefs) {
    if ( (*disc)[ref] > cut_ )
      output->push_back(T::make(ref));
  }
  size_t selected = output->size();
  evt.put(output);
  return (!filter_ || selected);
}

Member Data Documentation

template<typename T >
double RecoTauDiscriminatorRefSelectorImpl< T >::cut_ [private]

Definition at line 61 of file PFTauViewRefDiscriminantSelector.cc.

Definition at line 60 of file PFTauViewRefDiscriminantSelector.cc.

template<typename T >
bool RecoTauDiscriminatorRefSelectorImpl< T >::filter_ [private]

Definition at line 62 of file PFTauViewRefDiscriminantSelector.cc.

template<typename T >
edm::InputTag RecoTauDiscriminatorRefSelectorImpl< T >::src_ [private]

Definition at line 59 of file PFTauViewRefDiscriminantSelector.cc.