41 remainingEvents_(maxEvents_),
43 hasNewlyDroppedBranch_(),
45 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
48 wantAllEvents_(
false),
50 selector_config_id_(),
51 droppedBranchIDToKeptBranchID_(),
95 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
96 std::vector<BranchDescription const*> associationDescriptions;
97 std::set<BranchID> keptProductsInEvent;
107 associationDescriptions.push_back(&desc);
109 keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
136 std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
137 std::set<BranchID>& keptProductsInEvent) {
140 trueBranchIDToKeptBranchDesc);
144 std::vector<std::string> missingDictionaries;
146 std::string context(
"Calling OutputModule::keepThisBranch, checking dictionaries for kept types");
156 keptProductsInEvent.insert(desc.
branchID());
194 bool seenFirst =
false;
231 std::vector<ProductResolverIndexAndSkipBit>
233 std::vector<ProductResolverIndexAndSkipBit> returnValue;
235 auto const n =
s.numberOfTokens();
236 returnValue.reserve(
n);
238 for(
unsigned int i=0;
i<
n;++
i) {
249 return s.wantEvent(e);
258 FDEBUG(2) <<
"writeEvent called\n";
292 FDEBUG(2) <<
"beginRun called\n";
303 FDEBUG(2) <<
"endRun called\n";
313 FDEBUG(2) <<
"writeRun called\n";
323 FDEBUG(2) <<
"beginLuminosityBlock called\n";
334 FDEBUG(2) <<
"endLuminosityBlock called\n";
343 FDEBUG(2) <<
"writeLuminosityBlock called\n";
381 branchID = iter->second;
385 return branchIDLists_.get();
431 bool anyProductProduced) {
434 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_
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_
ParameterSetID id() const
virtual void writeLuminosityBlock(LuminosityBlockForOutput const &)=0
BranchIDLists const * branchIDLists()
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
void setEventSelectionInfo(std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
void selectAssociationProducts(std::vector< BranchDescription const * > const &associationDescriptions, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const
ProductResolverIndexAndSkipBit uncheckedIndexFrom(EDGetToken) const
bool getByToken(EDGetToken token, TypeID const &typeID, BasicHandle &result) 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)
void doWriteRun(RunPrincipal const &rp, ModuleCallingContext const *mcc)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
static SharedResourcesRegistry * instance()
bool doEvent(EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *act, ModuleCallingContext const *mcc)
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
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *mcc)
static void fillDescription(ParameterSetDescription &desc)
virtual bool isFileOpen() const
void doRespondToCloseInputFile(FileBlock const &fb)
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *mcc)
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &)
static void prevalidate(ConfigurationDescriptions &)
virtual void endLuminosityBlock(LuminosityBlockForOutput const &)
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
bool doEndRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)
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 doRespondToOpenInputFile(FileBlock const &fb)
virtual void respondToCloseInputFile(FileBlock const &)
std::vector< ProductResolverIndexAndSkipBit > productsUsedBySelection() const
bool doBeginRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)
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
ParameterSetID selector_config_id_