CMS 3D CMS Logo

Public Member Functions | Private Attributes

RecoTauPiZeroFlattener Class Reference

Inheritance diagram for RecoTauPiZeroFlattener:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es)
 RecoTauPiZeroFlattener (const edm::ParameterSet &pset)
 ~RecoTauPiZeroFlattener ()

Private Attributes

edm::InputTag jetSrc_
edm::InputTag piZeroSrc_

Detailed Description

Definition at line 28 of file RecoTauPiZeroFlattener.cc.


Constructor & Destructor Documentation

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

Definition at line 38 of file RecoTauPiZeroFlattener.cc.

References edm::ParameterSet::getParameter(), jetSrc_, and piZeroSrc_.

                                                                          {
  jetSrc_ = pset.getParameter<edm::InputTag>("jetSrc");
  piZeroSrc_ = pset.getParameter<edm::InputTag>("piZeroSrc");
  produces<std::vector<reco::RecoTauPiZero> >();
}
RecoTauPiZeroFlattener::~RecoTauPiZeroFlattener ( ) [inline]

Definition at line 31 of file RecoTauPiZeroFlattener.cc.

{}

Member Function Documentation

void RecoTauPiZeroFlattener::produce ( edm::Event evt,
const edm::EventSetup es 
) [virtual]

Implements edm::EDProducer.

Definition at line 45 of file RecoTauPiZeroFlattener.cc.

References edm::Event::getByLabel(), fwrapper::jets, jetSrc_, convertSQLitetoXML_cfg::output, piZeroSrc_, and edm::Event::put().

                                                                      {
  // Get the jet input collection via a view of Candidates
  edm::Handle<reco::CandidateView> jetView;
  evt.getByLabel(jetSrc_, jetView);

  // Convert to a vector of PFJetRefs
  reco::PFJetRefVector jets =
      reco::tau::castView<reco::PFJetRefVector>(jetView);

  // Get the pizero input collection
  edm::Handle<reco::JetPiZeroAssociation> piZeroAssoc;
  evt.getByLabel(piZeroSrc_, piZeroAssoc);

  // Create output collection
  std::auto_ptr<std::vector<reco::RecoTauPiZero> > output(
      new std::vector<reco::RecoTauPiZero>());

  // Loop over the jets and append the pizeros for each jet to our output
  // collection.
  BOOST_FOREACH(reco::PFJetRef jetRef, jets) {
    const std::vector<reco::RecoTauPiZero>& pizeros = (*piZeroAssoc)[jetRef];
    output->reserve(output->size() + pizeros.size());
    output->insert(output->end(), pizeros.begin(), pizeros.end());
  }

  evt.put(output);
}

Member Data Documentation

Definition at line 34 of file RecoTauPiZeroFlattener.cc.

Referenced by produce(), and RecoTauPiZeroFlattener().

Definition at line 35 of file RecoTauPiZeroFlattener.cc.

Referenced by produce(), and RecoTauPiZeroFlattener().