Skip to content

Commit

Permalink
Removed use of edm::EDFilter
Browse files Browse the repository at this point in the history
This finished the migration away from the deprecated class.
  • Loading branch information
Dr15Jones committed Oct 12, 2022
1 parent 018b8bc commit c529675
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 271 deletions.
123 changes: 2 additions & 121 deletions FWCore/Framework/interface/EDFilter.h
Original file line number Diff line number Diff line change
@@ -1,126 +1,7 @@
#ifndef FWCore_Framework_EDFilter_h
#define FWCore_Framework_EDFilter_h

/*----------------------------------------------------------------------
EDFilter: The base class of all "modules" used to control the flow of
processing in a processing path.
Filters can also insert products into the event.
These products should be informational products about the filter decision.
----------------------------------------------------------------------*/

#include "FWCore/Framework/interface/ProducerBase.h"
#include "FWCore/Framework/interface/EDConsumerBase.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/SharedResourcesAcquirer.h"

#include "FWCore/Concurrency/interface/WaitingTaskHolder.h"
#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
#include "DataFormats/Provenance/interface/ModuleDescription.h"
#include "FWCore/Utilities/interface/deprecated_macro.h"

#include <string>
#include <vector>
#include <array>

namespace edm {
namespace maker {
template <typename T>
class ModuleHolderT;
}

class ModuleCallingContext;
class PreallocationConfiguration;
class ActivityRegistry;
class ThinnedAssociationsHelper;

/**
* The legacy EDFilter class is deprecated. We annotate the
* constructor only with the CMS_DEPRECATED, because with gcc it
* turns out to flag deriving classes more reliably than annotating
* the entire class.
*/
class EDFilter : public ProducerBase, public EDConsumerBase {
public:
template <typename T>
friend class maker::ModuleHolderT;
template <typename T>
friend class WorkerT;
typedef EDFilter ModuleType;

CMS_DEPRECATED EDFilter();
~EDFilter() override;

static void fillDescriptions(ConfigurationDescriptions& descriptions);
static void prevalidate(ConfigurationDescriptions&);

static const std::string& baseType();

// Warning: the returned moduleDescription will be invalid during construction
ModuleDescription const& moduleDescription() const { return moduleDescription_; }

static bool wantsProcessBlocks() { return false; }
static bool wantsInputProcessBlocks() { return false; }
static bool wantsGlobalRuns() { return true; }
static bool wantsGlobalLuminosityBlocks() { return true; }
static bool wantsStreamRuns() { return false; }
static bool wantsStreamLuminosityBlocks() { return false; };

SerialTaskQueue* globalRunsQueue() { return &runQueue_; }
SerialTaskQueue* globalLuminosityBlocksQueue() { return &luminosityBlockQueue_; }

private:
bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*);
//Needed by WorkerT but not supported
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, Principal const&) const {}

void doPreallocate(PreallocationConfiguration const&) {}
void doBeginJob();
void doEndJob();
void doBeginProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) {}
void doAccessInputProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) {}
void doEndProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) {}
void doBeginRun(RunTransitionInfo const&, ModuleCallingContext const*);
void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
void doBeginLuminosityBlock(LumiTransitionInfo const&, ModuleCallingContext const*);
void doEndLuminosityBlock(LumiTransitionInfo const&, ModuleCallingContext const*);
void doRespondToOpenInputFile(FileBlock const& fb);
void doRespondToCloseInputFile(FileBlock const& fb);
void doRespondToCloseOutputFile() {}
void doRegisterThinnedAssociations(ProductRegistry const&, ThinnedAssociationsHelper&) {}

void registerProductsAndCallbacks(EDFilter* module, ProductRegistry* reg) {
registerProducts(module, reg, moduleDescription_);
}

std::string workerType() const { return "WorkerT<EDFilter>"; }

SharedResourcesAcquirer& sharedResourcesAcquirer() { return resourceAcquirer_; }

virtual bool filter(Event&, EventSetup const&) = 0;
virtual void beginJob() {}
virtual void endJob() {}

virtual void beginRun(Run const&, EventSetup const&) {}
virtual void endRun(Run const&, EventSetup const&) {}
virtual void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&) {}
virtual void endLuminosityBlock(LuminosityBlock const&, EventSetup const&) {}
virtual void respondToOpenInputFile(FileBlock const&) {}
virtual void respondToCloseInputFile(FileBlock const&) {}

bool hasAcquire() const { return false; }
bool hasAccumulator() const { return false; }

void setModuleDescription(ModuleDescription const& md) { moduleDescription_ = md; }
ModuleDescription moduleDescription_;
std::vector<BranchID> previousParentage_;
SharedResourcesAcquirer resourceAcquirer_;
SerialTaskQueue runQueue_;
SerialTaskQueue luminosityBlockQueue_;
ParentageID previousParentageId_;
};
} // namespace edm
#error \
"The use of edm::EDFilter has been removed. Please stop use of this header and switch module to a thread-friendly type."

