35 remainingEvents_(maxEvents_),
37 hasNewlyDroppedBranch_(),
39 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
42 wantAllEvents_(
false),
44 selector_config_id_(),
45 droppedBranchIDToKeptBranchID_(),
86 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
87 std::vector<BranchDescription const*> associationDescriptions;
88 std::set<BranchID> keptProductsInEvent;
98 associationDescriptions.push_back(&desc);
100 keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
112 for(
auto association : associationDescriptions) {
114 keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
127 std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
128 std::set<BranchID>& keptProductsInEvent) {
131 trueBranchIDToKeptBranchDesc);
139 keptProductsInEvent.insert(desc.
branchID());
197 FDEBUG(2) <<
"writeEvent called\n";
200 std::lock_guard<std::mutex> guard(
mutex_);
241 FDEBUG(2) <<
"beginRun called\n";
250 FDEBUG(2) <<
"endRun called\n";
258 FDEBUG(2) <<
"writeRun called\n";
266 FDEBUG(2) <<
"beginLuminosityBlock called\n";
275 FDEBUG(2) <<
"endLuminosityBlock called\n";
282 FDEBUG(2) <<
"writeLuminosityBlock called\n";
335 branchID = iter->second;
339 return branchIDLists_.get();
385 bool anyProductProduced) {
388 outputModulePathPositions,
395 if((*
i) && (*i)->productProvenancePtr() != 0) {
396 BranchID const& bid = (*i)->branchDescription().branchID();
399 it =
branchParents_.insert(std::make_pair(bid, std::set<ParentageID>())).first;
401 it->second.insert((*i)->productProvenancePtr()->parentageID());
412 std::set<ParentageID>
const& eIds =
i->second;
413 for(std::set<ParentageID>::const_iterator it = eIds.begin(), itEnd = eIds.end();
418 for(std::vector<BranchID>::const_iterator
j = parents.begin(), jEnd = parents.end();
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
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
static void fillDescription(ParameterSetDescription &desc, char const *parameterName)
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
virtual void writeLuminosityBlock(LuminosityBlockPrincipal const &, ModuleCallingContext const *)=0
virtual void write(EventPrincipal const &e, ModuleCallingContext const *)=0
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_
const_iterator end() const
ParameterSetID id() const
ParameterSet const & getParameterSet(ParameterSetID const &id)
SharedResourcesAcquirer resourceAcquirer_
virtual void reallyCloseFile()
SharedResourcesAcquirer createAcquirer(std::vector< std::string > const &) const
void insertEmpty(BranchID parent)
virtual void reallyOpenFile()
void insertChild(BranchID parent, BranchID child)
static const std::string & baseType()
void updateBranchParents(EventPrincipal const &ep)
void doWriteLuminosityBlock(LuminosityBlockPrincipal const &lbp, ModuleCallingContext const *mcc)
std::string const & processName() const
void doOpenFile(FileBlock const &fb)
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)
virtual void endLuminosityBlock(LuminosityBlockPrincipal const &, ModuleCallingContext const *)
std::vector< BranchID > const & parents() const
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
std::string process_name_
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
bool getMapped(key_type const &k, value_type &result) const
std::string const & moduleLabel() const
std::string const & productInstanceName() const
void doWriteRun(RunPrincipal const &rp, ModuleCallingContext const *mcc)
virtual void beginLuminosityBlock(LuminosityBlockPrincipal const &, ModuleCallingContext const *)
static SharedResourcesRegistry * instance()
bool doEvent(EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *act, ModuleCallingContext const *mcc)
TypeID unwrappedTypeID() const
void doPreForkReleaseResources()
std::unique_ptr< BranchIDLists > branchIDLists_
std::vector< BranchDescription const * > allBranchDescriptions() const
BranchID const & branchID() const
TypeWithDict const & unwrappedType() const
std::type_info const & typeInfo() const
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *mcc)
static void fillDescription(ParameterSetDescription &desc)
detail::TriggerResultsBasedEventSelector selectors_
virtual bool isFileOpen() const
void doRespondToCloseInputFile(FileBlock const &fb)
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *mcc)
void fillDependencyGraph()
std::unique_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper_
virtual void postForkReacquireResources(unsigned int, unsigned int)
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &)
static void prevalidate(ConfigurationDescriptions &)
void registerSharedResource(const std::string &)
A resource name must be registered before it can be used in the createAcquirer call.
const_iterator begin() const
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
static const std::string kLegacyModuleResourceName
All legacy modules share this resource.
handle_t getOneTriggerResults(EventPrincipal const &e, ModuleCallingContext const *)
virtual void beginRun(RunPrincipal const &, ModuleCallingContext const *)
virtual void respondToOpenInputFile(FileBlock const &)
static void fillDescription(ParameterSetDescription &desc)
bool doEndRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)
bool wantEvent(EventPrincipal const &e, ModuleCallingContext const *)
static const std::string kBaseType("EDAnalyzer")
std::vector< BranchID::value_type > BranchIDList
SelectedProductsForBranchType keptProducts_
ProductSelector productSelector_
std::vector< std::string > const & getAllTriggerNames()
BranchChildren branchChildren_
boost::filter_iterator< FilledProductPtr, ProductHolderCollection::const_iterator > const_iterator
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
BranchIDLists const * branchIDLists() const
ProductSelectorRules productSelectorRules_
BranchID const & originalBranchID() const
void doRespondToOpenInputFile(FileBlock const &fb)
virtual void respondToCloseInputFile(FileBlock const &)
volatile std::atomic< bool > shutdown_flag false
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)
void configure(OutputModuleDescription const &desc)
virtual void openFile(FileBlock const &)
static ParentageRegistry * instance()
std::atomic< int > remainingEvents_
virtual void writeRun(RunPrincipal const &, ModuleCallingContext const *)=0
virtual void endRun(RunPrincipal const &, ModuleCallingContext const *)
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector)
ParameterSet const & registerIt()
Trig getTriggerResults(EventPrincipal const &ep, ModuleCallingContext const *) const
ModuleDescription const & description() const
BranchParents branchParents_
virtual void preForkReleaseResources()
OutputModule(ParameterSet const &pset)
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
ParameterSetID selector_config_id_