57 : srcZCand_(iConfig.getParameter<edm::InputTag>(
"ZCandidateCollection"))
59 produces<std::vector<T1> >();
75 std::stringstream ss ;
77 std::auto_ptr<std::vector<T1> > TheBestZ(
new std::vector<T1 >);
80 iEvent.
getByLabel(srcZCand_,ZCandidatesHandle);
82 if( ZCandidatesHandle->size() == 0 )
88 double ZmassPDG = 91.18;
89 double DeltaMass = 10000;
91 typename std::vector<T1>::const_iterator ZCandIt ;
92 typename std::vector<T1>::const_iterator bestZCand ;
94 for (ZCandIt = ZCandidatesHandle->begin(); ZCandIt != ZCandidatesHandle->end(); ++ZCandIt) {
96 if( fabs(ZCandIt->mass()-ZmassPDG) < DeltaMass ){
97 DeltaMass = fabs(ZCandIt->mass()-ZmassPDG) ;
102 TheBestZ->push_back( *bestZCand );
103 iEvent.
put(TheBestZ);
107 template<
typename T1>
ZllArbitrator(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_MODULE(type)
ZllArbitrator< reco::CompositeCandidate > BestMassZArbitrationProducer
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const