1 #ifndef RecoMET_METProducers_MinMETProducerT_h
2 #define RecoMET_METProducers_MinMETProducerT_h
38 for ( vInputTag::const_iterator src_i =
src_.begin();
39 src_i !=
src_.end(); ++src_i ) {
40 src_token_.push_back( consumes<METCollection>(*src_i) );
42 produces<METCollection>();
53 int numMEtObjects = -1;
56 for (
typename vInputToken::const_iterator src_i =
src_token_.begin();
61 if ( numMEtObjects == -1 ) numMEtObjects = inputMETs->size();
62 else if ( numMEtObjects != (
int)inputMETs->size() )
64 <<
"Mismatch in number of input MET objects !!\n";
67 for (
int iMEtObject = 0; iMEtObject < numMEtObjects; ++iMEtObject ) {
71 for (
typename vInputToken::const_iterator src_i =
src_token_.begin();
76 const T& inputMET = inputMETs->at(iMEtObject);
77 if ( minMET == 0 || inputMET.pt() < minMET->pt() ) minMET = &inputMET;
80 outputMETs->push_back(
T(*minMET));
90 typedef std::vector<edm::EDGetTokenT<METCollection> >
vInputToken;
T getParameter(std::string const &) const
std::vector< edm::InputTag > vInputTag
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MinMETProducerT< reco::PFMET > MinPFMETProducer
std::vector< T > METCollection
std::vector< edm::EDGetTokenT< METCollection > > vInputToken
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void produce(edm::Event &evt, const edm::EventSetup &es) override
MinMETProducerT< reco::CaloMET > MinCaloMETProducer
MinMETProducerT(const edm::ParameterSet &cfg)