44 remainingEvents_(maxEvents_),
46 hasNewlyDroppedBranch_(),
48 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
51 wantAllEvents_(
false),
53 selector_config_id_(),
54 droppedBranchIDToKeptBranchID_(),
58 queue_(pset.getUntrackedParameter<unsigned
int>(
"concurrencyLimit")) {
92 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
93 std::vector<BranchDescription const*> associationDescriptions;
94 std::set<BranchID> keptProductsInEvent;
95 std::set<std::string> processesWithSelectedMergeableRunProducts;
105 associationDescriptions.push_back(&desc);
107 keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
145 std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter =
148 branchID = iter->second;
156 std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
157 std::set<BranchID>& keptProductsInEvent) {
166 keptProductsInEvent.insert(desc.
branchID());
196 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);
360 std::map<
std::string, std::vector<std::pair<std::string, int> > >
const& outputModulePathPositions,
361 bool anyProductProduced) {
364 outputModulePathPositions,
virtual void writeLuminosityBlock(LuminosityBlockForOutput const &)=0
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
std::atomic< int > remainingEvents_
bool selected(BranchDescription const &desc) const
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
std::map< BranchID, bool > keepAssociation_
virtual void setProcessesWithSelectedMergeableRunProducts(std::set< std::string > const &)
virtual bool isFileOpen() const
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void doPreallocate(PreallocationConfiguration const &)
static void fillDroppedToKept(ProductRegistry const &preg, std::map< BranchID, BranchDescription const * > const &trueBranchIDToKeptBranchDesc, std::map< BranchID::value_type, BranchID::value_type > &droppedBranchIDToKeptBranchID_)
virtual void reallyCloseFile()
virtual void doRespondToOpenInputFile_(FileBlock const &)
BranchIDLists const * origBranchIDLists_
virtual void write(EventForOutput const &)=0
ParameterSetID id() const
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
ParameterSet const & getParameterSet(ParameterSetID const &id)
bool selected(BranchDescription const &desc) const
virtual void doBeginLuminosityBlock_(LuminosityBlockForOutput const &)
bool doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
OutputModuleBase(ParameterSet const &pset)
ParameterSetID selector_config_id_
bool prePrefetchSelection(StreamID id, EventPrincipal const &, ModuleCallingContext const *)
edm::propagate_const< std::unique_ptr< BranchIDLists > > branchIDLists_
void setEventSelectionInfo(std::map< std::string, std::vector< std::pair< std::string, int >>> const &outputModulePathPositions, bool anyProductProduced)
std::string const & processName() const
std::vector< ProductResolverIndexAndSkipBit > productsUsedBySelection() 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
ModuleDescription const & description() const
void doWriteLuminosityBlock(LuminosityBlockPrincipal const &lbp, ModuleCallingContext const *)
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
void configure(OutputModuleDescription const &desc)
void updateBranchIDListsWithKeptAliases()
BranchIDLists const * branchIDLists_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ProductList const & productList() const
virtual void openFile(FileBlock const &) 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 &)
ProductResolverIndexAndSkipBit uncheckedIndexFrom(EDGetToken) const
void addDefault(ParameterSetDescription const &psetDescription)
static const std::string kBaseType("EDAnalyzer")
virtual void doBeginRun_(RunForOutput const &)
std::string const & moduleLabel() const
std::string const & productInstanceName() const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
virtual void preallocate(PreallocationConfiguration const &)
virtual void writeRun(RunForOutput const &)=0
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &)
int remainingEvents() const
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
ParameterSet selectEvents_
TypeID unwrappedTypeID() const
static void fillDescription(ParameterSetDescription &desc)
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
static void fillDescription(ParameterSetDescription &desc)
bool needToRunSelection() const
unsigned int numberOfLuminosityBlocks() const
void doWriteRun(RunPrincipal const &rp, ModuleCallingContext const *, MergeableRunProductMetadata const *)
void doOpenFile(FileBlock const &fb)
element_type const * get() const
void doRespondToOpenInputFile(FileBlock const &fb)
ProductSelectorRules productSelectorRules_
virtual void preallocStreams(unsigned int)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual void doEndLuminosityBlock_(LuminosityBlockForOutput const &)
std::vector< detail::TriggerResultsBasedEventSelector > selectors_
BranchIDLists const * branchIDLists() const
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
std::vector< BranchID::value_type > BranchIDList
ModuleDescription moduleDescription_
std::vector< std::string > const & getAllTriggerNames()
virtual void doRespondToCloseInputFile_(FileBlock const &)
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
virtual void preallocLumis(unsigned int)
unsigned int numberOfStreams() const
void setConsumer(EDConsumerBase const *iConsumer)
ProductSelector productSelector_
BranchID const & originalBranchID() const
void insertSelectedProcesses(BranchDescription const &desc, std::set< std::string > &processes)
SelectedProductsForBranchType keptProducts_
static void prevalidate(ConfigurationDescriptions &)
void doCloseFile()
Tell the OutputModule that is must end the current file.
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)
~OutputModuleBase() override
bool doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
ParameterSet const & registerIt()
std::string process_name_
static const std::string & baseType()
void doRespondToCloseInputFile(FileBlock const &fb)
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)