42 remainingEvents_(maxEvents_),
44 hasNewlyDroppedBranch_(),
46 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
49 wantAllEvents_(
false),
51 selector_config_id_(),
52 droppedBranchIDToKeptBranchID_(),
90 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
91 std::vector<BranchDescription const*> associationDescriptions;
92 std::set<BranchID> keptProductsInEvent;
93 std::set<std::string> processesWithSelectedMergeableRunProducts;
103 associationDescriptions.push_back(&desc);
105 keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
134 std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
135 std::set<BranchID>& keptProductsInEvent) {
140 std::vector<std::string> missingDictionaries;
142 std::string context(
"Calling OutputModule::keepThisBranch, checking dictionaries for kept types");
151 keptProductsInEvent.insert(desc.
branchID());
181 bool seenFirst =
false;
209 std::vector<ProductResolverIndexAndSkipBit> returnValue;
211 auto const n =
s.numberOfTokens();
212 returnValue.reserve(
n);
214 for (
unsigned int i = 0;
i <
n; ++
i) {
226 return s.wantEvent(e);
233 FDEBUG(2) <<
"writeEvent called\n";
264 FDEBUG(2) <<
"beginRun called\n";
272 FDEBUG(2) <<
"endRun called\n";
282 FDEBUG(2) <<
"writeRun called\n";
291 FDEBUG(2) <<
"beginLuminosityBlock called\n";
301 FDEBUG(2) <<
"endLuminosityBlock called\n";
309 FDEBUG(2) <<
"writeLuminosityBlock called\n";
337 std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter =
340 branchID = iter->second;
344 return branchIDLists_.get();
364 std::vector<std::string>
const& defaultOutputCommands) {
375 std::map<
std::string, std::vector<std::pair<std::string, int> > >
const& outputModulePathPositions,
376 bool anyProductProduced) {
379 outputModulePathPositions,
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
bool selected(BranchDescription const &desc) const
virtual void endRun(RunForOutput const &)
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
void throwMissingDictionariesException(std::vector< std::string > &missingDictionaries, std::string const &context)
ParameterSet selectEvents_
void doWriteRun(RunPrincipal const &rp, ModuleCallingContext const *mcc, MergeableRunProductMetadata const *)
BasicHandle getByToken(EDGetToken token, TypeID const &typeID) const
static void fillDroppedToKept(ProductRegistry const &preg, std::map< BranchID, BranchDescription const * > const &trueBranchIDToKeptBranchDesc, std::map< BranchID::value_type, BranchID::value_type > &droppedBranchIDToKeptBranchID_)
ModuleDescription moduleDescription_
std::map< BranchID, bool > keepAssociation_
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *mcc)
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *mcc)
ParameterSetID id() const
virtual void writeLuminosityBlock(LuminosityBlockForOutput const &)=0
BranchIDLists const * branchIDLists()
bool doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *mcc)
ParameterSet const & getParameterSet(ParameterSetID const &id)
void doPreallocate(PreallocationConfiguration const &)
SharedResourcesAcquirer resourceAcquirer_
virtual void reallyCloseFile()
SharedResourcesAcquirer createAcquirer(std::vector< std::string > const &) const
virtual void beginRun(RunForOutput const &)
edm::propagate_const< std::unique_ptr< BranchIDLists > > branchIDLists_
bool prePrefetchSelection(StreamID id, EventPrincipal const &, ModuleCallingContext const *)
static const std::string & baseType()
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
void doWriteLuminosityBlock(LuminosityBlockPrincipal const &lbp, ModuleCallingContext const *mcc)
std::string const & processName() const
void doOpenFile(FileBlock const &fb)
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
bool selected(BranchDescription const &desc) const
BranchIDLists const * origBranchIDLists_
void doCloseFile()
Tell the OutputModule that is must end the current file.
BranchIDLists const * branchIDLists_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ProductList const & productList() const
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *act, ModuleCallingContext const *mcc)
void selectAssociationProducts(std::vector< BranchDescription const * > const &associationDescriptions, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const
ProductResolverIndexAndSkipBit uncheckedIndexFrom(EDGetToken) const
std::string process_name_
void addDefault(ParameterSetDescription const &psetDescription)
std::string const & className() const
static void fillDescriptions(ConfigurationDescriptions &descriptions)
std::string const & moduleLabel() const
std::string const & productInstanceName() const
bool checkDictionary(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
static SharedResourcesRegistry * instance()
static void fillDescription(ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
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
static void fillDescription(ParameterSetDescription &desc)
virtual bool isFileOpen() const
void doRespondToCloseInputFile(FileBlock const &fb)
void setEventSelectionInfo(std::map< std::string, std::vector< std::pair< std::string, int >>> const &outputModulePathPositions, bool anyProductProduced)
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &)
static void prevalidate(ConfigurationDescriptions &)
virtual void endLuminosityBlock(LuminosityBlockForOutput const &)
bool doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *mcc)
virtual void beginLuminosityBlock(LuminosityBlockForOutput const &)
void registerSharedResource(const std::string &)
A resource name must be registered before it can be used in the createAcquirer call.
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
static const std::string kLegacyModuleResourceName
All legacy modules share this resource.
virtual void respondToOpenInputFile(FileBlock const &)
Trig getTriggerResults(EDGetTokenT< TriggerResults > const &token, EventForOutput const &e) const
static const std::string kBaseType("EDAnalyzer")
std::vector< BranchID::value_type > BranchIDList
std::vector< detail::TriggerResultsBasedEventSelector > selectors_
SelectedProductsForBranchType keptProducts_
ProductSelector productSelector_
std::vector< std::string > const & getAllTriggerNames()
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
unsigned int numberOfStreams() const
void setConsumer(EDConsumerBase const *iConsumer)
ProductSelectorRules productSelectorRules_
bool needToRunSelection() const
BranchID const & originalBranchID() const
void insertSelectedProcesses(BranchDescription const &desc, std::set< std::string > &processes)
void doRespondToOpenInputFile(FileBlock const &fb)
virtual void respondToCloseInputFile(FileBlock const &)
std::vector< ProductResolverIndexAndSkipBit > productsUsedBySelection() 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)
virtual void writeRun(RunForOutput const &)=0
void configure(OutputModuleDescription const &desc)
virtual void openFile(FileBlock const &)
std::atomic< int > remainingEvents_
ParameterSet const & registerIt()
ModuleDescription const & description() const
OutputModule(ParameterSet const &pset)
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
virtual void write(EventForOutput const &)=0
virtual void setProcessesWithSelectedMergeableRunProducts(std::set< std::string > const &)
ParameterSetID selector_config_id_