43using namespace std::chrono_literals;
64 case EReadMode::kNaive: os <<
"naive";
break;
65 case EReadMode::kInformed: os <<
"informed";
break;
80 static std::mutex
gLock;
84 auto token =
reader.CreateActiveEntryToken();
85 for (
unsigned int i =
threadId; i <
reader.GetNEntries(); i += 2) {
87 std::lock_guard<std::mutex> guard(
gLock);
92 case EReadMode::kInformed: token.SetEntryNumber(i);
break;
93 case EReadMode::kNaive:
break;
94 default: std::terminate();
104 reader.GetMetrics().GetCounter(
"RNTupleReader.RPageSourceFile.nClusterLoaded")->GetValueAsInt();
106 reader.GetMetrics().GetCounter(
"RNTupleReader.RPageSourceFile.nPageUnsealed")->GetValueAsInt();
108 reader.GetMetrics().GetCounter(
"RNTupleReader.RPageSourceFile.RClusterPool.nCluster")->GetValueAsInt();
110 reader.GetMetrics().GetCounter(
"RNTupleReader.RPageSourceFile.RPagePool.nPage")->GetValueAsInt();
123 const auto N =
reader->GetNEntries();
129 std::array<std::thread, 2>
threads;
138 std::cout <<
"Reading in mode '" <<
readMode <<
"':" << std::endl;
139 std::cout <<
"===========================" << std::endl;
140 reader->GetMetrics().Print(std::cout);
141 std::cout <<
"===========================" << std::endl << std::endl;
151 for (
int i = 0; i < 1000; ++i) {
155 auto prng = std::make_unique<TRandom3>();
166 auto graph =
new TGraph();
167 for (
unsigned int i = 0; i <
counts.size(); ++i) {
168 graph->SetPoint(i, i,
counts[i]);
170 graph->GetXaxis()->SetTitle(
"Number of processed entries");
190 TCanvas *canvas =
new TCanvas(
"",
"Shared Reader Example", 200, 10, 1500, 1000);
205 legend->AddEntry(
graph1,
"Number of decompressed pages",
"l");
206 legend->AddEntry(
graph2,
"Number of loaded clusters",
"l");
209 latex.SetTextAlign(22);
210 latex.DrawLatexNDC(0.5, 0.95,
"Naive Reading");
216 graph3->GetYaxis()->SetNdivisions(8);
217 graph3->GetYaxis()->SetRangeUser(-0.5, 14);
225 legend->AddEntry(
graph3,
"Number of currently cached pages",
"p");
226 legend->AddEntry(
graph4,
"Number of currently cached clusters",
"p");
242 latex.SetTextAlign(22);
243 latex.DrawLatexNDC(0.5, 0.95,
"Informed Reading");
249 graph7->GetYaxis()->SetNdivisions(8);
250 graph7->GetYaxis()->SetRangeUser(-0.5, 14);
TBuffer & operator<<(TBuffer &buf, const Tmpl *obj)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TStyle * gStyle
static std::unique_ptr< RNTupleModel > Create()
Reads RNTuple data from storage.
static std::unique_ptr< RNTupleReader > Open(std::string_view ntupleName, std::string_view storage, const ROOT::RNTupleReadOptions &options=ROOT::RNTupleReadOptions())
Open an RNTuple for reading.
static std::unique_ptr< RNTupleWriter > Recreate(std::unique_ptr< ROOT::RNTupleModel > model, std::string_view ntupleName, std::string_view storage, const ROOT::RNTupleWriteOptions &options=ROOT::RNTupleWriteOptions())
Creates an RNTupleWriter backed by storage, overwriting it if one with the same URI exists.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
A TGraph is an object made of two arrays X and Y with npoints each.
To draw Mathematical Formula.
This class displays a legend box (TPaveText) containing several legend entries.
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
void EnableImplicitMT(UInt_t numthreads=0)
Enable ROOT's implicit multi-threading for all objects and methods that provide an internal paralleli...