Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PgPostBankManager.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PgPostBankManager.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef PDBCALPG_PGPOSTBANKMANAGER_H
4 #define PDBCALPG_PGPOSTBANKMANAGER_H
5 
6 #include <pdbcalbase/PdbBankID.h>
7 #include <pdbcalbase/PdbBankManager.h>
8 
9 #include <phool/PHTimeStamp.h>
10 
11 #include <map>
12 #include <set>
13 #include <string>
14 #include <ctime>
15 
16 class PdbApplication;
17 class PdbCalBank;
18 class PdbCalBankIterator;
19 
21 {
22  public:
23  static PgPostBankManager *instance();
24  static int Register();
25  virtual ~PgPostBankManager();
26 
27  protected:
29 
30  public:
32  virtual PdbCalBank *createBank(const std::string &,
33  PdbBankID,
34  const std::string &, PHTimeStamp &, PHTimeStamp &, const std::string &);
35 
36  // create bank with run number as key
37  PdbCalBank *createBank(const int, const std::string &, PdbBankID, const std::string &, const std::string &, const time_t duration = 60);
38 
39  // create bank for a given range of run numbers rather than timestamps
40  PdbCalBank *createBank(const int, const int, const std::string &, PdbBankID, const std::string &, const std::string &);
41 
42  // fetch banks with run number as key
43  PdbCalBank *fetchBank(const std::string &, PdbBankID, const std::string &, const int);
44 
45  PdbCalBank *fetchClosestBank(const std::string &, PdbBankID, const std::string &, const int);
46 
47  // void fetchAllBanks(PdbBankList &, const std::string &, PdbBankID, const std::string &, const int);
48  // void fetchAllBanks(PdbBankList &, const std::string &, const std::string &, const int);
49 
50  // fetch banks with timestamp as key
51  PdbCalBank *fetchBank(const std::string &, PdbBankID, const std::string &, const PHTimeStamp &);
52 
54 
55  // void fetchAllBanks(PdbBankList &, const std::string &, PdbBankID, const std::string &, PHTimeStamp &);
56 
57  // void fetchAllBanks(PdbBankList &, const std::string &, const std::string &, PHTimeStamp &);
58 
60 
62 
63  void GetUsedBankRids(std::map<std::string, std::set<int> > &usedbanks) const;
64  void ClearUsedBankRids() { BankRid.clear(); }
65  void SetMaxInsertTime(const PHTimeStamp &tMax);
66 
67  private:
69  std::map<std::string, std::set<int> > BankRid;
72 };
73 
74 #endif /* PDBCAL_PG_PGPOSTBANKMANAGER_H */