CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
edm::OutputModule Class Referenceabstract

#include <OutputModule.h>

Inheritance diagram for edm::OutputModule:
DQMRootOutputModule edm::AsciiOutputModule edm::GetProductCheckerOutputModule edm::PoolOutputModule edm::ProvenanceCheckerOutputModule edm::StreamerOutputModuleBase edm::SubProcess edm::XMLOutputModule FRDEventOutputModule< Consumer >

Public Types

typedef OutputModule ModuleType
 
typedef OutputWorker WorkerType
 

Public Member Functions

BranchChildren const & branchChildren () const
 
boost::array< bool,
NumBranchTypes > const & 
hasNewlyDroppedBranch () const
 
SelectionsArray const & keptProducts () const
 
int maxEvents () const
 
 OutputModule (ParameterSet const &pset)
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts ()
 
bool wantAllEvents () const
 
virtual ~OutputModule ()
 

Static Public Member Functions

static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
ModuleDescription const & description () const
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
bool doEndRun (RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, CurrentProcessingContext const *cpc)
 
Trig getTriggerResults (Event const &ep) const
 
Trig getTriggerResults (EventPrincipal const &ep) const
 
ParameterSetID selectorConfig () const
 

Private Types

typedef std::map< BranchID,
std::set< ParentageID > > 
BranchParents
 

Private Member Functions

virtual void beginJob ()
 
virtual void beginLuminosityBlock (LuminosityBlockPrincipal const &lb)
 
virtual void beginRun (RunPrincipal const &r)
 
void configure (OutputModuleDescription const &desc)
 
void doCloseFile ()
 Tell the OutputModule that is must end the current file. More...
 
void doOpenFile (FileBlock const &fb)
 
virtual void doOpenFile ()
 
void doPostForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)
 
void doPreForkReleaseResources ()
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doWriteLuminosityBlock (LuminosityBlockPrincipal const &lbp)
 
void doWriteRun (RunPrincipal const &rp)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (LuminosityBlockPrincipal const &lb)
 
virtual void endRun (RunPrincipal const &r)
 
void fillDependencyGraph ()
 
virtual void finishEndFile ()
 
virtual bool isFileOpen () const
 
bool limitReached () const
 
void maybeOpenFile ()
 
virtual void openFile (FileBlock const &fb)
 
virtual void postForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)
 
virtual void preForkReleaseResources ()
 
void reallyCloseFile ()
 
void registerAnyProducts (OutputModule const *, ProductRegistry const *)
 
virtual void respondToCloseInputFile (FileBlock const &fb)
 
virtual void respondToCloseOutputFiles (FileBlock const &fb)
 
virtual void respondToOpenInputFile (FileBlock const &fb)
 
virtual void respondToOpenOutputFiles (FileBlock const &fb)
 
void setModuleDescription (ModuleDescription const &md)
 
virtual bool shouldWeCloseFile () const
 Ask the OutputModule if we should end the current file. More...
 
virtual void startEndFile ()
 
void updateBranchParents (EventPrincipal const &ep)
 
std::string workerType () const
 
virtual void write (EventPrincipal const &e)=0
 
virtual void writeBranchIDListRegistry ()
 
virtual void writeBranchMapper ()
 
virtual void writeFileFormatVersion ()
 
virtual void writeFileIdentifier ()
 
virtual void writeIndexIntoFile ()
 
virtual void writeLuminosityBlock (LuminosityBlockPrincipal const &lb)=0
 
virtual void writeParameterSetRegistry ()
 
virtual void writeParentageRegistry ()
 
virtual void writeProcessConfigurationRegistry ()
 
virtual void writeProcessHistoryRegistry ()
 
virtual void writeProductDependencies ()
 
virtual void writeProductDescriptionRegistry ()
 
virtual void writeRun (RunPrincipal const &r)=0
 

Private Attributes

BranchChildren branchChildren_
 
BranchParents branchParents_
 
CurrentProcessingContext const * current_context_
 
GroupSelector groupSelector_
 
GroupSelectorRules groupSelectorRules_
 
boost::array< bool,
NumBranchTypes
hasNewlyDroppedBranch_
 
SelectionsArray keptProducts_
 
int maxEvents_
 
ModuleDescription moduleDescription_
 
std::string process_name_
 
bool prodsValid_
 
int remainingEvents_
 
ParameterSetID selector_config_id_
 
detail::CachedProducts selectors_
 
bool wantAllEvents_
 

Friends

class OutputWorker
 
template<typename T >
class WorkerT
 

Detailed Description

Definition at line 35 of file OutputModule.h.

Member Typedef Documentation

typedef std::map<BranchID, std::set<ParentageID> > edm::OutputModule::BranchParents
private

Definition at line 139 of file OutputModule.h.

Definition at line 39 of file OutputModule.h.

Definition at line 40 of file OutputModule.h.

Constructor & Destructor Documentation

