CMS 3D CMS Logo

edm::OutputModule Class Reference

#include <FWCore/Framework/interface/OutputModule.h>

Inheritance diagram for edm::OutputModule:

edm::AsciiOutputModule edm::PoolOutputModule edm::ProvenanceCheckerOutputModule edm::StreamerOutputModuleBase edm::XMLOutputModule FRDEventOutputModule< Consumer > edm::StreamerOutputModule< Consumer >

List of all members.

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
 Accessor for maximum number of events to be written.
unsigned int nextID () const
 OutputModule (ParameterSet const &pset)
std::string const & processName () const
int remainingEvents () const
 Accessor for remaining number of events to be written.
bool selected (BranchDescription const &desc) const
void selectProducts ()
virtual ~OutputModule ()

Static Public Member Functions

static void fillDescription (edm::ParameterSetDescription &)

Protected Member Functions

CurrentProcessingContext const * currentContext () const
ModuleDescription const & description () const
Trig getTriggerResults (EventPrincipal const &ep) const
Trig getTriggerResults (Event const &ep) const
ParameterSetID selectorConfig () const
bool wantAllEvents () const

Private Types

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

Private Member Functions

virtual void beginJob (EventSetup const &)
virtual void beginLuminosityBlock (LuminosityBlockPrincipal const &lb)
virtual void beginRun (RunPrincipal const &r)
void configure (OutputModuleDescription const &desc)
void doBeginJob (EventSetup const &)
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
void doCloseFile ()
 Tell the OutputModule that is must end the current file.
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)
virtual void doOpenFile ()
void doOpenFile (FileBlock const &fb)
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 ()
 Tell the OutputModule to open an output file, if one is not already open.
