Produces the pat::CompositeCandidate. More...
#include <PhysicsTools/PatAlgos/interface/PATCompositeCandidateProducer.h>
Public Member Functions | |
PATCompositeCandidateProducer (const edm::ParameterSet &iConfig) | |
virtual void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
~PATCompositeCandidateProducer () | |
Private Attributes | |
bool | addEfficiencies_ |
bool | addResolutions_ |
pat::helper::EfficiencyLoader | efficiencyLoader_ |
pat::helper::KinResolutionsLoader | resolutionLoader_ |
edm::InputTag | src_ |
pat::PATUserDataHelper < pat::CompositeCandidate > | userDataHelper_ |
bool | useUserData_ |
Produces the pat::CompositeCandidate.
The PATCompositeCandidateProducer produces the analysis-level pat::CompositeCandidate starting from any collection of Candidates
Definition at line 41 of file PATCompositeCandidateProducer.h.
PATCompositeCandidateProducer::PATCompositeCandidateProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 21 of file PATCompositeCandidateProducer.cc.
References addEfficiencies_, addResolutions_, efficiencyLoader_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), resolutionLoader_, src_, and useUserData_.
: userDataHelper_( iConfig.getParameter<edm::ParameterSet>("userData") ) { // initialize the configurables src_ = iConfig.getParameter<InputTag>( "src" ); useUserData_ = false; if ( iConfig.exists("userData") ) { useUserData_ = true; } // Efficiency configurables addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies"); if (addEfficiencies_) { efficiencyLoader_ = pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies")); } // Resolution configurables addResolutions_ = iConfig.getParameter<bool>("addResolutions"); if (addResolutions_) { resolutionLoader_ = pat::helper::KinResolutionsLoader(iConfig.getParameter<edm::ParameterSet>("resolutions")); } // produces vector of particles produces<vector<pat::CompositeCandidate> >(); }
PATCompositeCandidateProducer::~PATCompositeCandidateProducer | ( | ) |
Definition at line 50 of file PATCompositeCandidateProducer.cc.
{ }
void PATCompositeCandidateProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 53 of file PATCompositeCandidateProducer.cc.
References pat::PATUserDataHelper< ObjectType >::add(), efficiencyLoader_, pat::helper::KinResolutionsLoader::enabled(), pat::helper::EfficiencyLoader::enabled(), edm::Event::getByLabel(), i, edm::HandleBase::isValid(), pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), edm::Event::put(), resolutionLoader_, pat::helper::EfficiencyLoader::setEfficiencies(), pat::helper::KinResolutionsLoader::setResolutions(), src_, userDataHelper_, and useUserData_.
{ // Get the vector of CompositeCandidate's from the event Handle<View<reco::CompositeCandidate> > cands; iEvent.getByLabel(src_, cands); if (efficiencyLoader_.enabled()) efficiencyLoader_.newEvent(iEvent); if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup); auto_ptr<vector<pat::CompositeCandidate> > myCompositeCandidates ( new vector<pat::CompositeCandidate>() ); if ( cands.isValid() ) { View<reco::CompositeCandidate>::const_iterator ibegin = cands->begin(), iend = cands->end(), i = ibegin; for ( ; i != iend; ++i ) { pat::CompositeCandidate cand(*i); if ( useUserData_ ) { userDataHelper_.add( cand, iEvent, iSetup ); } if (efficiencyLoader_.enabled()) efficiencyLoader_.setEfficiencies( cand, cands->refAt(i - cands->begin()) ); if (resolutionLoader_.enabled()) resolutionLoader_.setResolutions(cand); myCompositeCandidates->push_back( cand ); } }// end if the two handles are valid iEvent.put(myCompositeCandidates); }
bool pat::PATCompositeCandidateProducer::addEfficiencies_ [private] |
Definition at line 58 of file PATCompositeCandidateProducer.h.
Referenced by PATCompositeCandidateProducer().
bool pat::PATCompositeCandidateProducer::addResolutions_ [private] |
Definition at line 61 of file PATCompositeCandidateProducer.h.
Referenced by PATCompositeCandidateProducer().
Definition at line 59 of file PATCompositeCandidateProducer.h.
Referenced by PATCompositeCandidateProducer(), and produce().
Definition at line 62 of file PATCompositeCandidateProducer.h.
Referenced by PATCompositeCandidateProducer(), and produce().
Definition at line 53 of file PATCompositeCandidateProducer.h.
Referenced by PATCompositeCandidateProducer(), and produce().
pat::PATUserDataHelper<pat::CompositeCandidate> pat::PATCompositeCandidateProducer::userDataHelper_ [private] |
Definition at line 56 of file PATCompositeCandidateProducer.h.
Referenced by produce().
bool pat::PATCompositeCandidateProducer::useUserData_ [private] |
Definition at line 55 of file PATCompositeCandidateProducer.h.
Referenced by PATCompositeCandidateProducer(), and produce().