edm::OutputModule::OutputModule ( ParameterSet const &  pset)
explicit

Definition at line 113 of file OutputModule.cc.

References edm::ParameterSet::empty(), edm::getAllTriggerNames(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameterSet(), hasNewlyDroppedBranch_, i, edm::ParameterSet::id(), process_name_, edm::ParameterSet::registerIt(), selector_config_id_, selectors_, edm::detail::CachedProducts::setup(), edm::detail::CachedProducts::setupDefault(), and wantAllEvents_.

113  :
114  maxEvents_(-1),
116  keptProducts_(),
118  process_name_(),
119  groupSelectorRules_(pset, "outputCommands", "OutputModule"),
120  groupSelector_(),
122  current_context_(0),
123  prodsValid_(false),
124  wantAllEvents_(false),
125  selectors_(),
127  branchParents_(),
128  branchChildren_() {
129 
130  hasNewlyDroppedBranch_.assign(false);
131 
133  process_name_ = tns->getProcessName();
134 
135  ParameterSet selectevents =
136  pset.getUntrackedParameterSet("SelectEvents", ParameterSet());
137 
138  selectevents.registerIt(); // Just in case this PSet is not registered
139 
140  selector_config_id_ = selectevents.id();
141  // If selectevents is an emtpy ParameterSet, then we are to write
142  // all events, or one which contains a vstrig 'SelectEvents' that
143  // is empty, we are to write all events. We have no need for any
144  // EventSelectors.
145  if (selectevents.empty()) {
146  wantAllEvents_ = true;
148  return;
149  }
150 
151  std::vector<std::string> path_specs =
152  selectevents.getParameter<std::vector<std::string> >("SelectEvents");
153 
154  if (path_specs.empty()) {
155  wantAllEvents_ = true;
157  return;
158  }
159 
160  // If we get here, we have the possibility of having to deal with
161  // path_specs that look at more than one process.
162  std::vector<parsed_path_spec_t> parsed_paths(path_specs.size());
163  for (size_t i = 0; i < path_specs.size(); ++i) {
164  parse_path_spec(path_specs[i], parsed_paths[i]);
165  }
167  }
int i
Definition: DBlmapReader.cc:9
ModuleDescription moduleDescription_
Definition: OutputModule.h:124
CurrentProcessingContext const * current_context_
Definition: OutputModule.h:127
detail::CachedProducts selectors_
Definition: OutputModule.h:134
boost::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: OutputModule.h:119
std::string process_name_
Definition: OutputModule.h:121
SelectionsArray keptProducts_
Definition: OutputModule.h:118
GroupSelectorRules groupSelectorRules_
Definition: OutputModule.h:122
GroupSelector groupSelector_
Definition: OutputModule.h:123
void setup(std::vector< parsed_path_spec_t > const &path_specs, std::vector< std::string > const &triggernames, const std::string &process_name)
std::vector< std::string > const & getAllTriggerNames()
Definition: OutputModule.cc:35
BranchChildren branchChildren_
Definition: OutputModule.h:142
void setupDefault(std::vector< std::string > const &triggernames)
BranchParents branchParents_
Definition: OutputModule.h:140
ParameterSetID selector_config_id_
Definition: OutputModule.h:137
edm::OutputModule::~OutputModule ( )
virtual

Definition at line 205 of file OutputModule.cc.

205 { }

Member Function Documentation

const std::string & edm::OutputModule::baseType ( )
static

Definition at line 427 of file OutputModule.cc.

References edm::kBaseType().

427  {
428  return kBaseType;
429  }
static const std::string kBaseType("EDAnalyzer")
virtual void edm::OutputModule::beginJob ( void  )
inlineprivatevirtual

Reimplemented in edm::SubProcess, and edm::StreamerOutputModuleBase.

Definition at line 178 of file OutputModule.h.

Referenced by doBeginJob().

178 {}
virtual void edm::OutputModule::beginLuminosityBlock ( LuminosityBlockPrincipal const &  lb)
inlineprivatevirtual

Reimplemented in edm::SubProcess.

Definition at line 183 of file OutputModule.h.

Referenced by doBeginLuminosityBlock().

183 {}
virtual void edm::OutputModule::beginRun ( RunPrincipal const &  r)
inlineprivatevirtual

Reimplemented in edm::SubProcess, DQMRootOutputModule, FRDEventOutputModule< Consumer >, and edm::StreamerOutputModuleBase.

Definition at line 180 of file OutputModule.h.

Referenced by doBeginRun().

180 {}
BranchChildren const& edm::OutputModule::branchChildren ( ) const
inline

Definition at line 63 of file OutputModule.h.

References branchChildren_.

Referenced by edm::RootOutputFile::writeProductDependencies().

63 {return branchChildren_;}
BranchChildren branchChildren_
Definition: OutputModule.h:142
void edm::OutputModule::configure ( OutputModuleDescription const &  desc)
private

Definition at line 169 of file OutputModule.cc.

References edm::OutputModuleDescription::maxEvents_, maxEvents_, and remainingEvents_.

Referenced by edm::OutputWorker::configure().

169  {
170  remainingEvents_ = maxEvents_ = desc.maxEvents_;
171  }
CurrentProcessingContext const * edm::OutputModule::currentContext ( ) const
protected

Definition at line 398 of file OutputModule.cc.

References current_context_.

398  {
399  return current_context_;
400  }
CurrentProcessingContext const * current_context_
Definition: OutputModule.h:127
ModuleDescription const & edm::OutputModule::description ( ) const
protected

Definition at line 403 of file OutputModule.cc.

References moduleDescription_.

Referenced by edm::StreamerOutputModuleBase::serializeRegistry().

403  {
404  return moduleDescription_;
405  }
ModuleDescription moduleDescription_
Definition: OutputModule.h:124
void edm::OutputModule::doBeginJob ( )
protected

Definition at line 207 of file OutputModule.cc.

References beginJob(), and selectProducts().

207  {
208  selectProducts();
209  this->beginJob();
210  }
virtual void beginJob()
Definition: OutputModule.h:178
bool edm::OutputModule::doBeginLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
EventSetup const &  c,
CurrentProcessingContext const *  cpc 
)
protected

