# Newbie

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

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

---

## [Fitting of mutiple peaks in the case of unknown number of peaks](https://root-forum.cern.ch/t/fitting-of-mutiple-peaks-in-the-case-of-unknown-number-of-peaks/37287)

<div class="topic-metadata">

**Author:** [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Replies:** 0\
**Last updated:** [December 21, 2019, 12:15pm UTC](https://root-forum.cern.ch/t/fitting-of-mutiple-peaks-in-the-case-of-unknown-number-of-peaks/37287 "2019-12-21T12:15:32Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 6.14 Platform: linux Compiler: Not Provided How the following code can be modified for gaussian fitting of mutiple peaks in the c…

---

## [How can I perform multiple Gaussian fit on a "rebinned histogram"?](https://root-forum.cern.ch/t/how-can-i-perform-multiple-gaussian-fit-on-a-rebinned-histogram/37335)

<div class="topic-metadata">

**Author:** [@A\_Kumar](https://root-forum.cern.ch/u/A_Kumar)\
**Replies:** 1\
**Last updated:** [January 6, 2020, 3:09pm UTC](https://root-forum.cern.ch/t/how-can-i-perform-multiple-gaussian-fit-on-a-rebinned-histogram/37335 "2020-01-06T15:09:36Z")

</div>

I created a histogram from .tex file and then rebinned the histogram from \> Draw Panel \> binning. My query is how can i perform mutiple gussian fitting of this “rebinned histogram” ? How should i proceed ? Detailed steps…

---

## [TFormula from user-defined TF1](https://root-forum.cern.ch/t/tformula-from-user-defined-tf1/37414)

<div class="topic-metadata">

**Author:** [@tsfeith](https://root-forum.cern.ch/u/tsfeith)\
**Replies:** 1\
**Last updated:** [January 6, 2020, 9:34am UTC](https://root-forum.cern.ch/t/tformula-from-user-defined-tf1/37414 "2020-01-06T09:34:49Z")

</div>

Hi, I’ve been trying for a while to create a TFormula out of a user defined TF1 and so far I’ve come up empty, so I was wondering if there was some way to do it. I’ve managed to create the TF1, both via a lambda express…

---

## [Making maps in pyroot](https://root-forum.cern.ch/t/making-maps-in-pyroot/37385)

<div class="topic-metadata">

**Author:** [@schellman](https://root-forum.cern.ch/u/schellman)\
**Replies:** 4\
**Last updated:** [January 6, 2020, 9:33am UTC](https://root-forum.cern.ch/t/making-maps-in-pyroot/37385 "2020-01-06T09:33:36Z")

</div>

My question is how to make a map of vectors of strings in pyroot. I am accessing C++ code that produces a std::map\<std::string,std::vectorstd::string\> . I’ve tried just using a dictionary of lists but that does not wor…

---

## [Storing parameter values without running code](https://root-forum.cern.ch/t/storing-parameter-values-without-running-code/37428)

<div class="topic-metadata">

**Author:** [@asp211](https://root-forum.cern.ch/u/asp211)\
**Replies:** 1\
**Last updated:** [January 5, 2020, 10:34am UTC](https://root-forum.cern.ch/t/storing-parameter-values-without-running-code/37428 "2020-01-05T10:34:36Z")

</div>

I am aware that when you fit a function in root and run the code, it prints out the parameter constants that give the best fit. Is there a way to actually store the parameters in an array or variables without actually ru…

---

## [Plotting mulitple Ntuples on the same set of axes](https://root-forum.cern.ch/t/plotting-mulitple-ntuples-on-the-same-set-of-axes/37375)

<div class="topic-metadata">

**Author:** [@luiz\_iniciante](https://root-forum.cern.ch/u/luiz_iniciante)\
**Replies:** 9\
**Last updated:** [January 3, 2020, 2:19am UTC](https://root-forum.cern.ch/t/plotting-mulitple-ntuples-on-the-same-set-of-axes/37375 "2020-01-03T02:19:06Z")

</div>

Hello Forum, I’m trying to do something that, in principle, sounds easy, but is proving challenging to me. I have 3 Ntuples and would like to plot them on the same set of XY axes in the same style. I have written the f…

---

## [Multithreaded analysis doesn't seem to recognize null initialization of TH1D objects](https://root-forum.cern.ch/t/multithreaded-analysis-doesnt-seem-to-recognize-null-initialization-of-th1d-objects/36872)

<div class="topic-metadata">

**Author:** [@jstock](https://root-forum.cern.ch/u/jstock)\
**Replies:** 5\
**Last updated:** [January 3, 2020, 2:13am UTC](https://root-forum.cern.ch/t/multithreaded-analysis-doesnt-seem-to-recognize-null-initialization-of-th1d-objects/36872 "2020-01-03T02:13:11Z")

</div>

I am concerned by a warning that I get when trying to run a multithreaded analysis. The warning is: Warning in \<TOutputListSelectorDataMap::SetDataMembers()\>: potential memory leak: replacing data member \`h\_ar1\_bar\_dts…

---

## [Possibly incorrect bash profile](https://root-forum.cern.ch/t/possibly-incorrect-bash-profile/37354)

<div class="topic-metadata">

**Author:** [@asp211](https://root-forum.cern.ch/u/asp211)\
**Replies:** 4\
**Last updated:** [January 2, 2020, 4:30pm UTC](https://root-forum.cern.ch/t/possibly-incorrect-bash-profile/37354 "2020-01-02T16:30:38Z")

</div>

ROOT Version: 6.18/04 Platform: VSCode Compiler: Terminal System: Mac OSX I downloaded root, but I’m not sure if I set my .bash~profile correctly. What lines should I have in my .bash~profile in order to make it wo…

---

## [Python error withe libraries](https://root-forum.cern.ch/t/python-error-withe-libraries/37358)

<div class="topic-metadata">

**Author:** [@eddymaoui](https://root-forum.cern.ch/u/eddymaoui)\
**Replies:** 1\
**Last updated:** [January 2, 2020, 3:17pm UTC](https://root-forum.cern.ch/t/python-error-withe-libraries/37358 "2020-01-02T15:17:31Z")

</div>

hi all when i want to build the make file with (cmake …/root-6.16.00/) he give this ; solutions plz Version mismatch between Python interpreter (3.6.8) and libraries (2.7.17). ROOT cannot work with this configuration…

---

## [Getting error when trying to use fabs](https://root-forum.cern.ch/t/getting-error-when-trying-to-use-fabs/37365)

<div class="topic-metadata">

**Author:** [@Federico\_G](https://root-forum.cern.ch/u/Federico_G)\
**Replies:** 1\
**Last updated:** [January 2, 2020, 3:15pm UTC](https://root-forum.cern.ch/t/getting-error-when-trying-to-use-fabs/37365 "2020-01-02T15:15:20Z")

</div>

I have been getting the following error RooFormula::eval(fabs(Muon1\_eta)\<1.05&&fabs(Muon2\_eta)\<1.05): Formula doesn't compile: fabs(Muon1\_eta)\<1.05&&fabs(Muon2\_eta)\<1.05 My code resulting in this error is as follows: …

---

## [Gaussian fitting of mutiple peaks in the case of unknown number of peaks in histogram generated from .tex file (for example: test.tex). What are the change required in following code (this code is for 5 peaks)?](https://root-forum.cern.ch/t/gaussian-fitting-of-mutiple-peaks-in-the-case-of-unknown-number-of-peaks-in-histogram-generated-from-tex-file-for-example-test-tex-what-are-the-change-required-in-following-code-this-code-is-for-5-peaks/37305)

<div class="topic-metadata">

**Author:** [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Replies:** 5\
**Last updated:** [December 30, 2019, 5:01am UTC](https://root-forum.cern.ch/t/gaussian-fitting-of-mutiple-peaks-in-the-case-of-unknown-number-of-peaks-in-histogram-generated-from-tex-file-for-example-test-tex-what-are-the-change-required-in-following-code-this-code-is-for-5-peaks/37305 "2019-12-30T05:01:11Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 6.14 Platform: Not Provided Compiler: Not Provided TF1 \*fpol; Int\_t npol; const Int\_t npeaks = 5; Double\_t fpeaks(Double\_t \*x, D…

---

## [Confusion on using TRandom3](https://root-forum.cern.ch/t/confusion-on-using-trandom3/37356)

<div class="topic-metadata">

**Author:** [@hep\_1](https://root-forum.cern.ch/u/hep_1)\
**Replies:** 2\
**Last updated:** [December 28, 2019, 7:59pm UTC](https://root-forum.cern.ch/t/confusion-on-using-trandom3/37356 "2019-12-28T19:59:02Z")

</div>

Hi, I am new to ROOT, and I was learning how to use TRandom3. All I want to do is see how it works, and if I can generate some random numbers. I tried the following two codes: TRandom3 rand(0); for (Int\_t i = 0; i\<1…

---

## [Lots of errors when running my root program](https://root-forum.cern.ch/t/lots-of-errors-when-running-my-root-program/37344)

<div class="topic-metadata">

**Author:** [@asp211](https://root-forum.cern.ch/u/asp211)\
**Replies:** 1\
**Last updated:** [December 28, 2019, 5:14am UTC](https://root-forum.cern.ch/t/lots-of-errors-when-running-my-root-program/37344 "2019-12-28T05:14:48Z")

</div>

ROOT Version: 6.18/04 Platform: VSCode Compiler: VSCode System: Mac OSX I am a beginner to ROOT and after downloading it on my Mac and running the following macro: #include \<iostream\> #include \<cmath\> using namesp…

---

## [TApplication usage and live updating canvas](https://root-forum.cern.ch/t/tapplication-usage-and-live-updating-canvas/37317)

<div class="topic-metadata">

**Author:** [@bernardosilva](https://root-forum.cern.ch/u/bernardosilva)\
**Replies:** 5\
**Last updated:** [December 28, 2019, 2:26am UTC](https://root-forum.cern.ch/t/tapplication-usage-and-live-updating-canvas/37317 "2019-12-28T02:26:21Z")

</div>

I am having some trouble finding useful TApplication examples so I can understand it’s usage better. The only successfull programs I’ve made were with SetReturnFromRun(true) and gPad-\>WaitPrimitive() which, makes it so …

---

## [Reading a large amount of data from TTree at once](https://root-forum.cern.ch/t/reading-a-large-amount-of-data-from-ttree-at-once/37248)

<div class="topic-metadata">

**Author:** [@mj00](https://root-forum.cern.ch/u/mj00)\
**Replies:** 3\
**Last updated:** [December 24, 2019, 2:01pm UTC](https://root-forum.cern.ch/t/reading-a-large-amount-of-data-from-ttree-at-once/37248 "2019-12-24T14:01:46Z")

</div>

I have a root file whose size is smaller than 1GB. This file contains only one TTree that has 11 million entries with 12 variables. Using the data I tried to draw histograms with various settings. For this work, it is de…

---

## [Issue in compiling my code](https://root-forum.cern.ch/t/issue-in-compiling-my-code/37302)

<div class="topic-metadata">

**Author:** [@Shams](https://root-forum.cern.ch/u/Shams)\
**Replies:** 3\
**Last updated:** [December 24, 2019, 8:23am UTC](https://root-forum.cern.ch/t/issue-in-compiling-my-code/37302 "2019-12-24T08:23:15Z")

</div>

Hello, I am getting an error in compilation of my code (main.cpp). The error I see on the terminal is in the attached .txt file. Please suggest how to resolve this issue? Error.txt (867 Bytes) Please read tips for e…

---

## [Draw() function not working for Histograms](https://root-forum.cern.ch/t/draw-function-not-working-for-histograms/37260)

<div class="topic-metadata">

**Author:** [@mfarrington](https://root-forum.cern.ch/u/mfarrington)\
**Replies:** 4\
**Last updated:** [December 21, 2019, 8:17am UTC](https://root-forum.cern.ch/t/draw-function-not-working-for-histograms/37260 "2019-12-21T08:17:07Z")

</div>

I am trying to extract data from a tree and put it into a histogram using a c++ program, however I am having the issue that the program creates the TCanvas for the histogram when I use the Draw() function, but I never se…

---

## [Taking the absolute value of all the entries in a TBranch in RooFit](https://root-forum.cern.ch/t/taking-the-absolute-value-of-all-the-entries-in-a-tbranch-in-roofit/37253)

<div class="topic-metadata">

**Author:** [@Federico\_G](https://root-forum.cern.ch/u/Federico_G)\
**Replies:** 2\
**Last updated:** [December 20, 2019, 8:07am UTC](https://root-forum.cern.ch/t/taking-the-absolute-value-of-all-the-entries-in-a-tbranch-in-roofit/37253 "2019-12-20T08:07:05Z")

</div>

Hi I have a million entries in a TBranch and the value for each entry ranges from -2.5 to 2.5. I need to cut another set of data using these entries. Is there any way to turn take the absolute value of all the entries i…

---

## [Data-Sim comparison on same axis](https://root-forum.cern.ch/t/data-sim-comparison-on-same-axis/37246)

<div class="topic-metadata">

**Author:** [@Prya13](https://root-forum.cern.ch/u/Prya13)\
**Replies:** 6\
**Last updated:** [December 18, 2019, 4:50pm UTC](https://root-forum.cern.ch/t/data-sim-comparison-on-same-axis/37246 "2019-12-18T16:50:24Z")

</div>

Dear Rootians, I am trying to put these two plots on the same axis for a comparison between data and simulations. I used DrawNormalized() however it still did not work. please help Top plot is simulated while bottom pl…

---

## [R\_\_LOAD\_LIBRARY help](https://root-forum.cern.ch/t/r-load-library-help/37245)

<div class="topic-metadata">

**Author:** [@Flavia](https://root-forum.cern.ch/u/Flavia)\
**Replies:** 2\
**Last updated:** [December 17, 2019, 10:48pm UTC](https://root-forum.cern.ch/t/r-load-library-help/37245 "2019-12-17T22:48:47Z")

</div>

Dear Rooters, I need to include some libraries, that are in a certain path, before running my ROOT macro. When I ran my code line by line in the ROOT interpreter, starting with: root \[0\] .L full-path-to-my-lib/lib1.so…

---

## [Please help fitting](https://root-forum.cern.ch/t/please-help-fitting/37233)

<div class="topic-metadata">

**Author:** [@Shaggylee](https://root-forum.cern.ch/u/Shaggylee)\
**Replies:** 2\
**Last updated:** [December 17, 2019, 1:38pm UTC](https://root-forum.cern.ch/t/please-help-fitting/37233 "2019-12-17T13:38:56Z")

</div>

Hello Rooters. I drew the following picture. I want to fit like a blue line and I want to know the function to get as a result of the fitting. please help…

---

## [Please, help me! :(](https://root-forum.cern.ch/t/please-help-me/37231)

<div class="topic-metadata">

**Author:** [@Shaggylee](https://root-forum.cern.ch/u/Shaggylee)\
**Replies:** 1\
**Last updated:** [December 17, 2019, 9:16am UTC](https://root-forum.cern.ch/t/please-help-me/37231 "2019-12-17T09:16:56Z")

</div>

Hello, Rooter. I have gaussian fitting histogram. (red line) However, I want to fit the histogram around the blue line. I also want to know the function used for fitting. Please help…!

---

## [Draw Histogram from .txt file. I tried with the already available answers, but didn't work for me](https://root-forum.cern.ch/t/draw-histogram-from-txt-file-i-tried-with-the-already-available-answers-but-didnt-work-for-me/37188)

<div class="topic-metadata">

**Author:** [@A\_Kumar](https://root-forum.cern.ch/u/A_Kumar)\
**Replies:** 4\
**Last updated:** [December 17, 2019, 7:05am UTC](https://root-forum.cern.ch/t/draw-histogram-from-txt-file-i-tried-with-the-already-available-answers-but-didnt-work-for-me/37188 "2019-12-17T07:05:39Z")

</div>

\_\_\_a.txt (33.0 KB) Please read tips for efficient and successful posting and posting code \_ROOT Version: ROOT 6.14/06 \_Platform:Ubuntu 18.04 Compiler: Not Provided

---

## [Problem with Gaussian Distribution](https://root-forum.cern.ch/t/problem-with-gaussian-distribution/37200)

<div class="topic-metadata">

**Author:** [@Abh](https://root-forum.cern.ch/u/Abh)\
**Replies:** 1\
**Last updated:** [December 16, 2019, 9:30am UTC](https://root-forum.cern.ch/t/problem-with-gaussian-distribution/37200 "2019-12-16T09:30:14Z")

</div>

Hello All I am trying to plot gaussian distribution on transverse momentum distribution. But after normalizing the pt histogram, the function does not match with the histogram. The function and normalized histograms are…

---

## [Good day . I am new to roofit and i am fiiting a crystal ball fit to my signal. Please help me](https://root-forum.cern.ch/t/good-day-i-am-new-to-roofit-and-i-am-fiiting-a-crystal-ball-fit-to-my-signal-please-help-me/37212)

<div class="topic-metadata">

**Author:** [@marlon](https://root-forum.cern.ch/u/marlon)\
**Replies:** 1\
**Last updated:** [December 15, 2019, 4:48pm UTC](https://root-forum.cern.ch/t/good-day-i-am-new-to-roofit-and-i-am-fiiting-a-crystal-ball-fit-to-my-signal-please-help-me/37212 "2019-12-15T16:48:48Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided

---

## [TTree with Generic Object (nil return)](https://root-forum.cern.ch/t/ttree-with-generic-object-nil-return/37185)

<div class="topic-metadata">

**Author:** [@theyellowdog](https://root-forum.cern.ch/u/theyellowdog)\
**Replies:** 2\
**Last updated:** [December 13, 2019, 10:01pm UTC](https://root-forum.cern.ch/t/ttree-with-generic-object-nil-return/37185 "2019-12-13T22:01:10Z")

</div>

I have root file with already tree object and want to add another one. filename\_tree = "ttree\_example.root" # Update the file with a new tree but without destroy previous data ftree2=ROOT.TFile(filename\_tree,"UPDATE") …

---

## [Problems with root while using GATE](https://root-forum.cern.ch/t/problems-with-root-while-using-gate/37184)

<div class="topic-metadata">

**Author:** [@michelraed](https://root-forum.cern.ch/u/michelraed)\
**Replies:** 2\
**Last updated:** [December 13, 2019, 8:41pm UTC](https://root-forum.cern.ch/t/problems-with-root-while-using-gate/37184 "2019-12-13T20:41:46Z")

</div>

Everytime i run a simulation in GATE, the root sends an error message as follows : =========================================================== There was a crash. This is the entire stack trace of all threads: ==========…

---

## [How can I get the absolute value of all the values in a RooRealVar?](https://root-forum.cern.ch/t/how-can-i-get-the-absolute-value-of-all-the-values-in-a-roorealvar/37182)

<div class="topic-metadata">

**Author:** [@Federico\_G](https://root-forum.cern.ch/u/Federico_G)\
**Replies:** 2\
**Last updated:** [December 13, 2019, 10:29am UTC](https://root-forum.cern.ch/t/how-can-i-get-the-absolute-value-of-all-the-values-in-a-roorealvar/37182 "2019-12-13T10:29:39Z")

</div>

Hi, I have a very basic question but I’ve been struggling to find a solution. I have around a million entries in a RooRealVar that I have taken from a TBranch which range from -2.5 to 2.5, how can I turn all the negati…

---

## [Plotting Ntuple Components on a single Canvas](https://root-forum.cern.ch/t/plotting-ntuple-components-on-a-single-canvas/37168)

<div class="topic-metadata">

**Author:** [@theyellowdog](https://root-forum.cern.ch/u/theyellowdog)\
**Replies:** 3\
**Last updated:** [December 13, 2019, 7:25am UTC](https://root-forum.cern.ch/t/plotting-ntuple-components-on-a-single-canvas/37168 "2019-12-13T07:25:17Z")

</div>

I have Ntuple which contain data of four variables. (x:y:z:t) I am trying to draw 4 histogram on a single canvas but only getting a single histogram. f = ROOT.TFile(filename) c = ROOT.TCanvas() c.Divide(2,2) c.cd(4) f…

---

## [Is ROOT slower if built with -DCMAKE\_BUILD\_TYPE="Debug"?](https://root-forum.cern.ch/t/is-root-slower-if-built-with-dcmake-build-type-debug/36999)

<div class="topic-metadata">

**Author:** [@renyhp](https://root-forum.cern.ch/u/renyhp)\
**Replies:** 5\
**Last updated:** [December 12, 2019, 11:02am UTC](https://root-forum.cern.ch/t/is-root-slower-if-built-with-dcmake-build-type-debug/36999 "2019-12-12T11:02:00Z")

</div>

Hello everyone, Sorry for creating another topic. Question from the title. Will ROOT be slower if I compile it from source with the Debug option, compared to the precompiled binary that I can find on the website? If yes…

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

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