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