CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CondDBESSource.h
Go to the documentation of this file.
1 #ifndef CondCore_ESSources_CondDBESSource_h
2 #define CondCore_ESSources_CondDBESSource_h
3 //
4 // Package: CondCore/ESSources
5 // Class: CondDBESSource
6 //
7 /*
8  Description: EventSetup source module for serving data from offline database
9 */
10 //
11 // Author: Zhen Xie
12 //
13 // system include files
14 #include <string>
15 #include <map>
16 #include <set>
17 // user include files
19 
25 
26 namespace edm{
27  class ParameterSet;
28 }
29 namespace cond{
30  class DbSession;
31  class BasePayloadProxy;
32  class DataProxyWrapperBase;
33 }
34 
37  public:
38  typedef boost::shared_ptr<cond::DataProxyWrapperBase > ProxyP;
39  typedef std::multimap< std::string, ProxyP> ProxyMap;
40 
42 
43 
44  explicit CondDBESSource( const edm::ParameterSet& );
46 
47  protected:
49  const edm::IOVSyncValue& ,
51 
52  virtual void registerProxies(const edm::eventsetup::EventSetupRecordKey& iRecordKey, KeyedProxies& aProxyList) ;
53 
54  virtual void newInterval(const edm::eventsetup::EventSetupRecordKey& iRecordType, const edm::ValidityInterval& iInterval) ;
55 
56  private:
57 
58  // ----------member data ---------------------------
59 
61 
62  // Container of DataProxy, implemented as multi-map keyed by records
64 
65 
66  typedef std::map< std::string, cond::TagMetadata > TagCollection;
67  // the collections of tag, record/label used in this ESSource
69  std::map<std::string,std::pair<cond::DbSession,std::string> > m_sessionPool;
70  std::map<std::string,unsigned int> m_lastRecordRuns;
71 
72  struct Stats {
73  int nData;
74  int nSet;
75  int nRun;
76  int nLumi;
77  int nRefresh;
81  };
82 
84 
85  unsigned int m_lastRun;
86  unsigned int m_lastLumi;
88 
89  bool m_doDump;
90 
91  private:
92 
93  void fillList(const std::string & pfn, std::vector<std::string> & pfnList, const unsigned int listSize, const std::string & type);
94 
95  void fillTagCollectionFromGT(const std::string & coraldb,
96  const std::string & prefix,
97  const std::string & postfix,
98  const std::string & roottag,
99  std::set< cond::TagMetadata > & tagcoll);
100 
101  void fillTagCollectionFromDB( const std::vector<std::string> & coraldbList,
102  const std::vector<std::string> & prefix,
103  const std::vector<std::string> & postfix,
104  const std::vector<std::string> & roottagList,
105  std::map<std::string,cond::TagMetadata>& replacement);
106 };
107 #endif
std::map< std::string, cond::TagMetadata > TagCollection
type
Definition: HCALResponse.h:21
list pfn
Definition: dbtoconf.py:76
void fillTagCollectionFromGT(const std::string &coraldb, const std::string &prefix, const std::string &postfix, const std::string &roottag, std::set< cond::TagMetadata > &tagcoll)
void fillTagCollectionFromDB(const std::vector< std::string > &coraldbList, const std::vector< std::string > &prefix, const std::vector< std::string > &postfix, const std::vector< std::string > &roottagList, std::map< std::string, cond::TagMetadata > &replacement)
std::map< std::string, std::pair< cond::DbSession, std::string > > m_sessionPool
virtual void registerProxies(const edm::eventsetup::EventSetupRecordKey &iRecordKey, KeyedProxies &aProxyList)
cond::DbConnection m_connection
RefreshPolicy m_policy
std::map< std::string, unsigned int > m_lastRecordRuns
std::vector< std::pair< DataKey, boost::shared_ptr< DataProxy > > > KeyedProxies
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
void fillList(const std::string &pfn, std::vector< std::string > &pfnList, const unsigned int listSize, const std::string &type)
std::multimap< std::string, ProxyP > ProxyMap
TagCollection m_tagCollection
ProxyMap m_proxies
unsigned int m_lastRun
virtual void newInterval(const edm::eventsetup::EventSetupRecordKey &iRecordType, const edm::ValidityInterval &iInterval)
called when a new interval of validity occurs for iRecordType
CondDBESSource(const edm::ParameterSet &)
unsigned int m_lastLumi
boost::shared_ptr< cond::DataProxyWrapperBase > ProxyP