# Newbie

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

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

---

## [Not Getting my second points in TGraph](https://root-forum.cern.ch/t/not-getting-my-second-points-in-tgraph/39625)

<div class="topic-metadata">

**Author:** [@Conor\_McGee](https://root-forum.cern.ch/u/Conor_McGee)\
**Replies:** 1\
**Last updated:** [May 27, 2020, 4:54pm UTC](https://root-forum.cern.ch/t/not-getting-my-second-points-in-tgraph/39625 "2020-05-27T16:54:10Z")

</div>

Please read tips for efficient and successful posting and posting code \_ROOT Version:6.18/04 Platform: Linux Compiler: C++ I think So I am having issues with making a TGraph from only 2 points. The code used to work…

---

## [Memory allocation issues when opening multiple files](https://root-forum.cern.ch/t/memory-allocation-issues-when-opening-multiple-files/39575)

<div class="topic-metadata">

**Author:** [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Replies:** 4\
**Last updated:** [May 26, 2020, 4:43pm UTC](https://root-forum.cern.ch/t/memory-allocation-issues-when-opening-multiple-files/39575 "2020-05-26T16:43:13Z")

</div>

Dear experts, I am trying to collect my analysis results from different root files in a single plot. In order to do that I have to open the files sequentially, access some tree variables (and potentially do a quick selec…

---

## [TProfile2D mean of all bins](https://root-forum.cern.ch/t/tprofile2d-mean-of-all-bins/39587)

<div class="topic-metadata">

**Author:** [@bomben](https://root-forum.cern.ch/u/bomben)\
**Replies:** 2\
**Last updated:** [May 26, 2020, 12:57pm UTC](https://root-forum.cern.ch/t/tprofile2d-mean-of-all-bins/39587 "2020-05-26T12:57:10Z")

</div>

Dear all, how do I get the average of all bins in a TProfile2D, please? My case is the following: I have a 2 efficiency map, let’s say 10x10 bins. Each bin contains the efficiency for a certain position. How do I get …

---

## [Highlighted 2D Histogram. Display TH1D row-associated simultaneously in other window](https://root-forum.cern.ch/t/highlighted-2d-histogram-display-th1d-row-associated-simultaneously-in-other-window/39590)

<div class="topic-metadata">

**Author:** [@LCC](https://root-forum.cern.ch/u/LCC)\
**Replies:** 2\
**Last updated:** [May 25, 2020, 4:10pm UTC](https://root-forum.cern.ch/t/highlighted-2d-histogram-display-th1d-row-associated-simultaneously-in-other-window/39590 "2020-05-25T16:10:34Z")

</div>

Hi, I created a program in Python that makes a ROOT.TH2D histogram and save it into a Canvas. My next step is to configure an algorithm that, for each row where my mouse cursor is being displayed, highlight that row an…

---

## [Extracting a fit form a class function](https://root-forum.cern.ch/t/extracting-a-fit-form-a-class-function/37127)

<div class="topic-metadata">

**Author:** [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Replies:** 19\
**Last updated:** [May 24, 2020, 6:55pm UTC](https://root-forum.cern.ch/t/extracting-a-fit-form-a-class-function/37127 "2020-05-24T18:55:29Z")

</div>

Dear experts, I am writing an analysis code spread across several different classes with global inheritance form a base class object. The base class object is equipped with several helper functions (recursive directory …

---

## [Help with superimposing graphs](https://root-forum.cern.ch/t/help-with-superimposing-graphs/39568)

<div class="topic-metadata">

**Author:** [@esh187](https://root-forum.cern.ch/u/esh187)\
**Replies:** 1\
**Last updated:** [May 24, 2020, 12:33pm UTC](https://root-forum.cern.ch/t/help-with-superimposing-graphs/39568 "2020-05-24T12:33:56Z")

</div>

void g3() { Int\_t n = 20; Double\_t x\[n\], y\[n\], x1\[n\], y1\[n\]; for (Int\_t i=0; i\<n; i++) { x\[i\] = i\*0.1; y\[i\] = 10\*sin(x\[i\]+0.2); } for (Int\_t j=0; j\<n; j++) { x1\[j\] = j\*0.1; y1\[j\] = cos(x\[j\]); } TCanvas \*c…

---

## [Problem with histograms after saving to file](https://root-forum.cern.ch/t/problem-with-histograms-after-saving-to-file/39541)

<div class="topic-metadata">

**Author:** [@Natilus](https://root-forum.cern.ch/u/Natilus)\
**Replies:** 4\
**Last updated:** [May 24, 2020, 3:36am UTC](https://root-forum.cern.ch/t/problem-with-histograms-after-saving-to-file/39541 "2020-05-24T03:36:14Z")

</div>

Dear experts, I have a root program that works well and generates all histograms the way I want; however, if I save them to a root file, all the settings and color schemes disappear. For example, I set gStyle-\>SetPalet…

---

## [How to run c/c++ files on root](https://root-forum.cern.ch/t/how-to-run-c-c-files-on-root/39548)

<div class="topic-metadata">

**Author:** [@esh187](https://root-forum.cern.ch/u/esh187)\
**Replies:** 9\
**Last updated:** [May 22, 2020, 12:55pm UTC](https://root-forum.cern.ch/t/how-to-run-c-c-files-on-root/39548 "2020-05-22T12:55:23Z")

</div>

I have tried writing codes line by line but it’s too much work and I want to know how to write in a text editior and run it on root then as it is much easier, as in the header files required and such. For now I always ru…

---

## [http://root.cern.ch/files/WM.root not correct](https://root-forum.cern.ch/t/http-root-cern-ch-files-wm-root-not-correct/39553)

<div class="topic-metadata">

**Author:** [@11125](https://root-forum.cern.ch/u/11125)\
**Replies:** 4\
**Last updated:** [May 22, 2020, 11:51am UTC](https://root-forum.cern.ch/t/http-root-cern-ch-files-wm-root-not-correct/39553 "2020-05-22T11:51:59Z")

</div>

http://root.cern.ch/files/WM.root according to One China Policy, The RPC(official) and ROC(not official) should have the same color.

---

## [How to calculate effective sigma?](https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472)

<div class="topic-metadata">

**Author:** [@sahoos](https://root-forum.cern.ch/u/sahoos)\
**Replies:** 6\
**Last updated:** [May 22, 2020, 11:51am UTC](https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472 "2020-05-22T11:51:38Z")

</div>

Dear experts, I have fitted the data sets with two Gaussian PDFs in roofit. RooRealVar mean(“mean”,“mean”,1.777,1.75,1.79); RooRealVar sigma1(“sigma1”,“sigma1”,0.00,0.0,0.1); RooGaussian signal1(“signal1”,“signal1”,x…

---

## [How exactly does ROOT work](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509)

<div class="topic-metadata">

**Author:** [@esh187](https://root-forum.cern.ch/u/esh187)\
**Replies:** 41\
**Last updated:** [May 22, 2020, 9:03am UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509 "2020-05-22T09:03:10Z")

</div>

I am confused about where I should start with working on ROOT. I have installed it but I don’t understand how to run macros on it or what the general syntax is supposed to be like. The only coding I have done so far is c…

---

## [After changing margins, too much space between y-axis title and my y-axis itself](https://root-forum.cern.ch/t/after-changing-margins-too-much-space-between-y-axis-title-and-my-y-axis-itself/39511)

<div class="topic-metadata">

**Author:** [@evdv](https://root-forum.cern.ch/u/evdv)\
**Replies:** 4\
**Last updated:** [May 22, 2020, 8:51am UTC](https://root-forum.cern.ch/t/after-changing-margins-too-much-space-between-y-axis-title-and-my-y-axis-itself/39511 "2020-05-22T08:51:08Z")

</div>

Hi everyone, I am plotting a couple of TH2D histograms on the same canvas, but I am having some lay-out problems: I had to change my margins so that my axis titles would show, but now there is too much space between m…

---

## [Creating a histogram](https://root-forum.cern.ch/t/creating-a-histogram/39196)

<div class="topic-metadata">

**Author:** [@Natilus](https://root-forum.cern.ch/u/Natilus)\
**Replies:** 5\
**Last updated:** [May 21, 2020, 7:47pm UTC](https://root-forum.cern.ch/t/creating-a-histogram/39196 "2020-05-21T19:47:06Z")

</div>

Dear experts, I have a problem that has kept me busy for days. I would appreciate if you can help me. I have a tree stored in a root file with lots of branches one of which is called triggerbits. this branch stores the…

---

## [Error - dyld: Library not loaded](https://root-forum.cern.ch/t/error-dyld-library-not-loaded/39504)

<div class="topic-metadata">

**Author:** [@amrutha](https://root-forum.cern.ch/u/amrutha)\
**Replies:** 1\
**Last updated:** [May 21, 2020, 4:29pm UTC](https://root-forum.cern.ch/t/error-dyld-library-not-loaded/39504 "2020-05-21T16:29:11Z")

</div>

Hi, I’m trying to run an executable on my Mac and I’m getting the following runtime error: dyld: Library not loaded: libDynamicTTree.dylib Referenced from: /Users/amruthakrishna/root/summer2\_RA/Lab5015Analysis/./bin/a…

---

## [Get the integral of a function of a total function](https://root-forum.cern.ch/t/get-the-integral-of-a-function-of-a-total-function/39513)

<div class="topic-metadata">

**Author:** [@marcogobbo](https://root-forum.cern.ch/u/marcogobbo)\
**Replies:** 2\
**Last updated:** [May 21, 2020, 7:49am UTC](https://root-forum.cern.ch/t/get-the-integral-of-a-function-of-a-total-function/39513 "2020-05-21T07:49:03Z")

</div>

Hi! I’m having some problems to get a integral of a function that is inside in a total function. I fit this function with 3 functions: 2 gaussian and a constant. Now, I need to get the Integral (and his error) of one of …

---

## [Adding multiple 1D histograms](https://root-forum.cern.ch/t/adding-multiple-1d-histograms/39498)

<div class="topic-metadata">

**Author:** [@hep\_1](https://root-forum.cern.ch/u/hep_1)\
**Replies:** 11\
**Last updated:** [May 20, 2020, 2:58pm UTC](https://root-forum.cern.ch/t/adding-multiple-1d-histograms/39498 "2020-05-20T14:58:39Z")

</div>

When I run the macro attached here like 3 or 4 times, I start getting the same histogram plot every single time. I thought the use of TRandom3 meant I should be getting different plots since the data points generated are…

---

## [TGraph - Get Value(s) of X, based on value of Y](https://root-forum.cern.ch/t/tgraph-get-value-s-of-x-based-on-value-of-y/38289)

<div class="topic-metadata">

**Author:** [@ilomi](https://root-forum.cern.ch/u/ilomi)\
**Replies:** 5\
**Last updated:** [May 20, 2020, 10:22am UTC](https://root-forum.cern.ch/t/tgraph-get-value-s-of-x-based-on-value-of-y/38289 "2020-05-20T10:22:54Z")

</div>

In TGraph: Is there some function, which gives value(s) of x, if you know value of y? P.S. I can use for cycle and get some (approximate) result with Eval() Function. However, the result isn’t very precise - I cant u…

---

## [Filtering out part of event in RDataFrame](https://root-forum.cern.ch/t/filtering-out-part-of-event-in-rdataframe/39489)

<div class="topic-metadata">

**Author:** [@yunu](https://root-forum.cern.ch/u/yunu)\
**Replies:** 2\
**Last updated:** [May 20, 2020, 10:09am UTC](https://root-forum.cern.ch/t/filtering-out-part-of-event-in-rdataframe/39489 "2020-05-20T10:09:08Z")

</div>

Hello, My problem is next, I have a TTree with next Branches : Mult, pID\[Mult\], pEnergy\[Mult\], pTime\[Mult\], nID\[Mult\], nEnergy\[Mult\], nTime\[Mult\]. I have defined TCutG EnergyCut and would like to keep i parts of arrays …

---

## [Create and read a ROOT file](https://root-forum.cern.ch/t/create-and-read-a-root-file/39483)

<div class="topic-metadata">

**Author:** [@Fateme](https://root-forum.cern.ch/u/Fateme)\
**Replies:** 2\
**Last updated:** [May 19, 2020, 10:17pm UTC](https://root-forum.cern.ch/t/create-and-read-a-root-file/39483 "2020-05-19T22:17:05Z")

</div>

\_\_\_Hello everybody. Is it possible to create a ROOT file in a program and read it in the same program? I mean I create a ROOT file and fill it in the first part of program , can I read it in the second part of the sam…

---

## [What distribution does TH1::Sumw2() correspond to?](https://root-forum.cern.ch/t/what-distribution-does-th1-sumw2-correspond-to/39463)

<div class="topic-metadata">

**Author:** [@eggsAndCoffee](https://root-forum.cern.ch/u/eggsAndCoffee)\
**Replies:** 4\
**Last updated:** [May 19, 2020, 11:35am UTC](https://root-forum.cern.ch/t/what-distribution-does-th1-sumw2-correspond-to/39463 "2020-05-19T11:35:28Z")

</div>

I’m trying to understand what the motivation for TH1::Sumw2() is, and under what circumstances it actually properly represents the uncertainty on a histogram bin. From the documentation for TH1::Sumw2(), it is said that: …

---

## [Can't add Fit Parameter in Add Entry's Legend](https://root-forum.cern.ch/t/cant-add-fit-parameter-in-add-entrys-legend/39486)

<div class="topic-metadata">

**Author:** [@marcogobbo](https://root-forum.cern.ch/u/marcogobbo)\
**Replies:** 3\
**Last updated:** [May 19, 2020, 11:02am UTC](https://root-forum.cern.ch/t/cant-add-fit-parameter-in-add-entrys-legend/39486 "2020-05-19T11:02:57Z")

</div>

I’m trying to add the output of fit in TLegend, but I have a problem to concatenate char with double. I tried to do this: leg-\>AddEntry(fit1, "2960 mV #mu = " \<\< (const char \[15\])fit1-\>GetParameter(0), "l"); But I got…

---

## [How to use TSpectrum to locate peaks](https://root-forum.cern.ch/t/how-to-use-tspectrum-to-locate-peaks/39482)

<div class="topic-metadata">

**Author:** [@Conor\_McGee](https://root-forum.cern.ch/u/Conor_McGee)\
**Replies:** 1\
**Last updated:** [May 19, 2020, 6:46am UTC](https://root-forum.cern.ch/t/how-to-use-tspectrum-to-locate-peaks/39482 "2020-05-19T06:46:40Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Not Provided Compiler: C++ So I am trying to use TSpectrum to locate two peaks in this spectrum and it is …

---

## [Root gives an error for this macro but it runs fine in codeblocks](https://root-forum.cern.ch/t/root-gives-an-error-for-this-macro-but-it-runs-fine-in-codeblocks/39464)

<div class="topic-metadata">

**Author:** [@hep\_1](https://root-forum.cern.ch/u/hep_1)\
**Replies:** 2\
**Last updated:** [May 18, 2020, 3:28pm UTC](https://root-forum.cern.ch/t/root-gives-an-error-for-this-macro-but-it-runs-fine-in-codeblocks/39464 "2020-05-18T15:28:35Z")

</div>

The code I have attached is just something I wrote in codeblocks, and it runs fine there. I thought to check if I can run it in root too (and I assumed that it should work), but when I try to run it, root gives the error…

---

## [Jupyter PyROOT install issue](https://root-forum.cern.ch/t/jupyter-pyroot-install-issue/39418)

<div class="topic-metadata">

**Author:** [@lhagaman](https://root-forum.cern.ch/u/lhagaman)\
**Replies:** 1\
**Last updated:** [May 18, 2020, 8:15am UTC](https://root-forum.cern.ch/t/jupyter-pyroot-install-issue/39418 "2020-05-18T08:15:14Z")

</div>

I’m trying to learn PyROOT on mac with Jupyter notebooks. It was working fine, but then I found this tutorial which has the “%jsmva on” command. In my notebook this errors despite ROOT commands working normally. I’m usin…

---

## [Problem loading existing ROOTC++ Jupyter kernel notebook](https://root-forum.cern.ch/t/problem-loading-existing-rootc-jupyter-kernel-notebook/39360)

<div class="topic-metadata">

**Author:** [@marvin\_littlewood](https://root-forum.cern.ch/u/marvin_littlewood)\
**Replies:** 5\
**Last updated:** [May 18, 2020, 6:56am UTC](https://root-forum.cern.ch/t/problem-loading-existing-rootc-jupyter-kernel-notebook/39360 "2020-05-18T06:56:59Z")

</div>

\_ROOT Version: 6.20/04 \_Platform: XUbtuntu 20.04 (focal) \_Compiler: g++ 9.3 (distro version) Good afternoon! I’m a lecturer who has to teach C++ to year 1 mathematicians. I am considering moving to using the ROOT no…

---

## [Getting StdDev() and Mean() from branch of a tree in saved root file](https://root-forum.cern.ch/t/getting-stddev-and-mean-from-branch-of-a-tree-in-saved-root-file/39445)

<div class="topic-metadata">

**Author:** [@EkNishchey](https://root-forum.cern.ch/u/EkNishchey)\
**Replies:** 6\
**Last updated:** [May 18, 2020, 5:49am UTC](https://root-forum.cern.ch/t/getting-stddev-and-mean-from-branch-of-a-tree-in-saved-root-file/39445 "2020-05-18T05:49:12Z")

</div>

Hey! Greetings of the day, I do not know if the question is silly, but the same thing works for other trees, in the same root file. Actually, I have a root file in which some trees are saved, one of the trees is E200, w…

---

## [How to download root on windows](https://root-forum.cern.ch/t/how-to-download-root-on-windows/39402)

<div class="topic-metadata">

**Author:** [@esh187](https://root-forum.cern.ch/u/esh187)\
**Replies:** 46\
**Last updated:** [May 17, 2020, 3:57pm UTC](https://root-forum.cern.ch/t/how-to-download-root-on-windows/39402 "2020-05-17T15:57:54Z")

</div>

Hi, I am total newbie at this and I need to download ROOTCERN on my Windows10 Laptop for a project I’m working on but I have no idea where to start. I have a few questions: Will downloading this require me to format…

---

## [Setting y axis limit in a function plot](https://root-forum.cern.ch/t/setting-y-axis-limit-in-a-function-plot/39414)

<div class="topic-metadata">

**Author:** [@hep\_1](https://root-forum.cern.ch/u/hep_1)\
**Replies:** 2\
**Last updated:** [May 14, 2020, 8:34pm UTC](https://root-forum.cern.ch/t/setting-y-axis-limit-in-a-function-plot/39414 "2020-05-14T20:34:19Z")

</div>

Hi, when I try to plot two functions on the same graph, why is the y-axis limit not adjusting automatically? If you look at the macro I have attached here, a portion of the function in the negative y-axis is cut off. And…

---

## [CMake: Oracle enabled by default?](https://root-forum.cern.ch/t/cmake-oracle-enabled-by-default/39403)

<div class="topic-metadata">

**Author:** [@Reik](https://root-forum.cern.ch/u/Reik)\
**Replies:** 1\
**Last updated:** [May 14, 2020, 4:05pm UTC](https://root-forum.cern.ch/t/cmake-oracle-enabled-by-default/39403 "2020-05-14T16:05:47Z")

</div>

ROOT Version: master Platform: Linux 5.4 (Manjaro) Compiler: GCC 9.3 It seems like -Doracle flag is enabled by default (I did not notice this behaviour earlier - I never explicitly enabled the oracle flag). Is this …

---

## [Undeclared Identifier when running macros](https://root-forum.cern.ch/t/undeclared-identifier-when-running-macros/39387)

<div class="topic-metadata">

**Author:** [@stephen-mul](https://root-forum.cern.ch/u/stephen-mul)\
**Replies:** 24\
**Last updated:** [May 13, 2020, 3:15pm UTC](https://root-forum.cern.ch/t/undeclared-identifier-when-running-macros/39387 "2020-05-13T15:15:41Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided Having a strange issue when trying to follow some examples in both doc…

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

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