# Newbie

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

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

---

## [Overlying Histograms TH1F on TProfile](https://root-forum.cern.ch/t/overlying-histograms-th1f-on-tprofile/37633)

<div class="topic-metadata">

**Author:** [@sergio\_fernandez](https://root-forum.cern.ch/u/sergio_fernandez)\
**Replies:** 1\
**Last updated:** [January 20, 2020, 1:36pm UTC](https://root-forum.cern.ch/t/overlying-histograms-th1f-on-tprofile/37633 "2020-01-20T13:36:25Z")

</div>

Hi everyone I want to draw 3 different histograms with the same name TH1F inside 3 chains on one TProfile histogram. Only appears the canvas. #include "TFile.h" #include "TProfile.h" #include "TCanvas.h" #include "TDi…

---

## [Error on loading shared library](https://root-forum.cern.ch/t/error-on-loading-shared-library/37624)

<div class="topic-metadata">

**Author:** [@ydlawther](https://root-forum.cern.ch/u/ydlawther)\
**Replies:** 4\
**Last updated:** [January 18, 2020, 10:47am UTC](https://root-forum.cern.ch/t/error-on-loading-shared-library/37624 "2020-01-18T10:47:04Z")

</div>

I’m new to root and C++ and Linux… I have a MyClass.h and a MyClass.C file. If I try to type .x /Users/burial/Applications/root\_v6.18.04/MyClass.C I can successfully define MyClass\* t = new MyClass() But when I try…

---

## [Undeclared identifier error](https://root-forum.cern.ch/t/undeclared-identifier-error/37613)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 3\
**Last updated:** [January 17, 2020, 3:47pm UTC](https://root-forum.cern.ch/t/undeclared-identifier-error/37613 "2020-01-17T15:47:54Z")

</div>

Hello I’m getting an undeclared identifier error while trying to add two histograms. On running the program, canvas open and shuts instantly without showing any histogram nor any error. The error happens only while acce…

---

## [Wait function in root](https://root-forum.cern.ch/t/wait-function-in-root/37591)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 4\
**Last updated:** [January 17, 2020, 2:02pm UTC](https://root-forum.cern.ch/t/wait-function-in-root/37591 "2020-01-17T14:02:34Z")

</div>

How do you add a wait function in root? I tried sleep and delay functions from C++ but they don’t seem to be working. Please read tips for efficient and successful posting and posting code ROOT Version: 6.18 Platform…

---

## [Normalising a histogram directly](https://root-forum.cern.ch/t/normalising-a-histogram-directly/37614)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 1\
**Last updated:** [January 17, 2020, 1:59pm UTC](https://root-forum.cern.ch/t/normalising-a-histogram-directly/37614 "2020-01-17T13:59:55Z")

</div>

Hi I’ve been searching for a ways to normalize a histogram, however none of them are direct to normalize the data. However there exists a function DrawNormalized which plots normalized data. Shouldn’t we be able to extr…

---

## [Histogram operations](https://root-forum.cern.ch/t/histogram-operations/37611)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 1\
**Last updated:** [January 17, 2020, 11:14am UTC](https://root-forum.cern.ch/t/histogram-operations/37611 "2020-01-17T11:14:01Z")

</div>

I’m learning histogram operations currently, though for histograms to be used/plotted after the program has run, you create them as pointers. Though I think you can not perform operations on pointers for histograms. h1 a…

---

## [Environment variable not working](https://root-forum.cern.ch/t/environment-variable-not-working/37609)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 2\
**Last updated:** [January 17, 2020, 10:28am UTC](https://root-forum.cern.ch/t/environment-variable-not-working/37609 "2020-01-17T10:28:22Z")

</div>

Hi I have edited the environment variable to root\\bin but the root command is not working in cmd even though typing “root” in the directory root\\bin opens root. What is wrong? \_\_\_ Please read tips for efficient and…

---

## [Can't figure out the error](https://root-forum.cern.ch/t/cant-figure-out-the-error/37608)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 2\
**Last updated:** [January 17, 2020, 10:01am UTC](https://root-forum.cern.ch/t/cant-figure-out-the-error/37608 "2020-01-17T10:01:42Z")

</div>

Can someone help me to figure out what is wrong with this code? \_\_\_ Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided

---

## [Gaus generator for histograms](https://root-forum.cern.ch/t/gaus-generator-for-histograms/37590)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 1\
**Last updated:** [January 16, 2020, 10:51am UTC](https://root-forum.cern.ch/t/gaus-generator-for-histograms/37590 "2020-01-16T10:51:37Z")

</div>

How do you customize the mean and variance for a gauss function in hist.FillRandom(“gaus”,n\_fill)? my search led me to TRandom but I guess that Gaus is simply a num generator.\_\_\_ Please read tips for efficient and succ…

---

## [Error on opening root](https://root-forum.cern.ch/t/error-on-opening-root/37589)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 1\
**Last updated:** [January 16, 2020, 10:09am UTC](https://root-forum.cern.ch/t/error-on-opening-root/37589 "2020-01-16T10:09:24Z")

</div>

I’m getting the following error on executing the root application in root/bin. Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Not Provided Compiler: Not…

---

## [Understanding installation of Root](https://root-forum.cern.ch/t/understanding-installation-of-root/37588)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 1\
**Last updated:** [January 16, 2020, 10:08am UTC](https://root-forum.cern.ch/t/understanding-installation-of-root/37588 "2020-01-16T10:08:22Z")

</div>

I am installing root into my laptop. On the download links it mentions visual studio 2019 but I don’t understand what exactly does it mean. From what I know, visual studio is an IDE developed by Microsoft but is it neces…

---

## [Error messages displayed on opening root](https://root-forum.cern.ch/t/error-messages-displayed-on-opening-root/37578)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 1\
**Last updated:** [January 16, 2020, 8:00am UTC](https://root-forum.cern.ch/t/error-messages-displayed-on-opening-root/37578 "2020-01-16T08:00:05Z")

</div>

Hello I recently observed that when I open root through cmd, there are some error messages displayed before the program starts functioning. However, I don’t think that they pose any problem in the execution, I think I s…

---

## [How to keep root running after quitting sessions](https://root-forum.cern.ch/t/how-to-keep-root-running-after-quitting-sessions/37582)

<div class="topic-metadata">

**Author:** [@asp211](https://root-forum.cern.ch/u/asp211)\
**Replies:** 1\
**Last updated:** [January 16, 2020, 1:14am UTC](https://root-forum.cern.ch/t/how-to-keep-root-running-after-quitting-sessions/37582 "2020-01-16T01:14:28Z")

</div>

ROOT Version: 6.18/04 Platform: Mac OSX Compiler: VSCode When I initiate root, I do this: Open Mac Terminal Type cd Documents Type cd root2 (name of my root folder) Type source ./bin/thisroot.sh Type root At this…

---

## [Error when instaling to about 57%](https://root-forum.cern.ch/t/error-when-instaling-to-about-57/37540)

<div class="topic-metadata">

**Author:** [@Lym](https://root-forum.cern.ch/u/Lym)\
**Replies:** 6\
**Last updated:** [January 15, 2020, 8:00am UTC](https://root-forum.cern.ch/t/error-when-instaling-to-about-57/37540 "2020-01-15T08:00:58Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 6.18.04 Platform: Ubuntu18.04LTS Compiler: CMake Hello guys I meet some problem when installing the v6.18.04T I selected -Dall=…

---

## [Multiple root files in same canvas](https://root-forum.cern.ch/t/multiple-root-files-in-same-canvas/37498)

<div class="topic-metadata">

**Author:** [@A\_Kumar](https://root-forum.cern.ch/u/A_Kumar)\
**Replies:** 9\
**Last updated:** [January 14, 2020, 12:05pm UTC](https://root-forum.cern.ch/t/multiple-root-files-in-same-canvas/37498 "2020-01-14T12:05:00Z")

</div>

I have 4 root files (2 root files are generated from .C macro 1.root & 2.root which have x and y-axis value ) and the other two are histogram root files(geant1.rrot and geant2.root). The second part is causing some prob…

---

## [Incorrect values from array](https://root-forum.cern.ch/t/incorrect-values-from-array/37541)

<div class="topic-metadata">

**Author:** [@asp211](https://root-forum.cern.ch/u/asp211)\
**Replies:** 1\
**Last updated:** [January 13, 2020, 6:23am UTC](https://root-forum.cern.ch/t/incorrect-values-from-array/37541 "2020-01-13T06:23:12Z")

</div>

void MyCode(){ //data(# of points, # of dimensions) const int nBx = 24; const int nBy = 10; const int nBz = 5; const int nTotal = 39; char temp\_Bx\[500\]; sprintf(temp\_Bx,"BX\_BV.d…

---

## [Can't draw a user function](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286)

<div class="topic-metadata">

**Author:** [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Replies:** 7\
**Last updated:** [January 11, 2020, 9:01am UTC](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286 "2020-01-11T09:01:31Z")

</div>

I tried to do draw my function but it was error. { Double\_t myFunc(Double\_t x) { return x\*x+x+1.0 ; } TF1 \*f = new TF1("f", "myFunc(x)", 0, 100); f-\>Draw(); } This is a error. Who can help me resolve this pr…

---

## [Installation problems on Windows 10](https://root-forum.cern.ch/t/installation-problems-on-windows-10/33880)

<div class="topic-metadata">

**Author:** [@Jabberspocky](https://root-forum.cern.ch/u/Jabberspocky)\
**Replies:** 10\
**Last updated:** [January 9, 2020, 3:10pm UTC](https://root-forum.cern.ch/t/installation-problems-on-windows-10/33880 "2020-01-09T15:10:53Z")

</div>

I installed Visual Studio 2019 from https://visualstudio.microsoft.com/downloads/ . I didn’t add any workloads. I installed root\_v6.16.00.win32.vc15.exe from https://root.cern.ch/content/release-61600 . My computer runs…

---

## [Plotting the difference between a graph and the fitting function](https://root-forum.cern.ch/t/plotting-the-difference-between-a-graph-and-the-fitting-function/36393)

<div class="topic-metadata">

**Author:** [@marcousp](https://root-forum.cern.ch/u/marcousp)\
**Replies:** 7\
**Last updated:** [January 9, 2020, 12:36pm UTC](https://root-forum.cern.ch/t/plotting-the-difference-between-a-graph-and-the-fitting-function/36393 "2020-01-09T12:36:28Z")

</div>

Hello, I’m a ROOT newbie (and computing newbie in general). I don’t know the proper terminology to explain what I want to do, but it’s the following: Let’s say I have a plot of a fitted graph with error bars. I want to …

---

## [Normalization of RooHistPdf](https://root-forum.cern.ch/t/normalization-of-roohistpdf/37401)

<div class="topic-metadata">

**Author:** [@ilam](https://root-forum.cern.ch/u/ilam)\
**Replies:** 2\
**Last updated:** [January 8, 2020, 11:05pm UTC](https://root-forum.cern.ch/t/normalization-of-roohistpdf/37401 "2020-01-08T23:05:36Z")

</div>

Hi everyone, Happy New Year 2020! I created a RooHistPdf by passing a TH1 object to a RooDataHist and then using the RooDataHist to create a RooHistPdf. I am curious about 1) how the normalization is calculated in this…

---

## [What seems to be the problem with this macro for plotting data points from two arrays?](https://root-forum.cern.ch/t/what-seems-to-be-the-problem-with-this-macro-for-plotting-data-points-from-two-arrays/37482)

<div class="topic-metadata">

**Author:** [@hep\_1](https://root-forum.cern.ch/u/hep_1)\
**Replies:** 2\
**Last updated:** [January 8, 2020, 4:21pm UTC](https://root-forum.cern.ch/t/what-seems-to-be-the-problem-with-this-macro-for-plotting-data-points-from-two-arrays/37482 "2020-01-08T16:21:18Z")

</div>

In the macro I have attached below, what I intend to do is calculate value of pi using monte-carlo simulation for various values of “n”. Currently, I have five different values of n and it will give me five different val…

---

## [Where are errors in my file?](https://root-forum.cern.ch/t/where-are-errors-in-my-file/37473)

<div class="topic-metadata">

**Author:** [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Replies:** 7\
**Last updated:** [January 8, 2020, 2:49pm UTC](https://root-forum.cern.ch/t/where-are-errors-in-my-file/37473 "2020-01-08T14:49:19Z")

</div>

I can not run my file. I dont know where are errors in my file. Who can help me, please? TGraphAsymmErrors.C (922 Bytes) This is a error notification. ROOT Version: 5.34 Platform: Win 10 Compiler: Not Provided

---

## [Convertying pyroot TFile in memory to c++ TFile](https://root-forum.cern.ch/t/convertying-pyroot-tfile-in-memory-to-c-tfile/37285)

<div class="topic-metadata">

**Author:** [@jss](https://root-forum.cern.ch/u/jss)\
**Replies:** 10\
**Last updated:** [January 7, 2020, 6:30pm UTC](https://root-forum.cern.ch/t/convertying-pyroot-tfile-in-memory-to-c-tfile/37285 "2020-01-07T18:30:00Z")

</div>

Hi everyone, This may be some wishful thinking, but I’m wondering if there is a way to convert at pyroot TFile in memory to a c++ TFile in memory so I can pass it from python to a c++ function I have wrapped. I’ve made …

---

## [RDataFrame - Read 3D array from TTree branch](https://root-forum.cern.ch/t/rdataframe-read-3d-array-from-ttree-branch/37390)

<div class="topic-metadata">

**Author:** [@Reik](https://root-forum.cern.ch/u/Reik)\
**Replies:** 6\
**Last updated:** [January 7, 2020, 5:46pm UTC](https://root-forum.cern.ch/t/rdataframe-read-3d-array-from-ttree-branch/37390 "2020-01-07T17:46:09Z")

</div>

Is it possible to use RDataFrame in PyROOT to read 3D(or more dimensional) arrays from a TTree branch? I know I can write 3D arrays - #include "TFile.h" #include "TTree.h" #include "TBranch.h" void multimulti() { …

---

## [Rerunning a macro error and recommendation for a bug-free ROOT version](https://root-forum.cern.ch/t/rerunning-a-macro-error-and-recommendation-for-a-bug-free-root-version/36950)

<div class="topic-metadata">

**Author:** [@hep\_1](https://root-forum.cern.ch/u/hep_1)\
**Replies:** 14\
**Last updated:** [January 7, 2020, 4:09pm UTC](https://root-forum.cern.ch/t/rerunning-a-macro-error-and-recommendation-for-a-bug-free-root-version/36950 "2020-01-07T16:09:25Z")

</div>

Hi, it seems like this question has been asked multiple times, but I have one additional question. I was learning about histograms in ROOT, and wrote a simple macro that generates a gaussian histogram by randomly samplin…

---

## [Gaussian fitting of multiple peaks using TSpectrum](https://root-forum.cern.ch/t/gaussian-fitting-of-multiple-peaks-using-tspectrum/37422)

<div class="topic-metadata">

**Author:** [@A\_Kumar](https://root-forum.cern.ch/u/A_Kumar)\
**Replies:** 14\
**Last updated:** [January 7, 2020, 12:35pm UTC](https://root-forum.cern.ch/t/gaussian-fitting-of-multiple-peaks-using-tspectrum/37422 "2020-01-07T12:35:48Z")

</div>

Need Help ! Can someone provide the demo example of gaussian fitting of multiple peaks using TSpectrum class generated from .tex file Please read tips for efficient and successful posting and posting code ROOT Version…

---

## [How to find ex and ey in for error bar](https://root-forum.cern.ch/t/how-to-find-ex-and-ey-in-for-error-bar/37426)

<div class="topic-metadata">

**Author:** [@Abh](https://root-forum.cern.ch/u/Abh)\
**Replies:** 9\
**Last updated:** [January 4, 2020, 3:36pm UTC](https://root-forum.cern.ch/t/how-to-find-ex-and-ey-in-for-error-bar/37426 "2020-01-04T15:36:39Z")

</div>

HI ! I am plotting graphs with error bars. I am following examples from internet. But I can not understand how to get the ex value and ey value to have the bars. I have given some of my codes here . Thanks

---

## [Dealing with missing values in RDataFrame(CSV)](https://root-forum.cern.ch/t/dealing-with-missing-values-in-rdataframe-csv/37362)

<div class="topic-metadata">

**Author:** [@marty1885](https://root-forum.cern.ch/u/marty1885)\
**Replies:** 7\
**Last updated:** [January 7, 2020, 10:44am UTC](https://root-forum.cern.ch/t/dealing-with-missing-values-in-rdataframe-csv/37362 "2020-01-07T10:44:50Z")

</div>

Hi, what’s the proper way to deal with missing values in a RDataFrame? For example, consider the training data if the Tianic dataset. Even though ROOT thinks the column Age is a number, trying to plot a histogram of Age …

---

## [Error in fitting function of three variables](https://root-forum.cern.ch/t/error-in-fitting-function-of-three-variables/37437)

<div class="topic-metadata">

**Author:** [@asp211](https://root-forum.cern.ch/u/asp211)\
**Replies:** 4\
**Last updated:** [January 7, 2020, 4:32am UTC](https://root-forum.cern.ch/t/error-in-fitting-function-of-three-variables/37437 "2020-01-07T04:32:25Z")

</div>

void MyFitCode(){ //data(# of points, # of dimensions) ROOT::Fit::BinData data(5,3); Double\_t coor1\[3\] = {1,2,3}; Double\_t coor2\[3\] = {1,-2,1}; Double\_t coor3\[3\] = {2,7,3}; Double\_t coor4\[3\] = {3,…

---

## [Monte-carlo simulation of pi in root](https://root-forum.cern.ch/t/monte-carlo-simulation-of-pi-in-root/37382)

<div class="topic-metadata">

**Author:** [@hep\_1](https://root-forum.cern.ch/u/hep_1)\
**Replies:** 11\
**Last updated:** [January 7, 2020, 3:13am UTC](https://root-forum.cern.ch/t/monte-carlo-simulation-of-pi-in-root/37382 "2020-01-07T03:13:40Z")

</div>

In the macro that I have attached below, I am trying to use TRandom3 to generate random numbers and then do the usual monte-carlo simulation of pi. My objective is to try and do that for different values on nTotal in ord…

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

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