57 : srcZCand_(consumes<std::vector<T1> >(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.
getByToken(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)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
ZllArbitrator< reco::CompositeCandidate > BestMassZArbitrationProducer
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< std::vector< T1 > > srcZCand_