-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding instructions how to use ral in ROOT REPL
- Loading branch information
Showing
1 changed file
with
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,42 @@ | ||
# ral | ||
ROOT DataFrame Analysis Repository | ||
|
||
Key4hep library for use in ROOT RDataFrame based analysis. | ||
|
||
## Interactive use | ||
|
||
In order to use this library inside ROOT REPL one can open a root file with | ||
``` | ||
root test.root | ||
``` | ||
and then in the ROOT REPL do | ||
```cpp | ||
gSystem->Load("libral.so"); | ||
loadRal(); | ||
ROOT::RDataFrame dframe(*events); | ||
auto hist = dframe.Define("pT", "k4::ral::ReconstructedParticle::get_pt(ReconstructedParticles)").Histo1D("pT"); | ||
hist->Draw(); | ||
``` | ||
The whole output of the ROOT REPL can be seen here: | ||
``` | ||
------------------------------------------------------------------ | ||
| Welcome to ROOT 6.32.04 https://root.cern | | ||
| (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers | | ||
| Built for linuxx8664gcc on Aug 21 2024, 03:51:07 | | ||
| From heads/master@tags/v6-32-04 | | ||
| With g++ (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2) | | ||
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' | | ||
------------------------------------------------------------------ | ||
|
||
root [0] | ||
Attaching file test.root as _file0... | ||
(TFile *) 0x23c5ce0 | ||
root [1] gSystem->Load("libral.so"); | ||
root [2] loadRal() | ||
(bool) true | ||
root [3] ROOT::RDataFrame dframe(*events); | ||
root [4] auto hist = dframe.Define("pT", "k4::ral::ReconstructedParticle::get_pt(ReconstructedParticles)").Histo1D("pT"); | ||
root [5] hist->Draw(); | ||
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1 | ||
root [6] | ||
``` |