CMS 3D CMS Logo

edm::RunPrincipal Class Reference

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

Inheritance diagram for edm::RunPrincipal:

edm::Principal edm::EDProductGetter

List of all members.

Public Types

typedef RunAuxiliary Auxiliary
typedef Principal Base
typedef std::vector< RunEntryInfoEntryInfoVector

Public Member Functions

void addGroup (ConstBranchDescription const &bd, std::auto_ptr< EventEntryInfo > entryInfo)
void addGroup (std::auto_ptr< EDProduct > prod, ConstBranchDescription const &bd, std::auto_ptr< EventEntryInfo > entryInfo)
void addGroup (ConstBranchDescription const &bd)
RunAuxiliary const & aux () const
Timestamp const & beginTime () const
Timestamp const & endTime () const
void getAllProvenance (std::vector< Provenance const * > &provenances) const
Provenance getProvenance (BranchID const &bid) const
RunID const & id () const
void mergeRun (boost::shared_ptr< RunPrincipal > rp)
void put (std::auto_ptr< EDProduct > edp, ConstBranchDescription const &bd, std::auto_ptr< EventEntryInfo > entryInfo)
RunNumber_t run () const
 RunPrincipal (RunAuxiliary const &aux, boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, ProcessHistoryID const &hist=ProcessHistoryID(), boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), boost::shared_ptr< DelayedReader > rtrv=boost::shared_ptr< DelayedReader >(new NoDelayedReader))
void setEndTime (Timestamp const &time)
void setUnscheduledHandler (boost::shared_ptr< UnscheduledHandler >)
 ~RunPrincipal ()

Private Member Functions

virtual void addOrReplaceGroup (std::auto_ptr< Group > g)
virtual void resolveProvenance (Group const &g) const
virtual bool unscheduledFill (std::string const &) const

Private Attributes

RunAuxiliary aux_


Detailed Description

Definition at line 26 of file RunPrincipal.h.


Member Typedef Documentation

typedef RunAuxiliary edm::RunPrincipal::Auxiliary

Definition at line 28 of file RunPrincipal.h.

typedef Principal edm::RunPrincipal::Base

Definition at line 30 of file RunPrincipal.h.

typedef std::vector<RunEntryInfo> edm::RunPrincipal::EntryInfoVector

Definition at line 29 of file RunPrincipal.h.


Constructor & Destructor Documentation

edm::RunPrincipal::RunPrincipal ( RunAuxiliary const &  aux,
boost::shared_ptr< ProductRegistry const >  reg,
ProcessConfiguration const &  pc,
ProcessHistoryID const &  hist = ProcessHistoryID(),
boost::shared_ptr< BranchMapper mapper = boost::shared_ptr<BranchMapper>(new BranchMapper),
boost::shared_ptr< DelayedReader rtrv = boost::shared_ptr<DelayedReader>(new NoDelayedReader) 
) [inline]

Definition at line 32 of file RunPrincipal.h.

00037                                                                                                    :
00038           Base(reg, pc, hist, mapper, rtrv),
00039           aux_(aux) {}
    ~RunPrincipal() {}

edm::RunPrincipal::~RunPrincipal (  )  [inline]

Definition at line 40 of file RunPrincipal.h.

00040 {}


Member Function Documentation

void edm::RunPrincipal::addGroup ( ConstBranchDescription const &  bd,
std::auto_ptr< EventEntryInfo entryInfo 
)

Definition at line 40 of file RunPrincipal.cc.

References addOrReplaceGroup(), and g.

00041                                                {
00042     std::auto_ptr<Group> g(new Group(bd, entryInfo));
00043     addOrReplaceGroup(g);
00044   }

void edm::RunPrincipal::addGroup ( std::auto_ptr< EDProduct prod,
ConstBranchDescription const &  bd,
std::auto_ptr< EventEntryInfo entryInfo 
)

Definition at line 32 of file RunPrincipal.cc.

References addOrReplaceGroup(), and g.

00034                                                {
00035     std::auto_ptr<Group> g(new Group(prod, bd, entryInfo));
00036     addOrReplaceGroup(g);
00037   }

void edm::RunPrincipal::addGroup ( ConstBranchDescription const &  bd  ) 

