33 remainingEvents_(maxEvents_),
35 hasNewlyDroppedBranch_(),
37 productSelectorRules_(pset,
"outputCommands",
"OutputModule"),
40 wantAllEvents_(
false),
42 selector_config_id_(),
43 droppedBranchIDToKeptBranchID_(),
82 std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
97 std::map<BranchID, BranchDescription const*>::const_iterator
iter = trueBranchIDToKeptBranchDesc.find(trueBranchID);
98 if(iter != trueBranchIDToKeptBranchDesc.end()) {
100 <<
"Two (or more) equivalent branches have been selected for output.\n"
102 <<
"#2: " <<
BranchKey(*iter->second) <<
"\n"
103 <<
"Please drop at least one of them.\n";
105 trueBranchIDToKeptBranchDesc.insert(std::make_pair(trueBranchID, &desc));
149 std::map<BranchID, BranchDescription const*>::const_iterator
iter = trueBranchIDToKeptBranchDesc.find(branchID);
150 if(iter != trueBranchIDToKeptBranchDesc.end()) {
152 BranchID const& keptBranchID = iter->second->branchID();
153 if(keptBranchID != branchID) {
187 FDEBUG(2) <<
"writeEvent called\n";
190 std::lock_guard<std::mutex> guard(
mutex_);
231 FDEBUG(2) <<
"beginRun called\n";
240 FDEBUG(2) <<
"endRun called\n";
248 FDEBUG(2) <<
"writeRun called\n";
256 FDEBUG(2) <<
"beginLuminosityBlock called\n";
265 FDEBUG(2) <<
"endLuminosityBlock called\n";
272 FDEBUG(2) <<
"writeLuminosityBlock called\n";
325 branchID = iter->second;
329 return branchIDLists_.get();
370 bool anyProductProduced) {
373 outputModulePathPositions,
380 if((*
i) && (*i)->productProvenancePtr() != 0) {
381 BranchID const& bid = (*i)->branchDescription().branchID();
384 it =
branchParents_.insert(std::make_pair(bid, std::set<ParentageID>())).first;
386 it->second.insert((*i)->productProvenancePtr()->parentageID());
397 std::set<ParentageID>
const& eIds =
i->second;
398 for(std::set<ParentageID>::const_iterator it = eIds.begin(), itEnd = eIds.end();
403 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)
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
void selectProducts(ProductRegistry const &preg)
virtual void write(EventPrincipal const &e, ModuleCallingContext const *)=0
ModuleDescription moduleDescription_
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)
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
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()
virtual void postForkReacquireResources(unsigned int, unsigned int)
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
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)
ParameterSetID selector_config_id_