Definition at line 316 of file OutputModule.cc.

References beginLuminosityBlock(), current_context_, and FDEBUG.

318  {
319  detail::CPCSentry sentry(current_context_, cpc);
320  FDEBUG(2) << "beginLuminosityBlock called\n";
322  return true;
323  }
CurrentProcessingContext const * current_context_
Definition: OutputModule.h:127
virtual void beginLuminosityBlock(LuminosityBlockPrincipal const &lb)
Definition: OutputModule.h:183
#define FDEBUG(lev)
Definition: DebugMacros.h:18
bool edm::OutputModule::doBeginRun ( RunPrincipal const &  rp,
EventSetup const &  c,
CurrentProcessingContext const *  cpc 
)
protected

Definition at line 290 of file OutputModule.cc.

References beginRun(), current_context_, and FDEBUG.

292  {
293  detail::CPCSentry sentry(current_context_, cpc);
294  FDEBUG(2) << "beginRun called\n";
295  beginRun(rp);
296  return true;
297  }
CurrentProcessingContext const * current_context_
Definition: OutputModule.h:127
#define FDEBUG(lev)
Definition: DebugMacros.h:18
virtual void beginRun(RunPrincipal const &r)
Definition: OutputModule.h:180
void edm::OutputModule::doCloseFile ( )
private

Tell the OutputModule that is must end the current file.

Definition at line 374 of file OutputModule.cc.

References isFileOpen(), and reallyCloseFile().

Referenced by edm::OutputWorker::closeFile().

374  {
375  if (isFileOpen()) reallyCloseFile();
376  }
virtual bool isFileOpen() const
Definition: OutputModule.h:194
void edm::OutputModule::doEndJob ( )
protected

Definition at line 212 of file OutputModule.cc.

References endJob().

Referenced by edm::EventProcessor::endJob().

212  {
213  endJob();
214  }
virtual void endJob()
Definition: OutputModule.h:179
bool edm::OutputModule::doEndLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
EventSetup const &  c,
CurrentProcessingContext const *  cpc 
)
protected

Definition at line 326 of file OutputModule.cc.

References current_context_, endLuminosityBlock(), and FDEBUG.

328  {
329  detail::CPCSentry sentry(current_context_, cpc);
330  FDEBUG(2) << "endLuminosityBlock called\n";
331  endLuminosityBlock(lbp);
332  return true;
333  }
virtual void endLuminosityBlock(LuminosityBlockPrincipal const &lb)
Definition: OutputModule.h:184
CurrentProcessingContext const * current_context_
Definition: OutputModule.h:127
#define FDEBUG(lev)
Definition: DebugMacros.h:18
bool edm::OutputModule::doEndRun ( RunPrincipal const &  rp,
EventSetup const &  c,
CurrentProcessingContext const *  cpc 
)
protected

Definition at line 300 of file OutputModule.cc.

References current_context_, endRun(), and FDEBUG.

302  {
303  detail::CPCSentry sentry(current_context_, cpc);
304  FDEBUG(2) << "endRun called\n";
305  endRun(rp);
306  return true;
307  }
CurrentProcessingContext const * current_context_
Definition: OutputModule.h:127
#define FDEBUG(lev)
Definition: DebugMacros.h:18
virtual void endRun(RunPrincipal const &r)
Definition: OutputModule.h:181
bool edm::OutputModule::doEvent ( EventPrincipal const &  ep,
EventSetup const &  c,
CurrentProcessingContext const *  cpc 
)
protected

Definition at line 249 of file OutputModule.cc.

References current_context_, FDEBUG, moduleDescription_, prodsValid_, remainingEvents_, selectors_, updateBranchParents(), wantAllEvents_, edm::detail::CachedProducts::wantEvent(), and write().