Definition at line 26 of file RunPrincipal.cc.

References addOrReplaceGroup(), and g.

Referenced by put().

00026                                                          {
00027     std::auto_ptr<Group> g(new Group(bd));
00028     addOrReplaceGroup(g);
00029   }

void edm::RunPrincipal::addOrReplaceGroup ( std::auto_ptr< Group g  )  [private, virtual]

Implements edm::Principal.

Definition at line 6 of file RunPrincipal.cc.

References edm::Principal::addGroup_(), edm::Principal::getExistingGroup(), group, edm::Group::mergeGroup(), edm::Group::product(), and edm::Group::productUnavailable().

Referenced by addGroup(), and mergeRun().

00006                                                       {
00007 
00008     Group* group = getExistingGroup(*g);
00009     if (group != 0) {
00010 
00011       if (!group->productUnavailable()) {
00012         assert(group->product() != 0);
00013       }
00014       if (!g->productUnavailable()) {
00015         assert(g->product() != 0);
00016       }
00017 
00018       group->mergeGroup(g.get());
00019     } else {
00020       addGroup_(g);
00021     }
00022   }

RunAuxiliary const& edm::RunPrincipal::aux (  )  const [inline]

Definition at line 42 of file RunPrincipal.h.

References aux_, edm::Principal::processHistoryID(), and edm::RunAuxiliary::processHistoryID_.

Referenced by beginTime(), endTime(), id(), run(), and edm::RootOutputFile::writeRun().

00042                                     {
00043       aux_.processHistoryID_ = processHistoryID();
00044       return aux_;
00045     }

Timestamp const& edm::RunPrincipal::beginTime (  )  const [inline]

Definition at line 55 of file RunPrincipal.h.

References aux(), and edm::RunAuxiliary::beginTime().

Referenced by edm::EventProcessor::beginRun(), and edm::OccurrenceTraits< RunPrincipal, BranchActionBegin >::preScheduleSignal().

00055                                        {
00056       return aux().beginTime();
00057     }

Timestamp const& edm::RunPrincipal::endTime (  )  const [inline]

Definition at line 59 of file RunPrincipal.h.

References aux(), and edm::RunAuxiliary::endTime().

Referenced by edm::EventProcessor::endRun(), and edm::OccurrenceTraits< RunPrincipal, BranchActionEnd >::preScheduleSignal().

00059                                      {
00060       return aux().endTime();
00061     }

void edm::RunPrincipal::getAllProvenance ( std::vector< Provenance const * > &  provenances  )  const

Definition at line 87 of file RunPrincipal.cc.

References edm::Principal::begin(), edm::Principal::end(), i, and resolveProvenance().

00087                                                                                  {
00088     provenances.clear();
00089     for (Base::const_iterator i = begin(), iEnd = end(); i != iEnd; ++i) {
00090       if (i->second->provenanceAvailable()) {
00091         resolveProvenance(*i->second);
00092         if (i->second->provenance()->branchEntryInfoSharedPtr() &&
00093             i->second->provenance()->isPresent() &&
00094             i->second->provenance()->product().present())
00095            provenances.push_back(i->second->provenance());
00096         }
00097     }
00098   }

Provenance edm::RunPrincipal::getProvenance ( BranchID const &  bid  )  const

Definition at line 63 of file RunPrincipal.cc.

References g, edm::Principal::getGroup(), edm::errors::ProductNotFound, and unscheduledFill().

00063                                                        {
00064     SharedConstGroupPtr const& g = getGroup(bid, false, true, true);
00065     if (g.get() == 0) {
00066       throw edm::Exception(edm::errors::ProductNotFound,"InvalidID")
00067         << "getProvenance: no product with given branch id: "<< bid << "\n";
00068     }
00069 
00070     if (g->onDemand()) {
00071       unscheduledFill(g->productDescription().moduleLabel());
00072     }
00073     // We already tried to produce the unscheduled products above
00074     // If they still are not there, then throw
00075     if (g->onDemand()) {
00076       throw edm::Exception(edm::errors::ProductNotFound)
00077         << "getProvenance: no product with given BranchID: "<< bid <<"\n";
00078     }
00079 
00080     return *g->provenance();
00081   }

