File indexing completed on 2024-04-06 12:12:00
0001 #ifndef FWCore_Framework_stream_EDFilterBase_h
0002 #define FWCore_Framework_stream_EDFilterBase_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "FWCore/Framework/interface/ProducerBase.h"
0025 #include "FWCore/Framework/interface/EDConsumerBase.h"
0026 #include "FWCore/Framework/interface/Frameworkfwd.h"
0027 #include "FWCore/Framework/interface/stream/EDFilterAdaptor.h"
0028 #include "DataFormats/Provenance/interface/ModuleDescription.h"
0029 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0030
0031
0032 namespace edm {
0033
0034 class ProductRegistry;
0035 class ThinnedAssociationsHelper;
0036 class WaitingTaskWithArenaHolder;
0037
0038 namespace stream {
0039 class EDFilterAdaptorBase;
0040 template <typename>
0041 class ProducingModuleAdaptorBase;
0042
0043 class EDFilterBase : public edm::ProducerBase, public edm::EDConsumerBase {
0044
0045 friend class EDFilterAdaptorBase;
0046 friend class ProducingModuleAdaptorBase<EDFilterBase>;
0047
0048 public:
0049 typedef EDFilterAdaptorBase ModuleType;
0050
0051 EDFilterBase();
0052 EDFilterBase(const EDFilterBase&) = delete;
0053 const EDFilterBase& operator=(const EDFilterBase&) = delete;
0054 ~EDFilterBase() override;
0055
0056 static void fillDescriptions(ConfigurationDescriptions& descriptions);
0057 static void prevalidate(ConfigurationDescriptions& descriptions);
0058 static const std::string& baseType();
0059
0060
0061 ModuleDescription const& moduleDescription() const { return *moduleDescriptionPtr_; }
0062
0063 private:
0064 virtual void beginStream(StreamID) {}
0065 virtual void beginRun(edm::Run const&, edm::EventSetup const&) {}
0066 virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) {}
0067 virtual bool filter(Event&, EventSetup const&) = 0;
0068 virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) {}
0069 virtual void endRun(edm::Run const&, edm::EventSetup const&) {}
0070 virtual void endStream() {}
0071
0072 virtual void registerThinnedAssociations(ProductRegistry const&, ThinnedAssociationsHelper&) {}
0073
0074 virtual void doAcquire_(Event const&, EventSetup const&, WaitingTaskWithArenaHolder&) = 0;
0075
0076 void setModuleDescriptionPtr(ModuleDescription const* iDesc) { moduleDescriptionPtr_ = iDesc; }
0077
0078
0079 std::vector<BranchID> previousParentage_;
0080 std::vector<BranchID> gotBranchIDsFromAcquire_;
0081 ParentageID previousParentageId_;
0082 ModuleDescription const* moduleDescriptionPtr_;
0083 };
0084 }
0085 }
0086 #endif