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 #include <memory> 00016 #include <vector> 00017 00018 #include "boost/shared_ptr.hpp" 00019 00020 #include "DataFormats/Provenance/interface/BranchMapper.h" 00021 #include "DataFormats/Provenance/interface/LuminosityBlockAuxiliary.h" 00022 #include "DataFormats/Provenance/interface/RunID.h" 00023 #include "FWCore/Framework/interface/NoDelayedReader.h" 00024 #include "FWCore/Framework/interface/Principal.h" 00025 00026 namespace edm { 00027 class RunPrincipal; 00028 class UnscheduledHandler; 00029 class LuminosityBlockPrincipal : public Principal { 00030 public: 00031 typedef LuminosityBlockAuxiliary Auxiliary; 00032 typedef Principal Base; 00033 LuminosityBlockPrincipal( 00034 boost::shared_ptr<LuminosityBlockAuxiliary> aux, 00035 boost::shared_ptr<ProductRegistry const> reg, 00036 ProcessConfiguration const& pc, 00037 boost::shared_ptr<RunPrincipal> rp); 00038 00039 ~LuminosityBlockPrincipal() {} 00040 00041 void fillLuminosityBlockPrincipal( 00042 boost::shared_ptr<BranchMapper> mapper = boost::shared_ptr<BranchMapper>(new BranchMapper), 00043 boost::shared_ptr<DelayedReader> rtrv = boost::shared_ptr<DelayedReader>(new NoDelayedReader)); 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 std::auto_ptr<EDProduct> edp, 00090 std::auto_ptr<ProductProvenance> productProvenance); 00091 00092 void readImmediate() const; 00093 00094 void swap(LuminosityBlockPrincipal&); 00095 00096 private: 00097 virtual bool unscheduledFill(std::string const&) const {return false;} 00098 00099 void resolveProductImmediate(Group const& g) const; 00100 00101 boost::shared_ptr<RunPrincipal> runPrincipal_; 00102 00103 boost::shared_ptr<LuminosityBlockAuxiliary> aux_; 00104 }; 00105 } 00106 #endif 00107