# Newbie

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

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

---

## [Problems configuring ROOT (Latest) for centos7 from cvmfs](https://root-forum.cern.ch/t/problems-configuring-root-latest-for-centos7-from-cvmfs/37158)

<div class="topic-metadata">

**Author:** [@Esteban\_Fullana\_Torr](https://root-forum.cern.ch/u/Esteban_Fullana_Torr)\
**Replies:** 2\
**Last updated:** [December 12, 2019, 9:45am UTC](https://root-forum.cern.ch/t/problems-configuring-root-latest-for-centos7-from-cvmfs/37158 "2019-12-12T09:45:11Z")

</div>

Dear experts, I am having troubles configuring ROOT from cvmfs, I am following the instructions here: thisisnotalinkbecauseapparentlynewuserscanonlyputtwolinksinaposthttps://root.cern.ch/how-setup-root-externals-afscv…

---

## [Print parameter of function (TF1)](https://root-forum.cern.ch/t/print-parameter-of-function-tf1/37155)

<div class="topic-metadata">

**Author:** [@theyellowdog](https://root-forum.cern.ch/u/theyellowdog)\
**Replies:** 1\
**Last updated:** [December 11, 2019, 7:10pm UTC](https://root-forum.cern.ch/t/print-parameter-of-function-tf1/37155 "2019-12-11T19:10:24Z")

</div>

I am try to print the parameters in python for a TF1 class. fsig = ROOT.TF1(“fsig”,“\[Constant\]\*TMath::Gaus(x,\[Mass\],\[Sigma\])”) fbkg = ROOT.TF1(“fbkg”,“\[Constant\]exp(-(\[a1\]x)/100.-\[a2\](x/100)(x/100))”) fmodel = ROOT.…

---

## [Projecting Tree to Histogram](https://root-forum.cern.ch/t/projecting-tree-to-histogram/37132)

<div class="topic-metadata">

**Author:** [@mcconn13](https://root-forum.cern.ch/u/mcconn13)\
**Replies:** 2\
**Last updated:** [December 10, 2019, 4:55pm UTC](https://root-forum.cern.ch/t/projecting-tree-to-histogram/37132 "2019-12-10T16:55:31Z")

</div>

Hello all, Being really new to ROOT I thought it best to post this here. I started with something basic (or so I thought) and got stuck. I have an ASCII text file that contains photon energy spectra for several radionu…

---

## [Making cuts on ntuple data](https://root-forum.cern.ch/t/making-cuts-on-ntuple-data/37121)

<div class="topic-metadata">

**Author:** [@luiz\_iniciante](https://root-forum.cern.ch/u/luiz_iniciante)\
**Replies:** 3\
**Last updated:** [December 10, 2019, 1:53am UTC](https://root-forum.cern.ch/t/making-cuts-on-ntuple-data/37121 "2019-12-10T01:53:25Z")

</div>

Hello Fellow Rooters, When plotting histograms, it’s easy to make cuts on ntuple data. However, extracting a subset of ntuple data is surprisingly more complex and one basically has to loop over all the data. The workm…

---

## [Saving canvas with fitted histogram to .gif file](https://root-forum.cern.ch/t/saving-canvas-with-fitted-histogram-to-gif-file/37094)

<div class="topic-metadata">

**Author:** [@fresh](https://root-forum.cern.ch/u/fresh)\
**Replies:** 7\
**Last updated:** [December 9, 2019, 10:07am UTC](https://root-forum.cern.ch/t/saving-canvas-with-fitted-histogram-to-gif-file/37094 "2019-12-09T10:07:13Z")

</div>

Hi Rooters! I have a canvas on which I have drawn a histogram. I have then fitted my histogram with a predefined function. I would now like to save the result to a .gif file. However, the fit is not shown. Here’s a sni…

---

## [Creating data files for practice](https://root-forum.cern.ch/t/creating-data-files-for-practice/37089)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 3\
**Last updated:** [December 9, 2019, 10:04am UTC](https://root-forum.cern.ch/t/creating-data-files-for-practice/37089 "2019-12-09T10:04:21Z")

</div>

Hello I’m a total newbie and I need data files for practising various root functions. Can anyone guide me on how to create root files? Edit: I mean how to create a random raw data file. I know how to install random dat…

---

## [Writing into, then drawing two-dimensional arrays from a TTree, with one dimension having variable length](https://root-forum.cern.ch/t/writing-into-then-drawing-two-dimensional-arrays-from-a-ttree-with-one-dimension-having-variable-length/37086)

<div class="topic-metadata">

**Author:** [@jwruss](https://root-forum.cern.ch/u/jwruss)\
**Replies:** 4\
**Last updated:** [December 8, 2019, 8:41pm UTC](https://root-forum.cern.ch/t/writing-into-then-drawing-two-dimensional-arrays-from-a-ttree-with-one-dimension-having-variable-length/37086 "2019-12-08T20:41:13Z")

</div>

As an intermediate step to creating some histograms using getVoltsAtDigitizerCuts.C (4.6 KB) I wrote the macro makeVoltsAtDigitizerFile.C (6.1 KB) to create a file from which to use TTree::Draw() from. Initially I ha…

---

## [3.6f in an histogram example](https://root-forum.cern.ch/t/3-6f-in-an-histogram-example/37114)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 1\
**Last updated:** [December 8, 2019, 7:03pm UTC](https://root-forum.cern.ch/t/3-6f-in-an-histogram-example/37114 "2019-12-08T19:03:21Z")

</div>

In the following snippet from an example of histogram random data filling, a value is mentioned as 3.6f, what does this mean? \_\_\_ Please read tips for efficient and successful posting and posting code ROOT Version: …

---

## [Function doesn't retrun object](https://root-forum.cern.ch/t/function-doesnt-retrun-object/37074)

<div class="topic-metadata">

**Author:** [@adrian\_bl](https://root-forum.cern.ch/u/adrian_bl)\
**Replies:** 1\
**Last updated:** [December 5, 2019, 3:30pm UTC](https://root-forum.cern.ch/t/function-doesnt-retrun-object/37074 "2019-12-05T15:30:16Z")

</div>

Hello there! I ran into a problem concerning void-functions in ROOT. I tried to create five directory files and add the same list with a histrogram in it to each of them. The tricky part there is, that the sampled entri…

---

## [How to plot Graph from text file](https://root-forum.cern.ch/t/how-to-plot-graph-from-text-file/37049)

<div class="topic-metadata">

**Author:** [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Replies:** 5\
**Last updated:** [December 4, 2019, 10:20am UTC](https://root-forum.cern.ch/t/how-to-plot-graph-from-text-file/37049 "2019-12-04T10:20:41Z")

</div>

I have a text file. data.txt (82 Bytes) . I save it in C:\\root\_v5.34.36\\macros. I want to plot Graph from that file but i am not successful. This is my macros file em.C (50 Bytes) . Who can help me resolve this problem? …

---

## [Exporting Tree Branch into an ASCII file](https://root-forum.cern.ch/t/exporting-tree-branch-into-an-ascii-file/37031)

<div class="topic-metadata">

**Author:** [@myless](https://root-forum.cern.ch/u/myless)\
**Replies:** 2\
**Last updated:** [December 3, 2019, 1:49pm UTC](https://root-forum.cern.ch/t/exporting-tree-branch-into-an-ascii-file/37031 "2019-12-03T13:49:47Z")

</div>

\_ROOT Version: 6.18/04 \_Platform: ArchLinux 64-Bit \_Compiler: linuxx8664gcc Hello, I have a question about TTree::Scan() or just Trees/branches in general. I have a Tree with many entries called “tree”. I would lik…

---

## [Changing default directory for accessing macros](https://root-forum.cern.ch/t/changing-default-directory-for-accessing-macros/37034)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 4\
**Last updated:** [December 3, 2019, 1:27pm UTC](https://root-forum.cern.ch/t/changing-default-directory-for-accessing-macros/37034 "2019-12-03T13:27:06Z")

</div>

I know that on executing any macro, root looks for the file in root/macros directory, how do you change that directory, let’s say for accessing tutorials? Please read tips for efficient and successful posting and posti…

---

## [Can't find $ROOTSYS directory](https://root-forum.cern.ch/t/cant-find-rootsys-directory/37013)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 6\
**Last updated:** [December 3, 2019, 8:07am UTC](https://root-forum.cern.ch/t/cant-find-rootsys-directory/37013 "2019-12-03T08:07:31Z")

</div>

I’ve been reading the root user guide and it mentions the directory $ROOTSYS many times but I can’t find it. Though I think it means the root folder we use as it mentions $ROOTSYS /bin , and $ROOTSYS /tutorials and all, …

---

## [Reading order of Documents for learning root](https://root-forum.cern.ch/t/reading-order-of-documents-for-learning-root/37014)

<div class="topic-metadata">

**Author:** [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Replies:** 2\
**Last updated:** [December 2, 2019, 10:20am UTC](https://root-forum.cern.ch/t/reading-order-of-documents-for-learning-root/37014 "2019-12-02T10:20:48Z")

</div>

I’m trying to learn root but there are just too many documents and its been very confusing in which order should I start reading. Sometimes I start a document, some parts require deep programming knowledge, sometimes I r…

---

## [Fill the histogram with mean=1 and sigma=2](https://root-forum.cern.ch/t/fill-the-histogram-with-mean-1-and-sigma-2/37021)

<div class="topic-metadata">

**Author:** [@theyellowdog](https://root-forum.cern.ch/u/theyellowdog)\
**Replies:** 1\
**Last updated:** [December 1, 2019, 9:08pm UTC](https://root-forum.cern.ch/t/fill-the-histogram-with-mean-1-and-sigma-2/37021 "2019-12-01T21:08:53Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Pyroot Compiler: Python I need to create 10000 Gaussian Random number with mean=1 and sigma=2. h1=ROOT.TH…

---

## [Multithreading ROOT project](https://root-forum.cern.ch/t/multithreading-root-project/37010)

<div class="topic-metadata">

**Author:** [@fresh](https://root-forum.cern.ch/u/fresh)\
**Replies:** 1\
**Last updated:** [November 29, 2019, 6:02pm UTC](https://root-forum.cern.ch/t/multithreading-root-project/37010 "2019-11-29T18:02:23Z")

</div>

Hi, I’m new to this forum so I didn’t know where to post this. I’m working on a C++ binary which creates and fills multiple TH1F histograms with a huge amount of entries. To speed things up, I decided to try multithread…

---

## [TTree::Branch not recognizing actual class in ROOT 6.18/04](https://root-forum.cern.ch/t/ttree-branch-not-recognizing-actual-class-in-root-6-18-04/36846)

<div class="topic-metadata">

**Author:** [@renyhp](https://root-forum.cern.ch/u/renyhp)\
**Replies:** 15\
**Last updated:** [November 29, 2019, 5:49pm UTC](https://root-forum.cern.ch/t/ttree-branch-not-recognizing-actual-class-in-root-6-18-04/36846 "2019-11-29T17:49:27Z")

</div>

Hello everyone, this is my code: test.C: #include "myevent.hh" #include "TROOT.h" #include \<iostream\> #include "TTree.h" using namespace std; void test() { gROOT-\>ProcessLine(".L myevent.hh+"); TTree\* tree = …

---

## [How to make and call (conditional statements) as an object?](https://root-forum.cern.ch/t/how-to-make-and-call-conditional-statements-as-an-object/36914)

<div class="topic-metadata">

**Author:** [@jbmagallanes](https://root-forum.cern.ch/u/jbmagallanes)\
**Replies:** 5\
**Last updated:** [November 28, 2019, 8:43pm UTC](https://root-forum.cern.ch/t/how-to-make-and-call-conditional-statements-as-an-object/36914 "2019-11-28T20:43:58Z")

</div>

this one, for example: TRandom3 r; Double\_t rdm = r.Rndm(); if (rdm \< 0.25) { f001\[i\]-\>SetParameter(3,gRandom-\>Gaus(0.0017,0.0008)); } else if (rdm \> 0.75) { f001\[i\]-\>SetParameter(3,gRandom-\>Gaus(0.0033,0.0008)); …

---

## [From plotting to Ntuples](https://root-forum.cern.ch/t/from-plotting-to-ntuples/36984)

<div class="topic-metadata">

**Author:** [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Replies:** 4\
**Last updated:** [November 28, 2019, 1:43pm UTC](https://root-forum.cern.ch/t/from-plotting-to-ntuples/36984 "2019-11-28T13:43:32Z")

</div>

Hi, I have a plotting script which make and fills TH1’s, and I want to change the TH1’s to Ntuples, so I can analyse the data easily, Is there a straight forward way to link the TH1’s to a TTree? Or are there any more …

---

## [Scaling the total sum of histograms made by stacking them in a THStack, and display the scaled total sum on the plot](https://root-forum.cern.ch/t/scaling-the-total-sum-of-histograms-made-by-stacking-them-in-a-thstack-and-display-the-scaled-total-sum-on-the-plot/36980)

<div class="topic-metadata">

**Author:** [@Abdualazem](https://root-forum.cern.ch/u/Abdualazem)\
**Replies:** 5\
**Last updated:** [November 28, 2019, 8:00am UTC](https://root-forum.cern.ch/t/scaling-the-total-sum-of-histograms-made-by-stacking-them-in-a-thstack-and-display-the-scaled-total-sum-on-the-plot/36980 "2019-11-28T08:00:23Z")

</div>

Dear root experts, I’m trying to scale a total sum of histograms that I made by using THStack. What I want to see is a scaled blue histogram instead of the current one. The ratio plot seems to work fine with the scalin…

---

## [Problem reading text file](https://root-forum.cern.ch/t/problem-reading-text-file/36972)

<div class="topic-metadata">

**Author:** [@Abh](https://root-forum.cern.ch/u/Abh)\
**Replies:** 6\
**Last updated:** [November 27, 2019, 1:23pm UTC](https://root-forum.cern.ch/t/problem-reading-text-file/36972 "2019-11-27T13:23:25Z")

</div>

Hello I have started writing codes. And facing problems somewhere. Here i want to read the text file that i have generated and to plot some histograms. I have followed some examples from internet. Here I only can create…

---

## [How to fit with non-function](https://root-forum.cern.ch/t/how-to-fit-with-non-function/36954)

<div class="topic-metadata">

**Author:** [@elawrie](https://root-forum.cern.ch/u/elawrie)\
**Replies:** 4\
**Last updated:** [November 26, 2019, 11:54am UTC](https://root-forum.cern.ch/t/how-to-fit-with-non-function/36954 "2019-11-26T11:54:51Z")

</div>

Can you please help. I want to fit (x,y) data points (with errors bars of delta\_x and delta\_y) with: f(x) = par(0) + par(1) \* F1 + par(2) \* F2 where F1 and F2 are functions, but they are complex itnegral functions, so…

---

## [Compiling issue](https://root-forum.cern.ch/t/compiling-issue/36957)

<div class="topic-metadata">

**Author:** [@pabloati](https://root-forum.cern.ch/u/pabloati)\
**Replies:** 1\
**Last updated:** [November 26, 2019, 9:51am UTC](https://root-forum.cern.ch/t/compiling-issue/36957 "2019-11-26T09:51:28Z")

</div>

Please read tips for efficient and successful posting and posting code \_ROOT Version: 6.18/04 - 2019-09-11 Platform: CentOS Linux 7 (Core) Compiler: g++ Hello, I have installed ROOT following the instruction, but wh…

---

## [Why is an "error: redefinition of \[variable\]" occurring every time I run code more than once?](https://root-forum.cern.ch/t/why-is-an-error-redefinition-of-variable-occurring-every-time-i-run-code-more-than-once/36869)

<div class="topic-metadata">

**Author:** [@asp211](https://root-forum.cern.ch/u/asp211)\
**Replies:** 2\
**Last updated:** [November 25, 2019, 2:07pm UTC](https://root-forum.cern.ch/t/why-is-an-error-redefinition-of-variable-occurring-every-time-i-run-code-more-than-once/36869 "2019-11-25T14:07:00Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 6.18 Platform: Mac OS X Text Editor: Visual Studio Code { #include \<iostream\> using namespace std; int x2, y; int…

---

## [Getting (x,y) for maximum value within specific range of graph](https://root-forum.cern.ch/t/getting-x-y-for-maximum-value-within-specific-range-of-graph/36926)

<div class="topic-metadata">

**Author:** [@schniefen](https://root-forum.cern.ch/u/schniefen)\
**Replies:** 4\
**Last updated:** [November 25, 2019, 11:32am UTC](https://root-forum.cern.ch/t/getting-x-y-for-maximum-value-within-specific-range-of-graph/36926 "2019-11-25T11:32:28Z")

</div>

There have been similar questions on the forum, but mostly in connection with histograms. Consider the attached picture. How could one find the point corresponding to this local maximum (see arrow)? Thanks!

---

## [Fitting graph and specifying label options](https://root-forum.cern.ch/t/fitting-graph-and-specifying-label-options/36917)

<div class="topic-metadata">

**Author:** [@schniefen](https://root-forum.cern.ch/u/schniefen)\
**Replies:** 10\
**Last updated:** [November 22, 2019, 3:38pm UTC](https://root-forum.cern.ch/t/fitting-graph-and-specifying-label-options/36917 "2019-11-22T15:38:33Z")

</div>

Consider the attached file. When trying to fit the graph with a polynomial of degree 1 (with the range specified in the graph), the fit turns out to be quite erroneous. What could be the reason for that? The code is very…

---

## [Is there a way to generate or update the default particle list found under $ROOTSYS/etc/pdg\_table.txt?](https://root-forum.cern.ch/t/is-there-a-way-to-generate-or-update-the-default-particle-list-found-under-rootsys-etc-pdg-table-txt/36918)

<div class="topic-metadata">

**Author:** [@makor](https://root-forum.cern.ch/u/makor)\
**Replies:** 2\
**Last updated:** [November 22, 2019, 12:58pm UTC](https://root-forum.cern.ch/t/is-there-a-way-to-generate-or-update-the-default-particle-list-found-under-rootsys-etc-pdg-table-txt/36918 "2019-11-22T12:58:20Z")

</div>

Dear Experts, I am currently trying to match some simulation output with PDG information. In order to achieve this I made use of the TDatabasePDG.cxx functionalities, however, I found out that the information encoded in…

---

## [How do I print specific data points?](https://root-forum.cern.ch/t/how-do-i-print-specific-data-points/36897)

<div class="topic-metadata">

**Author:** [@jbmagallanes](https://root-forum.cern.ch/u/jbmagallanes)\
**Replies:** 10\
**Last updated:** [November 21, 2019, 7:55pm UTC](https://root-forum.cern.ch/t/how-do-i-print-specific-data-points/36897 "2019-11-21T19:55:07Z")

</div>

I have this command in my code: av41-\>Print(); and this gives out: x\[0\]=6.23438e-06, y\[0\]=1.79687 x\[1\]=0.00249998, y\[1\]=0.00423207 x\[2\]=0.00499373, y\[2\]=0.00209039 x\[3\]=0.00748748, y\[3\]=0.00138589 x\[4\]=0.00998123, y\[…

---

## [How to shorten my program](https://root-forum.cern.ch/t/how-to-shorten-my-program/36882)

<div class="topic-metadata">

**Author:** [@jbmagallanes](https://root-forum.cern.ch/u/jbmagallanes)\
**Replies:** 13\
**Last updated:** [November 21, 2019, 7:04pm UTC](https://root-forum.cern.ch/t/how-to-shorten-my-program/36882 "2019-11-21T19:04:22Z")

</div>

hi guys, I need some help again I will be using the function below for several times like more than 50 times as I keep changing these 3 parameters: fpf\[i\]-\>SetParameter(4,61.0); fpf\[i\]-\>SetParameter(6,gRandom-\>Gaus(0…

---

## [Fisher distribution diverging where it shouldn't](https://root-forum.cern.ch/t/fisher-distribution-diverging-where-it-shouldnt/36853)

<div class="topic-metadata">

**Author:** [@Arianna](https://root-forum.cern.ch/u/Arianna)\
**Replies:** 3\
**Last updated:** [November 20, 2019, 10:05am UTC](https://root-forum.cern.ch/t/fisher-distribution-diverging-where-it-shouldnt/36853 "2019-11-20T10:05:07Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 5.34 Platform: Ubuntu Virtual Machine on Windows10 host Compiler: CINT/ROOT C/C++ Interpreter version 5.18.00 Hello, I’m trying t…

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

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