CMS 3D CMS Logo

pat::PATCompositeCandidateProducer Class Reference

Produces the pat::CompositeCandidate. More...

#include <PhysicsTools/PatAlgos/interface/PATCompositeCandidateProducer.h>

Inheritance diagram for pat::PATCompositeCandidateProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 PATCompositeCandidateProducer (const edm::ParameterSet &iConfig)
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 ~PATCompositeCandidateProducer ()

Private Attributes

edm::InputTag src_
pat::PATUserDataHelper
< pat::CompositeCandidate
userDataHelper_
bool useUserData_


Detailed Description

Produces the pat::CompositeCandidate.

The PATCompositeCandidateProducer produces the analysis-level pat::CompositeCandidate starting from any collection of Candidates

Author:
Salvatore Rappoccio
Version:
Id
PATCompositeCandidateProducer.h,v 1.1 2008/12/02 03:36:03 srappocc Exp

Definition at line 40 of file PATCompositeCandidateProducer.h.


Constructor & Destructor Documentation

PATCompositeCandidateProducer::PATCompositeCandidateProducer ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 21 of file PATCompositeCandidateProducer.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), src_, and useUserData_.

00021                                                                                          :
00022   userDataHelper_( iConfig.getParameter<edm::ParameterSet>("userData") )
00023 {
00024   // initialize the configurables
00025   src_ = iConfig.getParameter<InputTag>( "src" );
00026 
00027   useUserData_ = false;
00028   if ( iConfig.exists("userData") ) {
00029     useUserData_ = true;
00030   }
00031 
00032   // produces vector of particles
00033   produces<vector<pat::CompositeCandidate> >();
00034 
00035 }

PATCompositeCandidateProducer::~PATCompositeCandidateProducer (  ) 

Definition at line 37 of file PATCompositeCandidateProducer.cc.

00037                                                               {
00038 }


Member Function Documentation

void PATCompositeCandidateProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 40 of file PATCompositeCandidateProducer.cc.

References pat::PATUserDataHelper< ObjectType >::add(), edm::Event::getByLabel(), i, edm::Handle< T >::isValid(), edm::Event::put(), src_, userDataHelper_, and useUserData_.

00040                                                                                      {
00041   // Get the vector of CompositeCandidate's from the event
00042   Handle<View<reco::CompositeCandidate> > cands;
00043   iEvent.getByLabel(src_, cands);
00044 
00045   auto_ptr<vector<pat::CompositeCandidate> > myCompositeCandidates ( new vector<pat::CompositeCandidate>() );
00046 
00047   if ( cands.isValid() ) {
00048 
00049     View<reco::CompositeCandidate>::const_iterator ibegin = cands->begin(),
00050       iend = cands->end(), i = ibegin;
00051     for ( ; i != iend; ++i ) {
00052 
00053       pat::CompositeCandidate cand(*i);
00054       
00055       if ( useUserData_ ) {
00056         userDataHelper_.add( cand, iEvent, iSetup );
00057       }
00058 
00059       myCompositeCandidates->push_back( cand );
00060     }
00061 
00062   }// end if the two handles are valid
00063 
00064   iEvent.put(myCompositeCandidates);
00065 
00066 }


Member Data Documentation

edm::InputTag pat::PATCompositeCandidateProducer::src_ [private]

Definition at line 52 of file PATCompositeCandidateProducer.h.

Referenced by PATCompositeCandidateProducer(), and produce().

pat::PATUserDataHelper<pat::CompositeCandidate> pat::PATCompositeCandidateProducer::userDataHelper_ [private]

Definition at line 55 of file PATCompositeCandidateProducer.h.

Referenced by produce().

bool pat::PATCompositeCandidateProducer::useUserData_ [private]

Definition at line 54 of file PATCompositeCandidateProducer.h.

Referenced by PATCompositeCandidateProducer(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:49:42 2009 for CMSSW by  doxygen 1.5.4