CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/FWCore/Framework/interface/LuminosityBlockPrincipal.h

Go to the documentation of this file.
00001 #ifndef FWCore_Framework_LuminosityBlockPrincipal_h
00002 #define FWCore_Framework_LuminosityBlockPrincipal_h
00003 
00004 /*----------------------------------------------------------------------
00005 
00006 LuminosityBlockPrincipal: This is the class responsible for management of
00007 per luminosity block EDProducts. It is not seen by reconstruction code;
00008 such code sees the LuminosityBlock class, which is a proxy for LuminosityBlockPrincipal.
00009 
00010 The major internal component of the LuminosityBlockPrincipal
00011 is the DataBlock.
00012 
00013 ----------------------------------------------------------------------*/
00014 
00015 
00016 #include "DataFormats/Provenance/interface/LuminosityBlockAuxiliary.h"
00017 #include "DataFormats/Provenance/interface/RunID.h"
00018 #include "FWCore/Framework/interface/Principal.h"
00019 
00020 #include "boost/shared_ptr.hpp"
00021 
00022 #include <vector>
00023 
00024 namespace edm {
00025 
00026   class HistoryAppender;
00027   class RunPrincipal;
00028   class UnscheduledHandler;
00029 
00030   class LuminosityBlockPrincipal : public Principal {
00031   public:
00032     typedef LuminosityBlockAuxiliary Auxiliary;
00033     typedef Principal Base;
00034     LuminosityBlockPrincipal(
00035         boost::shared_ptr<LuminosityBlockAuxiliary> aux,
00036         boost::shared_ptr<ProductRegistry const> reg,
00037         ProcessConfiguration const& pc,
00038         boost::shared_ptr<RunPrincipal> rp,
00039         HistoryAppender* historyAppender = 0);
00040 
00041     ~LuminosityBlockPrincipal() {}
00042 
00043     void fillLuminosityBlockPrincipal(DelayedReader* reader = 0);
00044 
00045     RunPrincipal const& runPrincipal() const {
00046       return *runPrincipal_;
00047     }
00048 
00049     RunPrincipal& runPrincipal() {
00050       return *runPrincipal_;
00051     }
00052 
00053     LuminosityBlockID id() const {
00054       return aux().id();
00055     }
00056 
00057     Timestamp const& beginTime() const {
00058       return aux().beginTime();
00059     }
00060 
00061     Timestamp const& endTime() const {
00062       return aux().endTime();
00063     }
00064 
00065     void setEndTime(Timestamp const& time) {
00066       aux_->setEndTime(time);
00067     }
00068 
00069     LuminosityBlockNumber_t luminosityBlock() const {
00070       return aux().luminosityBlock();
00071     }
00072 
00073     LuminosityBlockAuxiliary const& aux() const {
00074       return *aux_;
00075     }
00076 
00077     RunNumber_t run() const {
00078       return aux().run();
00079     }
00080 
00081     void mergeAuxiliary(LuminosityBlockAuxiliary const& aux) {
00082       return aux_->mergeAuxiliary(aux);
00083     }
00084 
00085     void setUnscheduledHandler(boost::shared_ptr<UnscheduledHandler>) {}
00086 
00087     void put(
00088         ConstBranchDescription const& bd,
00089         WrapperOwningHolder const& edp);
00090 
00091     void readImmediate() const;
00092 
00093   private:
00094     virtual bool unscheduledFill(std::string const&) const {return false;}
00095 
00096     void resolveProductImmediate(Group const& g) const;
00097 
00098     boost::shared_ptr<RunPrincipal> runPrincipal_;
00099 
00100     boost::shared_ptr<LuminosityBlockAuxiliary> aux_;
00101   };
00102 }
00103 #endif
00104