File indexing completed on 2025-01-31 02:19:21
0001 #ifndef FWCore_Framework_InputTagMatch_h
0002 #define FWCore_Framework_InputTagMatch_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "FWCore/Utilities/interface/InputTag.h"
0014 #include "DataFormats/Provenance/interface/ProductDescription.h"
0015
0016 #include <string>
0017
0018 namespace edm {
0019
0020 class InputTagMatch {
0021 public:
0022 InputTagMatch(edm::InputTag const& inputTag) : inputTag_(inputTag) {}
0023
0024 bool operator()(edm::ProductDescription const& productDescription) {
0025 bool result(true);
0026 bool match(false);
0027 if (!inputTag_.label().empty()) {
0028 match = true;
0029 result = (result && productDescription.moduleLabel() == inputTag_.label());
0030 }
0031 if (!inputTag_.instance().empty()) {
0032 match = true;
0033 result = (result && productDescription.productInstanceName() == inputTag_.instance());
0034 }
0035 if (!inputTag_.process().empty()) {
0036 match = true;
0037 result = (result && productDescription.processName() == inputTag_.process());
0038 }
0039 if (match)
0040 return result;
0041 return false;
0042 }
0043
0044 private:
0045 edm::InputTag inputTag_;
0046 };
0047 }
0048 #endif