17 Vector3() : fX(0), fY(0), fZ(0) {}
33 auto v =
new Vector3();
35 auto T =
new TTree(
"T",
"vector3 Tree");
36 T->Branch(
"v3", &
v, 32000, 1);
38 for (
Int_t i=0; i<10000; i++) {
39 v->SetXYZ(
r.Gaus(0, 1),
r.Landau(0, 1),
r.Gaus(100, 10));
47void read_all_vector3()
52 auto T =
f->Get<
TTree>(
"T");
54 auto h1 =
new TH1F(
"x",
"x component of Vector3", 100, -3, 3);
63 void read_branch_vector3()
68 auto T =
f->Get<
TTree>(
"T");
70 auto by = T->GetBranch(
"fY");
71 auto h2 =
new TH1F(
"y",
"y component of Vector3", 100, -5, 20);
82 auto c1 =
new TCanvas(
"c1",
"demo of Trees", 10, 10, 600, 800);
88 read_branch_vector3();
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
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)
This is the base class for the ROOT Random number generators.
A TTree represents a columnar dataset.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr, TClass *realClass, EDataType datatype, bool isptr, bool suppressMissingBranchError)