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>();
50 auto outputMETs = std::make_unique<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 ) {
68 const T* minMET =
nullptr;
71 for (
typename vInputToken::const_iterator src_i =
src_token_.begin();
76 const T& inputMET = inputMETs->at(iMEtObject);
77 if ( minMET ==
nullptr || 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
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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
~MinMETProducerT() override
void produce(edm::Event &evt, const edm::EventSetup &es) override
MinMETProducerT< reco::CaloMET > MinCaloMETProducer
MinMETProducerT(const edm::ParameterSet &cfg)