RunID const& edm::RunPrincipal::id ( void   )  const [inline]

Definition at line 51 of file RunPrincipal.h.

References aux(), and edm::RunAuxiliary::id().

Referenced by edm::checkConsistency(), edm::OccurrenceTraits< RunPrincipal, BranchActionEnd >::preScheduleSignal(), and edm::OccurrenceTraits< RunPrincipal, BranchActionBegin >::preScheduleSignal().

00051                             {
00052       return aux().id();
00053     }

void edm::RunPrincipal::mergeRun ( boost::shared_ptr< RunPrincipal rp  ) 

Definition at line 109 of file RunPrincipal.cc.

References addOrReplaceGroup(), aux_, g, i, and edm::RunAuxiliary::mergeAuxiliary().

00109                                                          {
00110 
00111     aux_.mergeAuxiliary(rp->aux());
00112 
00113     for (Base::const_iterator i = rp->begin(), iEnd = rp->end(); i != iEnd; ++i) {
00114 
00115       std::auto_ptr<Group> g(new Group());
00116       g->swap(*i->second);
00117 
00118       addOrReplaceGroup(g);
00119     }
00120   }

void edm::RunPrincipal::put ( std::auto_ptr< EDProduct edp,
ConstBranchDescription const &  bd,
std::auto_ptr< EventEntryInfo entryInfo 
)

Definition at line 47 of file RunPrincipal.cc.

References addGroup(), edm::Principal::addToProcessHistory(), edm::Principal::branchMapperPtr(), and edm::errors::InsertFailure.

Referenced by edm::Run::commit_().

00049                                                        {
00050 
00051     if (edp.get() == 0) {
00052       throw edm::Exception(edm::errors::InsertFailure,"Null Pointer")
00053         << "put: Cannot put because auto_ptr to product is null."
00054         << "\n";
00055     }
00056     this->addToProcessHistory();
00057     branchMapperPtr()->insert(*entryInfo);
00058     // Group assumes ownership
00059     this->addGroup(edp, bd, entryInfo);
00060   }

void edm::RunPrincipal::resolveProvenance ( Group const &  g  )  const [private, virtual]

Implements edm::Principal.

Definition at line 101 of file RunPrincipal.cc.

References edm::ConstBranchDescription::branchID(), edm::Principal::branchMapperPtr(), edm::Group::entryInfoPtr(), edm::Group::productDescription(), and edm::Group::setProvenance().

Referenced by getAllProvenance().

00101                                                       {
00102     if (!g.entryInfoPtr()) {
00103       // Now fix up the Group
00104       g.setProvenance(branchMapperPtr()->branchToEntryInfo(g.productDescription().branchID()));
00105     }
00106   }

RunNumber_t edm::RunPrincipal::run ( void   )  const [inline]

Definition at line 47 of file RunPrincipal.h.

References aux(), and edm::RunAuxiliary::run().

Referenced by edm::EventProcessor::beginRun(), edm::EventProcessor::endRun(), edm::EventProcessor::readAndCacheRun(), and edm::PoolOutputModule::writeRun().

00047                             {
00048       return aux().run();
00049     }

void edm::RunPrincipal::setEndTime ( Timestamp const &  time  )  [inline]

Definition at line 63 of file RunPrincipal.h.

References aux_, and edm::RunAuxiliary::setEndTime().

Referenced by edm::InputSource::doEndRun().

00063                                            {
00064       aux_.setEndTime(time);
00065     }

void edm::RunPrincipal::setUnscheduledHandler ( boost::shared_ptr< UnscheduledHandler  )  [inline]

Definition at line 67 of file RunPrincipal.h.

00067 {}

virtual bool edm::RunPrincipal::unscheduledFill ( std::string const &   )  const [inline, private, virtual]

Implements edm::Principal.

Definition at line 92 of file RunPrincipal.h.

Referenced by getProvenance().

00092 {return false;}


Member Data Documentation

RunAuxiliary edm::RunPrincipal::aux_ [private]

Definition at line 94 of file RunPrincipal.h.

Referenced by aux(), mergeRun(), and setEndTime().


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