-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
groot/{rcmd,riofs,rtree,rvers}: add rtree.Reader support for TNtuple{,D}
Signed-off-by: Sebastien Binet <binet@cern.ch>
- Loading branch information
Showing
11 changed files
with
225 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright ©2022 The go-hep Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build ignore | ||
// +build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
"log" | ||
|
||
"go-hep.org/x/hep/groot/internal/rtests" | ||
) | ||
|
||
var ( | ||
root = flag.String("f", "test-tntuple.root", "output ROOT file") | ||
) | ||
|
||
func main() { | ||
flag.Parse() | ||
|
||
out, err := rtests.RunCxxROOT("gentntuple", []byte(script), *root) | ||
if err != nil { | ||
log.Fatalf("could not run ROOT macro:\noutput:\n%v\nerror: %+v", string(out), err) | ||
} | ||
} | ||
|
||
const script = ` | ||
void gentntuple(const char* fname) { | ||
int bufsize = 32000; | ||
int evtmax = 10; | ||
auto f = TFile::Open(fname, "RECREATE"); | ||
auto t = new TNtuple("ntup", "my ntuple title", "x:y"); | ||
for (int i = 0; i != evtmax; i++) { | ||
t->Fill(i, i+0.5); | ||
} | ||
f->Write(); | ||
f->Close(); | ||
exit(0); | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright ©2022 The go-hep Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build ignore | ||
// +build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
"log" | ||
|
||
"go-hep.org/x/hep/groot/internal/rtests" | ||
) | ||
|
||
var ( | ||
root = flag.String("f", "test-tntupled.root", "output ROOT file") | ||
) | ||
|
||
func main() { | ||
flag.Parse() | ||
|
||
out, err := rtests.RunCxxROOT("gentntuple", []byte(script), *root) | ||
if err != nil { | ||
log.Fatalf("could not run ROOT macro:\noutput:\n%v\nerror: %+v", string(out), err) | ||
} | ||
} | ||
|
||
const script = ` | ||
void gentntuple(const char* fname) { | ||
int bufsize = 32000; | ||
int evtmax = 10; | ||
auto f = TFile::Open(fname, "RECREATE"); | ||
auto t = new TNtupleD("ntup", "my ntuple title", "x:y"); | ||
for (int i = 0; i != evtmax; i++) { | ||
t->Fill(i, i+0.5); | ||
} | ||
f->Write(); | ||
f->Close(); | ||
exit(0); | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.