251  {
252  detail::CPCSentry sentry(current_context_, cpc);
253  PVSentry products_sentry(selectors_, prodsValid_);
254 
255  FDEBUG(2) << "writeEvent called\n";
256 
257  if (!wantAllEvents_) {
258  // use module description and const_cast unless interface to
259  // event is changed to just take a const EventPrincipal
260  Event e(const_cast<EventPrincipal&>(ep), moduleDescription_);
261  if (!selectors_.wantEvent(e)) {
262  return true;
263  }
264  }
265  write(ep);
267  if (remainingEvents_ > 0) {
269  }
270  return true;
271  }
ModuleDescription moduleDescription_
Definition: OutputModule.h:124
CurrentProcessingContext const * current_context_
Definition: OutputModule.h:127
detail::CachedProducts selectors_
Definition: OutputModule.h:134
void updateBranchParents(EventPrincipal const &ep)
#define FDEBUG(lev)
Definition: DebugMacros.h:18
virtual void write(EventPrincipal const &e)=0
bool wantEvent(Event const &e)
void edm::OutputModule::doOpenFile ( FileBlock const &  fb)
private

Definition at line 340 of file OutputModule.cc.

References openFile().

Referenced by edm::OutputWorker::openFile().

340  {
341  openFile(fb);
342  }
virtual void openFile(FileBlock const &fb)
Definition: OutputModule.h:186
virtual void edm::OutputModule::doOpenFile ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 196 of file OutputModule.h.

Referenced by maybeOpenFile().

196 { }
void edm::OutputModule::doPostForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)
private

Definition at line 366 of file OutputModule.cc.

References postForkReacquireResources().

366  {
367  postForkReacquireResources(iChildIndex, iNumberOfChildren);
368  }
virtual void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
Definition: OutputModule.h:192
void edm::OutputModule::doPreForkReleaseResources ( )
private

Definition at line 361 of file OutputModule.cc.

References preForkReleaseResources().

361  {
363  }
virtual void preForkReleaseResources()
Definition: OutputModule.h:191
void edm::OutputModule::doRespondToCloseInputFile ( FileBlock const &  fb)
private

Definition at line 348 of file OutputModule.cc.

References respondToCloseInputFile().

348  {
350  }
virtual void respondToCloseInputFile(FileBlock const &fb)
Definition: OutputModule.h:188
void edm::OutputModule::doRespondToCloseOutputFiles ( FileBlock const &  fb)
private

Definition at line 356 of file OutputModule.cc.

References respondToCloseOutputFiles().

356  {
358  }
virtual void respondToCloseOutputFiles(FileBlock const &fb)
Definition: OutputModule.h:190
void edm::OutputModule::doRespondToOpenInputFile ( FileBlock const &  fb)
private

Definition at line 344 of file OutputModule.cc.

References respondToOpenInputFile().

344  {
346  }
virtual void respondToOpenInputFile(FileBlock const &fb)
Definition: OutputModule.h:187
void edm::OutputModule::doRespondToOpenOutputFiles ( FileBlock const &  fb)
private

Definition at line 352 of file OutputModule.cc.

References respondToOpenOutputFiles().

352  {
354  }
virtual void respondToOpenOutputFiles(FileBlock const &fb)
Definition: OutputModule.h:189
void edm::OutputModule::doWriteLuminosityBlock ( LuminosityBlockPrincipal const &  lbp)
private

Definition at line 335 of file OutputModule.cc.

References FDEBUG, and writeLuminosityBlock().

Referenced by edm::OutputWorker::writeLumi().

335  {
336  FDEBUG(2) << "writeLuminosityBlock called\n";
338  }
#define FDEBUG(lev)
Definition: DebugMacros.h:18
virtual void writeLuminosityBlock(LuminosityBlockPrincipal const &lb)=0
void edm::OutputModule::doWriteRun ( RunPrincipal const &  rp)
private

Definition at line 310 of file OutputModule.cc.

References FDEBUG, and writeRun().

Referenced by edm::OutputWorker::writeRun().

310  {
311  FDEBUG(2) << "writeRun called\n";
312  writeRun(rp);
313  }
#define FDEBUG(lev)
Definition: DebugMacros.h:18
virtual void writeRun(RunPrincipal const &r)=0
virtual void edm::OutputModule::endJob ( void  )
inlineprivatevirtual

Reimplemented in edm::SubProcess, and edm::StreamerOutputModuleBase.

Definition at line 179 of file OutputModule.h.

Referenced by doEndJob().

179 {}
virtual void edm::OutputModule::endLuminosityBlock ( LuminosityBlockPrincipal const &  lb)
inlineprivatevirtual

Reimplemented in edm::SubProcess.

Definition at line 184 of file OutputModule.h.

Referenced by doEndLuminosityBlock().

