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 <memory>
17 #include <set>
18 // user include files
20 
23 //#include "CondCore/DBCommon/interface/Time.h"
24 
25 namespace edm{
26  class ParameterSet;
27 }
28 
29 namespace cond{
30  class DataProxyWrapperBase;
31 }
32 
35  public:
36  typedef std::shared_ptr<cond::DataProxyWrapperBase > ProxyP;
37  typedef std::multimap< std::string, ProxyP> ProxyMap;
38 
40 
41 
42  explicit CondDBESSource( const edm::ParameterSet& );
44 
45  protected:
47  const edm::IOVSyncValue& ,
49 
50  virtual void registerProxies(const edm::eventsetup::EventSetupRecordKey& iRecordKey, KeyedProxies& aProxyList) ;
51 
52  virtual void newInterval(const edm::eventsetup::EventSetupRecordKey& iRecordType, const edm::ValidityInterval& iInterval) ;
53 
54  private:
55 
56  // ----------member data ---------------------------
57 
60 
61  // Container of DataProxy, implemented as multi-map keyed by records
63 
64 
65  typedef std::map< std::string, cond::GTEntry_t > TagCollection;
66  // the collections of tag, record/label used in this ESSource
68  std::map<std::string,std::pair<cond::persistency::Session,std::string> > m_sessionPool;
69  std::map<std::string,unsigned int> m_lastRecordRuns;
70 
71  struct Stats {
72  int nData;
73  int nSet;
74  int nRun;
75  int nLumi;
76  int nRefresh;
80  };
81 
83 
84  unsigned int m_lastRun;
85  unsigned int m_lastLumi;
87 
88  bool m_doDump;
89 
90  private:
91 
92  void fillList(const std::string & pfn, std::vector<std::string> & pfnList, const unsigned int listSize, const std::string & type);
93 
95  const std::string & prefix,
96  const std::string & postfix,
97  const std::string & roottag,
98  std::set< cond::GTEntry_t > & tagcoll,
99  cond::GTMetadata_t& gtMetadata);
100 
101  void fillTagCollectionFromDB( const std::vector<std::string> & connectionStringList,
102  const std::vector<std::string> & prefixList,
103  const std::vector<std::string> & postfixList,
104  const std::vector<std::string> & roottagList,
105  std::map<std::string,cond::GTEntry_t>& replacement,
106  cond::GTMetadata_t& gtMetadata);
107 };
108 #endif
type
Definition: HCALResponse.h:21
virtual void registerProxies(const edm::eventsetup::EventSetupRecordKey &iRecordKey, KeyedProxies &aProxyList)
RefreshPolicy m_policy
std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
void fillTagCollectionFromGT(const std::string &connectionString, const std::string &prefix, const std::string &postfix, const std::string &roottag, std::set< cond::GTEntry_t > &tagcoll, cond::GTMetadata_t &gtMetadata)
std::map< std::string, unsigned int > m_lastRecordRuns
cond::persistency::ConnectionPool m_connection
std::map< std::string, cond::GTEntry_t > TagCollection
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::map< std::string, std::pair< cond::persistency::Session, std::string > > m_sessionPool
std::shared_ptr< cond::DataProxyWrapperBase > ProxyP
std::multimap< std::string, ProxyP > ProxyMap
string connectionString
Definition: autoCondHLT.py:4
TagCollection m_tagCollection
void fillTagCollectionFromDB(const std::vector< std::string > &connectionStringList, const std::vector< std::string > &prefixList, const std::vector< std::string > &postfixList, const std::vector< std::string > &roottagList, std::map< std::string, cond::GTEntry_t > &replacement, cond::GTMetadata_t &gtMetadata)
std::string m_connectionString
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