ndmspc 0.20250304.0
Loading...
Searching...
No Matches
Utils.h
1#ifndef NdmspcCoreUtils_H
2#define NdmspcCoreUtils_H
3
4#include <TFile.h>
5#include <TAxis.h>
6#include <TMacro.h>
7#include <THnSparse.h>
8#include <nlohmann/json.hpp>
9using json = nlohmann::json;
10
11namespace Ndmspc {
12
19
20class Utils : TObject {
21
23 Utils() {};
25 virtual ~Utils() {};
26
27 public:
28 static TFile * OpenFile(std::string filename, std::string mode = "READ", bool createLocalDir = true);
29 static std::string OpenRawFile(std::string filename);
30 static bool SaveRawFile(std::string filename, std::string content);
31 static TMacro * OpenMacro(std::string filename);
32 // static void RebinBins(int & min, int & max, int rebin);
33 static std::string GetCutsPath(json cuts);
34 static Int_t GetBinFromBase(Int_t bin, Int_t rebin, Int_t rebin_start);
35 static int SetResultValueError(json cfg, THnSparse * output, std::string name, Int_t * point, double val, double err,
36 bool normalizeToWidth = false, bool onlyPositive = false, double times = 1);
37 static std::vector<std::string> Tokenize(std::string_view input, const char delim);
38
40 ClassDef(Utils, 0);
42
43}; // namespace Utils
44} // namespace Ndmspc
45#endif
Utils object.
Definition Utils.h:20
static std::string GetCutsPath(json cuts)
Definition Utils.cxx:143
Utils()
Constructor.
Definition Utils.h:23
static int SetResultValueError(json cfg, THnSparse *output, std::string name, Int_t *point, double val, double err, bool normalizeToWidth=false, bool onlyPositive=false, double times=1)
Definition Utils.cxx:197
static std::string OpenRawFile(std::string filename)
Definition Utils.cxx:57
static TFile * OpenFile(std::string filename, std::string mode="READ", bool createLocalDir=true)
Definition Utils.cxx:18
static Int_t GetBinFromBase(Int_t bin, Int_t rebin, Int_t rebin_start)
Definition Utils.cxx:175
static TMacro * OpenMacro(std::string filename)
Definition Utils.cxx:100
virtual ~Utils()
Destructor.
Definition Utils.h:25
static std::vector< std::string > Tokenize(std::string_view input, const char delim)
Definition Utils.cxx:256
static bool SaveRawFile(std::string filename, std::string content)
Definition Utils.cxx:85