37 remainingEvents_(maxEvents_),
39 hasNewlyDroppedBranch_(),
41 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
44 wantAllEvents_(
false),
46 selector_config_id_(),
47 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());
183 bool seenFirst =
false;
232 FDEBUG(2) <<
"writeEvent called\n";
235 std::lock_guard<std::mutex> guard(
mutex_);
270 FDEBUG(2) <<
"beginRun called\n";
279 FDEBUG(2) <<
"endRun called\n";
287 FDEBUG(2) <<
"writeRun called\n";
295 FDEBUG(2) <<
"beginLuminosityBlock called\n";
304 FDEBUG(2) <<
"endLuminosityBlock called\n";
311 FDEBUG(2) <<
"writeLuminosityBlock called\n";
364 branchID = iter->second;
368 return branchIDLists_.get();
414 bool anyProductProduced) {
417 outputModulePathPositions,
424 if((*
i) && (*i)->productProvenancePtr() != 0) {
425 BranchID const& bid = (*i)->branchDescription().branchID();
428 it =
branchParents_.insert(std::make_pair(bid, std::set<ParentageID>())).first;
430 it->second.insert((*i)->productProvenancePtr()->parentageID());
441 std::set<ParentageID>
const& eIds =
i->second;
442 for(std::set<ParentageID>::const_iterator it = eIds.begin(), itEnd = eIds.end();
447 for(std::vector<BranchID>::const_iterator
j = parents.begin(), jEnd = parents.end();
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
void setConsumer(EDConsumerBase const *iConsumer)
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
ParameterSet selectEvents_
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_
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
std::map< BranchID, bool > keepAssociation_
const_iterator end() const
ParameterSetID id() const
ParameterSet const & getParameterSet(ParameterSetID const &id)
void doPreallocate(PreallocationConfiguration const &)
SharedResourcesAcquirer resourceAcquirer_
virtual void reallyCloseFile()
SharedResourcesAcquirer createAcquirer(std::vector< std::string > const &) const
void insertEmpty(BranchID parent)
bool prePrefetchSelection(StreamID id, EventPrincipal const &, ModuleCallingContext const *)
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
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 fillDependencyGraph()
std::unique_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper_
void convert_handle(BasicHandle &&bh, Handle< T > &result)
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.
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)
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()
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
unsigned int numberOfStreams() const
ProductSelectorRules productSelectorRules_
Trig getTriggerResults(EDGetTokenT< TriggerResults > const &token, EventPrincipal const &ep, ModuleCallingContext const *) const
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()
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_