CMS 3D CMS Logo

edm::LuminosityBlockPrincipal Class Reference

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

Inheritance diagram for edm::LuminosityBlockPrincipal:

edm::Principal edm::EDProductGetter

List of all members.

Public Types

typedef LuminosityBlockAuxiliary Auxiliary
typedef Principal Base
typedef std::vector
< LumiEntryInfo
EntryInfoVector

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)
LuminosityBlockAuxiliary 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
LuminosityBlockID id () const
LuminosityBlockNumber_t luminosityBlock () const
 LuminosityBlockPrincipal (LuminosityBlockAuxiliary 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 mergeLuminosityBlock (boost::shared_ptr< LuminosityBlockPrincipal > lbp)
void put (std::auto_ptr< EDProduct > edp, ConstBranchDescription const &bd, std::auto_ptr< EventEntryInfo > entryInfo)
RunNumber_t run () const
RunPrincipalrunPrincipal ()
RunPrincipal const & runPrincipal () const
boost::shared_ptr< RunPrincipalrunPrincipalSharedPtr ()
void setEndTime (Timestamp const &time)
void setRunPrincipal (boost::shared_ptr< RunPrincipal > rp)
void setUnscheduledHandler (boost::shared_ptr< UnscheduledHandler >)
 ~LuminosityBlockPrincipal ()

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

LuminosityBlockAuxiliary aux_
boost::shared_ptr< RunPrincipalrunPrincipal_


Detailed Description

Definition at line 28 of file LuminosityBlockPrincipal.h.


Member Typedef Documentation

typedef LuminosityBlockAuxiliary edm::LuminosityBlockPrincipal::Auxiliary

Definition at line 30 of file LuminosityBlockPrincipal.h.

typedef Principal edm::LuminosityBlockPrincipal::Base

Definition at line 32 of file LuminosityBlockPrincipal.h.

typedef std::vector<LumiEntryInfo> edm::LuminosityBlockPrincipal::EntryInfoVector

Definition at line 31 of file LuminosityBlockPrincipal.h.


Constructor & Destructor Documentation

edm::LuminosityBlockPrincipal::LuminosityBlockPrincipal ( LuminosityBlockAuxiliary 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) 
)

Definition at line 7 of file LuminosityBlockPrincipal.cc.

00012                                              :
00013           Base(reg, pc, hist, mapper, rtrv),
00014           runPrincipal_(),
00015           aux_(aux) {}

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

Definition at line 40 of file LuminosityBlockPrincipal.h.

00040 {}


Member Function Documentation

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

Definition at line 51 of file LuminosityBlockPrincipal.cc.

References addOrReplaceGroup(), and g.

00052                                                {
00053     std::auto_ptr<Group> g(new Group(bd, entryInfo));
00054     addOrReplaceGroup(g);
00055   }

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

Definition at line 43 of file LuminosityBlockPrincipal.cc.

References addOrReplaceGroup(), and g.

00045                                                {
00046     std::auto_ptr<Group> g(new Group(prod, bd, entryInfo));
00047     addOrReplaceGroup(g);
00048   }

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

Definition at line 37 of file LuminosityBlockPrincipal.cc.

References addOrReplaceGroup(), and g.

Referenced by put().

00037                                                                      {
00038     std::auto_ptr<Group> g(new Group(bd));
00039     addOrReplaceGroup(g);
00040   }

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

Implements edm::Principal.

Definition at line 18 of file LuminosityBlockPrincipal.cc.

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

Referenced by addGroup(), and mergeLuminosityBlock().

00018                                                                   {
00019 
00020     Group* group = getExistingGroup(*g);
00021     if (group != 0) {
00022 
00023       if (!group->productUnavailable()) {
00024         assert(group->product() != 0);
00025       }
00026       if (!g->productUnavailable()) {
00027         assert(g->product() != 0);
00028       }
00029 
00030       group->mergeGroup(g.get());
00031     } else {
00032       addGroup_(g);
00033     }
00034   }

LuminosityBlockAuxiliary const& edm::LuminosityBlockPrincipal::aux (  )  const [inline]

Definition at line 79 of file LuminosityBlockPrincipal.h.

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

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

00079                                                 {
00080       aux_.processHistoryID_ = processHistoryID();
00081       return aux_;
00082     }

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

Definition at line 63 of file LuminosityBlockPrincipal.h.

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

Referenced by edm::EventProcessor::beginLumi(), edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionBegin >::preScheduleSignal(), and edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionEnd >::preScheduleSignal().

00063                                        {
00064       return aux().beginTime();
00065     }

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

Definition at line 67 of file LuminosityBlockPrincipal.h.

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

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

00067                                      {
00068       return aux().endTime();
00069     }

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

Definition at line 98 of file LuminosityBlockPrincipal.cc.

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

00098                                                                                              {
00099     provenances.clear();
00100     for (Base::const_iterator i = begin(), iEnd = end(); i != iEnd; ++i) {
00101       if (i->second->provenanceAvailable()) {
00102         resolveProvenance(*i->second);
00103         if (i->second->provenance()->branchEntryInfoSharedPtr() &&
00104             i->second->provenance()->isPresent() &&
00105             i->second->provenance()->product().present())
00106            provenances.push_back(i->second->provenance());
00107         }
00108     }
00109   }

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

Definition at line 74 of file LuminosityBlockPrincipal.cc.

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

