Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-11 03:38:17

0001 #ifndef FWCore_Framework_stream_EDFilter_h
0002 #define FWCore_Framework_stream_EDFilter_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     EDFilter
0007 //
0008 /**\class edm::stream::EDFilter EDFilter.h "FWCore/Framework/interface/stream/EDFilter.h"
0009 
0010  Description: Base class for stream based EDFilters
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Thu, 01 Aug 2013 21:41:42 GMT
0019 //
0020 
0021 #include "FWCore/Framework/interface/Frameworkfwd.h"
0022 #include "FWCore/Framework/interface/stream/AbilityToImplementor.h"
0023 #include "FWCore/Framework/interface/stream/CacheContexts.h"
0024 #include "FWCore/Framework/interface/stream/Contexts.h"
0025 #include "FWCore/Framework/interface/stream/AbilityChecker.h"
0026 #include "FWCore/Framework/interface/stream/EDFilterBase.h"
0027 #include "FWCore/Framework/interface/stream/ProducingModuleHelper.h"
0028 
0029 namespace edm {
0030 
0031   namespace stream {
0032 
0033     template <typename... T>
0034     class EDFilter : public AbilityToImplementor<T>::Type..., public EDFilterBase {
0035     public:
0036       using CacheTypes = CacheContexts<T...>;
0037 
0038       using GlobalCache = typename CacheTypes::GlobalCache;
0039       using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache;
0040       using RunCache = typename CacheTypes::RunCache;
0041       using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache;
0042       using RunContext = RunContextT<RunCache, GlobalCache>;
0043       using LuminosityBlockContext = LuminosityBlockContextT<LuminosityBlockCache, RunCache, GlobalCache>;
0044       using RunSummaryCache = typename CacheTypes::RunSummaryCache;
0045       using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache;
0046 
0047       using HasAbility = AbilityChecker<T...>;
0048 
0049       EDFilter() = default;
0050       EDFilter(const EDFilter&) = delete;
0051       const EDFilter& operator=(const EDFilter&) = delete;
0052 
0053       bool hasAbilityToProduceInBeginProcessBlocks() const final {
0054         return HasAbilityToProduceInBeginProcessBlocks<T...>::value;
0055       }
0056       bool hasAbilityToProduceInEndProcessBlocks() const final {
0057         return HasAbilityToProduceInEndProcessBlocks<T...>::value;
0058       }
0059 
0060       bool hasAbilityToProduceInBeginRuns() const final { return HasAbilityToProduceInBeginRuns<T...>::value; }
0061       bool hasAbilityToProduceInEndRuns() const final { return HasAbilityToProduceInEndRuns<T...>::value; }
0062 
0063       bool hasAbilityToProduceInBeginLumis() const final { return HasAbilityToProduceInBeginLumis<T...>::value; }
0064       bool hasAbilityToProduceInEndLumis() const final { return HasAbilityToProduceInEndLumis<T...>::value; }
0065 
0066     private:
0067       void doAcquire_(Event const& ev, EventSetup const& es, WaitingTaskHolder&& holder) final {
0068         doAcquireIfNeeded(this, ev, es, std::move(holder));
0069       }
0070     };
0071 
0072   }  // namespace stream
0073 }  // namespace edm
0074 
0075 #endif