# Newbie

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

[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:** 80

---

## [Problem with running example scripts](https://root-forum.cern.ch/t/problem-with-running-example-scripts/43431)

<div class="topic-metadata">

**Author:** [@Amos\_Mitos\_Laeballo](https://root-forum.cern.ch/u/Amos_Mitos_Laeballo)\
**Replies:** 2\
**Last updated:** [February 8, 2021, 4:57pm UTC](https://root-forum.cern.ch/t/problem-with-running-example-scripts/43431 "2021-02-08T16:57:17Z")

</div>

ROOT Version: 6.22.02 Platform: Linux Mint 20.1 Compiler: gcc Hello, I have downloaded the pre-compiled packages for ROOT but I stumble upon the attached errors when I try to run any of the examples provided with th…

---

## [Problem with class: Symbol lookup error](https://root-forum.cern.ch/t/problem-with-class-symbol-lookup-error/43423)

<div class="topic-metadata">

**Author:** [@EVTO](https://root-forum.cern.ch/u/EVTO)\
**Replies:** 6\
**Last updated:** [February 8, 2021, 1:21pm UTC](https://root-forum.cern.ch/t/problem-with-class-symbol-lookup-error/43423 "2021-02-08T13:21:39Z")

</div>

Please read tips for efficient and successful posting and posting code \_ROOT Version:\_6.0802 Platform: Ubuntu 16 Compiler: 5.4 Hi. Sorry for annoying you again. I created a class vertex.h “copying and pasting” the…

---

## [Crashes when using RooDataSet on PyROOT](https://root-forum.cern.ch/t/crashes-when-using-roodataset-on-pyroot/43411)

<div class="topic-metadata">

**Author:** [@mrli](https://root-forum.cern.ch/u/mrli)\
**Replies:** 2\
**Last updated:** [February 8, 2021, 10:27am UTC](https://root-forum.cern.ch/t/crashes-when-using-roodataset-on-pyroot/43411 "2021-02-08T10:27:24Z")

</div>

Dear all, I’m using PyROOT and met a strange problem. Here I post my test code. bmass = RooRealVar('bmass', 'bmass', 0) bpx = RooRealVar('bpx', 'bpx', 0) bpy = RooRealVar('bpy', 'bpy', 0) bpz = RooRealVar('bpz', 'bpz',…

---

## [Operation on RooDataSet and RooDataHist](https://root-forum.cern.ch/t/operation-on-roodataset-and-roodatahist/43414)

<div class="topic-metadata">

**Author:** [@zero1](https://root-forum.cern.ch/u/zero1)\
**Replies:** 1\
**Last updated:** [February 8, 2021, 9:24am UTC](https://root-forum.cern.ch/t/operation-on-roodataset-and-roodatahist/43414 "2021-02-08T09:24:01Z")

</div>

I created a PDF as a sum of two gaussians and an exponential and using this PDF generated a dataset, I don’t understand: How to generate the binned dataset, here \[https://root.cern.ch/doc/master/classRooDataHist.html#a…

---

## [Reduce TGraph point](https://root-forum.cern.ch/t/reduce-tgraph-point/43371)

<div class="topic-metadata">

**Author:** [@ROOTer1](https://root-forum.cern.ch/u/ROOTer1)\
**Replies:** 10\
**Last updated:** [February 4, 2021, 1:26pm UTC](https://root-forum.cern.ch/t/reduce-tgraph-point/43371 "2021-02-04T13:26:14Z")

</div>

Dear, is there a good way to reduce a TGraph having too many points without loosing the interpolation? or is there a smoothing function?

---

## [Finding the Tree name in a .root file](https://root-forum.cern.ch/t/finding-the-tree-name-in-a-root-file/43314)

<div class="topic-metadata">

**Author:** [@Shruti\_Narang](https://root-forum.cern.ch/u/Shruti_Narang)\
**Replies:** 9\
**Last updated:** [February 3, 2021, 8:54am UTC](https://root-forum.cern.ch/t/finding-the-tree-name-in-a-root-file/43314 "2021-02-03T08:54:31Z")

</div>

I have recreated a .root file using TSelector and I want to use this file for further analysis e.g I subtracted some channel numbers in a histogram and made a new .root file where histograms are lying at shifted position…

---

## [Copy a hist from a tree](https://root-forum.cern.ch/t/copy-a-hist-from-a-tree/43349)

<div class="topic-metadata">

**Author:** [@11111](https://root-forum.cern.ch/u/11111)\
**Replies:** 4\
**Last updated:** [February 3, 2021, 3:24am UTC](https://root-forum.cern.ch/t/copy-a-hist-from-a-tree/43349 "2021-02-03T03:24:50Z")

</div>

Hi experts, I have a problem here: I want to copy a hist from a tree.This is what I try to do: (following this link: https://root-forum.cern.ch/t/how-to-recover-an-object-in-a-ttree/4490) TH1F\* getHist(string file, s…

---

## [Add a branch to an existing tree in another .cc file](https://root-forum.cern.ch/t/add-a-branch-to-an-existing-tree-in-another-cc-file/43342)

<div class="topic-metadata">

**Author:** [@liuwei](https://root-forum.cern.ch/u/liuwei)\
**Replies:** 5\
**Last updated:** [February 2, 2021, 3:37pm UTC](https://root-forum.cern.ch/t/add-a-branch-to-an-existing-tree-in-another-cc-file/43342 "2021-02-02T15:37:18Z")

</div>

Hello, I meet a problem when I use root. I write a file to add a branch to an existing tree, and save it in main function. I declare all variable are global. But when proceeding to wf-\>cd(); wf-\>close(); the progra…

---

## [Fit according to a function combines both .c file and some terms](https://root-forum.cern.ch/t/fit-according-to-a-function-combines-both-c-file-and-some-terms/43353)

<div class="topic-metadata">

**Author:** [@ofir\_eizenberg](https://root-forum.cern.ch/u/ofir_eizenberg)\
**Replies:** 3\
**Last updated:** [February 2, 2021, 10:23am UTC](https://root-forum.cern.ch/t/fit-according-to-a-function-combines-both-c-file-and-some-terms/43353 "2021-02-02T10:23:40Z")

</div>

Heyy :slight\_smile: I tried doing something like this: given some function named VavilovAdapter() that exists on a ‘fit\_functions.c’ file I tried to fit this way R.gROOT.LoadMacro('/home/lab/reco/fit\_functions.c+') va…

---

## [Best way to save "long double" variables into a TTree](https://root-forum.cern.ch/t/best-way-to-save-long-double-variables-into-a-ttree/43287)

<div class="topic-metadata">

**Author:** [@ed20](https://root-forum.cern.ch/u/ed20)\
**Replies:** 4\
**Last updated:** [February 1, 2021, 9:35pm UTC](https://root-forum.cern.ch/t/best-way-to-save-long-double-variables-into-a-ttree/43287 "2021-02-01T21:35:41Z")

</div>

I have a lot of “long double” data variables which I want to save into a TTree, but the “long double” datatype is not supported in ROOT. Currently I am doing something like the following: long double var; double var\_cop…

---

## [Roofit libraries not available to compile the macro in macOS 11.1](https://root-forum.cern.ch/t/roofit-libraries-not-available-to-compile-the-macro-in-macos-11-1/43351)

<div class="topic-metadata">

**Author:** [@sv3048](https://root-forum.cern.ch/u/sv3048)\
**Replies:** 1\
**Last updated:** [February 1, 2021, 6:03pm UTC](https://root-forum.cern.ch/t/roofit-libraries-not-available-to-compile-the-macro-in-macos-11-1/43351 "2021-02-01T18:03:32Z")

</div>

Hi everyone, I am working with Root version 6.22/06 in macOS 11.1. I am trying to run the following macro. It is giving me errors (I have attached the errors in the file below {error.txt}). I am not sure that these erro…

---

## [Problem with iteration through the map](https://root-forum.cern.ch/t/problem-with-iteration-through-the-map/43356)

<div class="topic-metadata">

**Author:** [@alobasenko](https://root-forum.cern.ch/u/alobasenko)\
**Replies:** 2\
**Last updated:** [February 1, 2021, 5:49pm UTC](https://root-forum.cern.ch/t/problem-with-iteration-through-the-map/43356 "2021-02-01T17:49:28Z")

</div>

ROOT Version: 6.20/00 Platform: Ubuntu 20.04.2 LTS Compiler: gcc version 9.3.0 Hi, I am stuck with the problem of iterating through the map object. Here is my code of the test macro: #include \<iostream\> #include \<…

---

## [How to save a root Draw to a text file](https://root-forum.cern.ch/t/how-to-save-a-root-draw-to-a-text-file/43337)

<div class="topic-metadata">

**Author:** [@rushabhgala](https://root-forum.cern.ch/u/rushabhgala)\
**Replies:** 6\
**Last updated:** [February 1, 2021, 3:43pm UTC](https://root-forum.cern.ch/t/how-to-save-a-root-draw-to-a-text-file/43337 "2021-02-01T15:43:57Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided I have a root tree and I am trying to Draw an object of the tree. Her…

---

## [How to get number of args a user-made class' \_\_init\_\_ needs?](https://root-forum.cern.ch/t/how-to-get-number-of-args-a-user-made-class-init-needs/43347)

<div class="topic-metadata">

**Author:** [@mrli](https://root-forum.cern.ch/u/mrli)\
**Replies:** 3\
**Last updated:** [February 1, 2021, 1:17pm UTC](https://root-forum.cern.ch/t/how-to-get-number-of-args-a-user-made-class-init-needs/43347 "2021-02-01T13:17:41Z")

</div>

Hello all, I’m trying to write a Python script to load classes made by RooClassFactory::makePdf(). I use gROOT.LoadMacro() to load class successfully, now I want to get information about what parameters the class need. …

---

## [Can't fit an histogram with the generating function for said histogram](https://root-forum.cern.ch/t/cant-fit-an-histogram-with-the-generating-function-for-said-histogram/43348)

<div class="topic-metadata">

**Author:** [@zero1](https://root-forum.cern.ch/u/zero1)\
**Replies:** 3\
**Last updated:** [February 1, 2021, 12:25pm UTC](https://root-forum.cern.ch/t/cant-fit-an-histogram-with-the-generating-function-for-said-histogram/43348 "2021-02-01T12:25:10Z")

</div>

I have to generate data according to a distribution defined by me and then I have to fit said data. My code is as follows: #define N 50000 #define XMin 0.0 #define XMax 2.0 #define Mu1 1.0 #define Sigma1 0.20 #def…

---

## [Question about license of a python re-implementation](https://root-forum.cern.ch/t/question-about-license-of-a-python-re-implementation/43297)

<div class="topic-metadata">

**Author:** [@dirk](https://root-forum.cern.ch/u/dirk)\
**Replies:** 5\
**Last updated:** [January 30, 2021, 10:47pm UTC](https://root-forum.cern.ch/t/question-about-license-of-a-python-re-implementation/43297 "2021-01-30T22:47:58Z")

</div>

Dear root experts, I’m a former user of root and I was using it quite extensively throughout my time as a PHD student at CERN. I have a python re-implementation in place of a small part of root, which I’d like to distr…

---

## [How to get event weight for mc sample](https://root-forum.cern.ch/t/how-to-get-event-weight-for-mc-sample/43284)

<div class="topic-metadata">

**Author:** [@odylalalaaa](https://root-forum.cern.ch/u/odylalalaaa)\
**Replies:** 8\
**Last updated:** [January 30, 2021, 4:45am UTC](https://root-forum.cern.ch/t/how-to-get-event-weight-for-mc-sample/43284 "2021-01-30T04:45:12Z")

</div>

hi, im trying to get the weight of each event for the mc sample that i produced from madgraph and calculate the sum of event weights, i read through https://root-forum.cern.ch/t/tmva-how-to-get-event-by-event-weights/22…

---

## [Building ROOT on macOS Catalina (10.15.3)](https://root-forum.cern.ch/t/building-root-on-macos-catalina-10-15-3/37977)

<div class="topic-metadata">

**Author:** [@jaofferm](https://root-forum.cern.ch/u/jaofferm)\
**Replies:** 12\
**Last updated:** [January 28, 2021, 2:53pm UTC](https://root-forum.cern.ch/t/building-root-on-macos-catalina-10-15-3/37977 "2021-01-28T14:53:39Z")

</div>

Dear ROOTers, I’m trying to build ROOT from source on the latest version of macOS, but I’m running into some issues (I see that there are a few posts on this topic, but the reported errors appear different and their sol…

---

## [No matching member function for call to 'Get' (TTree)](https://root-forum.cern.ch/t/no-matching-member-function-for-call-to-get-ttree/43292)

<div class="topic-metadata">

**Author:** [@alobasenko](https://root-forum.cern.ch/u/alobasenko)\
**Replies:** 2\
**Last updated:** [January 27, 2021, 9:17pm UTC](https://root-forum.cern.ch/t/no-matching-member-function-for-call-to-get-ttree/43292 "2021-01-27T21:17:08Z")

</div>

ROOT Version: 6.20/00 Platform: ubuntu 20.04 Compiler: g++ 9.3.0 Hi, In my macro, I am writing a function that should copy the content of one branch to the histogram. Part of my code that involved in this: #includ…

---

## [How to enable PyROOT in windows 10?](https://root-forum.cern.ch/t/how-to-enable-pyroot-in-windows-10/43290)

<div class="topic-metadata">

**Author:** [@Ashutosh](https://root-forum.cern.ch/u/Ashutosh)\
**Replies:** 2\
**Last updated:** [January 27, 2021, 12:28pm UTC](https://root-forum.cern.ch/t/how-to-enable-pyroot-in-windows-10/43290 "2021-01-27T12:28:36Z")

</div>

Hi, I want to enable PyROOT on windows 10 but can’t find full guide for it. I have currently Anaconda installed with python version 3.8.5. Thank you. Please read tips for efficient and successful posting and posting …

---

## [Convert fitter to string](https://root-forum.cern.ch/t/convert-fitter-to-string/43137)

<div class="topic-metadata">

**Author:** [@Edward\_Finkelstein](https://root-forum.cern.ch/u/Edward_Finkelstein)\
**Replies:** 7\
**Last updated:** [January 27, 2021, 11:34am UTC](https://root-forum.cern.ch/t/convert-fitter-to-string/43137 "2021-01-27T11:34:33Z")

</div>

Hi, I am wondering if there is a way to convert the results of a fit to a C++ string, like convert the following line: auto fitr=hh-\>Fit(&ball,"SL",""); where hh is a TH1 pointer, and ball is a TF1 object. Something l…

---

## [If status=converged break](https://root-forum.cern.ch/t/if-status-converged-break/41782)

<div class="topic-metadata">

**Author:** [@Edward\_Finkelstein](https://root-forum.cern.ch/u/Edward_Finkelstein)\
**Replies:** 5\
**Last updated:** [January 27, 2021, 11:33am UTC](https://root-forum.cern.ch/t/if-status-converged-break/41782 "2021-01-27T11:33:29Z")

</div>

Hello, Is there a way to break a for loop if the fitter status=converged, and if so, how is it coded? I have some code below, where hh is a TH1 object and ball is a TF1. How would I break the loop when status=converged? …

---

## [While(!feof(file))...... not working](https://root-forum.cern.ch/t/while-feof-file-not-working/43275)

<div class="topic-metadata">

**Author:** [@Towseef\_Rehman](https://root-forum.cern.ch/u/Towseef_Rehman)\
**Replies:** 4\
**Last updated:** [January 26, 2021, 12:51pm UTC](https://root-forum.cern.ch/t/while-feof-file-not-working/43275 "2021-01-26T12:51:08Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 6.16.00 Platform: ubuntu Compiler: hello rooters, I am using while(!feof(file)){ process file } in my code so that if there are…

---

## [Root Crashes on windows 10](https://root-forum.cern.ch/t/root-crashes-on-windows-10/43273)

<div class="topic-metadata">

**Author:** [@Ashutosh](https://root-forum.cern.ch/u/Ashutosh)\
**Replies:** 4\
**Last updated:** [January 26, 2021, 9:32am UTC](https://root-forum.cern.ch/t/root-crashes-on-windows-10/43273 "2021-01-26T09:32:28Z")

</div>

Hi, I tried to execute a macro in which I have created a vector of size \[15\]\[3130\]. However it causes root to crash with following code. Faulting application name: root.exe, version: 6.23.1.0, time stamp: 0x600a6bfc Fa…

---

## [Reading TBranch with leaf list](https://root-forum.cern.ch/t/reading-tbranch-with-leaf-list/43267)

<div class="topic-metadata">

**Author:** [@Erdrick](https://root-forum.cern.ch/u/Erdrick)\
**Replies:** 1\
**Last updated:** [January 26, 2021, 9:20am UTC](https://root-forum.cern.ch/t/reading-tbranch-with-leaf-list/43267 "2021-01-26T09:20:47Z")

</div>

ROOT Version: v6.14.06 Platform: Ubuntu 16.04.6 LTS Compiler: 5.4.0 I have a root file in which a branch was written as a leaf list instead of a full object. What is the best way to read a leaf list in this scenario…

---

## [How to display events from .root files](https://root-forum.cern.ch/t/how-to-display-events-from-root-files/43271)

<div class="topic-metadata">

**Author:** [@SweynAn](https://root-forum.cern.ch/u/SweynAn)\
**Replies:** 1\
**Last updated:** [January 26, 2021, 5:57am UTC](https://root-forum.cern.ch/t/how-to-display-events-from-root-files/43271 "2021-01-26T05:57:11Z")

</div>

Recently I download some dataA.root file from ATLAS open data set. I tried to read data\_A.3lep.root and display a list of events but I failed. How could I read the events and select the events I am interested in from…

---

## [Generate random numbers obeying poisson distribution](https://root-forum.cern.ch/t/generate-random-numbers-obeying-poisson-distribution/43257)

<div class="topic-metadata">

**Author:** [@ajalotra](https://root-forum.cern.ch/u/ajalotra)\
**Replies:** 2\
**Last updated:** [January 26, 2021, 3:31am UTC](https://root-forum.cern.ch/t/generate-random-numbers-obeying-poisson-distribution/43257 "2021-01-26T03:31:28Z")

</div>

hi, can anyone help me to write a program to generate random numbers obeying poisson distribution with mean 4? Please read tips for efficient and successful posting and posting code ROOT Version: 6 Platform: Not Prov…

---

## [Deriving from TGNumberEntry gives compiler errors unresolved symbol](https://root-forum.cern.ch/t/deriving-from-tgnumberentry-gives-compiler-errors-unresolved-symbol/43167)

<div class="topic-metadata">

**Author:** [@bmahf](https://root-forum.cern.ch/u/bmahf)\
**Replies:** 7\
**Last updated:** [January 25, 2021, 5:40pm UTC](https://root-forum.cern.ch/t/deriving-from-tgnumberentry-gives-compiler-errors-unresolved-symbol/43167 "2021-01-25T17:40:17Z")

</div>

I am working on a code base using Root 5.28, building with VS2008. I am trying to inherit from some GUI controls in the application to extend their functionalities. I have started with TGNumberEntry and TGNumberEntryFi…

---

## [Calculating number of entries in a several peaks with different energies in a Histogram and calculating uncertainties and drawing error bar graph](https://root-forum.cern.ch/t/calculating-number-of-entries-in-a-several-peaks-with-different-energies-in-a-histogram-and-calculating-uncertainties-and-drawing-error-bar-graph/43222)

<div class="topic-metadata">

**Author:** [@Mo922022](https://root-forum.cern.ch/u/Mo922022)\
**Replies:** 7\
**Last updated:** [January 25, 2021, 4:09pm UTC](https://root-forum.cern.ch/t/calculating-number-of-entries-in-a-several-peaks-with-different-energies-in-a-histogram-and-calculating-uncertainties-and-drawing-error-bar-graph/43222 "2021-01-25T16:09:43Z")

</div>

Hello rooters, I have 2 Root files from two different Simulation and as seen in the image is a comparison between energy spectrum of prompt gamma radiation produced from proton interactions. Since this is the last part …

---

## [Fill existing tree in pyroot](https://root-forum.cern.ch/t/fill-existing-tree-in-pyroot/43254)

<div class="topic-metadata">

**Author:** [@ROOTer1](https://root-forum.cern.ch/u/ROOTer1)\
**Replies:** 1\
**Last updated:** [January 25, 2021, 1:01pm UTC](https://root-forum.cern.ch/t/fill-existing-tree-in-pyroot/43254 "2021-01-25T13:01:58Z")

</div>

I was wondering how you can fill events in an existing tree, I was trying something like this: #first make a new one subtree = ROOT.TTree(“subtree”,“subtree”) subtree.Branch(“var1” ,get\_var1) subtree.Branch(“var2” ,…

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

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