36 remainingEvents_(maxEvents_),
38 hasNewlyDroppedBranch_(),
40 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
43 wantAllEvents_(
false),
45 selector_config_id_(),
46 droppedBranchIDToKeptBranchID_(),
89 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
90 std::vector<BranchDescription const*> associationDescriptions;
91 std::set<BranchID> keptProductsInEvent;
101 associationDescriptions.push_back(&desc);
103 keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
115 for(
auto association : associationDescriptions) {
117 keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
130 std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
131 std::set<BranchID>& keptProductsInEvent) {
134 trueBranchIDToKeptBranchDesc);
142 keptProductsInEvent.insert(desc.
branchID());
180 bool seenFirst =
false;
227 FDEBUG(2) <<
"writeEvent called\n";
230 std::lock_guard<std::mutex> guard(
mutex_);
264 FDEBUG(2) <<
"beginRun called\n";
273 FDEBUG(2) <<
"endRun called\n";
281 FDEBUG(2) <<
"writeRun called\n";
289 FDEBUG(2) <<
"beginLuminosityBlock called\n";
298 FDEBUG(2) <<
"endLuminosityBlock called\n";
305 FDEBUG(2) <<
"writeLuminosityBlock called\n";
355 branchID = iter->second;
359 return branchIDLists_.get();
405 bool anyProductProduced) {
408 outputModulePathPositions,
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
void setConsumer(EDConsumerBase const *iConsumer)
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
bool selected(BranchDescription const &desc) const
static void fillDescription(ParameterSetDescription &desc, char const *parameterName)
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
virtual void writeLuminosityBlock(LuminosityBlockPrincipal const &, ModuleCallingContext const *)=0
ParameterSet selectEvents_
virtual void write(EventPrincipal const &e, ModuleCallingContext const *)=0
static void fillDroppedToKept(ProductRegistry const &preg, std::map< BranchID, BranchDescription const * > const &trueBranchIDToKeptBranchDesc, std::map< BranchID::value_type, BranchID::value_type > &droppedBranchIDToKeptBranchID_)
ModuleDescription moduleDescription_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::map< BranchID, bool > keepAssociation_
ParameterSetID id() const
BranchIDLists const * branchIDLists()
ParameterSet const & getParameterSet(ParameterSetID const &id)
void doPreallocate(PreallocationConfiguration const &)
SharedResourcesAcquirer resourceAcquirer_
virtual void reallyCloseFile()
SharedResourcesAcquirer createAcquirer(std::vector< std::string > const &) const
bool prePrefetchSelection(StreamID id, EventPrincipal const &, ModuleCallingContext const *)
virtual void reallyOpenFile()
static const std::string & baseType()
void doWriteLuminosityBlock(LuminosityBlockPrincipal const &lbp, ModuleCallingContext const *mcc)
std::string const & processName() const
void doOpenFile(FileBlock const &fb)
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
bool selected(BranchDescription const &desc) const
BranchIDLists const * origBranchIDLists_
void doCloseFile()
Tell the OutputModule that is must end the current file.
BranchIDLists const * branchIDLists_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
virtual void endLuminosityBlock(LuminosityBlockPrincipal const &, ModuleCallingContext const *)
ProductList const & productList() const
void setEventSelectionInfo(std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
void selectAssociationProducts(std::vector< BranchDescription const * > const &associationDescriptions, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const
std::string process_name_
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
std::string const & moduleLabel() const
std::string const & productInstanceName() const
void doWriteRun(RunPrincipal const &rp, ModuleCallingContext const *mcc)
virtual void beginLuminosityBlock(LuminosityBlockPrincipal const &, ModuleCallingContext const *)
static SharedResourcesRegistry * instance()
bool doEvent(EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *act, ModuleCallingContext const *mcc)
TypeID unwrappedTypeID() const
void doPreForkReleaseResources()
std::unique_ptr< BranchIDLists > branchIDLists_
std::vector< BranchDescription const * > allBranchDescriptions() const
BranchID const & branchID() const
TypeWithDict const & unwrappedType() const
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *mcc)
static void fillDescription(ParameterSetDescription &desc)
virtual bool isFileOpen() const
void doRespondToCloseInputFile(FileBlock const &fb)
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *mcc)
std::unique_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper_
void convert_handle(BasicHandle &&bh, Handle< T > &result)
virtual void postForkReacquireResources(unsigned int, unsigned int)
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &)
static void prevalidate(ConfigurationDescriptions &)
void registerSharedResource(const std::string &)
A resource name must be registered before it can be used in the createAcquirer call.
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
static const std::string kLegacyModuleResourceName
All legacy modules share this resource.
virtual void beginRun(RunPrincipal const &, ModuleCallingContext const *)
virtual void respondToOpenInputFile(FileBlock const &)
static void fillDescription(ParameterSetDescription &desc)
bool doEndRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)
static const std::string kBaseType("EDAnalyzer")
std::vector< BranchID::value_type > BranchIDList
std::vector< detail::TriggerResultsBasedEventSelector > selectors_
SelectedProductsForBranchType keptProducts_
ProductSelector productSelector_
std::vector< std::string > const & getAllTriggerNames()
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
unsigned int numberOfStreams() const
ProductSelectorRules productSelectorRules_
Trig getTriggerResults(EDGetTokenT< TriggerResults > const &token, EventPrincipal const &ep, ModuleCallingContext const *) const
BranchID const & originalBranchID() const
void doRespondToOpenInputFile(FileBlock const &fb)
virtual void respondToCloseInputFile(FileBlock const &)
volatile std::atomic< bool > shutdown_flag false
bool doBeginRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)
ParameterSetID registerProperSelectionInfo(edm::ParameterSet const &iInitial, std::string const &iLabel, std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
void configure(OutputModuleDescription const &desc)
virtual void openFile(FileBlock const &)
std::atomic< int > remainingEvents_
virtual void writeRun(RunPrincipal const &, ModuleCallingContext const *)=0
virtual void endRun(RunPrincipal const &, ModuleCallingContext const *)
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector)
ParameterSet const & registerIt()
ModuleDescription const & description() const
virtual void preForkReleaseResources()
OutputModule(ParameterSet const &pset)
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
ParameterSetID selector_config_id_