1 #ifndef RecoMET_METProducers_MinMETProducerT_h
2 #define RecoMET_METProducers_MinMETProducerT_h
36 for (vInputTag::const_iterator src_i =
src_.begin(); src_i !=
src_.end(); ++src_i) {
37 src_token_.push_back(consumes<METCollection>(*src_i));
39 produces<METCollection>();
45 auto outputMETs = std::make_unique<METCollection>();
48 int numMEtObjects = -1;
51 for (
typename vInputToken::const_iterator src_i =
src_token_.begin(); src_i !=
src_token_.end(); ++src_i) {
55 if (numMEtObjects == -1)
57 else if (numMEtObjects != (
int)
inputMETs->size())
58 throw cms::Exception(
"MinMETProducer::produce") <<
"Mismatch in number of input MET objects !!\n";
61 for (
int iMEtObject = 0; iMEtObject < numMEtObjects; ++iMEtObject) {
62 const T* minMET =
nullptr;
65 for (
typename vInputToken::const_iterator src_i =
src_token_.begin(); src_i !=
src_token_.end(); ++src_i) {
70 if (minMET ==
nullptr || inputMET.pt() < minMET->pt())
74 outputMETs->push_back(
T(*minMET));
84 typedef std::vector<edm::EDGetTokenT<METCollection> >
vInputToken;