42 remainingEvents_(maxEvents_),
44 hasNewlyDroppedBranch_(),
46 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
49 wantAllEvents_(
false),
51 selector_config_id_(),
52 droppedBranchIDToKeptBranchID_(),
88 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
103 std::map<BranchID, BranchDescription const*>::const_iterator
iter = trueBranchIDToKeptBranchDesc.find(trueBranchID);
104 if(iter != trueBranchIDToKeptBranchDesc.end()) {
106 <<
"Two (or more) equivalent branches have been selected for output.\n"
108 <<
"#2: " <<
BranchKey(*iter->second) <<
"\n"
109 <<
"Please drop at least one of them.\n";
111 trueBranchIDToKeptBranchDesc.insert(std::make_pair(trueBranchID, &desc));
155 std::map<BranchID, BranchDescription const*>::const_iterator
iter = trueBranchIDToKeptBranchDesc.find(branchID);
156 if(iter != trueBranchIDToKeptBranchDesc.end()) {
158 BranchID const& keptBranchID = iter->second->branchID();
159 if(keptBranchID != branchID) {
194 std::lock_guard<std::mutex> guard(
mutex_);
313 branchID = iter->second;
317 return branchIDLists_.get();
358 bool anyProductProduced) {
361 outputModulePathPositions,
368 if((*
i) && (*i)->productProvenancePtr() != 0) {
369 BranchID const& bid = (*i)->branchDescription().branchID();
372 it =
branchParents_.insert(std::make_pair(bid, std::set<ParentageID>())).first;
374 it->second.insert((*i)->productProvenancePtr()->parentageID());
385 std::set<ParentageID>
const& eIds =
i->second;
386 for(std::set<ParentageID>::const_iterator it = eIds.begin(), itEnd = eIds.end();
391 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
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)
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_
void selectProducts(ProductRegistry const &preg)
ProductSelectorRules productSelectorRules_
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 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()
static void fillDescription(ParameterSetDescription &desc)
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()
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)