# Newbie

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

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

---

## [How to add text in graph](https://root-forum.cern.ch/t/how-to-add-text-in-graph/39335)

<div class="topic-metadata">

**Author:** [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Replies:** 12\
**Last updated:** [May 12, 2020, 2:34pm UTC](https://root-forum.cern.ch/t/how-to-add-text-in-graph/39335 "2020-05-12T14:34:17Z")

</div>

Hi ! I am working on a code to add text to my graph but it is not able to write more than one line in the graph or canvas. efficiency\_R.C (1.9 KB) rad\_9.txt (340 Bytes) ROOT Version: Not Provided Platform: Not Provid…

---

## [Making a pointer to histogram in subfolder to make fits](https://root-forum.cern.ch/t/making-a-pointer-to-histogram-in-subfolder-to-make-fits/39363)

<div class="topic-metadata">

**Author:** [@Conor\_McGee](https://root-forum.cern.ch/u/Conor_McGee)\
**Replies:** 7\
**Last updated:** [May 11, 2020, 9:02pm UTC](https://root-forum.cern.ch/t/making-a-pointer-to-histogram-in-subfolder-to-make-fits/39363 "2020-05-11T21:02:34Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided So I am trying to make a Macro to open and fit various histograms. The…

---

## [Problem in Chi square fit value](https://root-forum.cern.ch/t/problem-in-chi-square-fit-value/38963)

<div class="topic-metadata">

**Author:** [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Replies:** 17\
**Last updated:** [May 11, 2020, 5:34pm UTC](https://root-forum.cern.ch/t/problem-in-chi-square-fit-value/38963 "2020-05-11T17:34:01Z")

</div>

I have drawn a histogram and try to fit it using exponential decay function but the value of chi square is of the order of 10^7. can you give me any idea about the chi square values? ROOT Version: Not Provided Platfor…

---

## [Problem with this code for plotting interference pattern](https://root-forum.cern.ch/t/problem-with-this-code-for-plotting-interference-pattern/39347)

<div class="topic-metadata">

**Author:** [@hep\_1](https://root-forum.cern.ch/u/hep_1)\
**Replies:** 4\
**Last updated:** [May 10, 2020, 8:21pm UTC](https://root-forum.cern.ch/t/problem-with-this-code-for-plotting-interference-pattern/39347 "2020-05-10T20:21:53Z")

</div>

This question is in reference to the code on page # 9 of \[interference\] the link. I wrote the code in C++ exactly the way it is given in the manual. However, this code does not have a main method, and I was doubtful if …

---

## [Error when compiling macro: "'Pythia8/Analysis.h' file not found"](https://root-forum.cern.ch/t/error-when-compiling-macro-pythia8-analysis-h-file-not-found/34562)

<div class="topic-metadata">

**Author:** [@jaofferm](https://root-forum.cern.ch/u/jaofferm)\
**Replies:** 19\
**Last updated:** [May 10, 2020, 6:55pm UTC](https://root-forum.cern.ch/t/error-when-compiling-macro-pythia8-analysis-h-file-not-found/34562 "2020-05-10T18:55:44Z")

</div>

Hi ROOTers, I’m compiling a macro that uses Pythia8. It contains the line " #include “TPythia8.h” ", however this raises an issue when compiling the macro with the .L+ option: /path/to/root/build/include/TPythia8.h:69:…

---

## [Sum of TF1 in a loop](https://root-forum.cern.ch/t/sum-of-tf1-in-a-loop/39276)

<div class="topic-metadata">

**Author:** [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Replies:** 7\
**Last updated:** [May 10, 2020, 5:16pm UTC](https://root-forum.cern.ch/t/sum-of-tf1-in-a-loop/39276 "2020-05-10T17:16:23Z")

</div>

Dear, In a loop of events, I want to calculate a Gaussian for each event, using the corresponding mean and width of the event, but also summing all the gaussians after each event. This is what I tried (naively), which d…

---

## [How to write data from a branch](https://root-forum.cern.ch/t/how-to-write-data-from-a-branch/39328)

<div class="topic-metadata">

**Author:** [@mustak21](https://root-forum.cern.ch/u/mustak21)\
**Replies:** 2\
**Last updated:** [May 9, 2020, 4:05am UTC](https://root-forum.cern.ch/t/how-to-write-data-from-a-branch/39328 "2020-05-09T04:05:21Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 6.14 Platform: Linux Compiler: Not Provided Hi, I have a root file containing a tree with a branch “pTheta\_emitted” which contai…

---

## [THStack with RDataFrame](https://root-forum.cern.ch/t/thstack-with-rdataframe/39291)

<div class="topic-metadata">

**Author:** [@eballabe](https://root-forum.cern.ch/u/eballabe)\
**Replies:** 2\
**Last updated:** [May 6, 2020, 8:22pm UTC](https://root-forum.cern.ch/t/thstack-with-rdataframe/39291 "2020-05-06T20:22:57Z")

</div>

Hi, I’m trying to draw a simple THStack using the new RDataFrame class. The problem is that I get the histograms drawn as points, while I would like to have them drawn as line and filled with colors. c125\_25 = ROOT.TCan…

---

## [Clusters of the processed RNTuple data set](https://root-forum.cern.ch/t/clusters-of-the-processed-rntuple-data-set/38376)

<div class="topic-metadata">

**Author:** [@clay](https://root-forum.cern.ch/u/clay)\
**Replies:** 5\
**Last updated:** [May 5, 2020, 8:20am UTC](https://root-forum.cern.ch/t/clusters-of-the-processed-rntuple-data-set/38376 "2020-05-05T08:20:42Z")

</div>

Please read tips for efficient and successful posting and posting code \_ROOT Version:\_7 Platform: linux Compiler: Not Provided @Wile\_E\_Coyote I am getting errors. I want to extend the ntpl003\_lhcbOpenData.C in such…

---

## [Drawing errors on a TH2 in the colz style?](https://root-forum.cern.ch/t/drawing-errors-on-a-th2-in-the-colz-style/39231)

<div class="topic-metadata">

**Author:** [@eggsAndCoffee](https://root-forum.cern.ch/u/eggsAndCoffee)\
**Replies:** 4\
**Last updated:** [May 4, 2020, 12:40pm UTC](https://root-forum.cern.ch/t/drawing-errors-on-a-th2-in-the-colz-style/39231 "2020-05-04T12:40:35Z")

</div>

Hello, My question seems simple, but I can’t quite find a satisfactory answer. If I have a TH2D h that has been filled, potentially with fractional weights (and certainly with Sumw2() called before filling), how can I d…

---

## [Adding an eps image to canvas](https://root-forum.cern.ch/t/adding-an-eps-image-to-canvas/39227)

<div class="topic-metadata">

**Author:** [@Alessandro\_Pilloni](https://root-forum.cern.ch/u/Alessandro_Pilloni)\
**Replies:** 3\
**Last updated:** [May 4, 2020, 11:09am UTC](https://root-forum.cern.ch/t/adding-an-eps-image-to-canvas/39227 "2020-05-04T11:09:02Z")

</div>

Dear all, I’m trying to add a logo image to a histogram. @couet I manage to add a png image, but if I save the canvas in postscript the quality is low. I’d rather add an eps image, and found the ${ROOTSYS}/tutorials/g…

---

## [Using TCutG with TTree::Draw() returns "bad numerical expression" error](https://root-forum.cern.ch/t/using-tcutg-with-ttree-draw-returns-bad-numerical-expression-error/39167)

<div class="topic-metadata">

**Author:** [@Galdiano](https://root-forum.cern.ch/u/Galdiano)\
**Replies:** 4\
**Last updated:** [May 4, 2020, 10:00am UTC](https://root-forum.cern.ch/t/using-tcutg-with-ttree-draw-returns-bad-numerical-expression-error/39167 "2020-05-04T10:00:18Z")

</div>

Hello there! I’m currently trying two draw a 2D histogram while applying a TCutG to it. This TCutG is generated by static casting a TGraph object save in a separate root file. The code is as follows: void GraphCutTest(…

---

## [Compilation error for short-example.cc given in fastjet3 user manual](https://root-forum.cern.ch/t/compilation-error-for-short-example-cc-given-in-fastjet3-user-manual/39233)

<div class="topic-metadata">

**Author:** [@Ali\_Esha](https://root-forum.cern.ch/u/Ali_Esha)\
**Replies:** 2\
**Last updated:** [May 4, 2020, 8:36am UTC](https://root-forum.cern.ch/t/compilation-error-for-short-example-cc-given-in-fastjet3-user-manual/39233 "2020-05-04T08:36:58Z")

</div>

I am trying to learn fastjet3. But I am not even able to compile any files with extension.cc even after specifying the path to header file. It shows there is no file or directory. Can someone please tell me how to compil…

---

## [Merging a .list file into a .root file](https://root-forum.cern.ch/t/merging-a-list-file-into-a-root-file/39215)

<div class="topic-metadata">

**Author:** [@Prya13](https://root-forum.cern.ch/u/Prya13)\
**Replies:** 1\
**Last updated:** [May 3, 2020, 12:22am UTC](https://root-forum.cern.ch/t/merging-a-list-file-into-a-root-file/39215 "2020-05-03T00:22:08Z")

</div>

Dear All, I have a .list file contains a list of 800 .root files, I want like to "hadd " the 800 .root files into one .root file, is this possible from the command line?

---

## [How to subtract one gaussian from another?](https://root-forum.cern.ch/t/how-to-subtract-one-gaussian-from-another/39229)

<div class="topic-metadata">

**Author:** [@Va\_Findesiecle](https://root-forum.cern.ch/u/Va_Findesiecle)\
**Replies:** 1\
**Last updated:** [May 3, 2020, 4:01pm UTC](https://root-forum.cern.ch/t/how-to-subtract-one-gaussian-from-another/39229 "2020-05-03T16:01:37Z")

</div>

Hello everyone, I fitted two histos, and now I got two 2d gaussians and i want to subtract one from another. Can somebody explain how to do it? Or should I fill 2 more histos with some data using my fits and than subtra…

---

## [RDataFrame and Friend Trees](https://root-forum.cern.ch/t/rdataframe-and-friend-trees/39219)

<div class="topic-metadata">

**Author:** [@dertexaner](https://root-forum.cern.ch/u/dertexaner)\
**Replies:** 1\
**Last updated:** [May 2, 2020, 5:56pm UTC](https://root-forum.cern.ch/t/rdataframe-and-friend-trees/39219 "2020-05-02T17:56:45Z")

</div>

Dear experts, I have an RDataFrame question, regarding the creation of new variables and/or use of Friend Trees. The specific use-case I have in mind is as follows: I have an input Tree with many variables, and I add …

---

## [Covariance matrix understanding](https://root-forum.cern.ch/t/covariance-matrix-understanding/39222)

<div class="topic-metadata">

**Author:** [@rabia\_shaheen](https://root-forum.cern.ch/u/rabia_shaheen)\
**Replies:** 1\
**Last updated:** [May 2, 2020, 5:43pm UTC](https://root-forum.cern.ch/t/covariance-matrix-understanding/39222 "2020-05-02T17:43:59Z")

</div>

Hi , I am trying to understand the covariance matrix. Is there any way to see that either my parameters are correlated or not? I also tried to see the correlation matrix. But cant understand how to interpret that matrix…

---

## [Straight line through TH3](https://root-forum.cern.ch/t/straight-line-through-th3/39104)

<div class="topic-metadata">

**Author:** [@juliangb](https://root-forum.cern.ch/u/juliangb)\
**Replies:** 28\
**Last updated:** [May 1, 2020, 8:29pm UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104 "2020-05-01T20:29:14Z")

</div>

Hello, I want to make a plot like this three “layers” of histograms from one TH3 with a line going across them. But what I get from this code (1.6 KB) is this plot As seen (it’s better if you run it yourselves),…

---

## [Issues Setting Up geant4\_vmc for Monte Carlo Simulations](https://root-forum.cern.ch/t/issues-setting-up-geant4-vmc-for-monte-carlo-simulations/39188)

<div class="topic-metadata">

**Author:** [@stephen-mul](https://root-forum.cern.ch/u/stephen-mul)\
**Replies:** 2\
**Last updated:** [May 1, 2020, 11:07am UTC](https://root-forum.cern.ch/t/issues-setting-up-geant4-vmc-for-monte-carlo-simulations/39188 "2020-05-01T11:07:33Z")

</div>

Please read tips for efficient and successful posting and posting code \_ROOT Version: 6.18.04 \_Platform: Windows 10 \_Compiler: Visual Studio 2019 I’m trying to setup geant4\_vmc following the installation instructio…

---

## [Reading variable sized array from TTree](https://root-forum.cern.ch/t/reading-variable-sized-array-from-ttree/39184)

<div class="topic-metadata">

**Author:** [@Reik](https://root-forum.cern.ch/u/Reik)\
**Replies:** 1\
**Last updated:** [April 30, 2020, 1:08pm UTC](https://root-forum.cern.ch/t/reading-variable-sized-array-from-ttree/39184 "2020-04-30T13:08:35Z")

</div>

ROOT Version: master Platform: Linux 5.4 (Manjaro) Compiler: GCC 9.3 I can create a ROOT file with a variable sized array of type Long64\_t like this - #include "TFile.h" #include "TTree.h" #include "TBranch.h" voi…

---

## [Create ROOT file](https://root-forum.cern.ch/t/create-root-file/39140)

<div class="topic-metadata">

**Author:** [@Fateme](https://root-forum.cern.ch/u/Fateme)\
**Replies:** 6\
**Last updated:** [April 30, 2020, 11:35am UTC](https://root-forum.cern.ch/t/create-root-file/39140 "2020-04-30T11:35:32Z")

</div>

I wanna to create a root file. Actually I wanna to create Ntuple, but I have an error massage with TFile. The error massage is: incomplete type is not allowed. May some one help me? TFile\* F = new TFile("test.root", "R…

---

## [Reading boolean data from TTree using PyROOT](https://root-forum.cern.ch/t/reading-boolean-data-from-ttree-using-pyroot/39178)

<div class="topic-metadata">

**Author:** [@Reik](https://root-forum.cern.ch/u/Reik)\
**Replies:** 6\
**Last updated:** [April 30, 2020, 9:27am UTC](https://root-forum.cern.ch/t/reading-boolean-data-from-ttree-using-pyroot/39178 "2020-04-30T09:27:46Z")

</div>

ROOT Version: master Platform: Linux 5.4 (Manjaro) Compiler: GCC 9.3 I can create a TTree with a branch holding boolean values like this - #include "TFile.h" #include "TTree.h" #include "TBranch.h" void tleafo() {…

---

## [Investigating memory leak while using TMinuit ROOT with valgrind](https://root-forum.cern.ch/t/investigating-memory-leak-while-using-tminuit-root-with-valgrind/39164)

<div class="topic-metadata">

**Author:** [@JohannesB](https://root-forum.cern.ch/u/JohannesB)\
**Replies:** 6\
**Last updated:** [April 30, 2020, 8:47am UTC](https://root-forum.cern.ch/t/investigating-memory-leak-while-using-tminuit-root-with-valgrind/39164 "2020-04-30T08:47:15Z")

</div>

I am using TMinuit in a loop for scanning some upper limit maps and I am running into a memory problem. The only thing which is created within the loop is the TMinuit object using “TMinuit \* minuit = new TMinuit(n\_params…

---

## [Unresolved symbol while linking error upon second run of macro](https://root-forum.cern.ch/t/unresolved-symbol-while-linking-error-upon-second-run-of-macro/39175)

<div class="topic-metadata">

**Author:** [@Charlie\_Chen](https://root-forum.cern.ch/u/Charlie_Chen)\
**Replies:** 2\
**Last updated:** [April 29, 2020, 8:04pm UTC](https://root-forum.cern.ch/t/unresolved-symbol-while-linking-error-upon-second-run-of-macro/39175 "2020-04-29T20:04:26Z")

</div>

Hello, I’m trying to run a very simple test script for working with vectors on ROOT6.18/00: #include "TFile.h" #include "TTree.h" #include "TTreeReader.h" #include "TTreeReaderValue.h" #include \<iostream\> #include \<vec…

---

## [Dificulty building ROOT on Ubuntu WSL](https://root-forum.cern.ch/t/dificulty-building-root-on-ubuntu-wsl/38699)

<div class="topic-metadata">

**Author:** [@dmishins](https://root-forum.cern.ch/u/dmishins)\
**Replies:** 17\
**Last updated:** [April 29, 2020, 4:06pm UTC](https://root-forum.cern.ch/t/dificulty-building-root-on-ubuntu-wsl/38699 "2020-04-29T16:06:35Z")

</div>

ROOT Version: root-6.20.04 Platform: Ubuntu 18.04.4 LTS Compiler: GCC 7 Hi, I am fairly new to ROOT and am trying to build it on Ubuntu WSL. I believe I have installed all the prerequisites linked at https://root.c…

---

## [Using ROOT with KDetSim to create 3D hist of cylindrical detector](https://root-forum.cern.ch/t/using-root-with-kdetsim-to-create-3d-hist-of-cylindrical-detector/39145)

<div class="topic-metadata">

**Author:** [@em3179](https://root-forum.cern.ch/u/em3179)\
**Replies:** 2\
**Last updated:** [April 29, 2020, 12:04pm UTC](https://root-forum.cern.ch/t/using-root-with-kdetsim-to-create-3d-hist-of-cylindrical-detector/39145 "2020-04-29T12:04:14Z")

</div>

Hi ROOT community, I’m hoping someone is familiar with KDetSim. Its a package used to solve the Possion Equation and thus simulate the E field and track charge inside semi-conductors. I found a sample script on the KD…

---

## [Is it possible to include fit parameters in a TLegend in a nice looking way?](https://root-forum.cern.ch/t/is-it-possible-to-include-fit-parameters-in-a-tlegend-in-a-nice-looking-way/39100)

<div class="topic-metadata">

**Author:** [@JoschaHanel](https://root-forum.cern.ch/u/JoschaHanel)\
**Replies:** 8\
**Last updated:** [April 29, 2020, 9:07am UTC](https://root-forum.cern.ch/t/is-it-possible-to-include-fit-parameters-in-a-tlegend-in-a-nice-looking-way/39100 "2020-04-29T09:07:11Z")

</div>

Hello, I am wondering if it is possible to create one single legend for a graph with a fit function, where the legend contains the markers and the fit function line (with their respective descriptions) PLUS the fit para…

---

## [Problem in estimation of sigma and bin range while fitting gaussian peak](https://root-forum.cern.ch/t/problem-in-estimation-of-sigma-and-bin-range-while-fitting-gaussian-peak/39086)

<div class="topic-metadata">

**Author:** [@arorastacy](https://root-forum.cern.ch/u/arorastacy)\
**Replies:** 18\
**Last updated:** [April 27, 2020, 8:14am UTC](https://root-forum.cern.ch/t/problem-in-estimation-of-sigma-and-bin-range-while-fitting-gaussian-peak/39086 "2020-04-27T08:14:29Z")

</div>

Hi, @couet @Wile\_E\_Coyote @moneta I have uploaded all the necessary files. In the C file I have use “?” because i am not sure to some of the estimated values. And I am trying to fit the peak which has a mean~1126. d9.…

---

## [Voigt function with parameter which depends on energy](https://root-forum.cern.ch/t/voigt-function-with-parameter-which-depends-on-energy/39139)

<div class="topic-metadata">

**Author:** [@babintsev](https://root-forum.cern.ch/u/babintsev)\
**Replies:** 5\
**Last updated:** [April 28, 2020, 1:03pm UTC](https://root-forum.cern.ch/t/voigt-function-with-parameter-which-depends-on-energy/39139 "2020-04-28T13:03:52Z")

</div>

\_\_\_Hello I cannot use gauss function when width parameter depends on energy - compilation error. I can overcame it using my own function. - see attachment. How to solve this problem with voigt function ? thank you, …

---

## [Histogram Drawing Frame Size](https://root-forum.cern.ch/t/histogram-drawing-frame-size/39132)

<div class="topic-metadata">

**Author:** [@scippsean](https://root-forum.cern.ch/u/scippsean)\
**Replies:** 3\
**Last updated:** [April 28, 2020, 7:32am UTC](https://root-forum.cern.ch/t/histogram-drawing-frame-size/39132 "2020-04-28T07:32:39Z")

</div>

Hello, I am plotting some 2d histograms and I would like the plot to be square. In other words, the x and y axes have the same range and bin width so I want that evident in the plot. As it stands, the drawing comes out …

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

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