# Newbie

**URL:** https://root-forum.cern.ch/c/newbie/26.md?page=68

[Latest](https://root-forum.cern.ch/latest.md) · [Categories](https://root-forum.cern.ch/categories.md) · [Tags](https://root-forum.cern.ch/tags.md)

**Page:** 69

---

## [Reading hist from a TTree](https://root-forum.cern.ch/t/reading-hist-from-a-ttree/46038)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 3\
**Last updated:** [July 29, 2021, 6:25am UTC](https://root-forum.cern.ch/t/reading-hist-from-a-ttree/46038 "2021-07-29T06:25:08Z")

</div>

I have a root file named “filename.root” with the tree named “treename”. There is a histogram named “histname” in this tree. I am trying to read this histogram but nothing is showing up. Please let me know my error. Here…

---

## [Selecting Particles and Filling the Histogram](https://root-forum.cern.ch/t/selecting-particles-and-filling-the-histogram/46078)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 10\
**Last updated:** [July 29, 2021, 9:39pm UTC](https://root-forum.cern.ch/t/selecting-particles-and-filling-the-histogram/46078 "2021-07-29T21:39:29Z")

</div>

Hello there. I have a root file with a list of particles and I am trying to select a specific particle and fill histogram out of it. I believe I made an error on the filling part as the histogram is showing empty. I have…

---

## [Incorrect path of ROOT\_LIBRARIES in cmake](https://root-forum.cern.ch/t/incorrect-path-of-root-libraries-in-cmake/45998)

<div class="topic-metadata">

**Author:** [@haha123](https://root-forum.cern.ch/u/haha123)\
**Replies:** 3\
**Last updated:** [July 29, 2021, 9:24pm UTC](https://root-forum.cern.ch/t/incorrect-path-of-root-libraries-in-cmake/45998 "2021-07-29T21:24:12Z")

</div>

Hi expert, I was compiling a geant4 + root project using cmake on a WSL system (Ubuntu 18). The “ROOT\_INCLUDE\_DIRS” gives correct path, i.e. …/Desktop/root/include. However, the “ROOT\_LIBRARIES” gives …/Desktop/root2/…

---

## [Docker Image for M1 Mac](https://root-forum.cern.ch/t/docker-image-for-m1-mac/46031)

<div class="topic-metadata">

**Author:** [@pettus](https://root-forum.cern.ch/u/pettus)\
**Replies:** 7\
**Last updated:** [July 29, 2021, 9:03pm UTC](https://root-forum.cern.ch/t/docker-image-for-m1-mac/46031 "2021-07-29T21:03:28Z")

</div>

I recently updated to a new M1 MacBook, and was wondering if a ready-made docker image exists? Especially one that works with PyROOT (and is at least compatible with Jupyter). I know there are ROOT installation methods…

---

## [Accessing Variables from a Complex TTree](https://root-forum.cern.ch/t/accessing-variables-from-a-complex-ttree/46073)

<div class="topic-metadata">

**Author:** [@Omar\_Ibna\_Nazim](https://root-forum.cern.ch/u/Omar_Ibna_Nazim)\
**Replies:** 2\
**Last updated:** [July 29, 2021, 8:46pm UTC](https://root-forum.cern.ch/t/accessing-variables-from-a-complex-ttree/46073 "2021-07-29T20:46:59Z")

</div>

ROOT Version: 6.22/08 Platform: CentOS Compiler: 4.8.5 I am using the MakeClass method to obtain the skeleton of a TTree with multiple Branches and the Branches having multiple TLeafs. I can print the event variables…

---

## [Plotting scatter plot from different tree in the same canvas](https://root-forum.cern.ch/t/plotting-scatter-plot-from-different-tree-in-the-same-canvas/46054)

<div class="topic-metadata">

**Author:** [@zero1](https://root-forum.cern.ch/u/zero1)\
**Replies:** 5\
**Last updated:** [July 29, 2021, 2:08pm UTC](https://root-forum.cern.ch/t/plotting-scatter-plot-from-different-tree-in-the-same-canvas/46054 "2021-07-29T14:08:30Z")

</div>

I’m trying to plot two scatter plot from two trees in one canvas, insipired by this tutorial ROOT: tutorials/tree/cernstaff.C File Reference, my code is: TTree \*TreeArr\[NPlots\]; //Load from flashmatchAnaArOnly the t…

---

## [Loading tree from a file](https://root-forum.cern.ch/t/loading-tree-from-a-file/46047)

<div class="topic-metadata">

**Author:** [@zero1](https://root-forum.cern.ch/u/zero1)\
**Replies:** 4\
**Last updated:** [July 28, 2021, 12:02pm UTC](https://root-forum.cern.ch/t/loading-tree-from-a-file/46047 "2021-07-28T12:02:29Z")

</div>

Hello everyone; I’m trying to write a script to load a tree from a root file; the file has a few folder and each folder has a few tree; when I run the following code: TFile \*fp = new TFile("../Output/OutAna\_500Events\_10…

---

## [Most efficient way to graph many ASCII files](https://root-forum.cern.ch/t/most-efficient-way-to-graph-many-ascii-files/45983)

<div class="topic-metadata">

**Author:** [@Solar](https://root-forum.cern.ch/u/Solar)\
**Replies:** 12\
**Last updated:** [July 28, 2021, 6:41am UTC](https://root-forum.cern.ch/t/most-efficient-way-to-graph-many-ascii-files/45983 "2021-07-28T06:41:04Z")

</div>

Hi there I am relatively new to ROOT, and I primarily do my coding in python, but my current job is all root and c++, so I would greatly appreciate some help. I have a folder with about 123 .txt files that have many dif…

---

## [Problems with TH2D plotting](https://root-forum.cern.ch/t/problems-with-th2d-plotting/45976)

<div class="topic-metadata">

**Author:** [@rrramos](https://root-forum.cern.ch/u/rrramos)\
**Replies:** 2\
**Last updated:** [July 27, 2021, 12:10pm UTC](https://root-forum.cern.ch/t/problems-with-th2d-plotting/45976 "2021-07-27T12:10:22Z")

</div>

Hello everyone!! I need some help with TH2D plotting. I have a TH2D histogram constructed from 2 branches (X and Y) of a TTree. What I want to do now is create a new TH2D but using the mean of Y in intervals of X. So, …

---

## [Loop over leaf and draw non-blank entries of another](https://root-forum.cern.ch/t/loop-over-leaf-and-draw-non-blank-entries-of-another/45811)

<div class="topic-metadata">

**Author:** [@Karl007](https://root-forum.cern.ch/u/Karl007)\
**Replies:** 20\
**Last updated:** [July 27, 2021, 11:40am UTC](https://root-forum.cern.ch/t/loop-over-leaf-and-draw-non-blank-entries-of-another/45811 "2021-07-27T11:40:31Z")

</div>

Hi, I have a tree with one branch and two leaves x and y. Leaf y has less entries than leaf x. When I scan I have something like this: Left: x, right: y I would like to draw leaf x only when there is a corresponding…

---

## [Subtracting bad events using RDataframe](https://root-forum.cern.ch/t/subtracting-bad-events-using-rdataframe/46008)

<div class="topic-metadata">

**Author:** [@Karl007](https://root-forum.cern.ch/u/Karl007)\
**Replies:** 6\
**Last updated:** [July 27, 2021, 7:30am UTC](https://root-forum.cern.ch/t/subtracting-bad-events-using-rdataframe/46008 "2021-07-27T07:30:18Z")

</div>

Hi, I would like to subtract some unwanted events to recreate a leaf using: auto new\_events = df.Define("unwanted\_events", "Take(myleaf1, myleaf1.size() \> myleaf2.size())") // exclude these events .Define("tot…

---

## [SetTitleSize() makes my x-label disappear](https://root-forum.cern.ch/t/settitlesize-makes-my-x-label-disappear/45994)

<div class="topic-metadata">

**Author:** [@Russell\_Marroquin](https://root-forum.cern.ch/u/Russell_Marroquin)\
**Replies:** 3\
**Last updated:** [July 26, 2021, 4:30pm UTC](https://root-forum.cern.ch/t/settitlesize-makes-my-x-label-disappear/45994 "2021-07-26T16:30:08Z")

</div>

\_\_ Hi everyone, I am trying to change the size of my x-label of my histogram of the form TH1D by using the following methods: Line 1: h1-\>SetXTitle(" some string " ); Line 2: h1-\>SetTitleSize(0.15, “X”); If …

---

## [There is a string that can erase a specific legend entry?](https://root-forum.cern.ch/t/there-is-a-string-that-can-erase-a-specific-legend-entry/46000)

<div class="topic-metadata">

**Author:** [@Cesar1](https://root-forum.cern.ch/u/Cesar1)\
**Replies:** 1\
**Last updated:** [July 25, 2021, 5:50pm UTC](https://root-forum.cern.ch/t/there-is-a-string-that-can-erase-a-specific-legend-entry/46000 "2021-07-25T17:50:40Z")

</div>

Dear experts, There is any string that when i input in AddEntry() it does not plot that specific legend?. I am reading the legends in a string array in python, but there is some histograms that i don’t want to show th…

---

## [Is there a way to save dataframe to an already existing root file?](https://root-forum.cern.ch/t/is-there-a-way-to-save-dataframe-to-an-already-existing-root-file/45974)

<div class="topic-metadata">

**Author:** [@Karl007](https://root-forum.cern.ch/u/Karl007)\
**Replies:** 8\
**Last updated:** [July 23, 2021, 10:58am UTC](https://root-forum.cern.ch/t/is-there-a-way-to-save-dataframe-to-an-already-existing-root-file/45974 "2021-07-23T10:58:23Z")

</div>

Hi, I’m trying to store filtered data to an already existing root file. I am using: c.Snapshot("tree", "rootFile"); But what it does actually is overwriting the “rootFile” with a new file that only has “tree” be…

---

## [Problem with TMVA when building ROOT from source](https://root-forum.cern.ch/t/problem-with-tmva-when-building-root-from-source/45937)

<div class="topic-metadata">

**Author:** [@Mkosh](https://root-forum.cern.ch/u/Mkosh)\
**Replies:** 8\
**Last updated:** [July 22, 2021, 5:44pm UTC](https://root-forum.cern.ch/t/problem-with-tmva-when-building-root-from-source/45937 "2021-07-22T17:44:11Z")

</div>

Hi all, I’m struggling to install ROOT on my Manjaro Linux system (I had almost identical issues on Ubuntu 20.04 so I just went back to Manjaro). I can install it from pacman and it runs fine, but I’m trying to build it…

---

## [Macro /usr/local/root/tutorials/pythia/pythiaExample.C does not work in root version 6.22/01](https://root-forum.cern.ch/t/macro-usr-local-root-tutorials-pythia-pythiaexample-c-does-not-work-in-root-version-6-22-01/45954)

<div class="topic-metadata">

**Author:** [@kurbatov](https://root-forum.cern.ch/u/kurbatov)\
**Replies:** 4\
**Last updated:** [July 22, 2021, 10:08am UTC](https://root-forum.cern.ch/t/macro-usr-local-root-tutorials-pythia-pythiaexample-c-does-not-work-in-root-version-6-22-01/45954 "2021-07-22T10:08:11Z")

</div>

ROOT Version: 6.22/01 Platform: Ubuntu 18.04.5 LTS Compiler: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 I am novice with PYthia and tried /usr/local/root/tutorials/pythia/pythiaExample.C without success. Companion macro…

---

## [Reading from TTree iwth different Branches](https://root-forum.cern.ch/t/reading-from-ttree-iwth-different-branches/45946)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 6\
**Last updated:** [July 21, 2021, 3:49pm UTC](https://root-forum.cern.ch/t/reading-from-ttree-iwth-different-branches/45946 "2021-07-21T15:49:18Z")

</div>

I am trying to read data from ROOT Tree with the name dk2nuTree. I am trying to print data from nuray.E leaf. I have posted a picture of the ROOT Object Browser view in the comment section. Thank you. void nuray() { …

---

## [Failed instalation of last version root with cmake](https://root-forum.cern.ch/t/failed-instalation-of-last-version-root-with-cmake/45947)

<div class="topic-metadata">

**Author:** [@kurbatov](https://root-forum.cern.ch/u/kurbatov)\
**Replies:** 4\
**Last updated:** [July 21, 2021, 1:21pm UTC](https://root-forum.cern.ch/t/failed-instalation-of-last-version-root-with-cmake/45947 "2021-07-21T13:21:41Z")

</div>

Please read tips for efficient and successful posting and posting code \_ROOT Version:6.22/01 \_Platform:Ubuntu 18.04.5 LTS \_Compiler:gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 I tried to install latest version root wit…

---

## [Problem with installation latest root with cmake](https://root-forum.cern.ch/t/problem-with-installation-latest-root-with-cmake/45949)

<div class="topic-metadata">

**Author:** [@kurbatov](https://root-forum.cern.ch/u/kurbatov)\
**Replies:** 1\
**Last updated:** [July 21, 2021, 11:43am UTC](https://root-forum.cern.ch/t/problem-with-installation-latest-root-with-cmake/45949 "2021-07-21T11:43:57Z")

</div>

Please read tips for efficient and successful posting and posting code \_ROOT Version:6.22/01 \_Platform:Ubuntu 18.04.5 LTS \_Compiler:gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 Failed when installation latest root with c…

---

## [Getting a histogram from a tree in pyroot](https://root-forum.cern.ch/t/getting-a-histogram-from-a-tree-in-pyroot/45936)

<div class="topic-metadata">

**Author:** [@mwalczak](https://root-forum.cern.ch/u/mwalczak)\
**Replies:** 3\
**Last updated:** [July 21, 2021, 8:38am UTC](https://root-forum.cern.ch/t/getting-a-histogram-from-a-tree-in-pyroot/45936 "2021-07-21T08:38:18Z")

</div>

Hi, I have a root file with a tree “btree” inside and few branches in that tree, e.g. “bb”. I can open the file and print number of entries in the tree, but don’t how to get the histogram from “bb” and draw it. I guess …

---

## [How to plot graphs at different stations](https://root-forum.cern.ch/t/how-to-plot-graphs-at-different-stations/45926)

<div class="topic-metadata">

**Author:** [@Night\_King](https://root-forum.cern.ch/u/Night_King)\
**Replies:** 6\
**Last updated:** [July 20, 2021, 3:37pm UTC](https://root-forum.cern.ch/t/how-to-plot-graphs-at-different-stations/45926 "2021-07-20T15:37:34Z")

</div>

I have to plot graphs of energy deposited and clustering size of muon and pion with Box generator at 500 MeV Please read tips for efficient and successful posting and posting code \_ROOT Version: 6.16/00 Platform: lin…

---

## [TH1D ProjectionX()](https://root-forum.cern.ch/t/th1d-projectionx/45929)

<div class="topic-metadata">

**Author:** [@Aman\_Upadhyay](https://root-forum.cern.ch/u/Aman_Upadhyay)\
**Replies:** 2\
**Last updated:** [July 20, 2021, 2:59pm UTC](https://root-forum.cern.ch/t/th1d-projectionx/45929 "2021-07-20T14:59:59Z")

</div>

I have to project two separate TH2F to two TH1D. For that, I am using this code: TH2F \*h2\_s = (TH2F\*)f-\>Get("hsig"); TH2F \*h2\_b = (TH2F\*)f-\>Get("hbg"); TH1D \*h1\_s = h2\_s-\>ProjectionX("",5,5); TH1D \*h1\_b …

---

## [Tlatex location in log scale](https://root-forum.cern.ch/t/tlatex-location-in-log-scale/45794)

<div class="topic-metadata">

**Author:** [@Keyvan\_Tabaei](https://root-forum.cern.ch/u/Keyvan_Tabaei)\
**Replies:** 7\
**Last updated:** [July 20, 2021, 12:18pm UTC](https://root-forum.cern.ch/t/tlatex-location-in-log-scale/45794 "2021-07-20T12:18:02Z")

</div>

hi dear experts, i am trying to draw latex texts on a graph with the y axis log scale. the text always appears at the top of the graph and when I try to change its location by mouse it goes at the horizontal axis and s…

---

## [Creating a contour plot from a .txt file and displaying it with a information bar](https://root-forum.cern.ch/t/creating-a-contour-plot-from-a-txt-file-and-displaying-it-with-a-information-bar/45922)

<div class="topic-metadata">

**Author:** [@fabstr](https://root-forum.cern.ch/u/fabstr)\
**Replies:** 2\
**Last updated:** [July 20, 2021, 9:04am UTC](https://root-forum.cern.ch/t/creating-a-contour-plot-from-a-txt-file-and-displaying-it-with-a-information-bar/45922 "2021-07-20T09:04:54Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 6.22/00 Platform:Ubuntu 20.04.1 LTS (WSL2) Compiler:GNU or GCC Hello, I’m trying to create a contour plot of a magnetic field fr…

---

## [Solve system of 6 quadratic equations](https://root-forum.cern.ch/t/solve-system-of-6-quadratic-equations/45819)

<div class="topic-metadata">

**Author:** [@jenskroeger](https://root-forum.cern.ch/u/jenskroeger)\
**Replies:** 4\
**Last updated:** [July 19, 2021, 7:50pm UTC](https://root-forum.cern.ch/t/solve-system-of-6-quadratic-equations/45819 "2021-07-19T19:50:34Z")

</div>

Hi all, I’m attempting to solve a system of quadratic equations using the GSLMultiRootFinder (ROOT::Math::GSLMultiRootFinder) following this example: ROOT: tutorials/math/exampleMultiRoot.C File Reference I can easily…

---

## [Filling a function to a histogram](https://root-forum.cern.ch/t/filling-a-function-to-a-histogram/45901)

<div class="topic-metadata">

**Author:** [@Aman\_Upadhyay](https://root-forum.cern.ch/u/Aman_Upadhyay)\
**Replies:** 3\
**Last updated:** [July 19, 2021, 2:53pm UTC](https://root-forum.cern.ch/t/filling-a-function-to-a-histogram/45901 "2021-07-19T14:53:24Z")

</div>

Hello Rooters, I was trying to calculate the significance value for every value using a signal and background histogram. I need to save this significance value and the corresponding bin value for later use. I was trying…

---

## [Error getting mean and standard deviation](https://root-forum.cern.ch/t/error-getting-mean-and-standard-deviation/45906)

<div class="topic-metadata">

**Author:** [@oskiiiii](https://root-forum.cern.ch/u/oskiiiii)\
**Replies:** 2\
**Last updated:** [July 19, 2021, 2:40pm UTC](https://root-forum.cern.ch/t/error-getting-mean-and-standard-deviation/45906 "2021-07-19T14:40:30Z")

</div>

Dear all, I’m quite new to root but so far I have been able to learn on my own. I’m getting a strange error and I would appreciate it if someone could help me. I have a long code, but I will summarize the important part…

---

## [C++ file not found in ROOT 6](https://root-forum.cern.ch/t/c-file-not-found-in-root-6/45894)

<div class="topic-metadata">

**Author:** [@Blae\_Stacey](https://root-forum.cern.ch/u/Blae_Stacey)\
**Replies:** 1\
**Last updated:** [July 18, 2021, 1:26pm UTC](https://root-forum.cern.ch/t/c-file-not-found-in-root-6/45894 "2021-07-18T13:26:35Z")

</div>

I’m going through the CERN beginner’s guide and I have created the slits.C file. When I load up root it says I am in the Rint: / directory but when I try to load the slits.C file it says Error in TRint::ProcessLine: mac…

---

## [Peak finding program](https://root-forum.cern.ch/t/peak-finding-program/45891)

<div class="topic-metadata">

**Author:** [@Saradindu](https://root-forum.cern.ch/u/Saradindu)\
**Replies:** 1\
**Last updated:** [July 18, 2021, 7:34am UTC](https://root-forum.cern.ch/t/peak-finding-program/45891 "2021-07-18T07:34:00Z")

</div>

I have some root files consisting of spectrums. I have to write down a code to check gain drift and fitting the peaks. How do I find out the peaks out of the spectrum and fit them ??

---

## [How to include fit parameters when writing histogram to file](https://root-forum.cern.ch/t/how-to-include-fit-parameters-when-writing-histogram-to-file/45882)

<div class="topic-metadata">

**Author:** [@emilyp](https://root-forum.cern.ch/u/emilyp)\
**Replies:** 1\
**Last updated:** [July 17, 2021, 4:36am UTC](https://root-forum.cern.ch/t/how-to-include-fit-parameters-when-writing-histogram-to-file/45882 "2021-07-17T04:36:55Z")

</div>

\_ Please read tips for efficient and successful posting and posting code ROOT Version: 6.20/04 Platform: Ubuntu Compiler: Not Provided Hello, I am trying to include fit parameters in the stat box of a histogram (T…

[Previous page](https://root-forum.cern.ch/c/newbie/26.md?page=67)

[Next page](https://root-forum.cern.ch/c/newbie/26.md?page=69)
