45 remainingEvents_(maxEvents_),
47 hasNewlyDroppedBranch_(),
49 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
52 wantAllEvents_(
false),
54 selector_config_id_(),
55 droppedBranchIDToKeptBranchID_(),
98 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
99 std::vector<BranchDescription const*> associationDescriptions;
100 std::set<BranchID> keptProductsInEvent;
110 associationDescriptions.push_back(&desc);
112 keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
124 for(
auto association : associationDescriptions) {
126 keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
139 std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
140 std::set<BranchID>& keptProductsInEvent) {
143 trueBranchIDToKeptBranchDesc);
151 keptProductsInEvent.insert(desc.
branchID());
193 bool seenFirst =
false;
230 std::lock_guard<std::mutex> guard(
mutex_);
343 branchID = iter->second;
347 return branchIDLists_.get();
393 bool anyProductProduced) {
396 outputModulePathPositions,
403 if((*
i) && (*i)->productProvenancePtr() != 0) {
404 BranchID const& bid = (*i)->branchDescription().branchID();
407 it =
branchParents_.insert(std::make_pair(bid, std::set<ParentageID>())).first;
409 it->second.insert((*i)->productProvenancePtr()->parentageID());
420 std::set<ParentageID>
const& eIds =
i->second;
421 for(std::set<ParentageID>::const_iterator it = eIds.begin(), itEnd = eIds.end();
426 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 *)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
ModuleDescription moduleDescription_
void doWriteRun(RunPrincipal const &rp, ModuleCallingContext const *)
static void prevalidate(ConfigurationDescriptions &)
const_iterator end() const
ParameterSet selectEvents_
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)
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
static void fillDescription(ParameterSetDescription &desc)
bool prePrefetchSelection(StreamID id, EventPrincipal const &, ModuleCallingContext const *)
std::unique_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper_
SharedResourcesAcquirer resourcesAcquirer_
virtual void doBeginLuminosityBlock_(LuminosityBlockPrincipal const &, ModuleCallingContext const *)
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
OutputModuleBase(ParameterSet const &pset)
std::vector< detail::TriggerResultsBasedEventSelector > selectors_
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
void doRespondToOpenInputFile(FileBlock const &fb)
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)
unsigned int numberOfStreams() const
static const std::string & baseType()
void doPreallocate(PreallocationConfiguration const &)
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()
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_