Public Member Functions | |
void | endJob () |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
ZllArbitrator (const edm::ParameterSet &iConfig) | |
virtual | ~ZllArbitrator () |
Private Attributes | |
edm::InputTag | srcZCand_ |
Definition at line 32 of file ZllArbitrator.cc.
ZllArbitrator< T1 >::ZllArbitrator | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 56 of file ZllArbitrator.cc.
: srcZCand_(iConfig.getParameter<edm::InputTag>("ZCandidateCollection")) { produces<std::vector<T1> >(); }
ZllArbitrator< T1 >::~ZllArbitrator | ( | ) | [virtual] |
Definition at line 65 of file ZllArbitrator.cc.
{}
void ZllArbitrator< T1 >::endJob | ( | void | ) | [virtual] |
void ZllArbitrator< T1 >::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 73 of file ZllArbitrator.cc.
References edm::Event::getByLabel(), and edm::Event::put().
{ std::stringstream ss ; std::auto_ptr<std::vector<T1> > TheBestZ(new std::vector<T1 >); edm::Handle< std::vector<T1> > ZCandidatesHandle; iEvent.getByLabel(srcZCand_,ZCandidatesHandle); if( ZCandidatesHandle->size() == 0 ) { iEvent.put(TheBestZ); return ; } double ZmassPDG = 91.18; double DeltaMass = 10000; typename std::vector<T1>::const_iterator ZCandIt ; typename std::vector<T1>::const_iterator bestZCand ; for (ZCandIt = ZCandidatesHandle->begin(); ZCandIt != ZCandidatesHandle->end(); ++ZCandIt) { if( fabs(ZCandIt->mass()-ZmassPDG) < DeltaMass ){ DeltaMass = fabs(ZCandIt->mass()-ZmassPDG) ; bestZCand = ZCandIt; } } TheBestZ->push_back( *bestZCand ); iEvent.put(TheBestZ); }
edm::InputTag ZllArbitrator< T1 >::srcZCand_ [private] |
Definition at line 45 of file ZllArbitrator.cc.