Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReadCalib.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ReadCalib.cc
1 #include "ReadCalib.h"
2 
3 #include <phool/recoConsts.h>
4 
5 #include <nlohmann/json.hpp> // every method returns a json object
6 #include <sphenixnpc.hpp>
7 
8 #include <cstdlib>
9 #include <iostream>
10 #include <string>
11 
13 {
14  std::cout << sphenixnpc::getGlobalTags() << std::endl;
15  return 0;
16 }
17 
19 {
20  std::cout << sphenixnpc::getPayloadTypes() << std::endl;
21  return 0;
22 }
23 
25 {
27  std::string globaltag;
28  if (rc->FlagExist("CDB_GLOBALTAG"))
29  {
30  globaltag = rc->get_StringFlag("CDB_GLOBALTAG");
31  }
32  else
33  {
34  std::cout << "rc flag for globat tag CDB_GLOBALTAG not set" << std::endl;
35  exit(1);
36  }
37  return getCalibrationFile(globaltag, type, iov);
38 }
39 
40 std::string ReadCalib::getCalibrationFile(const std::string &globaltag, const std::string &type, uint64_t iov) const
41 {
42  nlohmann::json result = sphenixnpc::get(globaltag, type, iov);
43  return result.at("msg");
44 }