|
ndmspc
v1.2.0-0.1.rc3
|
Utility class providing static helper functions for file operations, histogram manipulations, axis handling, string and vector utilities, JSON parsing, and progress display. More...
#include <NUtils.h>
Public Types | |
| using | RawJsonInjections = std::vector< std::pair< std::vector< std::string >, std::string > > |
Static Public Member Functions | |
| static bool | EnableMT (Int_t numthreads=-1) |
| Enable multi-threading with specified number of threads. More... | |
| static bool | AccessPathName (std::string path) |
| Check if a path is accessible. More... | |
| static bool | IsFileSupported (std::string filename) |
| Check if a file is supported. More... | |
| static int | Cp (std::string source, std::string destination, Bool_t progressbar=kTRUE) |
| Copy a file from source to destination. More... | |
| static bool | CreateDirectory (const std::string &path) |
| static TFile * | OpenFile (std::string filename, std::string mode="READ", bool createLocalDir=true) |
| Open a ROOT file. More... | |
| static std::string | OpenRawFile (std::string filename) |
| Open a raw file and return its content as string. More... | |
| static bool | SaveRawFile (std::string filename, std::string content) |
| Save content to a raw file. More... | |
| static TMacro * | OpenMacro (std::string filename) |
| Open a macro file. More... | |
| static bool | LoadJsonFile (json &cfg, std::string filename) |
| Loads a JSON configuration file into the provided json object. More... | |
| static std::string | InjectRawJson (json &j, const RawJsonInjections &injections) |
| static void | AddRawJsonInjection (json &j, const std::vector< std::string > &path, const std::string &rawJson, const std::string &injectionsKey="__raw_json_injections") |
| Add one raw JSON injection entry into metadata field. More... | |
| static bool | CollectRawJsonInjections (const json &j, RawJsonInjections &injections, const std::string &injectionsKey="__raw_json_injections") |
| Collect raw JSON injection entries from metadata field. More... | |
| static std::string | MergeRawJsonWithMetadata (const std::string &rawJson, const json &metadata) |
| Merge raw JSON string with metadata fields. More... | |
| static TH1 * | ProjectTHnSparse (THnSparse *hns, const std::vector< int > &axes, Option_t *option="") |
| Project a THnSparse histogram onto specified axes. More... | |
| static bool | SetAxisRanges (THnSparse *sparse, std::vector< std::vector< int >> ranges={}, bool withOverflow=false, bool modifyTitle=false, bool reset=true) |
| Set axis ranges for THnSparse using vector of ranges. More... | |
| static bool | SetAxisRanges (THnSparse *sparse, std::map< int, std::vector< int >> ranges, bool withOverflow=false, bool modifyTitle=false, bool reset=true) |
| Set axis ranges for THnSparse using map of ranges. More... | |
| static bool | GetAxisRangeInBase (TAxis *a, int rebin, int rebin_start, int bin, int &min, int &max) |
| Get axis range in base for rebinned axis. More... | |
| static bool | GetAxisRangeInBase (TAxis *a, int min, int max, TAxis *base, int &minBase, int &maxBase) |
| Get axis range in base axis. More... | |
| static TAxis * | CreateAxisFromLabels (const std::string &name, const std::string &title, const std::vector< std::string > &labels) |
| Create a TAxis from a list of labels. More... | |
| static TAxis * | CreateAxisFromLabelsSet (const std::string &name, const std::string &title, const std::set< std::string > &labels) |
| Create a TAxis from a set of labels. More... | |
| static THnSparse * | Convert (TH1 *h1, std::vector< std::string > names={}, std::vector< std::string > titles={}) |
| Convert TH1 to THnSparse. More... | |
| static THnSparse * | Convert (TH2 *h2, std::vector< std::string > names={}, std::vector< std::string > titles={}) |
| Convert TH2 to THnSparse. More... | |
| static THnSparse * | Convert (TH3 *h3, std::vector< std::string > names={}, std::vector< std::string > titles={}) |
| Convert TH3 to THnSparse. More... | |
| static THnSparse * | ReshapeSparseAxes (THnSparse *hns, std::vector< int > order, std::vector< TAxis * > newAxes={}, std::vector< int > newPoint={}, Option_t *option="E") |
| Reshape axes of THnSparse. More... | |
| static void | GetTrueHistogramMinMax (const TH1 *h, double &min_val, double &max_val, bool include_overflow_underflow=false) |
| Get minimum and maximum value of histogram bins. More... | |
| static TObjArray * | AxesFromDirectory (const std::vector< std::string > paths, const std::string &findPath, const std::string &fileName, const std::vector< std::string > &axesNames) |
| Creates an array of axes objects from files in specified directories. More... | |
| static std::vector< std::string > | Tokenize (std::string_view input, const char delim) |
| Tokenize a string by delimiter. More... | |
| static std::vector< int > | TokenizeInt (std::string_view input, const char delim) |
| Tokenize a string into integers by delimiter. More... | |
| static std::string | Join (const std::vector< std::string > &values, const char delim=',') |
| Join vector of strings into a single string with delimiter. More... | |
| static std::string | Join (const std::vector< int > &values, const char delim=',') |
| Join vector of integers into a single string with delimiter. More... | |
| static std::vector< std::string > | Find (std::string path, std::string filename="") |
| Find files in a path matching filename. More... | |
| static std::vector< std::string > | FindLocal (std::string path, std::string filename="") |
| Find local files in a path matching filename. More... | |
| static std::vector< std::string > | FindEos (std::string path, std::string filename="") |
| Find EOS files in a path matching filename. More... | |
| static std::set< std::string > | Unique (std::vector< std::string > &paths, int axis, std::string path, char token='/') |
| Get unique values from vector of strings at specified axis. More... | |
| static std::vector< std::string > | Truncate (std::vector< std::string > values, std::string value) |
| Truncate vector of strings by a value. More... | |
| static std::vector< int > | ArrayToVector (Int_t *v1, int size) |
| Convert array to vector. More... | |
| static void | VectorToArray (std::vector< int > v1, Int_t *v2) |
| Convert vector to array. More... | |
| static std::string | GetCoordsString (const std::vector< int > &coords, int index=-1, int width=0) |
| Get string representation of coordinates. More... | |
| static std::string | GetCoordsString (const std::vector< size_t > &coords, int index=-1, int width=0) |
| Get string representation of coordinates. More... | |
| static std::string | GetCoordsString (const std::vector< Long64_t > &coords, int index=-1, int width=0) |
| Get string representation of coordinates (Long64_t). More... | |
| static std::string | GetCoordsString (const std::vector< std::string > &coords, int index=-1, int width=0) |
| Get string representation of coordinates (string). More... | |
| static void | PrintPointSafe (const std::vector< int > &coords, int index=-1) |
| Print coordinates safely. More... | |
| static std::vector< std::vector< int > > | Permutations (const std::vector< int > &v) |
| Generate all permutations of a vector. More... | |
| static std::string | GetJsonString (json j) |
| Get JSON value as string. More... | |
| static int | GetJsonInt (json j) |
| Get JSON value as integer. More... | |
| static double | GetJsonDouble (json j) |
| Get JSON value as double. More... | |
| static json | GetSystemStats () |
| Get process CPU and RSS memory statistics using ROOT's gSystem::GetProcInfo. More... | |
| static json | GetTFileIOStats () |
| Get TFile read/write statistics by inspecting ROOT's list of open files. More... | |
| static json | GetNetDevStats () |
| Get system-wide network interface totals (RX/TX bytes) in a cross-platform way. On Linux reads /proc/net/dev; on macOS uses getifaddrs() and struct if_data. More... | |
| static bool | GetJsonBool (json j) |
| Get JSON value as boolean. More... | |
| static std::vector< std::string > | GetJsonStringArray (json j) |
| Get JSON value as array of strings. More... | |
| static std::string | FormatTime (long long seconds) |
| Format time in seconds to human-readable string. More... | |
| static void | ProgressBar (int current, int total, std::string prefix="", std::string suffix="", int barWidth=50) |
| Display progress bar. More... | |
| static void | ProgressBar (int current, int total, std::chrono::high_resolution_clock::time_point startTime, std::string prefix="", std::string suffix="", int barWidth=50) |
| Display progress bar with timing. More... | |
| static TCanvas * | CreateCanvas (const std::string &name, const std::string &title, int width=800, int height=600) |
| Create a ROOT TCanvas with specified name, title, and dimensions. More... | |
| static void | SafeDeleteObjects (std::vector< TObject * > &objects) |
| Safely delete a vector of ROOT objects, bypassing GarbageCollect. More... | |
| static void | SafeDeleteTList (TList *&lst) |
| Safely delete a TList and all its contents, bypassing ROOT's GarbageCollect. More... | |
| static void | SafeDeleteObject (TObject *&obj) |
| Safely delete a TObject, handling TList contents and TCanvas/TPad cleanup. More... | |
| static THnSparse * | CreateSparseFromParquetTaxi (const std::string &filename, THnSparse *hns=nullptr, Int_t nMaxRows=-1) |
| Create THnSparse from Parquet Taxi file. More... | |
Private Member Functions | |
| NUtils () | |
| Constructor. | |
| virtual | ~NUtils () |
| Destructor. | |
Utility class providing static helper functions for file operations, histogram manipulations, axis handling, string and vector utilities, JSON parsing, and progress display.
|
static |
Check if a path is accessible.
| path | Path to check. |
Check if path exists
Definition at line 115 of file NUtils.cxx.
References Ndmspc::NHttpRequest::head().
|
static |
Add one raw JSON injection entry into metadata field.
The server serializer can later collect these entries and apply InjectRawJson without each handler duplicating metadata format details.
| j | JSON envelope that stores injection metadata |
| path | Nested key path where raw JSON should be injected |
| rawJson | Raw JSON string to inject |
| injectionsKey | Metadata key used to store injection entries |
Definition at line 881 of file NUtils.cxx.
|
static |
Convert array to vector.
| v1 | Input array. |
| size | Size of array. |
Convert array to vector
Definition at line 1551 of file NUtils.cxx.
Referenced by Ndmspc::NGnTree::Import(), Ndmspc::NStorageTree::Merge(), Ndmspc::NBinningPoint::Print(), Ndmspc::NBinning::PrintContent(), Ndmspc::NGnThreadData::Process(), Ndmspc::NGnTree::Process(), and Ndmspc::NBinningPoint::RecalculateStorageCoords().
|
static |
Creates an array of axes objects from files in specified directories.
Searches the given directories for files matching the specified file name and headers, and constructs a TObjArray of axes objects found in those files.
| paths | A vector of directory paths to search. |
| findPath | The subdirectory path to look for within each directory. |
| fileName | The name of the file to search for in each directory. |
| axesNames | A vector of axis names |
Definition at line 1396 of file NUtils.cxx.
References CreateAxisFromLabelsSet(), and Tokenize().
Referenced by Ndmspc::NGnTree::Import().
|
static |
Collect raw JSON injection entries from metadata field.
| j | JSON envelope containing injection metadata |
| injections | Output vector of parsed {path, rawJson} entries |
| injectionsKey | Metadata key used to store injection entries |
Definition at line 924 of file NUtils.cxx.
|
static |
Convert TH1 to THnSparse.
| h1 | Input TH1. |
| names | Axis names. |
| titles | Axis titles. |
Convert TH1 to THnSparse
Definition at line 221 of file NUtils.cxx.
|
static |
Convert TH2 to THnSparse.
| h2 | Input TH2. |
| names | Axis names. |
| titles | Axis titles. |
Convert TH2 to THnSparse
Definition at line 286 of file NUtils.cxx.
|
static |
Convert TH3 to THnSparse.
| h3 | Input TH3. |
| names | Axis names. |
| titles | Axis titles. |
Convert TH3 to THnSparse
Definition at line 364 of file NUtils.cxx.
|
static |
Copy a file from source to destination.
| source | Source file path. |
| destination | Destination file path. |
Copy file
Definition at line 155 of file NUtils.cxx.
References IsFileSupported().
|
static |
Create a TAxis from a list of labels.
| name | Axis name. |
| title | Axis title. |
| labels | Vector of labels. |
Create label axis
Definition at line 185 of file NUtils.cxx.
Referenced by Ndmspc::NResourceMonitor::Initialize().
|
static |
Create a TAxis from a set of labels.
| name | Axis name. |
| title | Axis title. |
| labels | Set of labels. |
Create label axis
Definition at line 202 of file NUtils.cxx.
Referenced by AxesFromDirectory().
|
static |
Create a ROOT TCanvas with specified name, title, and dimensions.
This utility function creates and returns a pointer to a new TCanvas object.
| name | Name of the canvas. |
| title | Title of the canvas. |
| width | Width of the canvas in pixels (default: 800). |
| height | Height of the canvas in pixels (default: 600). |
Create canvas
Definition at line 1748 of file NUtils.cxx.
|
static |
Create a directory (and all parents) for local paths. Remote paths (containing "://", except "file://") are silently ignored as the remote protocol is expected to handle directory creation itself.
Definition at line 688 of file NUtils.cxx.
Referenced by OpenFile().
|
static |
Create THnSparse from Parquet Taxi file.
| filename | Parquet file name. |
| hns | Optional input THnSparse. |
| nMaxRows | Maximum number of rows to read. |
Definition at line 1945 of file NUtils.cxx.
|
static |
Enable multi-threading with specified number of threads.
| numthreads | Number of threads to enable (0 for default). |
Enable multithreading
Definition at line 46 of file NUtils.cxx.
Referenced by Ndmspc::NGnTree::Process().
|
static |
Find files in a path matching filename.
| path | Directory path. |
| filename | Filename pattern. |
Find files in path
Definition at line 963 of file NUtils.cxx.
References FindEos(), and FindLocal().
Referenced by Ndmspc::NGnTree::Import().
|
static |
Find EOS files in a path matching filename.
| path | Directory path. |
| filename | Filename pattern. |
Find eos files
Definition at line 1008 of file NUtils.cxx.
References OpenFile(), and Tokenize().
Referenced by Find().
|
static |
Find local files in a path matching filename.
| path | Directory path. |
| filename | Filename pattern. |
Find local files
Definition at line 986 of file NUtils.cxx.
Referenced by Find().
|
static |
Format time in seconds to human-readable string.
| seconds | Time in seconds. |
Definition at line 1660 of file NUtils.cxx.
Referenced by Ndmspc::NGnTree::Process(), and ProgressBar().
|
static |
Get axis range in base axis.
| a | Axis pointer. |
| min | Minimum bin. |
| max | Maximum bin. |
| base | Base axis pointer. |
| minBase | Output minimum base bin. |
| maxBase | Output maximum base bin. |
Gets axis range in base
Definition at line 1373 of file NUtils.cxx.
References GetAxisRangeInBase().
|
static |
Get axis range in base for rebinned axis.
| a | Axis pointer. |
| rebin | Rebin factor. |
| rebin_start | Start bin for rebinning. |
| bin | Bin index. |
| min | Output minimum bin. |
| max | Output maximum bin. |
Returns axis range in base in min and max variables
Definition at line 1338 of file NUtils.cxx.
Referenced by GetAxisRangeInBase(), and Ndmspc::NGnNavigator::Reshape().
|
static |
Get string representation of coordinates.
| coords | Vector of coordinates. |
| index | Index to highlight (-1 for none). |
| width | Width for formatting. |
Get coordinates string
Definition at line 1588 of file NUtils.cxx.
Referenced by Ndmspc::NBinning::AddBinningViaBinWidths(), Ndmspc::NGnNavigator::DrawSpectra(), Ndmspc::NGnNavigator::DrawSpectraByName(), Ndmspc::NGnNavigator::ExportToJson(), Ndmspc::NBinning::GenerateListOfAxes(), Ndmspc::NGnNavigator::GetChild(), Ndmspc::NGnTree::Import(), Ndmspc::NGnThreadData::Merge(), Ndmspc::NStorageTree::Merge(), Ndmspc::NGnTree::Open(), Permutations(), Ndmspc::NBinningDef::Print(), Ndmspc::NBinningPoint::Print(), Ndmspc::NStorageTree::Print(), Ndmspc::NGnNavigator::Print(), Ndmspc::NBinning::PrintContent(), PrintPointSafe(), Ndmspc::NGnThreadData::Process(), Ndmspc::NGnTree::Projection(), Ndmspc::NBinningDef::RefreshContentFromIds(), Ndmspc::NBinningDef::RefreshIdsFromContent(), and Ndmspc::NGnNavigator::Reshape().
|
static |
Get string representation of coordinates (Long64_t).
| coords | Vector of coordinates. |
| index | Index to highlight (-1 for none). |
| width | Width for formatting. |
Get coordinates string
Definition at line 1574 of file NUtils.cxx.
|
static |
Get string representation of coordinates.
| coords | Vector of coordinates. |
| index | Index to highlight (-1 for none). |
| width | Width for formatting. |
Get coordinates string
Definition at line 1602 of file NUtils.cxx.
|
static |
Get string representation of coordinates (string).
| coords | Vector of coordinates. |
| index | Index to highlight (-1 for none). |
| width | Width for formatting. |
Get coordinates string
Definition at line 1616 of file NUtils.cxx.
|
static |
Get JSON value as boolean.
| j | Input JSON. |
Returns json bool if it is valid
Definition at line 1513 of file NUtils.cxx.
|
static |
Get JSON value as double.
| j | Input JSON. |
Returns json double if it is valid
Definition at line 1490 of file NUtils.cxx.
|
static |
Get JSON value as integer.
| j | Input JSON. |
Returns json int if it is valid
Definition at line 1467 of file NUtils.cxx.
|
static |
Get JSON value as string.
| j | Input JSON. |
Returns json string if it is valid
Definition at line 1442 of file NUtils.cxx.
Referenced by GetJsonStringArray().
|
static |
Get JSON value as array of strings.
| j | Input JSON. |
Returns json string array if it is valid
Definition at line 1536 of file NUtils.cxx.
References GetJsonString().
|
static |
Get system-wide network interface totals (RX/TX bytes) in a cross-platform way. On Linux reads /proc/net/dev; on macOS uses getifaddrs() and struct if_data.
Definition at line 2130 of file NUtils.cxx.
|
static |
Get process CPU and RSS memory statistics using ROOT's gSystem::GetProcInfo.
Definition at line 2055 of file NUtils.cxx.
|
static |
Get TFile read/write statistics by inspecting ROOT's list of open files.
Definition at line 2074 of file NUtils.cxx.
|
static |
Get minimum and maximum value of histogram bins.
| h | Input histogram. |
| min_val | Output minimum value. |
| max_val | Output maximum value. |
| include_overflow_underflow | Include overflow/underflow bins. |
Retrieve the true min and max values of a histogram, ignoring underflow and overflow bins
Definition at line 621 of file NUtils.cxx.
Referenced by Ndmspc::NGnNavigator::ExportToJson().
|
static |
Injects multiple raw JSON strings into a json object at the specified nested key paths. Each entry in the injections vector is a pair of:
This avoids re-parsing raw JSON strings, preserving the exact output of TBufferJSON.
| json | The json object to inject into |
| injections | Vector of {keys, rawJson} pairs |
| std::invalid_argument | if any keys array is empty |
| std::runtime_error | if any placeholder is not found after dump |
Definition at line 839 of file NUtils.cxx.
|
static |
Check if a file is supported.
| filename | Name of the file. |
Check if file is supported
Definition at line 97 of file NUtils.cxx.
Referenced by Cp().
|
static |
Join vector of integers into a single string with delimiter.
| values | Vector of integers. |
| delim | Delimiter character. |
Join helper function
Definition at line 1124 of file NUtils.cxx.
|
static |
Join vector of strings into a single string with delimiter.
| values | Vector of strings. |
| delim | Delimiter character. |
Join helper function
Definition at line 1111 of file NUtils.cxx.
Referenced by Ndmspc::NGnNavigator::DrawSpectra(), Ndmspc::NGnThreadData::Init(), and Ndmspc::NGnTree::Projection().
|
static |
Loads a JSON configuration file into the provided json object.
| cfg | Reference to a json object where the file contents will be loaded. |
| filename | Path to the JSON file to load. |
Load JSON file
Definition at line 814 of file NUtils.cxx.
References OpenRawFile().
|
static |
Merge raw JSON string with metadata fields.
Parses the raw JSON string and merges in metadata fields. Metadata fields at the top level are added/merged directly; nested paths are not supported.
| rawJson | Raw JSON string to merge into |
| metadata | JSON object with fields to merge |
Merge raw JSON string with metadata fields
Definition at line 941 of file NUtils.cxx.
|
static |
Open a ROOT file.
| filename | File name. |
| mode | File open mode ("READ", "UPDATE", etc.). |
| createLocalDir | Create local directory if needed. |
Open root file and create directory when needed in local case
Definition at line 719 of file NUtils.cxx.
References CreateDirectory().
Referenced by FindEos(), Ndmspc::NStorageTree::InitTree(), OpenRawFile(), and SaveRawFile().
|
static |
Open a macro file.
| filename | Macro file name. |
Open macro - supports local files and http/https URLs
Definition at line 781 of file NUtils.cxx.
References Ndmspc::NHttpRequest::get(), and OpenRawFile().
|
static |
Open a raw file and return its content as string.
| filename | File name. |
Opens raw file
Definition at line 735 of file NUtils.cxx.
References OpenFile().
Referenced by LoadJsonFile(), and OpenMacro().
|
static |
Generate all permutations of a vector.
| v | Input vector. |
Return all permutations of a vector
Definition at line 1639 of file NUtils.cxx.
References GetCoordsString().
Referenced by Ndmspc::NGnNavigator::DrawSpectra().
|
static |
Print coordinates safely.
| coords | Vector of coordinates. |
| index | Index to highlight (-1 for none). |
Print point safe
Definition at line 1630 of file NUtils.cxx.
References GetCoordsString().
|
static |
Display progress bar with timing.
| current | Current progress. |
| total | Total value. |
| startTime | Start time point. |
| barWidth | Width of the bar. |
| prefix | Prefix string. |
| suffix | Suffix string. |
Print progress bar
Definition at line 1704 of file NUtils.cxx.
References FormatTime(), and Ndmspc::NLogger::GetLoggerMutex().
|
static |
Display progress bar.
| current | Current progress. |
| total | Total value. |
| barWidth | Width of the bar. |
| prefix | Prefix string. |
| suffix | Suffix string. |
Print progress bar
Definition at line 1673 of file NUtils.cxx.
References Ndmspc::NLogger::GetLoggerMutex().
Referenced by Ndmspc::NGnTree::Process().
|
static |
Project a THnSparse histogram onto specified axes.
| hns | Input THnSparse. |
| axes | Axes to project. |
| option | Projection options. |
Project THnSparse onto TH1
Definition at line 1167 of file NUtils.cxx.
Referenced by Ndmspc::NGnNavigator::DrawSpectra(), and Ndmspc::NGnTree::Projection().
|
static |
Reshape axes of THnSparse.
| hns | Input THnSparse. |
| order | New axis order. |
| newAxes | New axes (optional). |
| newPoint | New point (optional). |
| option | Option string. |
Reshape sparse axes
loop over all axes
Definition at line 452 of file NUtils.cxx.
Referenced by Ndmspc::NResourceMonitor::Initialize().
|
static |
Safely delete a TObject, handling TList contents and TCanvas/TPad cleanup.
If the object is a TList, delegates to SafeDeleteTList. Otherwise deletes directly.
| obj | Pointer reference to the object. Set to nullptr after deletion. |
Definition at line 2040 of file NUtils.cxx.
References SafeDeleteTList().
|
static |
Safely delete a vector of ROOT objects, bypassing GarbageCollect.
Extracts and empties pad primitive lists (to prevent GarbageCollect during canvas/pad destruction), then deletes all objects directly.
| objects | Vector of object pointers. Cleared after deletion. |
Definition at line 1953 of file NUtils.cxx.
Referenced by Ndmspc::NGnThreadData::FlushDeferredDeletes(), and SafeDeleteTList().
|
static |
Safely delete a TList and all its contents, bypassing ROOT's GarbageCollect.
Extracts objects into a vector, destroys the TList shell, then delegates to SafeDeleteObjects.
| lst | Pointer reference to the TList. Set to nullptr after deletion. |
Definition at line 2018 of file NUtils.cxx.
References SafeDeleteObjects().
Referenced by Ndmspc::NTreeBranch::GetEntry(), and SafeDeleteObject().
|
static |
Save content to a raw file.
| filename | File name. |
| content | Content to save. |
Save raw file
Definition at line 765 of file NUtils.cxx.
References OpenFile().
Referenced by Ndmspc::NGnNavigator::Export().
|
static |
Set axis ranges for THnSparse using map of ranges.
| sparse | Input THnSparse. |
| ranges | Map of axis ranges. |
| withOverflow | Include overflow bins. |
| modifyTitle | Modify histogram title. |
| reset | Reset axis ranges before setting new ones. |
Set axis ranges
Reset all axis ranges
Definition at line 1278 of file NUtils.cxx.
|
static |
Set axis ranges for THnSparse using vector of ranges.
| sparse | Input THnSparse. |
| ranges | Vector of axis ranges. |
| withOverflow | Include overflow bins. |
| modifyTitle | Modify histogram title. |
| reset | Reset axis ranges before setting new ones. |
Set axis ranges
Reset all axis ranges
Definition at line 1220 of file NUtils.cxx.
Referenced by Ndmspc::NGnNavigator::DrawSpectra(), Ndmspc::NStorageTree::Fill(), Ndmspc::NGnNavigator::GetChild(), Ndmspc::NGnTree::NGnTree(), Ndmspc::NGnTree::Play(), Ndmspc::NGnTree::Projection(), and Ndmspc::NGnNavigator::Reshape().
|
static |
Tokenize a string by delimiter.
| input | Input string. |
| delim | Delimiter character. |
Tokenize helper function
Definition at line 1073 of file NUtils.cxx.
Referenced by AxesFromDirectory(), FindEos(), Ndmspc::NGnTree::Open(), TokenizeInt(), and Unique().
|
static |
Tokenize a string into integers by delimiter.
| input | Input string. |
| delim | Delimiter character. |
Tokenize helper function
Definition at line 1095 of file NUtils.cxx.
References Tokenize().
|
static |
Truncate vector of strings by a value.
| values | Vector of strings. |
| value | Value to truncate by. |
Truncate helper function
Definition at line 1138 of file NUtils.cxx.
Referenced by Unique().
|
static |
Get unique values from vector of strings at specified axis.
| paths | Vector of paths. |
| axis | Axis index. |
| path | Path string. |
| token | Token character. |
Unique helper function
Definition at line 1152 of file NUtils.cxx.
References Tokenize(), and Truncate().
|
static |
Convert vector to array.
| v1 | Input vector. |
| v2 | Output array. |
Convert vector to array
Definition at line 1564 of file NUtils.cxx.
Referenced by Ndmspc::NBinning::AddBinning().