CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/FWCore/Framework/interface/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 ----------------------------------------------------------------------*/
00014 
00015 #include <memory>
00016 #include <string>
00017 #include <vector>
00018 
00019 #include "boost/shared_ptr.hpp"
00020 
00021 #include "DataFormats/Provenance/interface/BranchMapper.h"
00022 #include "DataFormats/Provenance/interface/RunAuxiliary.h"
00023 #include "FWCore/Framework/interface/NoDelayedReader.h"
00024 #include "FWCore/Framework/interface/Principal.h"
00025 
00026 namespace edm {
00027   class UnscheduledHandler;
00028   class RunPrincipal : public Principal {
00029   public:
00030     typedef RunAuxiliary Auxiliary;
00031     typedef Principal Base;
00032 
00033     RunPrincipal(
00034         boost::shared_ptr<RunAuxiliary> aux,
00035         boost::shared_ptr<ProductRegistry const> reg,
00036         ProcessConfiguration const& pc);
00037     ~RunPrincipal() {}
00038 
00039     void fillRunPrincipal(
00040         boost::shared_ptr<BranchMapper> mapper = boost::shared_ptr<BranchMapper>(new BranchMapper),
00041         boost::shared_ptr<DelayedReader> rtrv = boost::shared_ptr<DelayedReader>(new NoDelayedReader));
00042 
00043     RunAuxiliary const& aux() const {
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 mergeAuxiliary(RunAuxiliary const& aux) {
00068       return aux_->mergeAuxiliary(aux);
00069     }
00070 
00071     // ----- Mark this RunPrincipal as having been updated in the current Process.
00072     void addToProcessHistory();
00073 
00074     void checkProcessHistory() const;
00075 
00076     void setUnscheduledHandler(boost::shared_ptr<UnscheduledHandler>) {}
00077 
00078     void put(
00079         ConstBranchDescription const& bd,
00080         std::auto_ptr<EDProduct> edp,
00081         std::auto_ptr<ProductProvenance> productProvenance);
00082 
00083     void readImmediate() const;
00084 
00085     void swap(RunPrincipal&);
00086 
00087   private:
00088 
00089     virtual bool unscheduledFill(std::string const&) const {return false;}
00090 
00091     void resolveProductImmediate(Group const& g) const;
00092 
00093     // A vector of groups.
00094     boost::shared_ptr<RunAuxiliary> aux_;
00095   };
00096 }
00097 #endif
00098