45 remainingEvents_(maxEvents_),
47 hasNewlyDroppedBranch_(),
49 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
52 wantAllEvents_(
false),
54 selector_config_id_(),
55 droppedBranchIDToKeptBranchID_(),
97 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
98 std::vector<BranchDescription const*> associationDescriptions;
99 std::set<BranchID> keptProductsInEvent;
100 std::set<std::string> processesWithSelectedMergeableRunProducts;
110 associationDescriptions.push_back(&desc);
112 keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
114 processesWithSelectedMergeableRunProducts);
153 branchID = iter->second;
161 std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
162 std::set<BranchID>& keptProductsInEvent) {
165 trueBranchIDToKeptBranchDesc);
174 keptProductsInEvent.insert(desc.
branchID());
212 bool seenFirst =
false;
241 std::vector<ProductResolverIndexAndSkipBit>
243 std::vector<ProductResolverIndexAndSkipBit> returnValue;
245 auto const n =
s.numberOfTokens();
246 returnValue.reserve(
n);
248 for(
unsigned int i=0;
i<
n;++
i) {
259 return s.wantEvent(e);
416 bool anyProductProduced) {
419 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)
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_
bool doEvent(EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
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)
void setEventSelectionInfo(std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
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)
virtual void preallocLumis(unsigned int)
ProductSelectorRules productSelectorRules_
void doRespondToCloseInputFile(FileBlock const &fb)
std::atomic< int > remainingEvents_
virtual void reallyCloseFile()
virtual void doEndLuminosityBlock_(LuminosityBlockForOutput const &)
virtual void doBeginRun_(RunForOutput const &)
bool doBeginRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
bool doEndRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext 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)
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
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)
~OutputModuleBase() override
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup 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)