44 remainingEvents_(maxEvents_),
46 hasNewlyDroppedBranch_(),
48 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
51 wantAllEvents_(
false),
53 selector_config_id_(),
54 droppedBranchIDToKeptBranchID_(),
92 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
93 std::vector<BranchDescription const*> associationDescriptions;
94 std::set<BranchID> keptProductsInEvent;
104 associationDescriptions.push_back(&desc);
106 keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
118 for(
auto association : associationDescriptions) {
120 keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
133 std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
134 std::set<BranchID>& keptProductsInEvent) {
137 trueBranchIDToKeptBranchDesc);
145 keptProductsInEvent.insert(desc.
branchID());
204 std::lock_guard<std::mutex> guard(
mutex_);
323 branchID = iter->second;
327 return branchIDLists_.get();
373 bool anyProductProduced) {
376 outputModulePathPositions,
383 if((*
i) && (*i)->productProvenancePtr() != 0) {
384 BranchID const& bid = (*i)->branchDescription().branchID();
387 it =
branchParents_.insert(std::make_pair(bid, std::set<ParentageID>())).first;
389 it->second.insert((*i)->productProvenancePtr()->parentageID());
400 std::set<ParentageID>
const& eIds =
i->second;
401 for(std::set<ParentageID>::const_iterator it = eIds.begin(), itEnd = eIds.end();
406 for(std::vector<BranchID>::const_iterator
j = parents.begin(), jEnd = parents.end();
BranchIDLists const * branchIDLists() const
static const std::string kBaseType("EDAnalyzer")
std::unique_ptr< BranchIDLists > branchIDLists_
bool selected(BranchDescription const &desc) const
void doPreForkReleaseResources()
static void fillDescription(ParameterSetDescription &desc, char const *parameterName)
ModuleDescription const & description() const
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
static void fillDroppedToKept(ProductRegistry const &preg, std::map< BranchID, BranchDescription const * > const &trueBranchIDToKeptBranchDesc, std::map< BranchID::value_type, BranchID::value_type > &droppedBranchIDToKeptBranchID_)
SelectedProductsForBranchType keptProducts_
void doWriteLuminosityBlock(LuminosityBlockPrincipal const &lbp, ModuleCallingContext const *)
ModuleDescription moduleDescription_
void doWriteRun(RunPrincipal const &rp, ModuleCallingContext const *)
static void prevalidate(ConfigurationDescriptions &)
const_iterator end() const
bool doEvent(EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
BranchParents branchParents_
ParameterSetID id() const
void configure(OutputModuleDescription const &desc)
ParameterSet const & getParameterSet(ParameterSetID const &id)
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
virtual void doEndRun_(RunPrincipal const &, ModuleCallingContext const *)
void insertEmpty(BranchID parent)
void insertChild(BranchID parent, BranchID child)
bool doBeginRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
std::string const & processName() const
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
BranchChildren branchChildren_
ProductSelectorRules productSelectorRules_
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &)
virtual void doBeginRun_(RunPrincipal const &, ModuleCallingContext const *)
BranchIDLists const * branchIDLists_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Trig getTriggerResults(EventPrincipal const &ep, ModuleCallingContext const *) const
std::vector< BranchID > const & parents() const
virtual void doRespondToCloseInputFile_(FileBlock const &)
ProductList const & productList() const
virtual void doRespondToOpenInputFile_(FileBlock const &)
virtual void openFile(FileBlock const &)
void selectAssociationProducts(std::vector< BranchDescription const * > const &associationDescriptions, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const
void addDefault(ParameterSetDescription const &psetDescription)
std::atomic< int > remainingEvents_
bool getMapped(key_type const &k, value_type &result) const
std::string const & moduleLabel() const
std::string const & productInstanceName() const
bool selected(BranchDescription const &desc) const
virtual void reallyCloseFile()
virtual void reallyOpenFile()
TypeID unwrappedTypeID() const
void setEventSelectionInfo(std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
std::vector< BranchDescription const * > allBranchDescriptions() const
virtual void writeRun(RunPrincipal const &, ModuleCallingContext const *)=0
BranchID const & branchID() const
virtual void preForkReleaseResources()
TypeWithDict const & unwrappedType() const
std::type_info const & typeInfo() const
static void fillDescription(ParameterSetDescription &desc)
std::unique_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper_
SharedResourcesAcquirer resourcesAcquirer_
virtual void doBeginLuminosityBlock_(LuminosityBlockPrincipal const &, ModuleCallingContext const *)
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
OutputModuleBase(ParameterSet const &pset)
virtual void doEndLuminosityBlock_(LuminosityBlockPrincipal const &, ModuleCallingContext const *)
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
void doRespondToCloseInputFile(FileBlock const &fb)
virtual SharedResourcesAcquirer createAcquirer()
const_iterator begin() const
handle_t getOneTriggerResults(EventPrincipal const &e, ModuleCallingContext const *)
void doRespondToOpenInputFile(FileBlock const &fb)
bool wantEvent(EventPrincipal const &e, ModuleCallingContext const *)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual void write(EventPrincipal const &e, ModuleCallingContext const *)=0
std::vector< BranchID::value_type > BranchIDList
bool doEndRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
std::vector< std::string > const & getAllTriggerNames()
boost::filter_iterator< FilledProductPtr, ProductHolderCollection::const_iterator > const_iterator
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
static const std::string & baseType()
std::string process_name_
void doOpenFile(FileBlock const &fb)
virtual void writeLuminosityBlock(LuminosityBlockPrincipal const &, ModuleCallingContext const *)=0
virtual void postForkReacquireResources(unsigned int, unsigned int)
BranchIDLists const * origBranchIDLists_
BranchID const & originalBranchID() const
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
volatile std::atomic< bool > shutdown_flag false
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 doCloseFile()
Tell the OutputModule that is must end the current file.
static void fillDescription(ParameterSetDescription &desc)
virtual bool isFileOpen() const
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
void updateBranchParents(EventPrincipal const &ep)
static ParentageRegistry * instance()
ProductSelector productSelector_
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector)
ParameterSet const & registerIt()
virtual ~OutputModuleBase()
detail::TriggerResultsBasedEventSelector selectors_
ParameterSetID selector_config_id_
void fillDependencyGraph()
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
std::map< BranchID, bool > keepAssociation_