Go to the documentation of this file.00001 #ifndef FWCore_Framework_PrincipalCache_h
00002 #define FWCore_Framework_PrincipalCache_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
00027 #include "DataFormats/Provenance/interface/RunID.h"
00028 #include "DataFormats/Provenance/interface/LuminosityBlockID.h"
00029
00030 #include "boost/shared_ptr.hpp"
00031
00032 namespace edm {
00033
00034 class RunPrincipal;
00035 class LuminosityBlockPrincipal;
00036 class EventPrincipal;
00037 class RunAuxiliary;
00038 class LuminosityBlockAuxiliary;
00039 class ProductRegistry;
00040
00041 class PrincipalCache {
00042 public:
00043
00044 PrincipalCache();
00045 ~PrincipalCache();
00046
00047 RunPrincipal& runPrincipal(ProcessHistoryID const& phid, RunNumber_t run) const;
00048 boost::shared_ptr<RunPrincipal> const& runPrincipalPtr(ProcessHistoryID const& phid, RunNumber_t run) const;
00049 RunPrincipal& runPrincipal() const;
00050 boost::shared_ptr<RunPrincipal> const& runPrincipalPtr() const;
00051
00052 LuminosityBlockPrincipal& lumiPrincipal(ProcessHistoryID const& phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const;
00053 boost::shared_ptr<LuminosityBlockPrincipal> const& lumiPrincipalPtr(ProcessHistoryID const& phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const;
00054 LuminosityBlockPrincipal& lumiPrincipal() const;
00055 boost::shared_ptr<LuminosityBlockPrincipal> const& lumiPrincipalPtr() const;
00056
00057 EventPrincipal& eventPrincipal() const { return *eventPrincipal_; }
00058
00059 void merge(boost::shared_ptr<RunAuxiliary> aux, boost::shared_ptr<ProductRegistry const> reg);
00060 void merge(boost::shared_ptr<LuminosityBlockAuxiliary> aux, boost::shared_ptr<ProductRegistry const> reg);
00061
00062 void insert(boost::shared_ptr<RunPrincipal> rp);
00063 void insert(boost::shared_ptr<LuminosityBlockPrincipal> lbp);
00064 void insert(boost::shared_ptr<EventPrincipal> ep) { eventPrincipal_ = ep; }
00065
00066 void deleteRun(ProcessHistoryID const& phid, RunNumber_t run);
00067 void deleteLumi(ProcessHistoryID const& phid, RunNumber_t run, LuminosityBlockNumber_t lumi);
00068
00069 void adjustEventToNewProductRegistry(boost::shared_ptr<ProductRegistry const> reg);
00070
00071 void adjustIndexesAfterProductRegistryAddition();
00072
00073 private:
00074
00075 void throwRunMissing() const;
00076 void throwLumiMissing() const;
00077
00078
00079
00080 boost::shared_ptr<RunPrincipal> runPrincipal_;
00081 boost::shared_ptr<LuminosityBlockPrincipal> lumiPrincipal_;
00082 boost::shared_ptr<EventPrincipal> eventPrincipal_;
00083
00084
00085
00086
00087
00088
00089
00090
00091 ProcessHistoryID inputProcessHistoryID_;
00092 ProcessHistoryID reducedInputProcessHistoryID_;
00093 RunNumber_t run_;
00094 LuminosityBlockNumber_t lumi_;
00095 };
00096 }
00097
00098 #endif