Adapted from the ntpl007_mtFill tutorial.
 
 
 
 
#include <atomic>
#include <memory>
#include <mutex>
#include <thread>
#include <vector>
#include <utility>
 
 
 
 
 
void FillData(RNTupleParallelWriter *
writer)
 
{
 
   auto prng = std::make_unique<TRandom3>();
 
 
 
   auto id = 
entry->GetPtr<std::uint32_t>(
"id");
 
   auto vpx = 
entry->GetPtr<std::vector<float>>(
"vpx");
 
   auto vpy = 
entry->GetPtr<std::vector<float>>(
"vpy");
 
   auto vpz = 
entry->GetPtr<std::vector<float>>(
"vpz");
 
 
 
      int npx = 
static_cast<int>(
prng->Rndm(1) * 15);
 
      
      for (
int j = 0; 
j < 
npx; ++
j) {
 
         float px, py, pz;
         pz = px * px + py * py;
 
      }
 
   }
}
 
void Write()
{
   
   model->MakeField<std::uint32_t>("id");
   model->MakeField<std::vector<float>>("vpx");
   model->MakeField<std::vector<float>>("vpy");
   model->MakeField<std::vector<float>>("vpz");
 
   
   
   options.SetApproxZippedClusterSize(1024 * 1024);
 
   
 
 
   
   
}
 
void Read()
{
 
 
   TCanvas *
c1 = 
new TCanvas(
"c2", 
"Multi-Threaded Filling Example", 200, 10, 1500, 500);
 
 
   TH1F h(
"h", 
"This is the px distribution", 100, -4, 4);
 
   
   
 
   auto nEvents = 
reader->GetNEntries();
 
   TH2F hFillSequence(
"", 
"Entry Id vs Thread Id;Entry Sequence Number;Filling Thread", 100, 0, nEvents, 100, 0,
 
   for (
auto i : 
reader->GetEntryRange())
 
}
 
{
   Write();
   Read();
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
R__EXTERN TStyle * gStyle
 
A writer to fill an RNTuple from multiple contexts.
 
static std::unique_ptr< RNTupleModel > CreateBare()
Creates a "bare model", i.e. an RNTupleModel with no default entry.
 
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.
 
Common user-tunable settings for storing RNTuples.
 
1-D histogram with a float per channel (see TH1 documentation)
 
2-D histogram with a float per channel (see TH1 documentation)
 
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
 
ROOT::RNTupleGlobalRange GetFieldRange(const ROOT::RFieldBase &field, const ROOT::Internal::RPageSource &pageSource)
Helper to get the iteration space of the given field that needs to be connected to the given page sou...