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