Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:16:05

0001 #ifndef SPHENIXNPC_SPHENIXCLIENT_H
0002 #define SPHENIXNPC_SPHENIXCLIENT_H
0003 
0004 #include <nopayloadclient/nopayloadclient.hpp>
0005 
0006 #include <nlohmann/json.hpp>
0007 
0008 #include <set>
0009 #include <string>
0010 
0011 class SphenixClient : public nopayloadclient::NoPayloadClient
0012 {
0013  public:
0014   SphenixClient() = default;
0015   explicit SphenixClient(const std::string& globaltag);
0016   virtual ~SphenixClient() = default;
0017   // make clang happy, since we use our own without overriding the base class methods
0018   using nopayloadclient::NoPayloadClient::getPayloadIOVs;
0019 
0020 #pragma GCC diagnostic push
0021 #pragma GCC diagnostic ignored "-Woverloaded-virtual"
0022   nlohmann::json insertPayload(const std::string& pl_type, const std::string& file_url, long long iov_start);
0023   nlohmann::json getUrlDict(long long iov);
0024   nlohmann::json deletePayloadIOV(const std::string& pl_type, long long iov_start);
0025 #pragma GCC diagnostic pop
0026 
0027   nlohmann::json getPayloadIOVs(long long iov);
0028   nlohmann::json getUrl(const std::string& pl_type, long long iov);
0029   nlohmann::json insertPayload(const std::string& pl_type, const std::string& file_url, long long iov_start, long long iov_end) override;
0030   nlohmann::json setGlobalTag(const std::string& name) override;
0031   std::string getCalibration(const std::string& pl_type, long long iov);
0032   nlohmann::json unlockGlobalTag(const std::string& tagname) override;
0033   nlohmann::json lockGlobalTag(const std::string& tagname) override;
0034   nlohmann::json deletePayloadIOV(const std::string& pl_type, long long iov_start, long long iov_end) override;
0035 
0036   bool existGlobalTag(const std::string& tagname);
0037   int createDomain(const std::string& domain);
0038   int cache_set_GlobalTag(const std::string& name);
0039   bool isGlobalTagSet();
0040   void Verbosity(int i) { m_Verbosity = i; }
0041   int Verbosity() const { return m_Verbosity; }
0042 
0043  private:
0044   int m_Verbosity = 0;
0045   std::string m_CachedGlobalTag;
0046   std::set<std::string> m_DomainCache;
0047   std::set<std::string> m_GlobalTagCache;
0048 };
0049 
0050 #endif  // SPHENIXNPC_SPHENIXCLIENT_H