31 hpx->SetFillColor(48);
33 std::vector<float> vpx;
34 std::vector<float> vpy;
35 std::vector<float> vpz;
36 std::vector<float> vrand;
39 TTree *t =
new TTree(
"tvec",
"Tree with vectors");
43 t->
Branch(
"vrand", &vrand);
46 auto c1 =
new TCanvas(
"c1",
"Dynamic Filling Example", 200, 10, 700, 500);
50 for (
Int_t i = 0; i < 25000; i++) {
58 for (
Int_t j = 0; j < npx; ++j) {
62 pz = px * px + py * py;
70 vrand.emplace_back(random);
96 auto t =
f->Get<
TTree>(
"tvec");
98 std::vector<float> *vpx =
nullptr;
101 auto c1 =
new TCanvas(
"c1",
"Dynamic Filling Example", 200, 10, 700, 500);
110 auto h =
new TH1F(
"h",
"This is the px distribution", 100, -4, 4);
113 for (
Int_t i = 0; i < 25000; i++) {
118 for (
UInt_t j = 0; j < vpx->size(); ++j) {
139void tree121_hvector()
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long long Long64_t
Portable signed long integer 8 bytes.
float Float_t
Float 4 bytes (float).
externTBenchmark * gBenchmark
A TTree is a list of TBranches.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
1-D histogram with a float per channel (see TH1 documentation)
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr, TClass *realClass, EDataType datatype, bool isptr, bool suppressMissingBranchError)
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.