184 {}
virtual void edm::OutputModule::endRun ( RunPrincipal const &  r)
inlineprivatevirtual

Reimplemented in edm::SubProcess, FRDEventOutputModule< Consumer >, and edm::StreamerOutputModuleBase.

Definition at line 181 of file OutputModule.h.

Referenced by doEndRun().

181 {}
void edm::OutputModule::fillDependencyGraph ( )
private

Definition at line 447 of file OutputModule.cc.

References branchChildren_, branchParents_, edm::detail::ThreadSafeRegistry< KEY, T, E >::getMapped(), i, edm::BranchChildren::insertChild(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), j, parents, and edm::Parentage::parents().

Referenced by reallyCloseFile().

447  {
448  for (BranchParents::const_iterator i = branchParents_.begin(), iEnd = branchParents_.end();
449  i != iEnd; ++i) {
450  BranchID const& child = i->first;
451  std::set<ParentageID> const& eIds = i->second;
452  for (std::set<ParentageID>::const_iterator it = eIds.begin(), itEnd = eIds.end();
453  it != itEnd; ++it) {
454  Parentage entryDesc;
455  ParentageRegistry::instance()->getMapped(*it, entryDesc);
456  std::vector<BranchID> const& parents = entryDesc.parents();
457  for (std::vector<BranchID>::const_iterator j = parents.begin(), jEnd = parents.end();
458  j != jEnd; ++j) {
459  branchChildren_.insertChild(*j, child);
460  }
461  }
462  }
463  }
int i
Definition: DBlmapReader.cc:9
TPRegexp parents
Definition: eve_filter.cc:24
bool getMapped(key_type const &k, value_type &result) const
void insertChild(BranchID parent, BranchID child)
int j
Definition: DBlmapReader.cc:9
BranchChildren branchChildren_
Definition: OutputModule.h:142
static ThreadSafeRegistry * instance()
BranchParents branchParents_
Definition: OutputModule.h:140
void edm::OutputModule::fillDescription ( ParameterSetDescription desc)
static
void edm::OutputModule::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 413 of file OutputModule.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

413  {
415  desc.setUnknown();
416  descriptions.addDefault(desc);
417  }
virtual void edm::OutputModule::finishEndFile ( )
inlineprivatevirtual

Reimplemented in DQMRootOutputModule, and edm::PoolOutputModule.

Definition at line 222 of file OutputModule.h.

Referenced by reallyCloseFile().

222 {}
Trig edm::OutputModule::getTriggerResults ( Event const &  ep) const
protected

Definition at line 217 of file OutputModule.cc.

References edm::detail::CachedProducts::getOneTriggerResults(), and selectors_.

Referenced by getTriggerResults(), and edm::StreamerOutputModuleBase::setHltMask().

217  {
218  return selectors_.getOneTriggerResults(ev);
219  }
handle_t getOneTriggerResults(Event const &e)
detail::CachedProducts selectors_
Definition: OutputModule.h:134
Trig edm::OutputModule::getTriggerResults ( EventPrincipal const &  ep) const
protected

Definition at line 221 of file OutputModule.cc.

References current_context_, getTriggerResults(), and edm::CurrentProcessingContext::moduleDescription().

221  {
222  // This is bad, because we're returning handles into an Event that
223  // is destructed before the return. It might not fail, because the
224  // actual EventPrincipal is not destroyed, but it still needs to
225  // be cleaned up.
226  Event ev(const_cast<EventPrincipal&>(ep),
228  return getTriggerResults(ev);
229  }
ModuleDescription const * moduleDescription() const
CurrentProcessingContext const * current_context_
Definition: OutputModule.h:127
Trig getTriggerResults(Event const &ep) const
boost::array<bool, NumBranchTypes> const& edm::OutputModule::hasNewlyDroppedBranch ( ) const
inline

Definition at line 57 of file OutputModule.h.

References hasNewlyDroppedBranch_.

Referenced by edm::RootOutputFile::beginInputFile().

57 {return hasNewlyDroppedBranch_;}
boost::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: OutputModule.h:119
virtual bool edm::OutputModule::isFileOpen ( ) const
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 194 of file OutputModule.h.

Referenced by doCloseFile(), and maybeOpenFile().

194 { return true; }
SelectionsArray const& edm::OutputModule::keptProducts ( ) const
inline
bool edm::OutputModule::limitReached ( ) const
inlineprivate

Definition at line 205 of file OutputModule.h.

References remainingEvents_.

Referenced by edm::OutputWorker::limitReached().

205 {return remainingEvents_ == 0;}
int edm::OutputModule::maxEvents ( ) const
inline

Accessor for maximum number of events to be written. -1 is used for unlimited.

Definition at line 46 of file OutputModule.h.

References maxEvents_.

Referenced by edm::SubProcess::SubProcess().

46 {return maxEvents_;}
void edm::OutputModule::maybeOpenFile ( )
private

Tell the OutputModule to open an output file, if one is not already open.

Definition at line 370 of file OutputModule.cc.

References doOpenFile(), and isFileOpen().

Referenced by edm::OutputWorker::openNewFileIfNeeded().

370  {
371  if (!isFileOpen()) doOpenFile();
372  }
virtual void doOpenFile()
Definition: OutputModule.h:196
virtual bool isFileOpen() const
Definition: OutputModule.h:194
virtual void edm::OutputModule::openFile ( FileBlock const &  fb)
inlineprivatevirtual
virtual void edm::OutputModule::postForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)
inlineprivatevirtual

