# Newbie

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

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

---

## [TH1-\>FillRandom(...) doesn't work with linear function](https://root-forum.cern.ch/t/th1-fillrandom-doesnt-work-with-linear-function/40078)

<div class="topic-metadata">

**Author:** [@Laternenpfahl](https://root-forum.cern.ch/u/Laternenpfahl)\
**Replies:** 2\
**Last updated:** [June 25, 2020, 1:05pm UTC](https://root-forum.cern.ch/t/th1-fillrandom-doesnt-work-with-linear-function/40078 "2020-06-25T13:05:27Z")

</div>

Please read tips for efficient and successful posting and posting code \_ROOT Version: 6.20/02 \_Platform: Linux Compiler: Not Provided Hey there, I am currently trying to artificially contaminate histograms (made f…

---

## [Beginning with the ATLAS dataset](https://root-forum.cern.ch/t/beginning-with-the-atlas-dataset/40049)

<div class="topic-metadata">

**Author:** [@mmk](https://root-forum.cern.ch/u/mmk)\
**Replies:** 1\
**Last updated:** [June 23, 2020, 4:10pm UTC](https://root-forum.cern.ch/t/beginning-with-the-atlas-dataset/40049 "2020-06-23T16:10:38Z")

</div>

Hello, I’m trying to get started with Atlas dataset, using their git repository of code files fro analysis and plotting of data. I’m using these commands, I have only downloaded a few data/mc file (only for this partic…

---

## [Quantile of a TH1 using GetQuantiles()](https://root-forum.cern.ch/t/quantile-of-a-th1-using-getquantiles/39954)

<div class="topic-metadata">

**Author:** [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Replies:** 4\
**Last updated:** [June 23, 2020, 11:14am UTC](https://root-forum.cern.ch/t/quantile-of-a-th1-using-getquantiles/39954 "2020-06-23T11:14:31Z")

</div>

Dear, I’m trying to get the quantile value for 60%, and here is what I’m doing h = ROOT.TH1F(“h”,“demo quantiles”,100,-3,3) h.FillRandom(“gaus”,5000) prob=np.array(\[0.6\]) q=np.array(\[0.\]) print h.GetQuantiles(1,q,…

---

## [I don;t understand my error](https://root-forum.cern.ch/t/i-don-t-understand-my-error/40037)

<div class="topic-metadata">

**Author:** [@esh187](https://root-forum.cern.ch/u/esh187)\
**Replies:** 1\
**Last updated:** [June 23, 2020, 10:37am UTC](https://root-forum.cern.ch/t/i-don-t-understand-my-error/40037 "2020-06-23T10:37:51Z")

</div>

\_ I keep getting this error when I try to run a macro I made, what does it mean? The macro worked fine until yesterday it’s been acting up now for no reason I am very confused. ========================================…

---

## [Y-axis randomly resizes Problem](https://root-forum.cern.ch/t/y-axis-randomly-resizes-problem/40021)

<div class="topic-metadata">

**Author:** [@Abhinab\_Mukhopadhyay](https://root-forum.cern.ch/u/Abhinab_Mukhopadhyay)\
**Replies:** 2\
**Last updated:** [June 22, 2020, 6:25pm UTC](https://root-forum.cern.ch/t/y-axis-randomly-resizes-problem/40021 "2020-06-22T18:25:40Z")

</div>

ROOT Version: v6.18.04 Platform: Ubuntu 20.04 LTS Compiler: C/C++ Hi, so I am new to root and I am currently using it to extract data from file and plot as well as fit them in each separate canvas, I have the fit in l…

---

## [Missing energy using atlas dataset](https://root-forum.cern.ch/t/missing-energy-using-atlas-dataset/40023)

<div class="topic-metadata">

**Author:** [@mmk](https://root-forum.cern.ch/u/mmk)\
**Replies:** 5\
**Last updated:** [June 22, 2020, 8:00am UTC](https://root-forum.cern.ch/t/missing-energy-using-atlas-dataset/40023 "2020-06-22T08:00:56Z")

</div>

Hey there, I’m new to root framework, I’m trying to calculate missing transverse energy mET, using transverse momentum of particles in the final state. but I’ m not sure how to analyse after calculating mEt values als…

---

## [Compare two TLorentzVectors for equality with operator==](https://root-forum.cern.ch/t/compare-two-tlorentzvectors-for-equality-with-operator/40019)

<div class="topic-metadata">

**Author:** [@Y.S.Zhang](https://root-forum.cern.ch/u/Y.S.Zhang)\
**Replies:** 1\
**Last updated:** [June 22, 2020, 6:28am UTC](https://root-forum.cern.ch/t/compare-two-tlorentzvectors-for-equality-with-operator/40019 "2020-06-22T06:28:22Z")

</div>

Hi, Experts I am working on matching particles’ four-momenta. I find there is a member function of TLorentzVector and TVector3 called ==. I checked the source code. It returns a boolean by applying == to two double typ…

---

## [How to fill 2d histo with function?](https://root-forum.cern.ch/t/how-to-fill-2d-histo-with-function/39972)

<div class="topic-metadata">

**Author:** [@Va\_Findesiecle](https://root-forum.cern.ch/u/Va_Findesiecle)\
**Replies:** 1\
**Last updated:** [June 19, 2020, 9:01am UTC](https://root-forum.cern.ch/t/how-to-fill-2d-histo-with-function/39972 "2020-06-19T09:01:01Z")

</div>

Hello everyone, I have 2 TH2F histos, 1st one with data, 2nd one with background that I want to subtract from the data. After the second diagram has been fitted with function Double\_t fun2(Double\_t \*x, Double\_t \*par) {…

---

## [https://youtu.be/s9PTrWOnDy8](https://root-forum.cern.ch/t/https-youtu-be-s9ptrwondy8/39976)

<div class="topic-metadata">

**Author:** [@Rajat\_Aggarwal](https://root-forum.cern.ch/u/Rajat_Aggarwal)\
**Replies:** 1\
**Last updated:** [June 19, 2020, 6:15am UTC](https://root-forum.cern.ch/t/https-youtu-be-s9ptrwondy8/39976 "2020-06-19T06:15:23Z")

</div>

I tried installing root from the above tutorial for my windows 10. While checking it in command prompt, i am getting the following message, “Root is not recognised as an internal or external command, operable program or …

---

## [std::vector\<ROOT::RDF::RResultPtr\<TH1D\>\> th1v; slow writing many histograms](https://root-forum.cern.ch/t/std-vector-root-rresultptr-th1d-th1v-slow-writing-many-histograms/39940)

<div class="topic-metadata">

**Author:** [@david90](https://root-forum.cern.ch/u/david90)\
**Replies:** 3\
**Last updated:** [June 18, 2020, 9:27pm UTC](https://root-forum.cern.ch/t/std-vector-root-rresultptr-th1d-th1v-slow-writing-many-histograms/39940 "2020-06-18T21:27:44Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 6.16 Platform: Not Provided Compiler: Not Provided Hi everyone, I’m trying to use RDataframe for my analysis, I’m able to store m…

---

## [tree-\>Print() does not produce any output](https://root-forum.cern.ch/t/tree-print-does-not-produce-any-output/39971)

<div class="topic-metadata">

**Author:** [@mfglinux\_gmail](https://root-forum.cern.ch/u/mfglinux_gmail)\
**Replies:** 2\
**Last updated:** [June 18, 2020, 5:32pm UTC](https://root-forum.cern.ch/t/tree-print-does-not-produce-any-output/39971 "2020-06-18T17:32:21Z")

</div>

Hello I am not able to see the output of TTree::Print() inside the root interpreter. Does it mean I am filling the tree wrongly? You can have a look at the example tree that I uploaded: https://cernbox.cern.ch/index.p…

---

## [ROOT canvas don't show](https://root-forum.cern.ch/t/root-canvas-dont-show/39961)

<div class="topic-metadata">

**Author:** [@xdoll](https://root-forum.cern.ch/u/xdoll)\
**Replies:** 1\
**Last updated:** [June 18, 2020, 9:55am UTC](https://root-forum.cern.ch/t/root-canvas-dont-show/39961 "2020-06-18T09:55:32Z")

</div>

Hi! I have ROOT 6.20/04 and Ubuntu 20.04. I am trying to get familiar with ROOT but when I try to run simple examples like plotting something no canvas window shows up. If I type: TF1 f1(“f1”,“sin(x)/x”,0.,10.); f1.Dr…

---

## [How to use multiple algorithms with Minuit2?](https://root-forum.cern.ch/t/how-to-use-multiple-algorithms-with-minuit2/39907)

<div class="topic-metadata">

**Author:** [@eggsAndCoffee](https://root-forum.cern.ch/u/eggsAndCoffee)\
**Replies:** 5\
**Last updated:** [June 17, 2020, 3:36pm UTC](https://root-forum.cern.ch/t/how-to-use-multiple-algorithms-with-minuit2/39907 "2020-06-17T15:36:49Z")

</div>

I am trying to move from Minuit to Minuit2, following the example code listed at https://root.cern/doc/master/NumericalMinimization\_8C.html. However, it is unclear to me how the ROOT::Math::Minimizer class can be used to…

---

## [GetListOfKeys from a tree](https://root-forum.cern.ch/t/getlistofkeys-from-a-tree/39913)

<div class="topic-metadata">

**Author:** [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Replies:** 2\
**Last updated:** [June 15, 2020, 8:34am UTC](https://root-forum.cern.ch/t/getlistofkeys-from-a-tree/39913 "2020-06-15T08:34:41Z")

</div>

Dear, How do you get the name of variables in a tree using GetListOfKeys()? file = ROOT.TFile(Path+rootfile,“read”) #how to switch to the tree? rootkeys = file.GetListOfKeys() for key in rootkeys: #here I want to …

---

## [Downloading ROOT on Windows](https://root-forum.cern.ch/t/downloading-root-on-windows/39905)

<div class="topic-metadata">

**Author:** [@leon1122](https://root-forum.cern.ch/u/leon1122)\
**Replies:** 5\
**Last updated:** [June 15, 2020, 6:29am UTC](https://root-forum.cern.ch/t/downloading-root-on-windows/39905 "2020-06-15T06:29:08Z")

</div>

Hi, everyone. I’m completely new to ROOT and have only previously coded in Python through Jupyter Notebook. I’m trying to download the 6.20/04 production release on my Windows 10 laptop. The only download options for Win…

---

## [Erf fitting to ratio histogram](https://root-forum.cern.ch/t/erf-fitting-to-ratio-histogram/39870)

<div class="topic-metadata">

**Author:** [@Prya13](https://root-forum.cern.ch/u/Prya13)\
**Replies:** 8\
**Last updated:** [June 12, 2020, 3:11pm UTC](https://root-forum.cern.ch/t/erf-fitting-to-ratio-histogram/39870 "2020-06-12T15:11:05Z")

</div>

Dear all, I an trying to fit using erf function from TMath, and struggling very much not getting it quite right. Can I kindly have some help this fit? Here is the sample fitting macro that I have used: TF1 \*myFit1T1 =…

---

## [Plotting difference between data and fit on the same plot for Cs-137 spectrum](https://root-forum.cern.ch/t/plotting-difference-between-data-and-fit-on-the-same-plot-for-cs-137-spectrum/39869)

<div class="topic-metadata">

**Author:** [@Edward\_Finkelstein](https://root-forum.cern.ch/u/Edward_Finkelstein)\
**Replies:** 3\
**Last updated:** [June 11, 2020, 6:28pm UTC](https://root-forum.cern.ch/t/plotting-difference-between-data-and-fit-on-the-same-plot-for-cs-137-spectrum/39869 "2020-06-11T18:28:49Z")

</div>

Hello, I am trying to plot on the existing plot the difference between the fitted function and the histogram. I thought it was as simple as including the line h-\>Add(g,-1); but then my existing plot gets distorted. The …

---

## [JSROOT disable keyboard event processing](https://root-forum.cern.ch/t/jsroot-disable-keyboard-event-processing/39201)

<div class="topic-metadata">

**Author:** [@berserker](https://root-forum.cern.ch/u/berserker)\
**Replies:** 10\
**Last updated:** [June 11, 2020, 11:15am UTC](https://root-forum.cern.ch/t/jsroot-disable-keyboard-event-processing/39201 "2020-06-11T11:15:14Z")

</div>

Dear Experts! When I export a Jupyter Notebook to HTML slides (see e.g. \[1\]) and navigate across slides using keyboard arrows or PgUp/PgDn etc., these keyboard events are also processed by JSROOT plots and screw them u…

---

## [Fitting Cs137 spectrum from Compton scattering experiment](https://root-forum.cern.ch/t/fitting-cs137-spectrum-from-compton-scattering-experiment/39854)

<div class="topic-metadata">

**Author:** [@Edward\_Finkelstein](https://root-forum.cern.ch/u/Edward_Finkelstein)\
**Replies:** 4\
**Last updated:** [June 11, 2020, 8:38am UTC](https://root-forum.cern.ch/t/fitting-cs137-spectrum-from-compton-scattering-experiment/39854 "2020-06-11T08:38:40Z")

</div>

Compton.cxx (960 Bytes) Compton.txt (329.3 KB) Hello, I am struggling to fit data of Cs137 spectrum from Compton scattering experiment with a single function which is the sum of the gaussian for the signal and the poly…

---

## [Numerical minimization without having to define parameters globally](https://root-forum.cern.ch/t/numerical-minimization-without-having-to-define-parameters-globally/39868)

<div class="topic-metadata">

**Author:** [@Charlie\_Chen](https://root-forum.cern.ch/u/Charlie_Chen)\
**Replies:** 3\
**Last updated:** [June 11, 2020, 8:34am UTC](https://root-forum.cern.ch/t/numerical-minimization-without-having-to-define-parameters-globally/39868 "2020-06-11T08:34:09Z")

</div>

I have a list of events that for each event I have to perform numerical minimization on with a function that takes in several parameters which are constants that are used to define the function (see below code). Followin…

---

## [Looping over folders and opening each folder to access the root file](https://root-forum.cern.ch/t/looping-over-folders-and-opening-each-folder-to-access-the-root-file/39774)

<div class="topic-metadata">

**Author:** [@sur](https://root-forum.cern.ch/u/sur)\
**Replies:** 2\
**Last updated:** [June 10, 2020, 8:33am UTC](https://root-forum.cern.ch/t/looping-over-folders-and-opening-each-folder-to-access-the-root-file/39774 "2020-06-10T08:33:50Z")

</div>

Hi all, I am new to root and wanted to ask basic question of accessing the root files. I would like to loop over the folders and then opening each folder and then open the root file inside these folders. Also, I am usin…

---

## [Confusing error](https://root-forum.cern.ch/t/confusing-error/39843)

<div class="topic-metadata">

**Author:** [@jbmagallanes](https://root-forum.cern.ch/u/jbmagallanes)\
**Replies:** 6\
**Last updated:** [June 10, 2020, 8:29am UTC](https://root-forum.cern.ch/t/confusing-error/39843 "2020-06-10T08:29:02Z")

</div>

I tried running this program again by .x SampleAveragingCode01.C++ void SampleAveragingCode01() { static Int\_t nf = 10; auto can = new TCanvas("c1", "c1", 800,500); gStyle-\>SetOptStat(0); auto hh = new TH1F("hh", "…

---

## [Use of SetMaxTreeSize() in the following example](https://root-forum.cern.ch/t/use-of-setmaxtreesize-in-the-following-example/39837)

<div class="topic-metadata">

**Author:** [@hep\_1](https://root-forum.cern.ch/u/hep_1)\
**Replies:** 10\
**Last updated:** [June 9, 2020, 6:31pm UTC](https://root-forum.cern.ch/t/use-of-setmaxtreesize-in-the-following-example/39837 "2020-06-09T18:31:13Z")

</div>

In the sample code attached here, I am trying to incorporate my knowledge of root file and TTree. The next line of job is to use TChain to add the many root files that I obtain. I have a couple of doubts regarding how t…

---

## [Question: How to set defaut options on all root sessions](https://root-forum.cern.ch/t/question-how-to-set-defaut-options-on-all-root-sessions/39827)

<div class="topic-metadata">

**Author:** [@hvsouza](https://root-forum.cern.ch/u/hvsouza)\
**Replies:** 5\
**Last updated:** [June 9, 2020, 6:08pm UTC](https://root-forum.cern.ch/t/question-how-to-set-defaut-options-on-all-root-sessions/39827 "2020-06-09T18:08:38Z")

</div>

Hi there, Does anyone knows if there is a possibility to set a few options automatically in any root session? For example: I would like to always draw Ticks on X and Y as a default option. Without needing to use “gP…

---

## [\*\*\* Break \*\*\* segmentation violation when i run for loop using ifstream](https://root-forum.cern.ch/t/break-segmentation-violation-when-i-run-for-loop-using-ifstream/39833)

<div class="topic-metadata">

**Author:** [@Malek\_Mastafa](https://root-forum.cern.ch/u/Malek_Mastafa)\
**Replies:** 20\
**Last updated:** [June 9, 2020, 4:36pm UTC](https://root-forum.cern.ch/t/break-segmentation-violation-when-i-run-for-loop-using-ifstream/39833 "2020-06-09T16:36:39Z")

</div>

Hi every one This for loop is part of a big code, whenever i try to read data line by line from a text file i get \*\*\* Break \*\*\* segmentation violation this is the for loop const int size = 2304; Double\_t rel\[size\] …

---

## [Accesing members/methods descriptions defined in the header comments](https://root-forum.cern.ch/t/accesing-members-methods-descriptions-defined-in-the-header-comments/39849)

<div class="topic-metadata">

**Author:** [@mfglinux\_gmail](https://root-forum.cern.ch/u/mfglinux_gmail)\
**Replies:** 5\
**Last updated:** [June 9, 2020, 3:29pm UTC](https://root-forum.cern.ch/t/accesing-members-methods-descriptions-defined-in-the-header-comments/39849 "2020-06-09T15:29:46Z")

</div>

Hello I have some trees with classes mapped to branches. By now I have more variables defined that I can remember of. I like the reflection feature in ROOT that allows me to tabulate and get definitions of methods. I w…

---

## [When you don't know the range of the histogram](https://root-forum.cern.ch/t/when-you-dont-know-the-range-of-the-histogram/39835)

<div class="topic-metadata">

**Author:** [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Replies:** 2\
**Last updated:** [June 8, 2020, 11:02pm UTC](https://root-forum.cern.ch/t/when-you-dont-know-the-range-of-the-histogram/39835 "2020-06-08T23:02:11Z")

</div>

Dear, How can you define a TH1 without specifying the range of the x-axis, which should be by default equal to the last entries on the left and right of the histogram? Thanks!

---

## [Questions about TGMatrixLayout and how uniquely identifying each of an unknown number of buttons](https://root-forum.cern.ch/t/questions-about-tgmatrixlayout-and-how-uniquely-identifying-each-of-an-unknown-number-of-buttons/39818)

<div class="topic-metadata">

**Author:** [@rajliv](https://root-forum.cern.ch/u/rajliv)\
**Replies:** 3\
**Last updated:** [June 8, 2020, 9:25am UTC](https://root-forum.cern.ch/t/questions-about-tgmatrixlayout-and-how-uniquely-identifying-each-of-an-unknown-number-of-buttons/39818 "2020-06-08T09:25:50Z")

</div>

Hi I’m working with a project and have encountered a bit of a roadblock. This is not as much a technical problem as most of the threads here, but I hope that is ok. One part of the project is an object keeping track of…

---

## [Installing root with Conda](https://root-forum.cern.ch/t/installing-root-with-conda/39787)

<div class="topic-metadata">

**Author:** [@IP25](https://root-forum.cern.ch/u/IP25)\
**Replies:** 2\
**Last updated:** [June 8, 2020, 9:22am UTC](https://root-forum.cern.ch/t/installing-root-with-conda/39787 "2020-06-08T09:22:04Z")

</div>

Hi! I just installed https://repo.continuum.io/archive/Anaconda3-2020.02-Linux-x86\_64.sh. I need to install root as well. I used conda install -c conda-forge root But it is not installing it. It keeps again isntead. H…

---

## [Fatal Errors when running ROOT for the first time](https://root-forum.cern.ch/t/fatal-errors-when-running-root-for-the-first-time/39795)

<div class="topic-metadata">

**Author:** [@jjmosley](https://root-forum.cern.ch/u/jjmosley)\
**Replies:** 1\
**Last updated:** [June 8, 2020, 8:11am UTC](https://root-forum.cern.ch/t/fatal-errors-when-running-root-for-the-first-time/39795 "2020-06-08T08:11:14Z")

</div>

ROOT Version: 6.18.04 Platform: Windows 10 x64 Compiler: Visual Studio 2019 I’m a newbie setting up root for the first time. When I type root into windows command prompt this is what I get: input\_line\_3:37:10: fatal …

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

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