47 remainingEvents_(maxEvents_),
49 hasNewlyDroppedBranch_(),
51 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
54 wantAllEvents_(
false),
56 selector_config_id_(),
57 droppedBranchIDToKeptBranchID_(),
95 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
96 std::vector<BranchDescription const*> associationDescriptions;
97 std::set<BranchID> keptProductsInEvent;
98 std::set<std::string> processesWithSelectedMergeableRunProducts;
108 associationDescriptions.push_back(&desc);
110 keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
140 std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
141 std::set<BranchID>& keptProductsInEvent) {
146 std::vector<std::string> missingDictionaries;
148 std::string context(
"Calling OutputModuleBase::keepThisBranch, checking dictionaries for kept types");
157 keptProductsInEvent.insert(desc.
branchID());
185 std::vector<std::shared_ptr<SerialTaskQueue>>(1, std::make_shared<SerialTaskQueue>())};
194 bool seenFirst =
false;
216 std::vector<ProductResolverIndexAndSkipBit> returnValue;
218 auto const n =
s.numberOfTokens();
219 returnValue.reserve(
n);
221 for (
unsigned int i = 0;
i <
n; ++
i) {
235 return s.wantEvent(e);
324 std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter =
327 branchID = iter->second;
331 return branchIDLists_.get();
361 std::map<
std::string, std::vector<std::pair<std::string, int>>>
const& outputModulePathPositions,
362 bool anyProductProduced) {
365 outputModulePathPositions,
static const std::string kBaseType("EDAnalyzer")
bool selected(BranchDescription const &desc) const
ModuleDescription const & description() const
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
void throwMissingDictionariesException(std::vector< std::string > &missingDictionaries, std::string const &context)
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
static void fillDroppedToKept(ProductRegistry const &preg, std::map< BranchID, BranchDescription const * > const &trueBranchIDToKeptBranchDesc, std::map< BranchID::value_type, BranchID::value_type > &droppedBranchIDToKeptBranchID_)
SelectedProductsForBranchType keptProducts_
void doWriteLuminosityBlock(LuminosityBlockPrincipal const &lbp, ModuleCallingContext const *)
ModuleDescription moduleDescription_
static void prevalidate(ConfigurationDescriptions &)
ParameterSet selectEvents_
bool needToRunSelection() const
ParameterSetID id() const
SubProcessParentageHelper const * subProcessParentageHelper_
void configure(OutputModuleDescription const &desc)
ParameterSet const & getParameterSet(ParameterSetID const &id)
virtual void preallocLumis(unsigned int)
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
std::string const & processName() const
static void fillDescription(ParameterSetDescription &desc, char const *parameterName, std::vector< std::string > const &defaultStrings=defaultSelectionStrings())
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void setEventSelectionInfo(std::map< std::string, std::vector< std::pair< std::string, int >>> const &outputModulePathPositions, bool anyProductProduced)
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
bool doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
virtual void doBeginLuminosityBlock_(LuminosityBlockForOutput const &)
ProductSelectorRules productSelectorRules_
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &)
BranchIDLists const * branchIDLists_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
virtual void doRespondToCloseInputFile_(FileBlock const &)
ProductList const & productList() const
virtual void doRespondToOpenInputFile_(FileBlock const &)
virtual void openFile(FileBlock const &)
void selectAssociationProducts(std::vector< BranchDescription const * > const &associationDescriptions, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const
virtual void doEndRun_(RunForOutput const &)
virtual void write(EventForOutput const &)=0
ProductResolverIndexAndSkipBit uncheckedIndexFrom(EDGetToken) const
void addDefault(ParameterSetDescription const &psetDescription)
std::string const & className() const
std::atomic< int > remainingEvents_
void doWriteRun(RunPrincipal const &rp, ModuleCallingContext const *, MergeableRunProductMetadata const *)
std::string const & moduleLabel() const
std::string const & productInstanceName() const
bool checkDictionary(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
bool selected(BranchDescription const &desc) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
virtual void reallyCloseFile()
TypeID unwrappedTypeID() const
std::vector< BranchDescription const * > allBranchDescriptions() const
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector, ConsumesCollector &&iC)
BranchID const & branchID() const
TypeWithDict const & unwrappedType() const
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
static void fillDescription(ParameterSetDescription &desc)
unsigned int numberOfLuminosityBlocks() const
SubProcessParentageHelper const * subProcessParentageHelper_
bool prePrefetchSelection(StreamID id, EventPrincipal const &, ModuleCallingContext const *)
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
SharedResourcesAcquirer resourcesAcquirer_
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
OutputModuleBase(ParameterSet const &pset)
std::vector< detail::TriggerResultsBasedEventSelector > selectors_
virtual void writeRun(RunForOutput const &)=0
virtual void doEndLuminosityBlock_(LuminosityBlockForOutput const &)
void doRespondToCloseInputFile(FileBlock const &fb)
virtual SharedResourcesAcquirer createAcquirer()
bool doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
void doRespondToOpenInputFile(FileBlock const &fb)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual void doBeginRun_(RunForOutput const &)
std::vector< BranchID::value_type > BranchIDList
virtual void writeLuminosityBlock(LuminosityBlockForOutput const &)=0
std::vector< std::string > const & getAllTriggerNames()
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
unsigned int numberOfStreams() const
static const std::string & baseType()
void doPreallocate(PreallocationConfiguration const &)
void setConsumer(EDConsumerBase const *iConsumer)
std::string process_name_
void doOpenFile(FileBlock const &fb)
~OutputModuleBase() override
BranchIDLists const * origBranchIDLists_
BranchID const & originalBranchID() const
void insertSelectedProcesses(BranchDescription const &desc, std::set< std::string > &processes)
virtual void setProcessesWithSelectedMergeableRunProducts(std::set< std::string > const &)
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 doCloseFile()
Tell the OutputModule that is must end the current file.
static void fillDescription(ParameterSetDescription &desc)
virtual bool isFileOpen() const
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
ProductSelector productSelector_
std::vector< ProductResolverIndexAndSkipBit > productsUsedBySelection() const
ParameterSet const & registerIt()
ParameterSetID selector_config_id_
edm::propagate_const< std::unique_ptr< BranchIDLists > > branchIDLists_
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
BranchIDLists const * branchIDLists()
std::map< BranchID, bool > keepAssociation_