virtual void openFile (FileBlock const &fb)
void reallyCloseFile ()
void registerAnyProducts (boost::shared_ptr< 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.
virtual void startEndFile ()
void updateBranchParents (EventPrincipal const &ep)
std::string workerType () const
virtual void write (EventPrincipal const &e)=0
virtual void writeBranchMapper ()
virtual void writeEntryDescriptions ()
virtual void writeEventHistory ()
virtual void writeFileFormatVersion ()
virtual void writeFileIdentifier ()
virtual void writeFileIndex ()
virtual void writeLuminosityBlock (LuminosityBlockPrincipal const &lb)=0
virtual void writeModuleDescriptionRegistry ()
virtual void writeParameterSetRegistry ()
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_
unsigned int nextID_
std::string process_name_
bool prodsValid_
int remainingEvents_
ParameterSetID selector_config_id_
detail::CachedProducts selectors_
bool wantAllEvents_

Friends

class OutputWorker
class WorkerT


Detailed Description

Definition at line 38 of file OutputModule.h.


Member Typedef Documentation

typedef std::map<BranchID, std::set<EntryDescriptionID> > edm::OutputModule::BranchParents [private]

Definition at line 130 of file OutputModule.h.

typedef OutputModule edm::OutputModule::ModuleType

Definition at line 42 of file OutputModule.h.

typedef OutputWorker edm::OutputModule::WorkerType

Definition at line 43 of file OutputModule.h.


Constructor & Destructor Documentation

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

Definition at line 117 of file OutputModule.cc.

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

00117                                                      : 
00118     maxEvents_(-1),
00119     remainingEvents_(maxEvents_),
00120     nextID_(),
00121     keptProducts_(),
00122     hasNewlyDroppedBranch_(),
00123     process_name_(),
00124     groupSelectorRules_(pset, "outputCommands", "OutputModule"),
00125     groupSelector_(),
00126     moduleDescription_(),
00127     current_context_(0),
00128     prodsValid_(false),
00129     wantAllEvents_(false),
00130     selectors_(),
00131     selector_config_id_(),
00132     branchParents_(),
00133     branchChildren_()
00134   {
00135     hasNewlyDroppedBranch_.assign(false);
00136 
00137     edm::Service<edm::service::TriggerNamesService> tns;
00138     process_name_ = tns->getProcessName();
00139 
00140     ParameterSet selectevents =
00141       pset.getUntrackedParameter("SelectEvents", ParameterSet());
00142 
00143     selector_config_id_ = selectevents.id();
00144     // If selectevents is an emtpy ParameterSet, then we are to write
00145     // all events, or one which contains a vstrig 'SelectEvents' that
00146     // is empty, we are to write all events. We have no need for any
00147     // EventSelectors.
00148     if (selectevents.empty()) {
00149         wantAllEvents_ = true;
00150         selectors_.setupDefault(getAllTriggerNames());
00151         return;
00152     }
00153 
00154     vector<std::string> path_specs = 
00155       selectevents.getParameter<vector<std::string> >("SelectEvents");
00156 
00157     if (path_specs.empty()) {
00158         wantAllEvents_ = true;
00159         selectors_.setupDefault(getAllTriggerNames());
00160         return;
00161     }
00162 
00163     // If we get here, we have the possibility of having to deal with
00164     // path_specs that look at more than one process.
00165     vector<parsed_path_spec_t> parsed_paths(path_specs.size());
00166     for (size_t i = 0; i < path_specs.size(); ++i)
00167       parse_path_spec(path_specs[i], parsed_paths[i]);
00168 
00169     selectors_.setup(parsed_paths, getAllTriggerNames(), process_name_);
00170   }

edm::OutputModule::~OutputModule (  )  [virtual]

Definition at line 209 of file OutputModule.cc.

00209 { }


Member Function Documentation

virtual void edm::OutputModule::beginJob ( EventSetup const &   )  [inline, private, virtual]

Reimplemented in edm::StreamerOutputModuleBase.

Definition at line 179 of file OutputModule.h.

Referenced by doBeginJob().

00179 {}

virtual void edm::OutputModule::beginLuminosityBlock ( LuminosityBlockPrincipal const &  lb  )  [inline, private, virtual]

Definition at line 184 of file OutputModule.h.

Referenced by doBeginLuminosityBlock().

00184 {}

virtual void edm::OutputModule::beginRun ( RunPrincipal const &  r  )  [inline, private, virtual]

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

Definition at line 181 of file OutputModule.h.

Referenced by doBeginRun().

00181 {}

BranchChildren const& edm::OutputModule::branchChildren (  )  const [inline]

Definition at line 65 of file OutputModule.h.

References branchChildren_.

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

00065 {return branchChildren_;}

void edm::OutputModule::configure ( OutputModuleDescription const &  desc  )  [private]

Definition at line 172 of file OutputModule.cc.

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

00172                                                                   {
00173     remainingEvents_ = maxEvents_ = desc.maxEvents_;
00174   }

CurrentProcessingContext const * edm::OutputModule::currentContext (  )  const [protected]

Definition at line 392 of file OutputModule.cc.

References current_context_.

00392                                      {
00393     return current_context_;
00394   }

ModuleDescription const & edm::OutputModule::description (  )  const [protected]

Definition at line 397 of file OutputModule.cc.

References moduleDescription_.

Referenced by edm::StreamerOutputModuleBase::serializeRegistry(), and FRDEventOutputModule< Consumer >::write().

00397                                   {
00398     return moduleDescription_;
00399   }

void edm::OutputModule::doBeginJob ( EventSetup const &  c  )  [private]

Definition at line 211 of file OutputModule.cc.

References beginJob(), and selectProducts().

00211                                                    {
00212     selectProducts();
00213     beginJob(c);
00214   }

bool edm::OutputModule::doBeginLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
EventSetup const &  c,
CurrentProcessingContext const *  cpc 
) [private]

Definition at line 319 of file OutputModule.cc.

References beginLuminosityBlock(), current_context_, and FDEBUG.

00321                                                                                  {
00322     detail::CPCSentry sentry(current_context_, cpc);
00323     FDEBUG(2) << "beginLuminosityBlock called\n";
00324     beginLuminosityBlock(lbp);
00325     return true;
00326   }

bool edm::OutputModule::doBeginRun ( RunPrincipal const &  rp,
EventSetup const &  c,
CurrentProcessingContext const *  cpc 
) [private]

Definition at line 293 of file OutputModule.cc.

References beginRun(), current_context_, and FDEBUG.

00295                                                                      {
00296     detail::CPCSentry sentry(current_context_, cpc);
00297     FDEBUG(2) << "beginRun called\n";
00298     beginRun(rp);
00299     return true;
00300   }

