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 ----------------------------------------------------------------------*/ 00014 00015 #include <string> 00016 #include <vector> 00017 00018 #include "boost/shared_ptr.hpp" 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 Principal Base; 00030 00031 RunPrincipal( 00032 boost::shared_ptr<RunAuxiliary> aux, 00033 boost::shared_ptr<ProductRegistry const> reg, 00034 ProcessConfiguration const& pc); 00035 ~RunPrincipal() {} 00036 00037 void fillRunPrincipal( 00038 boost::shared_ptr<BranchMapper> mapper = boost::shared_ptr<BranchMapper>(), 00039 DelayedReader* reader = 0); 00040 00041 RunAuxiliary const& aux() const { 00042 return *aux_; 00043 } 00044 00045 RunNumber_t run() const { 00046 return aux().run(); 00047 } 00048 00049 RunID const& id() const { 00050 return aux().id(); 00051 } 00052 00053 Timestamp const& beginTime() const { 00054 return aux().beginTime(); 00055 } 00056 00057 Timestamp const& endTime() const { 00058 return aux().endTime(); 00059 } 00060 00061 void setEndTime(Timestamp const& time) { 00062 aux_->setEndTime(time); 00063 } 00064 00065 void mergeAuxiliary(RunAuxiliary const& aux) { 00066 return aux_->mergeAuxiliary(aux); 00067 } 00068 00069 // ----- Mark this RunPrincipal as having been updated in the current Process. 00070 void addToProcessHistory(); 00071 00072 void checkProcessHistory() const; 00073 00074 void setUnscheduledHandler(boost::shared_ptr<UnscheduledHandler>) {} 00075 00076 void put( 00077 ConstBranchDescription const& bd, 00078 WrapperOwningHolder const& edp, 00079 ProductProvenance& productProvenance); 00080 00081 void readImmediate() const; 00082 00083 private: 00084 00085 virtual bool unscheduledFill(std::string const&) const {return false;} 00086 00087 void resolveProductImmediate(Group const& g) const; 00088 00089 // A vector of groups. 00090 boost::shared_ptr<RunAuxiliary> aux_; 00091 }; 00092 } 00093 #endif 00094