00074                                                                    {
00075     SharedConstGroupPtr const& g = getGroup(bid, false, true, true);
00076     if (g.get() == 0) {
00077       throw edm::Exception(edm::errors::ProductNotFound,"InvalidID")
00078         << "getProvenance: no product with given branch id: "<< bid << "\n";
00079     }
00080 
00081     if (g->onDemand()) {
00082       unscheduledFill(g->productDescription().moduleLabel());
00083     }
00084     // We already tried to produce the unscheduled products above
00085     // If they still are not there, then throw
00086     if (g->onDemand()) {
00087       throw edm::Exception(edm::errors::ProductNotFound)
00088         << "getProvenance: no product with given BranchID: "<< bid <<"\n";
00089     }
00090 
00091     return *g->provenance();
00092   }

LuminosityBlockID edm::LuminosityBlockPrincipal::id ( void   )  const [inline]

Definition at line 59 of file LuminosityBlockPrincipal.h.

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

Referenced by edm::checkConsistency(), edm::NoDelayedReader::getProduct_(), edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionBegin >::preScheduleSignal(), edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionEnd >::preScheduleSignal(), and edm::PoolOutputModule::writeLuminosityBlock().

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

LuminosityBlockNumber_t edm::LuminosityBlockPrincipal::luminosityBlock (  )  const [inline]

Definition at line 75 of file LuminosityBlockPrincipal.h.

References aux(), and edm::LuminosityBlockAuxiliary::luminosityBlock().

Referenced by edm::EventProcessor::beginLumi(), edm::EventProcessor::endLumi(), and edm::EventProcessor::readAndCacheLumi().

00075                                                     {
00076       return aux().luminosityBlock();
00077     }

void edm::LuminosityBlockPrincipal::mergeLuminosityBlock ( boost::shared_ptr< LuminosityBlockPrincipal lbp  ) 

Definition at line 120 of file LuminosityBlockPrincipal.cc.

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

00120                                                                                               {
00121 
00122     aux_.mergeAuxiliary(lbp->aux());
00123 
00124     for (Base::const_iterator i = lbp->begin(), iEnd = lbp->end(); i != iEnd; ++i) {
00125  
00126       std::auto_ptr<Group> g(new Group());
00127       g->swap(*i->second);
00128 
00129       addOrReplaceGroup(g);
00130     }
00131   }

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

Definition at line 58 of file LuminosityBlockPrincipal.cc.

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

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

00060                                                        {
00061 
00062     if (edp.get() == 0) {
00063       throw edm::Exception(edm::errors::InsertFailure,"Null Pointer")
00064         << "put: Cannot put because auto_ptr to product is null."
00065         << "\n";
00066     }
00067     this->addToProcessHistory();
00068     branchMapperPtr()->insert(*entryInfo);
00069     // Group assumes ownership
00070     this->addGroup(edp, bd, entryInfo);
00071   }

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

Implements edm::Principal.

Definition at line 112 of file LuminosityBlockPrincipal.cc.

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

Referenced by getAllProvenance().

00112                                                                   {
00113     if (!g.entryInfoPtr()) {
00114       // Now fix up the Group
00115       g.setProvenance(branchMapperPtr()->branchToEntryInfo(g.productDescription(). branchID()));
00116     }
00117   }

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

Definition at line 84 of file LuminosityBlockPrincipal.h.

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

Referenced by edm::EventProcessor::beginLumi(), and edm::EventProcessor::endLumi().

00084                             {
00085       return aux().run();
00086     }

RunPrincipal& edm::LuminosityBlockPrincipal::runPrincipal (  )  [inline]

Definition at line 46 of file LuminosityBlockPrincipal.h.

References runPrincipal_.

00046                                   {
00047       return *runPrincipal_;
00048     }

RunPrincipal const& edm::LuminosityBlockPrincipal::runPrincipal (  )  const [inline]

Definition at line 42 of file LuminosityBlockPrincipal.h.

References runPrincipal_.

Referenced by edm::newRun(), and edm::EventPrincipal::runPrincipal().

00042                                              {
00043       return *runPrincipal_;
00044     }

boost::shared_ptr<RunPrincipal> edm::LuminosityBlockPrincipal::runPrincipalSharedPtr (  )  [inline]

Definition at line 51 of file LuminosityBlockPrincipal.h.

References runPrincipal_.

Referenced by edm::newRun().

00051                             {
00052       return runPrincipal_;
00053     }

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

Definition at line 71 of file LuminosityBlockPrincipal.h.

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

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

00071                                            {
00072       aux_.setEndTime(time);
00073     }

void edm::LuminosityBlockPrincipal::setRunPrincipal ( boost::shared_ptr< RunPrincipal rp  )  [inline]

Definition at line 55 of file LuminosityBlockPrincipal.h.

References runPrincipal_.

00055                                                            {
00056       runPrincipal_ = rp;
00057     }

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

Definition at line 88 of file LuminosityBlockPrincipal.h.

00088 {}

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

Implements edm::Principal.

Definition at line 112 of file LuminosityBlockPrincipal.h.

Referenced by getProvenance().

00112 {return false;}


Member Data Documentation

LuminosityBlockAuxiliary edm::LuminosityBlockPrincipal::aux_ [private]

Definition at line 115 of file LuminosityBlockPrincipal.h.

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

boost::shared_ptr<RunPrincipal> edm::LuminosityBlockPrincipal::runPrincipal_ [private]

Definition at line 114 of file LuminosityBlockPrincipal.h.

Referenced by runPrincipal(), runPrincipalSharedPtr(), and setRunPrincipal().


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