CMS 3D CMS Logo

pfpat Namespace Reference


Functions

template<class T>
void fetchCollection (T &c, const edm::InputTag &tag, const edm::Event &iEvent)


Function Documentation

template<class T>
void pfpat::fetchCollection ( T &  c,
const edm::InputTag tag,
const edm::Event iEvent 
) [inline]

Definition at line 10 of file FetchCollection.h.

References empty, lat::endl(), err, Exception, and edm::Event::getByLabel().

Referenced by PFTopProjector::produce(), PFIsolation::produce(), and PFPileUp::produce().

00012                                              {
00013   
00014   edm::InputTag empty;
00015   if( tag==empty ) return;
00016   
00017   bool found = iEvent.getByLabel(tag, c);
00018   
00019   if(!found ) {
00020     std::ostringstream  err;
00021     err<<" cannot get collection: "
00022        <<tag<<std::endl;
00023     edm::LogError("PFPAT")<<err.str();
00024     throw cms::Exception( "MissingProduct", err.str());
00025   }
00026   
00027 }


Generated on Tue Jun 9 18:49:59 2009 for CMSSW by  doxygen 1.5.4