#include <vector>
void write()
{
TH1F *hpx =
new TH1F(
"hpx",
"This is the px distribution",100,-4,4);
std::vector<float> vpx;
std::vector<float> vpy;
std::vector<float> vpz;
std::vector<float> vrand;
vpx.clear();
vpy.clear();
vpz.clear();
vrand.clear();
for (
Int_t j = 0; j < npx; ++j) {
vpx.emplace_back(px);
vpz.emplace_back(pz);
vrand.emplace_back(random);
}
break;
}
}
}
void read()
{
TTree *t;
f->GetObject(
"tvec",t);
std::vector<float> *vpx = nullptr;
TH1F *
h =
new TH1F(
"h",
"This is the px distribution",100,-4,4);
for (
UInt_t j = 0; j < vpx->size(); ++j) {
}
break;
}
}
}
void hvector()
{
write();
read();
}
R__EXTERN TBenchmark * gBenchmark
R__EXTERN TRandom * gRandom
R__EXTERN TSystem * gSystem
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
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.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
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)
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
void Draw(Option_t *option="") override
Draw this histogram with options.
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=nullptr)
Change branch address, dealing with clone trees properly.
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.