# Newbie

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

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

---

## [Problem in Background fitting](https://root-forum.cern.ch/t/problem-in-background-fitting/38598)

<div class="topic-metadata">

**Author:** [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Replies:** 11\
**Last updated:** [March 29, 2020, 2:55pm UTC](https://root-forum.cern.ch/t/problem-in-background-fitting/38598 "2020-03-29T14:55:47Z")

</div>

A spectrum is drawn by me using the code and text file below: fithisto.C (3.4 KB) eu\_gu\_1.txt (44.1 KB) In my code, I have subtracted the background but I want to fit the background which was subtracted. Please help …

---

## [Fit function uses initial parameter values](https://root-forum.cern.ch/t/fit-function-uses-initial-parameter-values/38516)

<div class="topic-metadata">

**Author:** [@evdv](https://root-forum.cern.ch/u/evdv)\
**Replies:** 32\
**Last updated:** [March 29, 2020, 1:25pm UTC](https://root-forum.cern.ch/t/fit-function-uses-initial-parameter-values/38516 "2020-03-29T13:25:03Z")

</div>

ROOT Version: 6.18/04 Platform: Linux I defined a sigmoid function with 2 parameters (and set the initial parameter values). I am now trying to fit this function to a plot (called fun\[1\]), however my ‘fit’ always just …

---

## [Segmentation violation, Root 6](https://root-forum.cern.ch/t/segmentation-violation-root-6/38605)

<div class="topic-metadata">

**Author:** [@caroline](https://root-forum.cern.ch/u/caroline)\
**Replies:** 4\
**Last updated:** [March 29, 2020, 12:23pm UTC](https://root-forum.cern.ch/t/segmentation-violation-root-6/38605 "2020-03-29T12:23:28Z")

</div>

Hello everyone! I’ve got a very simple code for now but somehow I’ve got a problem with it. There is my code: void fun() { gROOT-\>Reset(); TChain\* Bchain = new TChain("TauTree"); Bchain-\>Add("/…

---

## [How to renew my data during Geant4 simulation](https://root-forum.cern.ch/t/how-to-renew-my-data-during-geant4-simulation/38590)

<div class="topic-metadata">

**Author:** [@Lan](https://root-forum.cern.ch/u/Lan)\
**Replies:** 4\
**Last updated:** [March 29, 2020, 9:56am UTC](https://root-forum.cern.ch/t/how-to-renew-my-data-during-geant4-simulation/38590 "2020-03-29T09:56:25Z")

</div>

Hi, everyone! I’m a beginner of root and geant4, trying to use root to analysis my simulation results. I was using TBrowser b command to read the .root file created by Geant4 code. But every time I got a new result I ha…

---

## [Error while using TTree-\>GetEntry()](https://root-forum.cern.ch/t/error-while-using-ttree-getentry/38591)

<div class="topic-metadata">

**Author:** [@recaptcha19](https://root-forum.cern.ch/u/recaptcha19)\
**Replies:** 5\
**Last updated:** [March 28, 2020, 9:14am UTC](https://root-forum.cern.ch/t/error-while-using-ttree-getentry/38591 "2020-03-28T09:14:24Z")

</div>

I have a ROOT file which contains a tree as shown above. I tried to print the entries of a variable (for example, Px) using the following code. root\[0\] TFile f("ampt\_afterART.root"); root\[1\] TTree\* t; root\[2\] f.GetObj…

---

## [Error during Installation of Root in ubuntu system](https://root-forum.cern.ch/t/error-during-installation-of-root-in-ubuntu-system/38433)

<div class="topic-metadata">

**Author:** [@sv3048](https://root-forum.cern.ch/u/sv3048)\
**Replies:** 4\
**Last updated:** [March 28, 2020, 7:10am UTC](https://root-forum.cern.ch/t/error-during-installation-of-root-in-ubuntu-system/38433 "2020-03-28T07:10:58Z")

</div>

Hi, I am trying to install root in my ubuntu 19.04 system. After giving the command cmake --build . – -j1 I am getting this error. Can anyone pls suggest me how can I get rid of this error message, If have faced sam…

---

## [How to include errors in Graph](https://root-forum.cern.ch/t/how-to-include-errors-in-graph/38592)

<div class="topic-metadata">

**Author:** [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Replies:** 6\
**Last updated:** [March 27, 2020, 1:22pm UTC](https://root-forum.cern.ch/t/how-to-include-errors-in-graph/38592 "2020-03-27T13:22:12Z")

</div>

@couet @Wile\_E\_Coyote Hi ! I have drawn a histogram (Efficiency vs Energy). I got the value of efficiency by using formula Efficiency = (A/B) for different points in the graph. Now, I want to include the errors by us…

---

## [Can't open file TLorentzVector.h](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043)

<div class="topic-metadata">

**Author:** [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Replies:** 23\
**Last updated:** [March 25, 2020, 6:52pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043 "2020-03-25T18:52:16Z")

</div>

excuse me, i am trying to compile and run a C++ code using root and i get this error "can’t open TLorentzVector.h " However the TLorentzVector.h header exist in the include library file ! what should i do to fix this pro…

---

## [Using fftw3.h in root](https://root-forum.cern.ch/t/using-fftw3-h-in-root/38553)

<div class="topic-metadata">

**Author:** [@Waldi](https://root-forum.cern.ch/u/Waldi)\
**Replies:** 11\
**Last updated:** [March 25, 2020, 10:33am UTC](https://root-forum.cern.ch/t/using-fftw3-h-in-root/38553 "2020-03-25T10:33:42Z")

</div>

Hi! In my program test.C I use another program decov.C in which a deconvolution algorithm is implemented. This program is not written by myself but was part of the PhD of someone else, but during my thesis I could just …

---

## [Remote access of root files](https://root-forum.cern.ch/t/remote-access-of-root-files/38561)

<div class="topic-metadata">

**Author:** [@Erdrick](https://root-forum.cern.ch/u/Erdrick)\
**Replies:** 2\
**Last updated:** [March 24, 2020, 6:51pm UTC](https://root-forum.cern.ch/t/remote-access-of-root-files/38561 "2020-03-24T18:51:41Z")

</div>

ROOT Version: v6.14.06 Platform: Red Hat Enterprise Linux Server release 7.7 (Maipo) Compiler: gcc/8.3.0 I have root files stored on a remote host and want to use them for data analysis on my local machine. I am fol…

---

## [Sigmoid fit to efficiency plot](https://root-forum.cern.ch/t/sigmoid-fit-to-efficiency-plot/38512)

<div class="topic-metadata">

**Author:** [@evdv](https://root-forum.cern.ch/u/evdv)\
**Replies:** 9\
**Last updated:** [March 23, 2020, 12:02pm UTC](https://root-forum.cern.ch/t/sigmoid-fit-to-efficiency-plot/38512 "2020-03-23T12:02:34Z")

</div>

ROOT Version: 6.18/04 Platform: Linux Hi all! I have plotted efficiency curves, and now I want to fit sigmoid functions to them. I tried to fit a sigmoid function to the first efficiency curve (the red one), which is c…

---

## [Fitting TGraphAsymErrors, difference between "W" and "EX0"](https://root-forum.cern.ch/t/fitting-tgraphasymerrors-difference-between-w-and-ex0/38522)

<div class="topic-metadata">

**Author:** [@abcd](https://root-forum.cern.ch/u/abcd)\
**Replies:** 7\
**Last updated:** [March 23, 2020, 10:13am UTC](https://root-forum.cern.ch/t/fitting-tgraphasymerrors-difference-between-w-and-ex0/38522 "2020-03-23T10:13:59Z")

</div>

Hey, I am fitting a TGraphAsymErrors graph, and I was wondering what the difference was between adding “EX0” or adding “W” to the Fit function. If I understood it correctly, “W” means that the error bars are being ignore…

---

## [Incorrect Histogram Plot](https://root-forum.cern.ch/t/incorrect-histogram-plot/38480)

<div class="topic-metadata">

**Author:** [@chrisbgd](https://root-forum.cern.ch/u/chrisbgd)\
**Replies:** 13\
**Last updated:** [March 23, 2020, 9:20am UTC](https://root-forum.cern.ch/t/incorrect-histogram-plot/38480 "2020-03-23T09:20:59Z")

</div>

Hi All, While plotting a histogram from a data file, the last point is not coming out right! As you can see in the first image, the ‘y’ value for ‘x=5’ must be 25 but it comes out to be 50? Where’s the error? Also, wha…

---

## [Send histogram saved in a root file to friend](https://root-forum.cern.ch/t/send-histogram-saved-in-a-root-file-to-friend/38521)

<div class="topic-metadata">

**Author:** [@abcd](https://root-forum.cern.ch/u/abcd)\
**Replies:** 1\
**Last updated:** [March 22, 2020, 11:19am UTC](https://root-forum.cern.ch/t/send-histogram-saved-in-a-root-file-to-friend/38521 "2020-03-22T11:19:08Z")

</div>

Hi all, I have generated some histograms, which are stored in a root file. How can I save these histograms such that I can send them to a friend, so that he can use them in his code (i.e. without needing the data that wa…

---

## [Using a 2D array to plot with TGraph](https://root-forum.cern.ch/t/using-a-2d-array-to-plot-with-tgraph/38511)

<div class="topic-metadata">

**Author:** [@T\_man](https://root-forum.cern.ch/u/T_man)\
**Replies:** 6\
**Last updated:** [March 21, 2020, 2:12pm UTC](https://root-forum.cern.ch/t/using-a-2d-array-to-plot-with-tgraph/38511 "2020-03-21T14:12:06Z")

</div>

I am trying to plot a TGraph (Root cern) using data stored in a 2D array. I have defined my 2D array like this double\*\*meansig = new double\*\[NPIXAX\]; for(int i = 0; i \< NPIXAX; i++){ meansig\[i\] = new double\[NPIXAY\];} T…

---

## [Facing an error while running](https://root-forum.cern.ch/t/facing-an-error-while-running/38506)

<div class="topic-metadata">

**Author:** [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Replies:** 3\
**Last updated:** [March 20, 2020, 3:04pm UTC](https://root-forum.cern.ch/t/facing-an-error-while-running/38506 "2020-03-20T15:04:37Z")

</div>

I am getting some kind of error Please help me in resolving this error. Now, I am getting another error while running my overall code. error: no member named 'FindFixBin' in 'TGraph' std::cout \<\< g-\>Integral(g-\>Find…

---

## [Background fit (red line) is not shown on my graph](https://root-forum.cern.ch/t/background-fit-red-line-is-not-shown-on-my-graph/38502)

<div class="topic-metadata">

**Author:** [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Replies:** 1\
**Last updated:** [March 20, 2020, 12:50pm UTC](https://root-forum.cern.ch/t/background-fit-red-line-is-not-shown-on-my-graph/38502 "2020-03-20T12:50:26Z")

</div>

Just uploaded the text file and code. Background fit is not shown. If i have made some mistake then please look at it and correct me. eu\_gu\_1.txt (44.1 KB) fithisto.C (3.6 KB) Have a nice day!!! \_ROOT Version:\_6.14 P…

---

## [Problem in understanding the Complex code](https://root-forum.cern.ch/t/problem-in-understanding-the-complex-code/38486)

<div class="topic-metadata">

**Author:** [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Replies:** 6\
**Last updated:** [March 20, 2020, 11:22am UTC](https://root-forum.cern.ch/t/problem-in-understanding-the-complex-code/38486 "2020-03-20T11:22:48Z")

</div>

Hi, I am a newbie. I was reading a code for the background elimination but unable to understand the code properly. TSpectrum \*s = new TSpectrum(); for (i = 0; i \< nbins; i++) source\[i\]=back-\>GetBinContent(i + 1); s-\>…

---

## [Fitting a Linear Function](https://root-forum.cern.ch/t/fitting-a-linear-function/38478)

<div class="topic-metadata">

**Author:** [@chrisbgd](https://root-forum.cern.ch/u/chrisbgd)\
**Replies:** 7\
**Last updated:** [March 19, 2020, 12:13pm UTC](https://root-forum.cern.ch/t/fitting-a-linear-function/38478 "2020-03-19T12:13:42Z")

</div>

Hi All, I’m a ROOT newbie and trying to fit a simple linear function but the values of parameters and chi^2/ndf are not coming nice. What am I missing? I’ve uploaded the cpp file, data file and graph png below. Thanks…

---

## [Problem when installing root-6.18.04 in Mac](https://root-forum.cern.ch/t/problem-when-installing-root-6-18-04-in-mac/38436)

<div class="topic-metadata">

**Author:** [@JohnyBoy](https://root-forum.cern.ch/u/JohnyBoy)\
**Replies:** 2\
**Last updated:** [March 18, 2020, 11:09pm UTC](https://root-forum.cern.ch/t/problem-when-installing-root-6-18-04-in-mac/38436 "2020-03-18T23:09:59Z")

</div>

Hi everyone! I’m trying to install root-6.18.04 in a mac0S 10.10.5. However, after extracting the files using the command tar xfzv root\_v6.18.04.source.tar.gz I attempt to run the following: ./configure --all from t…

---

## [How to fill color in function?](https://root-forum.cern.ch/t/how-to-fill-color-in-function/38450)

<div class="topic-metadata">

**Author:** [@meu](https://root-forum.cern.ch/u/meu)\
**Replies:** 6\
**Last updated:** [March 18, 2020, 2:18pm UTC](https://root-forum.cern.ch/t/how-to-fill-color-in-function/38450 "2020-03-18T14:18:10Z")

</div>

Hi, Everyone, I want to fill color in function, then can ROOT do it? I have sample code making the gaussian. { TCanvas \*c=new TCanvas(); TF1 \*f=new TF1("f", "TMath::Gaus(x)", -6, 6); f-\>Draw(); return c; } F…

---

## [Usage of TFile Class](https://root-forum.cern.ch/t/usage-of-tfile-class/38453)

<div class="topic-metadata">

**Author:** [@recaptcha19](https://root-forum.cern.ch/u/recaptcha19)\
**Replies:** 1\
**Last updated:** [March 18, 2020, 12:54pm UTC](https://root-forum.cern.ch/t/usage-of-tfile-class/38453 "2020-03-18T12:54:09Z")

</div>

What is the difference between using TFile and TFile\* to perform input/output operations on files?

---

## [TGraph visualization through PyROOT](https://root-forum.cern.ch/t/tgraph-visualization-through-pyroot/38435)

<div class="topic-metadata">

**Author:** [@unimelb](https://root-forum.cern.ch/u/unimelb)\
**Replies:** 6\
**Last updated:** [March 18, 2020, 6:58am UTC](https://root-forum.cern.ch/t/tgraph-visualization-through-pyroot/38435 "2020-03-18T06:58:14Z")

</div>

Hi I have written a script in PyROOT through my python interpreter (PyCharm) which takes data from a TTree and creates a TGraph. The script runs smoothly however I no visualization of the graph appears, does anyone else …

---

## [How to calculate Efficiency error?](https://root-forum.cern.ch/t/how-to-calculate-efficiency-error/38425)

<div class="topic-metadata">

**Author:** [@meu](https://root-forum.cern.ch/u/meu)\
**Replies:** 4\
**Last updated:** [March 17, 2020, 12:53pm UTC](https://root-forum.cern.ch/t/how-to-calculate-efficiency-error/38425 "2020-03-17T12:53:31Z")

</div>

Hi, everyone I use one detector like Scintillator, Aerogel Cherenkov counter. When I get the total number of events N and the observed number of passed events k with cut condition, I can define efficiency. efficiency…

---

## [Create legend for histogram created in for loop](https://root-forum.cern.ch/t/create-legend-for-histogram-created-in-for-loop/38429)

<div class="topic-metadata">

**Author:** [@evdv](https://root-forum.cern.ch/u/evdv)\
**Replies:** 3\
**Last updated:** [March 16, 2020, 3:33pm UTC](https://root-forum.cern.ch/t/create-legend-for-histogram-created-in-for-loop/38429 "2020-03-16T15:33:57Z")

</div>

ROOT Version: 6.18/04 Platform: Linux I am trying to add a legend to a plot that consists of 3 histograms that were created in a for loop, they are called ratio\[i\], where i goes from 0 to 2, and refers to the elements …

---

## [Root Macro stops compiling](https://root-forum.cern.ch/t/root-macro-stops-compiling/38419)

<div class="topic-metadata">

**Author:** [@stef\_cg](https://root-forum.cern.ch/u/stef_cg)\
**Replies:** 5\
**Last updated:** [March 16, 2020, 1:48pm UTC](https://root-forum.cern.ch/t/root-macro-stops-compiling/38419 "2020-03-16T13:48:47Z")

</div>

Hello! I have a macro that takes a File A with X graphs inside of it, divides the graphs into groups of 10 and creates a graph that is the average of those 10 graphs, and then creates a new File B with X/10 graphs insid…

---

## [Loop over histograms, referring to file with %d](https://root-forum.cern.ch/t/loop-over-histograms-referring-to-file-with-d/38426)

<div class="topic-metadata">

**Author:** [@evdv](https://root-forum.cern.ch/u/evdv)\
**Replies:** 6\
**Last updated:** [March 16, 2020, 12:12pm UTC](https://root-forum.cern.ch/t/loop-over-histograms-referring-to-file-with-d/38426 "2020-03-16T12:12:50Z")

</div>

ROOT Version: 6.18/04 Platform: Linux I am trying to loop over different histograms in a rootfile and draw these histograms on the same plot. I have tried: ‘’’ void Function(); auto f = new TFile (“output.root”); s…

---

## [Setting precedence in CMakeList.txt](https://root-forum.cern.ch/t/setting-precedence-in-cmakelist-txt/36593)

<div class="topic-metadata">

**Author:** [@Xola](https://root-forum.cern.ch/u/Xola)\
**Replies:** 5\
**Last updated:** [March 16, 2020, 11:27am UTC](https://root-forum.cern.ch/t/setting-precedence-in-cmakelist-txt/36593 "2020-03-16T11:27:38Z")

</div>

Hi. So I have a project that I am trying to manipulate so that it compiles a copy of RooSimultaneous.cxx and RooSimultaneous.h from my source directory instead of going into the ROOT libraries. I have attached a copy o…

---

## [Cling results for ninja check-cling, FreeBSD 12-stable, llvm10, git HEAD](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373)

<div class="topic-metadata">

**Author:** [@rcarter](https://root-forum.cern.ch/u/rcarter)\
**Replies:** 9\
**Last updated:** [March 15, 2020, 9:56pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373 "2020-03-15T21:56:33Z")

</div>

Hi, I couldn’t get a build of ROOT pushed through, though I am quite far. I decided to first try to get cling up. After burning quite a bit of carbon I have cling and the tests built. However I am getting some failu…

---

## [Problem with fopen filepath nesting](https://root-forum.cern.ch/t/problem-with-fopen-filepath-nesting/38394)

<div class="topic-metadata">

**Author:** [@luiz\_iniciante](https://root-forum.cern.ch/u/luiz_iniciante)\
**Replies:** 6\
**Last updated:** [March 13, 2020, 12:13pm UTC](https://root-forum.cern.ch/t/problem-with-fopen-filepath-nesting/38394 "2020-03-13T12:13:30Z")

</div>

Hello Forum Members, I’m having trouble opening a csv file using ‘fopen’. When the file path reads as below, there are no problems opening the file “sample.csv”: FILE \*fp; char \*fname = "/home/dakar/topas/ mean/cav4MV\_…

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

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