void edm::OutputModule::doCloseFile (  )  [private]

Tell the OutputModule that is must end the current file.

Definition at line 367 of file OutputModule.cc.

References isFileOpen(), and reallyCloseFile().

00367                                  {
00368     if (isFileOpen()) reallyCloseFile();
00369   }

void edm::OutputModule::doEndJob (  )  [private]

Definition at line 216 of file OutputModule.cc.

References endJob().

00216                               {
00217     endJob();
00218   }

bool edm::OutputModule::doEndLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
EventSetup const &  c,
CurrentProcessingContext const *  cpc 
) [private]

Definition at line 329 of file OutputModule.cc.

References current_context_, endLuminosityBlock(), and FDEBUG.

00331                                                                                {
00332     detail::CPCSentry sentry(current_context_, cpc);
00333     FDEBUG(2) << "endLuminosityBlock called\n";
00334     endLuminosityBlock(lbp);
00335     return true;
00336   }

bool edm::OutputModule::doEndRun ( RunPrincipal const &  rp,
EventSetup const &  c,
CurrentProcessingContext const *  cpc 
) [private]

Definition at line 303 of file OutputModule.cc.

References current_context_, endRun(), and FDEBUG.

00305                                                                    {
00306     detail::CPCSentry sentry(current_context_, cpc);
00307     FDEBUG(2) << "endRun called\n";
00308     endRun(rp);
00309     return true;
00310   }

bool edm::OutputModule::doEvent ( EventPrincipal const &  ep,
EventSetup const &  c,
CurrentProcessingContext const *  cpc 
) [private]

Definition at line 250 of file OutputModule.cc.

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

00252                                                              {
00253     detail::CPCSentry sentry(current_context_, cpc);
00254     PVSentry          products_sentry(selectors_, prodsValid_);
00255 
00256     FDEBUG(2) << "writeEvent called\n";
00257 
00258     // This ugly little bit is here to prevent making the Event
00259     // if we don't need it.
00260     if (!wantAllEvents_) {
00261       // use module description and const_cast unless interface to
00262       // event is changed to just take a const EventPrincipal
00263       Event e(const_cast<EventPrincipal &>(ep), moduleDescription_);
00264       if (!selectors_.wantEvent(e)) {
00265         return true;
00266       }
00267     }
00268     write(ep);
00269     updateBranchParents(ep);
00270     if (remainingEvents_ > 0) {
00271       --remainingEvents_;
00272     }
00273     return true;
00274   }

