29 std::vector<BranchDescription const*>
45 void remove_whitespace(std::string&
s) {
46 s.erase(
std::remove(s.begin(), s.end(),
' '), s.end());
47 s.erase(
std::remove(s.begin(), s.end(),
'\t'), s.end());
50 void test_remove_whitespace() {
51 std::string
a(
"noblanks");
52 std::string
b(
"\t no blanks \t");
62 typedef std::pair<std::string, std::string> parsed_path_spec_t;
63 void parse_path_spec(std::string
const& path_spec,
64 parsed_path_spec_t&
output) {
65 std::string trimmed_path_spec(path_spec);
66 remove_whitespace(trimmed_path_spec);
69 if (colon == std::string::npos) {
70 output.first = trimmed_path_spec;
72 output.first = trimmed_path_spec.substr(0, colon);
73 output.second = trimmed_path_spec.substr(colon + 1,
74 trimmed_path_spec.size());
78 void test_parse_path_spec() {
79 std::vector<std::string> paths;
80 paths.push_back(
"a:p1");
81 paths.push_back(
"b:p2");
82 paths.push_back(
" c");
83 paths.push_back(
"ddd\t:p3");
84 paths.push_back(
"eee: p4 ");
86 std::vector<parsed_path_spec_t> parsed(paths.size());
87 for (
size_t i = 0;
i < paths.size(); ++
i)
88 parse_path_spec(paths[
i], parsed[i]);
90 assert(parsed[0].
first ==
"a");
91 assert(parsed[0].
second ==
"p1");
92 assert(parsed[1].
first ==
"b");
93 assert(parsed[1].
second ==
"p2");
94 assert(parsed[2].
first ==
"c");
95 assert(parsed[2].
second ==
"");
96 assert(parsed[3].
first ==
"ddd");
97 assert(parsed[3].
second ==
"p3");
98 assert(parsed[4].
first ==
"eee");
99 assert(parsed[4].
second ==
"p4");
106 test_remove_whitespace();
107 test_parse_path_spec();
115 remainingEvents_(maxEvents_),
117 hasNewlyDroppedBranch_(),
119 groupSelectorRules_(pset,
"outputCommands",
"OutputModule"),
121 moduleDescription_(),
124 wantAllEvents_(
false),
126 selector_config_id_(),
143 if (selectevents.
empty()) {
149 std::vector<std::string> path_specs =
150 selectevents.
getParameter<std::vector<std::string> >(
"SelectEvents");
152 if (path_specs.empty()) {
160 std::vector<parsed_path_spec_t> parsed_paths(path_specs.size());
161 for (
size_t i = 0;
i < path_specs.size(); ++
i) {
162 parse_path_spec(path_specs[
i], parsed_paths[i]);
180 ProductRegistry::ProductList::const_iterator it =
181 reg->productList().begin();
182 ProductRegistry::ProductList::const_iterator
end =
183 reg->productList().end();
185 for (; it !=
end; ++it) {
224 Event ev(const_cast<EventPrincipal&>(ep),
238 detail::CachedProducts&
p;
241 PVSentry(PVSentry
const&);
253 FDEBUG(2) <<
"writeEvent called\n";
294 FDEBUG(2) <<
"beginRun called\n";
304 FDEBUG(2) <<
"endRun called\n";
311 FDEBUG(2) <<
"writeRun called\n";
320 FDEBUG(2) <<
"beginLuminosityBlock called\n";
330 FDEBUG(2) <<
"endLuminosityBlock called\n";
336 FDEBUG(2) <<
"writeLuminosityBlock called\n";
425 static const std::string
kBaseType(
"OutputModule");
434 if ((*
i) && (*i)->productProvenancePtr() != 0) {
435 BranchID const& bid = (*i)->branchDescription().branchID();
438 it =
branchParents_.insert(std::make_pair(bid, std::set<ParentageID>())).first;
440 it->second.insert((*i)->productProvenancePtr()->parentageID());
451 std::set<ParentageID>
const& eIds =
i->second;
452 for (std::set<ParentageID>::const_iterator it = eIds.begin(), itEnd = eIds.end();
457 for (std::vector<BranchID>::const_iterator
j = parents.begin(), jEnd = parents.end();
virtual void respondToOpenInputFile(FileBlock const &fb)
nocap nocap const skelname & operator=(const skelname &)
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
T getParameter(std::string const &) const
virtual void doOpenFile()
virtual void writeProductDependencies()
T getUntrackedParameter(std::string const &, T const &) const
std::vector< BranchDescription const * > getAllBranchDescriptions()
BranchType const & branchType() const
virtual void endLuminosityBlock(LuminosityBlockPrincipal const &lb)
ModuleDescription moduleDescription_
virtual void writeFileFormatVersion()
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
const_iterator end() const
ModuleDescription const * moduleDescription() const
handle_t getOneTriggerResults(Event const &e)
ParameterSetID id() const
CurrentProcessingContext const * current_context_
detail::CachedProducts selectors_
virtual void writeIndexIntoFile()
virtual void beginLuminosityBlock(LuminosityBlockPrincipal const &lb)
boost::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
void insertEmpty(BranchID parent)
bool getMapped(key_type const &k, value_type &result) const
void insertChild(BranchID parent, BranchID child)
static const std::string & baseType()
virtual void respondToOpenOutputFiles(FileBlock const &fb)
void updateBranchParents(EventPrincipal const &ep)
virtual void finishEndFile()
static void fillDescription(ParameterSetDescription &desc, char const *parameterName)
bool selected(BranchDescription const &desc) const
virtual void beginRun(RunPrincipal const &r)
virtual void writeParentageRegistry()
void doCloseFile()
Tell the OutputModule that is must end the current file.
std::vector< BranchID > const & parents() const
U second(std::pair< T, U > const &p)
void run_all_output_module_tests()
std::string process_name_
virtual void writeProcessConfigurationRegistry()
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
bool doEvent(EventPrincipal const &ep, EventSetup const &c, CurrentProcessingContext const *cpc)
SelectionsArray keptProducts_
void doWriteLuminosityBlock(LuminosityBlockPrincipal const &lbp)
void doPreForkReleaseResources()
virtual void writeLuminosityBlock(LuminosityBlockPrincipal const &lb)=0
GroupSelectorRules groupSelectorRules_
GroupSelector groupSelector_
void doRespondToCloseOutputFiles(FileBlock const &fb)
static void fillDescription(ParameterSetDescription &desc)
virtual void writeRun(RunPrincipal const &r)=0
virtual void write(EventPrincipal const &e)=0
virtual bool isFileOpen() const
virtual void respondToCloseOutputFiles(FileBlock const &fb)
void doRespondToCloseInputFile(FileBlock const &fb)
virtual void writeFileIdentifier()
void fillDependencyGraph()
void setup(std::vector< parsed_path_spec_t > const &path_specs, std::vector< std::string > const &triggernames, const std::string &process_name)
CurrentProcessingContext const * currentContext() const
const_iterator begin() const
void doWriteRun(RunPrincipal const &rp)
static void fillDescription(ParameterSetDescription &desc)
virtual void respondToCloseInputFile(FileBlock const &fb)
static const std::string kBaseType("EDAnalyzer")
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
boost::filter_iterator< FilledGroupPtr, GroupCollection::const_iterator > const_iterator
std::vector< std::string > const & getAllTriggerNames()
BranchChildren branchChildren_
bool selected(BranchDescription const &desc) const
Trig getTriggerResults(Event const &ep) const
virtual void writeParameterSetRegistry()
Strings const & getTrigPaths() const
virtual void endRun(RunPrincipal const &r)
static ThreadSafeRegistry * instance()
void doRespondToOpenInputFile(FileBlock const &fb)
bool doEndRun(RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
void configure(OutputModuleDescription const &desc)
std::vector< BranchDescription const * > allBranchDescriptions() const
void setupDefault(std::vector< std::string > const &triggernames)
virtual void openFile(FileBlock const &fb)
bool doBeginRun(RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
void initialize(GroupSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
virtual void startEndFile()
virtual void writeBranchMapper()
ModuleDescription const & description() const
virtual void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
BranchParents branchParents_
virtual void preForkReleaseResources()
OutputModule(ParameterSet const &pset)
bool wantEvent(Event const &e)
virtual void writeBranchIDListRegistry()
virtual void writeProcessHistoryRegistry()
void doRespondToOpenOutputFiles(FileBlock const &fb)
virtual void writeProductDescriptionRegistry()
ParameterSetID selector_config_id_