45 remainingEvents_(maxEvents_),
47 hasNewlyDroppedBranch_(),
49 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
52 wantAllEvents_(
false),
54 selector_config_id_(),
55 droppedBranchIDToKeptBranchID_(),
59 queue_(pset.getUntrackedParameter<unsigned
int>(
"concurrencyLimit")) {
98 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
99 std::vector<BranchDescription const*> associationDescriptions;
100 std::set<BranchID> keptProductsInEvent;
101 std::set<std::string> processesWithSelectedMergeableRunProducts;
111 associationDescriptions.push_back(&desc);
113 keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
115 processesWithSelectedMergeableRunProducts);
154 branchID = iter->second;
162 std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
163 std::set<BranchID>& keptProductsInEvent) {
166 trueBranchIDToKeptBranchDesc);
175 keptProductsInEvent.insert(desc.
branchID());
213 bool seenFirst =
false;
242 std::vector<ProductResolverIndexAndSkipBit>
244 std::vector<ProductResolverIndexAndSkipBit> returnValue;
246 auto const n =
s.numberOfTokens();
247 returnValue.reserve(
n);
249 for(
unsigned int i=0;
i<
n;++
i) {
260 return s.wantEvent(e);
418 bool anyProductProduced) {
421 outputModulePathPositions,
virtual void writeLuminosityBlock(LuminosityBlockForOutput const &)=0
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, 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 doEvent(EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
bool doEndRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
void setEventSelectionInfo(std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
ParameterSet const & getParameterSet(ParameterSetID const &id)
bool selected(BranchDescription const &desc) const
virtual void doBeginLuminosityBlock_(LuminosityBlockForOutput 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_
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 *)
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 doBeginRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext 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 &)
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
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
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)