ndmspc 0.20250304.0
|
#include <PointRun.h>
Public Member Functions | |
PointRun (std::string macro="NdmspcPointRun.C") | |
virtual | ~PointRun () |
bool | Run (std::string filename, std::string userConfig="", std::string environment="", std::string userConfigRaw="", std::string binnings="", bool show=false, std::string outfilename="") |
bool | GenerateJobs (std::string jobs, std::string filename, std::string userConfig="", std::string environment="", std::string userConfigRaw="", std::string jobDir="/tmp/ndmspc-jobs", std::string binnings="") |
json & | Cfg () |
Returns global config object. | |
json * | CfgPtr () |
Returns global config pointer to object. | |
TFile * | GetInputFile () const |
Returns input file. | |
TList * | GetInputList () const |
Returns list of input objects. | |
THnSparse * | GetResultObject () const |
Returns retults hnsparse object. | |
Int_t * | GetCurrentPoint () |
Returns current point coordinates. | |
std::vector< std::string > | GetCurrentPointLabels () |
Returns current point labels. | |
json | GetCurrentPointValue () |
Return current point value in json. | |
TList * | GetOutputList () const |
Returns output list. | |
void | SetOutputList (TList *outList) |
Sets output list. | |
void | SetSkipCurrentBin (bool scb=true) |
Sets flag for skupping bin. | |
void | SetProcessExit (bool pe=true) |
Sets flag for ending process. | |
Static Public Member Functions | |
static void | SetEnvironment (std::string env) |
Sets environment. | |
static bool | Generate (std::string name="myAnalysis", std::string inFile="myFile.root", std::string inObjectName="myNDHistogram") |
static bool | Merge (int from=0, int to=1, std::string name="myAnalysis.json", std::string userConfig="", std::string environment="", std::string userConfigRaw="", std::string binning="", std::string cacheDir="${PWD}/.ndmspc_merge_cache", std::string fileOpt="?remote=1") |
Merge. | |
Private Member Functions | |
bool | LoadConfig (std::string config, std::string userConfig="", std::string environment="", std::string userConfigRaw="", std::string binning="", bool show=false, std::string outfilename="") |
bool | Init (std::string extraPath="") |
bool | Finish () |
TList * | OpenInputs () |
THnSparse * | CreateResult () |
bool | ApplyCuts () |
int | ProcessSingleFile () |
bool | ProcessSinglePoint () |
bool | ProcessRecursive (int i) |
bool | ProcessRecursiveInner (Int_t i, std::vector< std::string > &n) |
void | OutputFileOpen () |
void | OutputFileClose () |
int | ProcessHistogramRun () |
bool | GenerateRecursiveConfig (Int_t dim, std::vector< std::vector< int > > &ranges, json &cfg, std::string &outfilename, int &count) |
Private Attributes | |
TMacro * | fMacro {nullptr} |
Macro. | |
int | fVerbose {0} |
Verbose level. | |
int | fBinCount {0} |
Bin Count (TODO! rename to axis level maybe) | |
TFile * | fInputFile {nullptr} |
Input file. | |
TList * | fInputList {nullptr} |
Input list. | |
THnSparse * | fResultObject {nullptr} |
Result object. | |
TFile * | fCurrentOutputFile {nullptr} |
Current output file. | |
std::string | fCurrentOutputFileName {} |
Current output filename. | |
TDirectory * | fCurrentOutputRootDirectory {nullptr} |
Current output root directory. | |
Int_t | fCurrentPoint [32] |
Current point. | |
std::vector< std::string > | fCurrentPointLabels {} |
Current labels. | |
json | fCurrentPointValue {} |
Current point value. | |
THnSparse * | fCurrentProccessHistogram {nullptr} |
Current processed histogram. | |
TH1S * | fMapAxesType {nullptr} |
Map axis type histogram. | |
std::vector< TAxis * > | fCurrentProcessHistogramAxes {} |
Current process histogram axes. | |
std::vector< int > | fCurrentProcessHistogramPoint {} |
Current process histoghram point. | |
bool | fIsSkipBin {false} |
Flag to skip bin. | |
bool | fIsProcessOk {false} |
Flag that process is ok. | |
bool | fIsProcessExit {false} |
Flag to exit process. | |
TList * | fOutputList {nullptr} |
Output list. | |
Static Private Attributes | |
static std::string | fgEnvironment = "" |
Environment. | |
PointRun object.
Definition at line 24 of file PointRun.h.
Ndmspc::PointRun::PointRun | ( | std::string | macro = "NdmspcPointRun.C" | ) |
Default constructor
Definition at line 29 of file PointRun.cxx.
References fMacro, and Ndmspc::Utils::OpenMacro().
|
virtual |
Descructor
Definition at line 40 of file PointRun.cxx.
|
private |
Apply cuts
TODO! port it to std::string
Definition at line 467 of file PointRun.cxx.
References fCurrentPoint, fCurrentProcessHistogramPoint, fInputList, fVerbose, and Ndmspc::Utils::GetBinFromBase().
Referenced by ProcessSinglePoint().
|
inline |
Returns global config object.
Definition at line 35 of file PointRun.h.
|
inline |
Returns global config pointer to object.
Definition at line 37 of file PointRun.h.
|
private |
Create result object
Definition at line 249 of file PointRun.cxx.
References fCurrentPoint, fCurrentPointLabels, fCurrentProccessHistogram, fCurrentProcessHistogramAxes, fCurrentProcessHistogramPoint, fInputList, fMapAxesType, fResultObject, and fVerbose.
Referenced by ProcessSinglePoint().
|
private |
Finish
Definition at line 912 of file PointRun.cxx.
References fInputFile, fInputList, and fVerbose.
Referenced by ProcessSingleFile().
|
static |
Generate point macro and config
Definition at line 1221 of file PointRun.cxx.
References Ndmspc::Utils::OpenFile().
bool Ndmspc::PointRun::GenerateJobs | ( | std::string | jobs, |
std::string | filename, | ||
std::string | userConfig = "", | ||
std::string | environment = "", | ||
std::string | userConfigRaw = "", | ||
std::string | jobDir = "/tmp/ndmspc-jobs", | ||
std::string | binnings = "" ) |
Generates jobs
Definition at line 1090 of file PointRun.cxx.
References fMacro, fVerbose, GenerateRecursiveConfig(), LoadConfig(), and Ndmspc::Utils::Tokenize().
|
private |
Generate config recursively
Definition at line 1194 of file PointRun.cxx.
References GenerateRecursiveConfig(), and Ndmspc::Core::SaveConfig().
Referenced by GenerateJobs(), and GenerateRecursiveConfig().
|
inline |
Returns current point coordinates.
Definition at line 45 of file PointRun.h.
References fCurrentPoint.
|
inline |
Returns current point labels.
Definition at line 47 of file PointRun.h.
References fCurrentPointLabels.
|
inline |
Return current point value in json.
Definition at line 49 of file PointRun.h.
References fCurrentPointValue.
|
inline |
|
inline |
|
inline |
|
inline |
Returns retults hnsparse object.
Definition at line 43 of file PointRun.h.
References fResultObject.
|
private |
Init
Definition at line 78 of file PointRun.cxx.
References fVerbose, Ndmspc::Utils::GetCutsPath(), and Ndmspc::Utils::OpenFile().
Referenced by ProcessHistogramRun().
|
private |
Load config and set default PointRun parameters
Definition at line 47 of file PointRun.cxx.
References fVerbose, and Ndmspc::Core::LoadConfig().
Referenced by GenerateJobs(), and Run().
|
private |
Open Input objects
Definition at line 159 of file PointRun.cxx.
References fInputFile, fInputList, fVerbose, and Ndmspc::Utils::OpenFile().
Referenced by ProcessSingleFile().
|
private |
Closing output file
Definition at line 887 of file PointRun.cxx.
References fCurrentOutputFile, fCurrentOutputFileName, fCurrentOutputRootDirectory, fMapAxesType, fResultObject, and fVerbose.
Referenced by ProcessSinglePoint().
|
private |
Open output file
Definition at line 772 of file PointRun.cxx.
References fCurrentOutputFile, fCurrentOutputFileName, fCurrentOutputRootDirectory, fVerbose, Ndmspc::Utils::GetCutsPath(), and Ndmspc::Utils::OpenFile().
Referenced by ProcessRecursiveInner().
|
private |
Process histogram run
Definition at line 981 of file PointRun.cxx.
References fCurrentProccessHistogram, fCurrentProcessHistogramAxes, fCurrentProcessHistogramPoint, fVerbose, Init(), Ndmspc::Utils::OpenFile(), and ProcessSingleFile().
Referenced by Run().
|
private |
Process run in recursion
Definition at line 594 of file PointRun.cxx.
References fInputList, fVerbose, ProcessRecursive(), and ProcessSinglePoint().
Referenced by ProcessRecursive(), and ProcessSingleFile().
|
private |
Process inner recursion
Definition at line 662 of file PointRun.cxx.
References fBinCount, fCurrentOutputFile, fCurrentOutputRootDirectory, fCurrentPoint, fCurrentPointLabels, fCurrentPointValue, fIsProcessExit, fIsProcessOk, fIsSkipBin, fMacro, fResultObject, fVerbose, OutputFileOpen(), ProcessRecursiveInner(), and SetOutputList().
Referenced by ProcessRecursiveInner(), and ProcessSinglePoint().
|
private |
Process singe file
Definition at line 934 of file PointRun.cxx.
References Finish(), OpenInputs(), ProcessRecursive(), and ProcessSinglePoint().
Referenced by ProcessHistogramRun(), and Run().
|
private |
Process single point
Definition at line 547 of file PointRun.cxx.
References ApplyCuts(), CreateResult(), fBinCount, fIsProcessOk, fIsSkipBin, fResultObject, fVerbose, OutputFileClose(), and ProcessRecursiveInner().
Referenced by ProcessRecursive(), and ProcessSingleFile().
bool Ndmspc::PointRun::Run | ( | std::string | filename, |
std::string | userConfig = "", | ||
std::string | environment = "", | ||
std::string | userConfigRaw = "", | ||
std::string | binnings = "", | ||
bool | show = false, | ||
std::string | outfilename = "" ) |
Main run
Definition at line 1064 of file PointRun.cxx.
References fMacro, fVerbose, LoadConfig(), ProcessHistogramRun(), and ProcessSingleFile().
|
inlinestatic |
|
inline |
Sets output list.
Definition at line 53 of file PointRun.h.
References fOutputList.
Referenced by ProcessRecursiveInner().
|
inline |
|
inline |
|
private |
Bin Count (TODO! rename to axis level maybe)
Definition at line 71 of file PointRun.h.
Referenced by ProcessRecursiveInner(), and ProcessSinglePoint().
|
private |
Current output file.
Definition at line 75 of file PointRun.h.
Referenced by OutputFileClose(), OutputFileOpen(), and ProcessRecursiveInner().
|
private |
Current output filename.
Definition at line 76 of file PointRun.h.
Referenced by OutputFileClose(), and OutputFileOpen().
|
private |
Current output root directory.
Definition at line 77 of file PointRun.h.
Referenced by OutputFileClose(), OutputFileOpen(), and ProcessRecursiveInner().
|
private |
Current point.
Definition at line 78 of file PointRun.h.
Referenced by ApplyCuts(), CreateResult(), GetCurrentPoint(), and ProcessRecursiveInner().
|
private |
Current labels.
Definition at line 79 of file PointRun.h.
Referenced by CreateResult(), GetCurrentPointLabels(), and ProcessRecursiveInner().
|
private |
Current point value.
Definition at line 80 of file PointRun.h.
Referenced by GetCurrentPointValue(), and ProcessRecursiveInner().
|
private |
Current processed histogram.
Definition at line 81 of file PointRun.h.
Referenced by CreateResult(), and ProcessHistogramRun().
|
private |
Current process histogram axes.
Definition at line 83 of file PointRun.h.
Referenced by CreateResult(), and ProcessHistogramRun().
|
private |
Current process histoghram point.
Definition at line 84 of file PointRun.h.
Referenced by ApplyCuts(), CreateResult(), and ProcessHistogramRun().
|
staticprivate |
|
private |
Input file.
Definition at line 72 of file PointRun.h.
Referenced by Finish(), GetInputFile(), and OpenInputs().
|
private |
Input list.
Definition at line 73 of file PointRun.h.
Referenced by ApplyCuts(), CreateResult(), Finish(), GetInputList(), OpenInputs(), and ProcessRecursive().
|
private |
Flag to exit process.
Definition at line 87 of file PointRun.h.
Referenced by ProcessRecursiveInner(), and SetProcessExit().
|
private |
Flag that process is ok.
Definition at line 86 of file PointRun.h.
Referenced by ProcessRecursiveInner(), and ProcessSinglePoint().
|
private |
Flag to skip bin.
Definition at line 85 of file PointRun.h.
Referenced by ProcessRecursiveInner(), ProcessSinglePoint(), and SetSkipCurrentBin().
|
private |
Macro.
Definition at line 69 of file PointRun.h.
Referenced by GenerateJobs(), PointRun(), ProcessRecursiveInner(), and Run().
|
private |
Map axis type histogram.
Definition at line 82 of file PointRun.h.
Referenced by CreateResult(), and OutputFileClose().
|
private |
Output list.
Definition at line 88 of file PointRun.h.
Referenced by GetOutputList(), and SetOutputList().
|
private |
Result object.
Definition at line 74 of file PointRun.h.
Referenced by CreateResult(), GetResultObject(), OutputFileClose(), ProcessRecursiveInner(), and ProcessSinglePoint().
|
private |
Verbose level.
Definition at line 70 of file PointRun.h.
Referenced by ApplyCuts(), CreateResult(), Finish(), GenerateJobs(), Init(), LoadConfig(), OpenInputs(), OutputFileClose(), OutputFileOpen(), ProcessHistogramRun(), ProcessRecursive(), ProcessRecursiveInner(), ProcessSinglePoint(), and Run().