4#include "HnSparseStress.h"
7int main(
int argc,
char ** argv)
9 Printf(
"%s v%s-%s", NDMSPC_NAME, NDMSPC_VERSION, NDMSPC_VERSION_RELEASE);
13 std::string filename =
"/tmp/HnSparse.root";
14 bool projections =
false;
18 double min = -(double)nBins / 2;
19 double max = (double)nBins / 2;
20 Long64_t chunkSize = 1024 * 1024;
25 for (Int_t i = 0; i < nDim; i++) {
35 TStopwatch timeStress;
37 stress.
Stress(h, size, bytes);
39 timeStress.Print(
"m");
41 Long64_t nBinsSizeBytes =
sizeof(Double_t) * h->GetNbins();
42 Printf(
"size : %03.2f MB (%lld B)", (
double)nBinsSizeBytes / (1024 * 1024), nBinsSizeBytes);
46 TFile * f = TFile::Open(filename.data(),
"RECREATE");
47 f->SetCompressionSettings(ROOT::RCompressionSetting::EDefaults::kUseAnalysis);
48 Printf(
"Writing histogram ...");
51 Printf(
"Creating and writing projections ...");
52 for (Int_t i = 0; i < nDim; i++) {
53 ((TH1 *)h->Projection(i))->Write();
54 for (Int_t j = 0; j < nDim; j++) {
56 ((TH2 *)h->Projection(j, i))->Write();
63 Printf(
"Output was saved in '%s' size : %.2f MB (%lld B)", filename.data(),
64 (
double)f->GetBytesWritten() / (1024 * 1024), f->GetBytesWritten());
virtual Bool_t Stress(HnSparse *h, Long64_t size=1e3, bool bytes=false)