Reimplemented in edm::SubProcess, and edm::PoolOutputModule.

Definition at line 192 of file OutputModule.h.

Referenced by doPostForkReacquireResources().

192 {}
virtual void edm::OutputModule::preForkReleaseResources ( )
inlineprivatevirtual

Reimplemented in edm::SubProcess.

Definition at line 191 of file OutputModule.h.

Referenced by doPreForkReleaseResources().

191 {}
std::string const& edm::OutputModule::processName ( ) const
inline

Definition at line 55 of file OutputModule.h.

References process_name_.

Referenced by edm::StreamerOutputModuleBase::serializeRegistry(), and DQMRootOutputModule::startEndFile().

55 {return process_name_;}
std::string process_name_
Definition: OutputModule.h:121
void edm::OutputModule::reallyCloseFile ( )
private

Definition at line 378 of file OutputModule.cc.

References branchChildren_, branchParents_, edm::BranchChildren::clear(), fillDependencyGraph(), finishEndFile(), startEndFile(), writeBranchIDListRegistry(), writeBranchMapper(), writeFileFormatVersion(), writeFileIdentifier(), writeIndexIntoFile(), writeParameterSetRegistry(), writeParentageRegistry(), writeProcessConfigurationRegistry(), writeProcessHistoryRegistry(), writeProductDependencies(), and writeProductDescriptionRegistry().

Referenced by doCloseFile().

378  {
380  startEndFile();
392  finishEndFile();
393  branchParents_.clear();
395  }
virtual void writeProductDependencies()
Definition: OutputModule.h:220
virtual void writeFileFormatVersion()
Definition: OutputModule.h:211
virtual void writeIndexIntoFile()
Definition: OutputModule.h:213
virtual void finishEndFile()
Definition: OutputModule.h:222
virtual void writeParentageRegistry()
Definition: OutputModule.h:218
virtual void writeProcessConfigurationRegistry()
Definition: OutputModule.h:214
virtual void writeFileIdentifier()
Definition: OutputModule.h:212
void fillDependencyGraph()
BranchChildren branchChildren_
Definition: OutputModule.h:142
virtual void writeParameterSetRegistry()
Definition: OutputModule.h:216
virtual void startEndFile()
Definition: OutputModule.h:210
virtual void writeBranchMapper()
Definition: OutputModule.h:221
BranchParents branchParents_
Definition: OutputModule.h:140
virtual void writeBranchIDListRegistry()
Definition: OutputModule.h:217
virtual void writeProcessHistoryRegistry()
Definition: OutputModule.h:215
virtual void writeProductDescriptionRegistry()
Definition: OutputModule.h:219
void edm::OutputModule::registerAnyProducts ( OutputModule const *  ,
ProductRegistry const *   
)
inlineprivate

Definition at line 172 of file OutputModule.h.

172 {}
int edm::OutputModule::remainingEvents ( ) const
inline

Accessor for remaining number of events to be written. -1 is used for unlimited.

Definition at line 50 of file OutputModule.h.

References remainingEvents_.

Referenced by edm::PoolOutputModule::beginInputFile().

50 {return remainingEvents_;}
virtual void edm::OutputModule::respondToCloseInputFile ( FileBlock const &  fb)
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule, and edm::SubProcess.

Definition at line 188 of file OutputModule.h.

Referenced by doRespondToCloseInputFile().

188 {}
virtual void edm::OutputModule::respondToCloseOutputFiles ( FileBlock const &  fb)
inlineprivatevirtual

Reimplemented in edm::SubProcess.

Definition at line 190 of file OutputModule.h.

Referenced by doRespondToCloseOutputFiles().

190 {}
virtual void edm::OutputModule::respondToOpenInputFile ( FileBlock const &  fb)
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule, and edm::SubProcess.

Definition at line 187 of file OutputModule.h.

Referenced by doRespondToOpenInputFile().

187 {}
virtual void edm::OutputModule::respondToOpenOutputFiles ( FileBlock const &  fb)
inlineprivatevirtual

Reimplemented in edm::SubProcess.

Definition at line 189 of file OutputModule.h.

Referenced by doRespondToOpenOutputFiles().

189 {}
bool edm::OutputModule::selected ( BranchDescription const &  desc) const

Definition at line 408 of file OutputModule.cc.

References groupSelector_, and edm::GroupSelector::selected().

