CMS 3D CMS Logo

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 $Id: LuminosityBlockPrincipal.h,v 1.34 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/LuminosityBlockAuxiliary.h"
00022 #include "DataFormats/Provenance/interface/RunID.h"
00023 #include "FWCore/Framework/interface/Principal.h"
00024 
00025 namespace edm {
00026   class RunPrincipal;
00027   class UnscheduledHandler;
00028   class LuminosityBlockPrincipal : public Principal {
00029   public:
00030     typedef LuminosityBlockAuxiliary Auxiliary;
00031     typedef std::vector<LumiEntryInfo> EntryInfoVector;
00032     typedef Principal Base;
00033     LuminosityBlockPrincipal(LuminosityBlockAuxiliary const& aux,
00034         boost::shared_ptr<ProductRegistry const> reg,
00035         ProcessConfiguration const& pc,
00036         ProcessHistoryID const& hist = ProcessHistoryID(),
00037         boost::shared_ptr<BranchMapper> mapper = boost::shared_ptr<BranchMapper>(new BranchMapper),
00038         boost::shared_ptr<DelayedReader> rtrv = boost::shared_ptr<DelayedReader>(new NoDelayedReader));
00039 
00040     ~LuminosityBlockPrincipal() {}
00041 
00042     RunPrincipal const& runPrincipal() const {
00043       return *runPrincipal_;
00044     }
00045 
00046     RunPrincipal & runPrincipal() {
00047       return *runPrincipal_;
00048     }
00049 
00050     boost::shared_ptr<RunPrincipal>
00051     runPrincipalSharedPtr() {
00052       return runPrincipal_;
00053     }
00054 
00055     void setRunPrincipal(boost::shared_ptr<RunPrincipal> rp) {
00056       runPrincipal_ = rp;
00057     }
00058 
00059     LuminosityBlockID id() const {
00060       return aux().id();
00061     }
00062 
00063     Timestamp const& beginTime() const {
00064       return aux().beginTime();
00065     }
00066 
00067     Timestamp const& endTime() const {
00068       return aux().endTime();
00069     }
00070 
00071     void setEndTime(Timestamp const& time) {
00072       aux_.setEndTime(time);
00073     }
00074 
00075     LuminosityBlockNumber_t luminosityBlock() const {
00076       return aux().luminosityBlock();
00077     }
00078 
00079     LuminosityBlockAuxiliary const& aux() const {
00080       aux_.processHistoryID_ = processHistoryID();
00081       return aux_;
00082     }
00083 
00084     RunNumber_t run() const {
00085       return aux().run();
00086     }
00087 
00088     void setUnscheduledHandler(boost::shared_ptr<UnscheduledHandler>) {}
00089 
00090     void mergeLuminosityBlock(boost::shared_ptr<LuminosityBlockPrincipal> lbp);
00091 
00092     Provenance
00093     getProvenance(BranchID const& bid) const;
00094 
00095     void
00096     getAllProvenance(std::vector<Provenance const *> & provenances) const;
00097 
00098     void put(std::auto_ptr<EDProduct> edp,
00099              ConstBranchDescription const& bd, std::auto_ptr<EventEntryInfo> entryInfo);
00100 
00101     void addGroup(ConstBranchDescription const& bd);
00102 
00103     void addGroup(std::auto_ptr<EDProduct> prod, ConstBranchDescription const& bd, std::auto_ptr<EventEntryInfo> entryInfo);
00104 
00105     void addGroup(ConstBranchDescription const& bd, std::auto_ptr<EventEntryInfo> entryInfo);
00106 
00107   private:
00108     virtual void addOrReplaceGroup(std::auto_ptr<Group> g);
00109 
00110     virtual void resolveProvenance(Group const& g) const;
00111 
00112     virtual bool unscheduledFill(std::string const&) const {return false;}
00113 
00114     boost::shared_ptr<RunPrincipal> runPrincipal_;
00115     LuminosityBlockAuxiliary aux_;
00116   };
00117 }
00118 #endif
00119 

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