Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
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
12
int
ReadCalib::listGlobalTags
()
13
{
14
std::cout << sphenixnpc::getGlobalTags() << std::endl;
15
return
0;
16
}
17
18
int
ReadCalib::listPayloadTypes
()
19
{
20
std::cout << sphenixnpc::getPayloadTypes() << std::endl;
21
return
0;
22
}
23
24
std::string
ReadCalib::getCalibrationFile
(
const
std::string
&
type
, uint64_t iov)
const
25
{
26
recoConsts
*rc =
recoConsts::instance
();
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
}
coresoftware
blob
master
offline
database
dbtools
ReadCalib.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:04
using
1.8.2 with
sPHENIX GitHub integration