CMS 3D CMS Logo

RunPrincipal.h

Go to the documentation of this file.
00001 #ifndef FWCore_Framework_RunPrincipal_h
00002 #define FWCore_Framework_RunPrincipal_h
00003 
00004 /*----------------------------------------------------------------------
00005   
00006 RunPrincipal: This is the class responsible for management of
00007 per run EDProducts. It is not seen by reconstruction code;
00008 such code sees the Run class, which is a proxy for RunPrincipal.
00009 
00010 The major internal component of the RunPrincipal
00011 is the DataBlock.
00012 
00013 $Id: RunPrincipal.h,v 1.26 2008/08/22 01:44:37 wmtan Exp $
00014 
00015 ----------------------------------------------------------------------*/
00016 
00017 #include "boost/shared_ptr.hpp"
00018 #include <vector>
00019 
00020 #include "DataFormats/Provenance/interface/BranchMapper.h"
00021 #include "DataFormats/Provenance/interface/RunAuxiliary.h"
00022 #include "FWCore/Framework/interface/Principal.h"
00023 
00024 namespace edm {
00025   class UnscheduledHandler;
00026   class RunPrincipal : public Principal {
00027   public:
00028     typedef RunAuxiliary Auxiliary;
00029     typedef std::vector<RunEntryInfo> EntryInfoVector;
00030     typedef Principal Base;
00031 
00032     RunPrincipal(RunAuxiliary const& aux,
00033         boost::shared_ptr<ProductRegistry const> reg,
00034         ProcessConfiguration const& pc,
00035         ProcessHistoryID const& hist = ProcessHistoryID(),
00036         boost::shared_ptr<BranchMapper> mapper = boost::shared_ptr<BranchMapper>(new BranchMapper),
00037         boost::shared_ptr<DelayedReader> rtrv = boost::shared_ptr<DelayedReader>(new NoDelayedReader)) :
00038           Base(reg, pc, hist, mapper, rtrv),
00039           aux_(aux) {}
00040     ~RunPrincipal() {}
00041 
00042     RunAuxiliary const& aux() const {
00043       aux_.processHistoryID_ = processHistoryID();
00044       return aux_;
00045     }
00046 
00047     RunNumber_t run() const {
00048       return aux().run();
00049     }
00050 
00051     RunID const& id() const {
00052       return aux().id();
00053     }
00054 
00055     Timestamp const& beginTime() const {
00056       return aux().beginTime();
00057     }
00058 
00059     Timestamp const& endTime() const {
00060       return aux().endTime();
00061     }
00062 
00063     void setEndTime(Timestamp const& time) {
00064       aux_.setEndTime(time);
00065     }
00066 
00067     void setUnscheduledHandler(boost::shared_ptr<UnscheduledHandler>) {}
00068 
00069     void mergeRun(boost::shared_ptr<RunPrincipal> rp);
00070 
00071     Provenance
00072     getProvenance(BranchID const& bid) const;
00073 
00074     void
00075     getAllProvenance(std::vector<Provenance const *> & provenances) const;
00076 
00077     void put(std::auto_ptr<EDProduct> edp,
00078              ConstBranchDescription const& bd, std::auto_ptr<EventEntryInfo> entryInfo);
00079 
00080     void addGroup(ConstBranchDescription const& bd);
00081 
00082     void addGroup(std::auto_ptr<EDProduct> prod, ConstBranchDescription const& bd, std::auto_ptr<EventEntryInfo> entryInfo);
00083 
00084     void addGroup(ConstBranchDescription const& bd, std::auto_ptr<EventEntryInfo> entryInfo);
00085 
00086   private:
00087 
00088     virtual void addOrReplaceGroup(std::auto_ptr<Group> g);
00089 
00090     virtual void resolveProvenance(Group const& g) const;
00091 
00092     virtual bool unscheduledFill(std::string const&) const {return false;}
00093 
00094     RunAuxiliary aux_;
00095   };
00096 }
00097 #endif
00098 

Generated on Tue Jun 9 17:35:46 2009 for CMSSW by  doxygen 1.5.4