virtual void edm::OutputModule::doOpenFile (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 195 of file OutputModule.h.

Referenced by maybeOpenFile().

00195 { }

void edm::OutputModule::doOpenFile ( FileBlock const &  fb  )  [private]

Definition at line 343 of file OutputModule.cc.

References openFile().

00343                                                    {
00344     openFile(fb);
00345   }

void edm::OutputModule::doRespondToCloseInputFile ( FileBlock const &  fb  )  [private]

Definition at line 351 of file OutputModule.cc.

References respondToCloseInputFile().

00351                                                                   {
00352     respondToCloseInputFile(fb);
00353   }

void edm::OutputModule::doRespondToCloseOutputFiles ( FileBlock const &  fb  )  [private]

Definition at line 359 of file OutputModule.cc.

References respondToCloseOutputFiles().

00359                                                                     {
00360     respondToCloseOutputFiles(fb);
00361   }

void edm::OutputModule::doRespondToOpenInputFile ( FileBlock const &  fb  )  [private]

Definition at line 347 of file OutputModule.cc.

References respondToOpenInputFile().

00347                                                                  {
00348     respondToOpenInputFile(fb);
00349   }

void edm::OutputModule::doRespondToOpenOutputFiles ( FileBlock const &  fb  )  [private]

Definition at line 355 of file OutputModule.cc.

References respondToOpenOutputFiles().

00355                                                                    {
00356     respondToOpenOutputFiles(fb);
00357   }

void edm::OutputModule::doWriteLuminosityBlock ( LuminosityBlockPrincipal const &  lbp  )  [private]

Definition at line 338 of file OutputModule.cc.

References FDEBUG, and writeLuminosityBlock().

00338                                                                                {
00339     FDEBUG(2) << "writeLuminosityBlock called\n";
00340     writeLuminosityBlock(lbp);
00341   }

void edm::OutputModule::doWriteRun ( RunPrincipal const &  rp  )  [private]

Definition at line 313 of file OutputModule.cc.

References FDEBUG, and writeRun().

00313                                                  {
00314     FDEBUG(2) << "writeRun called\n";
00315     writeRun(rp);
00316   }

virtual void edm::OutputModule::endJob ( void   )  [inline, private, virtual]

Reimplemented in edm::StreamerOutputModuleBase.

Definition at line 180 of file OutputModule.h.

Referenced by doEndJob().

00180 {}

virtual void edm::OutputModule::endLuminosityBlock ( LuminosityBlockPrincipal const &  lb  )  [inline, private, virtual]

Definition at line 185 of file OutputModule.h.

Referenced by doEndLuminosityBlock().

00185 {}

virtual void edm::OutputModule::endRun ( RunPrincipal const &  r  )  [inline, private, virtual]

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

Definition at line 182 of file OutputModule.h.

Referenced by doEndRun().

00182 {}

void edm::OutputModule::fillDependencyGraph (  )  [private]

Definition at line 430 of file OutputModule.cc.

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

Referenced by reallyCloseFile().

00430                                     {
00431     for (BranchParents::const_iterator i = branchParents_.begin(), iEnd = branchParents_.end();
00432         i != iEnd; ++i) {
00433       BranchID const& child = i->first;
00434       std::set<EntryDescriptionID> const& eIds = i->second;
00435       for (std::set<EntryDescriptionID>::const_iterator it = eIds.begin(), itEnd = eIds.end();
00436           it != itEnd; ++it) {
00437         EventEntryDescription entryDesc;
00438         EntryDescriptionRegistry::instance()->getMapped(*it, entryDesc);
00439         std::vector<BranchID> const& parents = entryDesc.parents();
00440         for (std::vector<BranchID>::const_iterator j = parents.begin(), jEnd = parents.end();
00441           j != jEnd; ++j) {
00442           branchChildren_.insertChild(*j, child);
00443         }
00444       }
00445     }
00446   }

void edm::OutputModule::fillDescription ( edm::ParameterSetDescription iDesc  )  [static]

Definition at line 410 of file OutputModule.cc.

References edm::ParameterSetDescription::setUnknown().

00410                                                               {
00411     iDesc.setUnknown();
00412   }

virtual void edm::OutputModule::finishEndFile (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 222 of file OutputModule.h.

Referenced by reallyCloseFile().

00222 {}

Trig edm::OutputModule::getTriggerResults ( EventPrincipal const &  ep  )  const [protected]

Definition at line 225 of file OutputModule.cc.

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

00225                                                                      {
00226     // This is bad, because we're returning handles into an Event that
00227     // is destructed before the return. It might not fail, because the
00228     // actual EventPrincipal is not destroyed, but it still needs to
00229     // be cleaned up.
00230     Event ev(const_cast<EventPrincipal&>(ep), 
00231              *current_context_->moduleDescription());
00232     return getTriggerResults(ev);
00233   }

Trig edm::OutputModule::getTriggerResults ( Event const &  ep  )  const [protected]

Definition at line 221 of file OutputModule.cc.

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

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

00221                                                             {
00222     return selectors_.getOneTriggerResults(ev);
00223   }

boost::array<bool, NumBranchTypes> const& edm::OutputModule::hasNewlyDroppedBranch (  )  const [inline]

Definition at line 61 of file OutputModule.h.

References hasNewlyDroppedBranch_.

Referenced by edm::PoolOutputModule::write(), edm::PoolOutputModule::writeLuminosityBlock(), and edm::PoolOutputModule::writeRun().

00061 {return hasNewlyDroppedBranch_;}

virtual bool edm::OutputModule::isFileOpen (  )  const [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 193 of file OutputModule.h.

Referenced by doCloseFile(), and maybeOpenFile().

00193 { return true; }

SelectionsArray const& edm::OutputModule::keptProducts (  )  const [inline]

Definition at line 60 of file OutputModule.h.

References keptProducts_.

Referenced by edm::PoolOutputModule::fillSelectedItemList(), edm::RootOutputFile::finishEndFile(), and edm::XMLOutputModule::write().

00060 {return keptProducts_;}

bool edm::OutputModule::limitReached (  )  const [inline, private]

Definition at line 204 of file OutputModule.h.

References remainingEvents_.

00204 {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 49 of file OutputModule.h.

References maxEvents_.

00049 {return maxEvents_;}

void edm::OutputModule::maybeOpenFile (  )  [private]

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

Definition at line 363 of file OutputModule.cc.

References doOpenFile(), and isFileOpen().

00363                                    {
00364     if (!isFileOpen()) doOpenFile();
00365   }

unsigned int edm::OutputModule::nextID (  )  const

Definition at line 405 of file OutputModule.cc.

References nextID_.

00405                                           {
00406     return nextID_;
00407   }

virtual void edm::OutputModule::openFile ( FileBlock const &  fb  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 187 of file OutputModule.h.

Referenced by doOpenFile().

00187 {}

std::string const& edm::OutputModule::processName (  )  const [inline]

Definition at line 59 of file OutputModule.h.

References process_name_.

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

00059 {return process_name_;}

void edm::OutputModule::reallyCloseFile (  )  [private]

Definition at line 371 of file OutputModule.cc.

References branchChildren_, branchParents_, edm::BranchChildren::clear(), fillDependencyGraph(), finishEndFile(), startEndFile(), writeBranchMapper(), writeEntryDescriptions(), writeEventHistory(), writeFileFormatVersion(), writeFileIdentifier(), writeFileIndex(), writeModuleDescriptionRegistry(), writeParameterSetRegistry(), writeProcessConfigurationRegistry(), writeProcessHistoryRegistry(), writeProductDependencies(), and writeProductDescriptionRegistry().

Referenced by doCloseFile().

void edm::OutputModule::registerAnyProducts ( boost::shared_ptr< OutputModule >const &  ,
ProductRegistry const *   
) [inline, private]

Definition at line 173 of file OutputModule.h.

00173 {}

int edm::OutputModule::remainingEvents (  )  const [inline]

Accessor for remaining number of events to be written.

-1 is used for unlimited.

Definition at line 53 of file OutputModule.h.

References remainingEvents_.

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

00053 {return remainingEvents_;}

virtual void edm::OutputModule::respondToCloseInputFile ( FileBlock const &  fb  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 189 of file OutputModule.h.

Referenced by doRespondToCloseInputFile().

00189 {}

virtual void edm::OutputModule::respondToCloseOutputFiles ( FileBlock const &  fb  )  [inline, private, virtual]

Definition at line 191 of file OutputModule.h.

Referenced by doRespondToCloseOutputFiles().

00191 {}

virtual void edm::OutputModule::respondToOpenInputFile ( FileBlock const &  fb  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 188 of file OutputModule.h.

Referenced by doRespondToOpenInputFile().

00188 {}

virtual void edm::OutputModule::respondToOpenOutputFiles ( FileBlock const &  fb  )  [inline, private, virtual]

Definition at line 190 of file OutputModule.h.

Referenced by doRespondToOpenOutputFiles().

00190 {}

bool edm::OutputModule::selected ( BranchDescription const &  desc  )  const

Definition at line 401 of file OutputModule.cc.

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

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

00401                                                                  {
00402     return groupSelector_.selected(desc);
00403   }

ParameterSetID edm::OutputModule::selectorConfig (  )  const [inline, protected]

Definition at line 85 of file OutputModule.h.

References selector_config_id_.

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

00085 { return selector_config_id_; }

void edm::OutputModule::selectProducts (  ) 

Definition at line 176 of file OutputModule.cc.

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

Referenced by doBeginJob().

00176                                     {
00177     if (groupSelector_.initialized()) return;
00178     groupSelector_.initialize(groupSelectorRules_, getAllBranchDescriptions());
00179     Service<ConstProductRegistry> reg;
00180     nextID_ = reg->nextID();
00181 
00182     // TODO: See if we can collapse keptProducts_ and groupSelector_ into a
00183     // single object. See the notes in the header for GroupSelector
00184     // for more information.
00185 
00186     ProductRegistry::ProductList::const_iterator it  = 
00187       reg->productList().begin();
00188     ProductRegistry::ProductList::const_iterator end = 
00189       reg->productList().end();
00190 
00191     for (; it != end; ++it) {
00192       BranchDescription const& desc = it->second;
00193       if(desc.transient()) {
00194         // if the class of the branch is marked transient, output nothing
00195       } else if(!desc.present() && !desc.produced()) {
00196         // else if the branch containing the product has been previously dropped,
00197         // output nothing
00198       } else if (selected(desc)) {
00199         // else if the branch has been selected, put it in the list of selected branches
00200         keptProducts_[desc.branchType()].push_back(&desc);
00201       } else {
00202         // otherwise, output nothing,
00203         // and mark the fact that there is a newly dropped branch of this type.
00204         hasNewlyDroppedBranch_[desc.branchType()] = true;
00205       }
00206     }
00207   }

void edm::OutputModule::setModuleDescription ( ModuleDescription const &  md  )  [inline, private]

Definition at line 197 of file OutputModule.h.

References moduleDescription_.

00197                                                            {
00198       moduleDescription_ = md;
00199     }

virtual bool edm::OutputModule::shouldWeCloseFile (  )  const [inline, private, virtual]

Ask the OutputModule if we should end the current file.

Reimplemented in edm::PoolOutputModule.

Definition at line 176 of file OutputModule.h.

00176 {return false;}

virtual void edm::OutputModule::startEndFile (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 209 of file OutputModule.h.

Referenced by reallyCloseFile().

00209 {}

void edm::OutputModule::updateBranchParents ( EventPrincipal const &  ep  )  [private]

Definition at line 415 of file OutputModule.cc.

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

Referenced by doEvent().

00415                                                             {
00416     for (EventPrincipal::const_iterator i = ep.begin(), iEnd = ep.end(); i != iEnd; ++i) {
00417       if (i->second->entryInfoPtr() != 0) {
00418         BranchID const& bid = i->first;
00419         BranchParents::iterator it = branchParents_.find(bid);
00420         if (it == branchParents_.end()) {
00421            it = branchParents_.insert(std::make_pair(bid, std::set<EntryDescriptionID>())).first;
00422         }
00423         it->second.insert(i->second->entryInfoPtr()->entryDescriptionID());
00424         branchChildren_.insertEmpty(bid);
00425       }
00426     }
00427   }

bool edm::OutputModule::wantAllEvents (  )  const [inline, protected]

Definition at line 83 of file OutputModule.h.

References wantAllEvents_.

00083 {return wantAllEvents_;}

std::string edm::OutputModule::workerType (  )  const [inline, private]

Definition at line 159 of file OutputModule.h.

00159 {return "OutputWorker";}

virtual void edm::OutputModule::write ( EventPrincipal const &  e  )  [private, pure virtual]

Implemented in edm::AsciiOutputModule, edm::ProvenanceCheckerOutputModule, edm::XMLOutputModule, edm::PoolOutputModule, FRDEventOutputModule< Consumer >, and edm::StreamerOutputModuleBase.

Referenced by doEvent().

virtual void edm::OutputModule::writeBranchMapper (  )  [inline, private, virtual]

Definition at line 221 of file OutputModule.h.

Referenced by reallyCloseFile().

00221 {}

virtual void edm::OutputModule::writeEntryDescriptions (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 220 of file OutputModule.h.

Referenced by reallyCloseFile().

00220 {}

virtual void edm::OutputModule::writeEventHistory (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 213 of file OutputModule.h.

Referenced by reallyCloseFile().

00213 {}

virtual void edm::OutputModule::writeFileFormatVersion (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 210 of file OutputModule.h.

Referenced by reallyCloseFile().

00210 {}

virtual void edm::OutputModule::writeFileIdentifier (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 211 of file OutputModule.h.

Referenced by reallyCloseFile().

00211 {}

virtual void edm::OutputModule::writeFileIndex (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 212 of file OutputModule.h.

Referenced by reallyCloseFile().

00212 {}

virtual void edm::OutputModule::writeLuminosityBlock ( LuminosityBlockPrincipal const &  lb  )  [private, pure virtual]

Implemented in edm::AsciiOutputModule, edm::ProvenanceCheckerOutputModule, edm::XMLOutputModule, edm::PoolOutputModule, FRDEventOutputModule< Consumer >, and edm::StreamerOutputModuleBase.

Referenced by doWriteLuminosityBlock().

virtual void edm::OutputModule::writeModuleDescriptionRegistry (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 216 of file OutputModule.h.

Referenced by reallyCloseFile().

00216 {}

virtual void edm::OutputModule::writeParameterSetRegistry (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 217 of file OutputModule.h.

Referenced by reallyCloseFile().

00217 {}

virtual void edm::OutputModule::writeProcessConfigurationRegistry (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 214 of file OutputModule.h.

Referenced by reallyCloseFile().

00214 {}

virtual void edm::OutputModule::writeProcessHistoryRegistry (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 215 of file OutputModule.h.

Referenced by reallyCloseFile().

00215 {}

virtual void edm::OutputModule::writeProductDependencies (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 219 of file OutputModule.h.

Referenced by reallyCloseFile().

00219 {}

virtual void edm::OutputModule::writeProductDescriptionRegistry (  )  [inline, private, virtual]

Reimplemented in edm::PoolOutputModule.

Definition at line 218 of file OutputModule.h.

Referenced by reallyCloseFile().

00218 {}

virtual void edm::OutputModule::writeRun ( RunPrincipal const &  r  )  [private, pure virtual]

Implemented in edm::AsciiOutputModule, edm::ProvenanceCheckerOutputModule, edm::XMLOutputModule, edm::PoolOutputModule, FRDEventOutputModule< Consumer >, and edm::StreamerOutputModuleBase.

Referenced by doWriteRun().


Friends And Related Function Documentation

friend class OutputWorker [friend]

Definition at line 41 of file OutputModule.h.

friend class WorkerT [friend]

Definition at line 40 of file OutputModule.h.


Member Data Documentation

BranchChildren edm::OutputModule::branchChildren_ [private]

Definition at line 133 of file OutputModule.h.

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

BranchParents edm::OutputModule::branchParents_ [private]

Definition at line 131 of file OutputModule.h.

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

CurrentProcessingContext const* edm::OutputModule::current_context_ [private]

Definition at line 118 of file OutputModule.h.

Referenced by currentContext(), doBeginLuminosityBlock(), doBeginRun(), doEndLuminosityBlock(), doEndRun(), doEvent(), and getTriggerResults().

GroupSelector edm::OutputModule::groupSelector_ [private]

Definition at line 114 of file OutputModule.h.

Referenced by selected(), and selectProducts().

GroupSelectorRules edm::OutputModule::groupSelectorRules_ [private]

Definition at line 113 of file OutputModule.h.

Referenced by selectProducts().

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

Definition at line 110 of file OutputModule.h.

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

SelectionsArray edm::OutputModule::keptProducts_ [private]

Definition at line 108 of file OutputModule.h.

Referenced by keptProducts(), and selectProducts().

int edm::OutputModule::maxEvents_ [private]

Definition at line 89 of file OutputModule.h.

Referenced by configure(), and maxEvents().

ModuleDescription edm::OutputModule::moduleDescription_ [private]

Definition at line 115 of file OutputModule.h.

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

unsigned int edm::OutputModule::nextID_ [private]

Definition at line 92 of file OutputModule.h.

Referenced by nextID(), and selectProducts().

std::string edm::OutputModule::process_name_ [private]

Definition at line 112 of file OutputModule.h.

Referenced by OutputModule(), and processName().

bool edm::OutputModule::prodsValid_ [mutable, private]

Definition at line 122 of file OutputModule.h.

Referenced by doEvent().

int edm::OutputModule::remainingEvents_ [private]

Definition at line 90 of file OutputModule.h.

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

ParameterSetID edm::OutputModule::selector_config_id_ [private]

Definition at line 128 of file OutputModule.h.

Referenced by OutputModule(), and selectorConfig().

detail::CachedProducts edm::OutputModule::selectors_ [mutable, private]

Definition at line 125 of file OutputModule.h.

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

bool edm::OutputModule::wantAllEvents_ [private]

Definition at line 124 of file OutputModule.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:42:01 2009 for CMSSW by  doxygen 1.5.4