ndmspc  0.20250128.0
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>
9 using json = nlohmann::json;
10 
11 namespace Ndmspc {
12 
19 
20 class Utils : TObject {
21 
22  Utils() {};
23  virtual ~Utils() {};
24 
25  public:
26  static TFile * OpenFile(std::string filename, std::string mode = "READ", bool createLocalDir = true);
27  static std::string OpenRawFile(std::string filename);
28  static TMacro * OpenMacro(std::string filename);
29  // static void RebinBins(int & min, int & max, int rebin);
30  static std::string GetCutsPath(json cuts);
31  static Int_t GetBinFromBase(Int_t bin, Int_t rebin, Int_t rebin_start);
32  static int SetResultValueError(json cfg, THnSparse * output, std::string name, Int_t * point, double val, double err,
33  bool normalizeToWidth = false, bool onlyPositive = false, double times = 1);
34  static std::vector<std::string> Tokenize(std::string_view input, const char delim);
35 
37  ClassDef(Utils, 0);
39 
40 }; // namespace Utils
41 } // namespace Ndmspc
42 #endif
Utils object.
Definition: Utils.h:20
static TFile * OpenFile(std::string filename, std::string mode="READ", bool createLocalDir=true)
Definition: Utils.cxx:18