Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
118 changes: 2 additions & 116 deletions FWCore/Framework/interface/EDProducer.h
Original file line number Diff line number Diff line change
@@ -1,121 +1,7 @@
#ifndef FWCore_Framework_EDProducer_h
#define FWCore_Framework_EDProducer_h

/*----------------------------------------------------------------------

EDProducer: The base class of "modules" whose main purpose is to insert new
EDProducts into an Event.


----------------------------------------------------------------------*/

#include "FWCore/Framework/interface/ProducerBase.h"
#include "FWCore/Framework/interface/EDConsumerBase.h"
#include "FWCore/Framework/interface/SharedResourcesAcquirer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "DataFormats/Provenance/interface/ModuleDescription.h"
#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
#include "FWCore/Concurrency/interface/WaitingTaskHolder.h"
#include "FWCore/Utilities/interface/deprecated_macro.h"

#include <string>
#include <vector>

namespace edm {

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

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

/**
* The legacy EDProducer 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 EDProducer : public ProducerBase, public EDConsumerBase {
public:
template <typename T>
friend class maker::ModuleHolderT;
template <typename T>
friend class WorkerT;
typedef EDProducer ModuleType;

CMS_DEPRECATED EDProducer();
~EDProducer() override;

static void fillDescriptions(ConfigurationDescriptions& descriptions);
static void prevalidate(ConfigurationDescriptions& descriptions);
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(EDProducer* module, ProductRegistry* reg) {
registerProducts(module, reg, moduleDescription_);
}

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

SharedResourcesAcquirer& sharedResourcesAcquirer() { return resourceAcquirer_; }

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

virtual void beginRun(Run const& /* iR */, EventSetup const& /* iE */) {}
virtual void endRun(Run const& /* iR */, EventSetup const& /* iE */) {}
virtual void beginLuminosityBlock(LuminosityBlock const& /* iL */, EventSetup const& /* iE */) {}
virtual void endLuminosityBlock(LuminosityBlock const& /* iL */, EventSetup const& /* iE */) {}
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::EDProducer 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.

Loading