Referenced by selectProducts(), and edm::AsciiOutputModule::write().

408  {
409  return groupSelector_.selected(desc);
410  }
GroupSelector groupSelector_
Definition: OutputModule.h:123
bool selected(BranchDescription const &desc) const
ParameterSetID edm::OutputModule::selectorConfig ( ) const
inlineprotected

Definition at line 83 of file OutputModule.h.

References selector_config_id_.

Referenced by edm::StreamerOutputModuleBase::serializeEvent(), and edm::RootOutputFile::writeOne().

83 { return selector_config_id_; }
ParameterSetID selector_config_id_
Definition: OutputModule.h:137
void edm::OutputModule::selectProducts ( )

Definition at line 173 of file OutputModule.cc.

References edm::BranchDescription::branchType(), end, edm::getAllBranchDescriptions(), groupSelector_, groupSelectorRules_, hasNewlyDroppedBranch_, edm::GroupSelector::initialize(), edm::GroupSelector::initialized(), keptProducts_, edm::BranchDescription::present(), edm::BranchDescription::produced(), selected(), and edm::BranchDescription::transient().

Referenced by doBeginJob().

173  {
174  if (groupSelector_.initialized()) return;
177 
178  // TODO: See if we can collapse keptProducts_ and groupSelector_ into a
179  // single object. See the notes in the header for GroupSelector
180  // for more information.
181 
182  ProductRegistry::ProductList::const_iterator it =
183  reg->productList().begin();
184  ProductRegistry::ProductList::const_iterator end =
185  reg->productList().end();
186 
187  for (; it != end; ++it) {
188  BranchDescription const& desc = it->second;
189  if(desc.transient()) {
190  // if the class of the branch is marked transient, output nothing
191  } else if(!desc.present() && !desc.produced()) {
192  // else if the branch containing the product has been previously dropped,
193  // output nothing
194  } else if (selected(desc)) {
195  // else if the branch has been selected, put it in the list of selected branches
196  keptProducts_[desc.branchType()].push_back(&desc);
197  } else {
198  // otherwise, output nothing,
199  // and mark the fact that there is a newly dropped branch of this type.
200  hasNewlyDroppedBranch_[desc.branchType()] = true;
201  }
202  }
203  }
std::vector< BranchDescription const * > getAllBranchDescriptions()
Definition: OutputModule.cc:30
bool initialized() const
Definition: GroupSelector.h:34
boost::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: OutputModule.h:119
bool selected(BranchDescription const &desc) const
SelectionsArray keptProducts_
Definition: OutputModule.h:118
GroupSelectorRules groupSelectorRules_
Definition: OutputModule.h:122
GroupSelector groupSelector_
Definition: OutputModule.h:123
#define end
Definition: vmac.h:38
void initialize(GroupSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
void edm::OutputModule::setModuleDescription ( ModuleDescription const &  md)
inlineprivate

Definition at line 198 of file OutputModule.h.

References moduleDescription_.

198  {
199  moduleDescription_ = md;
200  }
ModuleDescription moduleDescription_
Definition: OutputModule.h:124
virtual bool edm::OutputModule::shouldWeCloseFile ( ) const
inlineprivatevirtual

Ask the OutputModule if we should end the current file.

Reimplemented in edm::PoolOutputModule, and edm::TimeoutPoolOutputModule.

Definition at line 175 of file OutputModule.h.

Referenced by edm::OutputWorker::shouldWeCloseFile().

175 {return false;}
virtual void edm::OutputModule::startEndFile ( )
inlineprivatevirtual

Reimplemented in DQMRootOutputModule, and edm::PoolOutputModule.

Definition at line 210 of file OutputModule.h.

Referenced by reallyCloseFile().

210 {}
void edm::OutputModule::updateBranchParents ( EventPrincipal const &  ep)
private

Definition at line 432 of file OutputModule.cc.

References edm::Principal::begin(), branchChildren_, branchParents_, edm::Principal::end(), i, and edm::BranchChildren::insertEmpty().

Referenced by doEvent().

432  {
433  for (EventPrincipal::const_iterator i = ep.begin(), iEnd = ep.end(); i != iEnd; ++i) {
434  if ((*i) && (*i)->productProvenancePtr() != 0) {
435  BranchID const& bid = (*i)->branchDescription().branchID();
436  BranchParents::iterator it = branchParents_.find(bid);
437  if (it == branchParents_.end()) {
438  it = branchParents_.insert(std::make_pair(bid, std::set<ParentageID>())).first;
439  }
440  it->second.insert((*i)->productProvenancePtr()->parentageID());
442  }
443  }
444  }
int i
Definition: DBlmapReader.cc:9
void insertEmpty(BranchID parent)
boost::filter_iterator< FilledGroupPtr, GroupCollection::const_iterator > const_iterator
Definition: Principal.h:48
BranchChildren branchChildren_
Definition: OutputModule.h:142
BranchParents branchParents_
Definition: OutputModule.h:140
bool edm::OutputModule::wantAllEvents ( ) const
inline
std::string edm::OutputModule::workerType ( ) const
inlineprivate

Definition at line 158 of file OutputModule.h.

158 {return "OutputWorker";}
virtual void edm::OutputModule::write ( EventPrincipal const &  e)
privatepure virtual
virtual void edm::OutputModule::writeBranchIDListRegistry ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 217 of file OutputModule.h.

Referenced by reallyCloseFile().

217 {}
virtual void edm::OutputModule::writeBranchMapper ( )
inlineprivatevirtual

Definition at line 221 of file OutputModule.h.

Referenced by reallyCloseFile().

221 {}
virtual void edm::OutputModule::writeFileFormatVersion ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 211 of file OutputModule.h.

Referenced by reallyCloseFile().

211 {}
virtual void edm::OutputModule::writeFileIdentifier ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 212 of file OutputModule.h.

Referenced by reallyCloseFile().

212 {}
virtual void edm::OutputModule::writeIndexIntoFile ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 213 of file OutputModule.h.

Referenced by reallyCloseFile().

213 {}
virtual void edm::OutputModule::writeLuminosityBlock ( LuminosityBlockPrincipal const &  lb)
privatepure virtual
virtual void edm::OutputModule::writeParameterSetRegistry ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 216 of file OutputModule.h.

Referenced by reallyCloseFile().

216 {}
virtual void edm::OutputModule::writeParentageRegistry ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 218 of file OutputModule.h.

Referenced by reallyCloseFile().

218 {}
virtual void edm::OutputModule::writeProcessConfigurationRegistry ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 214 of file OutputModule.h.

Referenced by reallyCloseFile().

214 {}
virtual void edm::OutputModule::writeProcessHistoryRegistry ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 215 of file OutputModule.h.

Referenced by reallyCloseFile().

215 {}
virtual void edm::OutputModule::writeProductDependencies ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 220 of file OutputModule.h.

Referenced by reallyCloseFile().

220 {}
virtual void edm::OutputModule::writeProductDescriptionRegistry ( )
inlineprivatevirtual

Reimplemented in edm::PoolOutputModule.

Definition at line 219 of file OutputModule.h.

Referenced by reallyCloseFile().

219 {}
virtual void edm::OutputModule::writeRun ( RunPrincipal const &  r)
privatepure virtual

Friends And Related Function Documentation

friend class OutputWorker
friend

Definition at line 38 of file OutputModule.h.

template<typename T >
friend class WorkerT
friend

Definition at line 37 of file OutputModule.h.

Member Data Documentation

BranchChildren edm::OutputModule::branchChildren_
private
BranchParents edm::OutputModule::branchParents_
private

Definition at line 140 of file OutputModule.h.

Referenced by fillDependencyGraph(), reallyCloseFile(), and updateBranchParents().

CurrentProcessingContext const* edm::OutputModule::current_context_
private
GroupSelector edm::OutputModule::groupSelector_
private

Definition at line 123 of file OutputModule.h.

Referenced by selected(), and selectProducts().

GroupSelectorRules edm::OutputModule::groupSelectorRules_
private

Definition at line 122 of file OutputModule.h.

Referenced by selectProducts().

boost::array<bool, NumBranchTypes> edm::OutputModule::hasNewlyDroppedBranch_
private

Definition at line 119 of file OutputModule.h.

Referenced by hasNewlyDroppedBranch(), OutputModule(), and selectProducts().

SelectionsArray edm::OutputModule::keptProducts_
private

Definition at line 118 of file OutputModule.h.

Referenced by keptProducts(), and selectProducts().

int edm::OutputModule::maxEvents_
private

Definition at line 100 of file OutputModule.h.

Referenced by configure(), and maxEvents().

ModuleDescription edm::OutputModule::moduleDescription_
private

Definition at line 124 of file OutputModule.h.

Referenced by description(), doEvent(), and setModuleDescription().

std::string edm::OutputModule::process_name_
private

Definition at line 121 of file OutputModule.h.

Referenced by OutputModule(), and processName().

bool edm::OutputModule::prodsValid_
mutableprivate

Definition at line 131 of file OutputModule.h.

Referenced by doEvent().

int edm::OutputModule::remainingEvents_
private

Definition at line 101 of file OutputModule.h.

Referenced by configure(), doEvent(), limitReached(), and remainingEvents().

ParameterSetID edm::OutputModule::selector_config_id_
private

Definition at line 137 of file OutputModule.h.

Referenced by OutputModule(), and selectorConfig().

detail::CachedProducts edm::OutputModule::selectors_
mutableprivate

Definition at line 134 of file OutputModule.h.

Referenced by doEvent(), getTriggerResults(), and OutputModule().

bool edm::OutputModule::wantAllEvents_
private

Definition at line 133 of file OutputModule.h.

Referenced by doEvent(), OutputModule(), and wantAllEvents().