Functions | |
template<class T> | |
void | fetchCollection (T &c, const edm::InputTag &tag, const edm::Event &iEvent) |
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 }