#endif
1 change: 0 additions & 1 deletion FWCore/Framework/interface/Frameworkfwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace edm {
class ConsumesCollector;
class DelayedReader;
class EDAnalyzer;
class EDFilter;
class EDLooper;
class EDProducer;
class Event;
Expand Down
1 change: 0 additions & 1 deletion FWCore/Framework/interface/ProducerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace edm {
class Run;

class EDProducer;
class EDFilter;
namespace one {
class EDProducerBase;
class EDFilterBase;
Expand Down
120 changes: 0 additions & 120 deletions FWCore/Framework/src/EDFilter.cc

This file was deleted.

26 changes: 0 additions & 26 deletions FWCore/Framework/src/WorkerT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "FWCore/Framework/interface/EventPrincipal.h"

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/EDFilter.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDProducerBase.h"
#include "FWCore/Framework/interface/one/EDFilterBase.h"
Expand Down Expand Up @@ -172,14 +171,6 @@ namespace edm {
return module_->globalLuminosityBlocksQueue();
}
template <>
SerialTaskQueue* WorkerT<EDFilter>::globalRunsQueue() {
return module_->globalRunsQueue();
}
template <>
SerialTaskQueue* WorkerT<EDFilter>::globalLuminosityBlocksQueue() {
return module_->globalLuminosityBlocksQueue();
}
template <>
SerialTaskQueue* WorkerT<EDAnalyzer>::globalRunsQueue() {
return module_->globalRunsQueue();
}
Expand Down Expand Up @@ -653,10 +644,6 @@ namespace edm {
return &(module_->sharedResourcesAcquirer().serialQueueChain());
}
template <>
Worker::TaskQueueAdaptor WorkerT<EDFilter>::serializeRunModule() {
return &(module_->sharedResourcesAcquirer().serialQueueChain());
}
template <>
Worker::TaskQueueAdaptor WorkerT<EDProducer>::serializeRunModule() {
return &(module_->sharedResourcesAcquirer().serialQueueChain());
}
Expand Down Expand Up @@ -705,10 +692,6 @@ namespace edm {
bool mustPrefetchMayGet<EDProducer>() {
return true;
}
template <>
bool mustPrefetchMayGet<EDFilter>() {
return true;
}

template <>
bool mustPrefetchMayGet<edm::one::EDProducerBase>() {
Expand Down Expand Up @@ -841,10 +824,6 @@ namespace edm {
return Worker::kProducer;
}
template <>
Worker::Types WorkerT<EDFilter>::moduleType() const {
return Worker::kFilter;
}
template <>
Worker::Types WorkerT<edm::one::EDProducerBase>::moduleType() const {
return Worker::kProducer;
}
Expand Down Expand Up @@ -917,10 +896,6 @@ namespace edm {
return Worker::kLegacy;
}
template <>
Worker::ConcurrencyTypes WorkerT<EDFilter>::moduleConcurrencyType() const {
return Worker::kLegacy;
}
template <>
Worker::ConcurrencyTypes WorkerT<edm::one::EDProducerBase>::moduleConcurrencyType() const {
return Worker::kOne;
}
Expand Down Expand Up @@ -987,7 +962,6 @@ namespace edm {
//Explicitly instantiate our needed templates to avoid having the compiler
// instantiate them in all of our libraries
template class WorkerT<EDProducer>;
template class WorkerT<EDFilter>;
template class WorkerT<EDAnalyzer>;
template class WorkerT<one::EDProducerBase>;
template class WorkerT<one::EDFilterBase>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ and query the component for its allowed ParameterSetDescription.

namespace edm {
class EDProducer;
class EDFilter;
class EDAnalyzer;

namespace one {
Expand Down Expand Up @@ -106,7 +105,6 @@ namespace edm {

static const std::string& extendedBaseType(EDAnalyzer const*) { return kExtendedBaseForEDAnalyzer; }
static const std::string& extendedBaseType(EDProducer const*) { return kExtendedBaseForEDProducer; }
static const std::string& extendedBaseType(EDFilter const*) { return kExtendedBaseForEDFilter; }
static const std::string& extendedBaseType(one::EDAnalyzerBase const*) { return kExtendedBaseForOneEDAnalyzer; }
static const std::string& extendedBaseType(one::EDProducerBase const*) { return kExtendedBaseForOneEDProducer; }
static const std::string& extendedBaseType(one::EDFilterBase const*) { return kExtendedBaseForOneEDFilter; }
Expand Down

0 comments on commit c529675

Please sign in to comment.