# Newbie

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

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

---

## [Building custom interpreter in ROOT](https://root-forum.cern.ch/t/building-custom-interpreter-in-root/52988)

<div class="topic-metadata">

**Author:** [@salz-root](https://root-forum.cern.ch/u/salz-root)\
**Replies:** 14\
**Last updated:** [February 28, 2023, 3:10pm UTC](https://root-forum.cern.ch/t/building-custom-interpreter-in-root/52988 "2023-02-28T15:10:14Z")

</div>

Hi, We used ‘custom CINT’ (CINT built with our proprietary compiled functions) many years ago with older versions of linux (Ubuntu 12.x and earlier). We are now moving to Ubuntu 22.x and would like to similarly build a …

---

## [Adding statistics in plot from ascii file without fitting](https://root-forum.cern.ch/t/adding-statistics-in-plot-from-ascii-file-without-fitting/53602)

<div class="topic-metadata">

**Author:** [@gdash](https://root-forum.cern.ch/u/gdash)\
**Replies:** 13\
**Last updated:** [February 28, 2023, 10:36am UTC](https://root-forum.cern.ch/t/adding-statistics-in-plot-from-ascii-file-without-fitting/53602 "2023-02-28T10:36:26Z")

</div>

I have a .txt file with two columns. I tried to put one column in x axis and and another in y axis and plot x vs y. Now I want to show the statistics in the plot without fitting it. How can I do so. Here is what I have …

---

## [Plot an overlay histogram from multiple .txt files](https://root-forum.cern.ch/t/plot-an-overlay-histogram-from-multiple-txt-files/53813)

<div class="topic-metadata">

**Author:** [@gdash](https://root-forum.cern.ch/u/gdash)\
**Replies:** 3\
**Last updated:** [February 28, 2023, 10:30am UTC](https://root-forum.cern.ch/t/plot-an-overlay-histogram-from-multiple-txt-files/53813 "2023-02-28T10:30:51Z")

</div>

Hi, I was trying to plot a histogram from 5 text files having two columns each. The first column is time in order of nanoseconds and second column is number of events. I want an overlay plot of 5 different histograms. I…

---

## [Look at every n-th event](https://root-forum.cern.ch/t/look-at-every-n-th-event/53798)

<div class="topic-metadata">

**Author:** [@beg1nner](https://root-forum.cern.ch/u/beg1nner)\
**Replies:** 2\
**Last updated:** [February 27, 2023, 7:12pm UTC](https://root-forum.cern.ch/t/look-at-every-n-th-event/53798 "2023-02-27T19:12:17Z")

</div>

Dear experts, I am wondering if it is possible to somehow look at every 10th event after particular cut using RDataFrame? What I basically want to happen is having some pT cut and if pT is more than 45, then look at on…

---

## [TMVA-Wrong Number of Entries w.r.t Inputs](https://root-forum.cern.ch/t/tmva-wrong-number-of-entries-w-r-t-inputs/53732)

<div class="topic-metadata">

**Author:** [@Threshic](https://root-forum.cern.ch/u/Threshic)\
**Replies:** 4\
**Last updated:** [February 27, 2023, 4:31pm UTC](https://root-forum.cern.ch/t/tmva-wrong-number-of-entries-w-r-t-inputs/53732 "2023-02-27T16:31:52Z")

</div>

\_ROOT Version: 6.24.06 \_Platform: centos7.6 Compiler: Not Provided Hello everyone, I am currently using the tmva framework to build a BDT. I will explain in two parts : one version that works, another that does not…

---

## [Error bars are not clear](https://root-forum.cern.ch/t/error-bars-are-not-clear/53793)

<div class="topic-metadata">

**Author:** [@Dil](https://root-forum.cern.ch/u/Dil)\
**Replies:** 3\
**Last updated:** [February 27, 2023, 8:57am UTC](https://root-forum.cern.ch/t/error-bars-are-not-clear/53793 "2023-02-27T08:57:02Z")

</div>

Hello Experts, I’m trying to add the error bars to my histogram. But I do see only the squares with black dot. I have weighed histogram by model.Applied sumW2 option before filling the histogram.(At this stage also I s…

---

## [How can I change the z-axis range of a 2d graph](https://root-forum.cern.ch/t/how-can-i-change-the-z-axis-range-of-a-2d-graph/53783)

<div class="topic-metadata">

**Author:** [@mbl1230](https://root-forum.cern.ch/u/mbl1230)\
**Replies:** 2\
**Last updated:** [February 26, 2023, 4:10pm UTC](https://root-forum.cern.ch/t/how-can-i-change-the-z-axis-range-of-a-2d-graph/53783 "2023-02-26T16:10:56Z")

</div>

I want to plot a number of 3d curves using TGraph2D since based on searching the forum I found that MultiGraph doesn’t work for 3d curves. I have been able to plot each curve in the same canvas, but the x/y/z plot range…

---

## [Including Libraries to make macros in c++](https://root-forum.cern.ch/t/including-libraries-to-make-macros-in-c/53778)

<div class="topic-metadata">

**Author:** [@ishanpatel](https://root-forum.cern.ch/u/ishanpatel)\
**Replies:** 2\
**Last updated:** [February 25, 2023, 8:24pm UTC](https://root-forum.cern.ch/t/including-libraries-to-make-macros-in-c/53778 "2023-02-25T20:24:04Z")

</div>

How do I get #includ “TH1F.h” to run in my macro. It says that the file is not found. Do I have to download it separately? I already have root installed and I thought that the libraries are all installed when that happen…

---

## [Secondary axis](https://root-forum.cern.ch/t/secondary-axis/53775)

<div class="topic-metadata">

**Author:** [@Basharat](https://root-forum.cern.ch/u/Basharat)\
**Replies:** 2\
**Last updated:** [February 25, 2023, 4:14pm UTC](https://root-forum.cern.ch/t/secondary-axis/53775 "2023-02-25T16:14:49Z")

</div>

How to plot a second y-axis on the right? Or a secondary x-axis? I can do it in matplotlib, but I don’t see any straightforward option in ROOT. Please help.

---

## [Linking TPythia8 with root](https://root-forum.cern.ch/t/linking-tpythia8-with-root/53736)

<div class="topic-metadata">

**Author:** [@Mango](https://root-forum.cern.ch/u/Mango)\
**Replies:** 5\
**Last updated:** [February 24, 2023, 9:17pm UTC](https://root-forum.cern.ch/t/linking-tpythia8-with-root/53736 "2023-02-24T21:17:05Z")

</div>

Hi all! I am trying to test out the root tutorial: pythiaExample.C using TPythia8.h instead of TPythia6.h. When I try to load and execute in root prompt it returns: /path/to/pythia8.C:2:10 fatal error: ‘TPythia8.h’ file…

---

## [Problem in plotting from text file using TGraph Err](https://root-forum.cern.ch/t/problem-in-plotting-from-text-file-using-tgraph-err/53627)

<div class="topic-metadata">

**Author:** [@gini](https://root-forum.cern.ch/u/gini)\
**Replies:** 11\
**Last updated:** [February 23, 2023, 9:52am UTC](https://root-forum.cern.ch/t/problem-in-plotting-from-text-file-using-tgraph-err/53627 "2023-02-23T09:52:46Z")

</div>

Hi, I want to plot a TGRaph with errors by reading the x, y and the corresponding error of data points from a text file of 100 entries. Unfortunatly I am not able to plot it correctly and I dont undertant what is the pr…

---

## [Manipulating Histogram Data and Fill in a New Histogram](https://root-forum.cern.ch/t/manipulating-histogram-data-and-fill-in-a-new-histogram/53742)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 2\
**Last updated:** [February 23, 2023, 7:54am UTC](https://root-forum.cern.ch/t/manipulating-histogram-data-and-fill-in-a-new-histogram/53742 "2023-02-23T07:54:24Z")

</div>

I have a histogram in a ROOT file whose x-axis is channel number and y-axis is number of hits. I am trying to divide number of hits by total entries of a histogram and plot this hitrate in new histogram where x-axis is c…

---

## [Best way to get the leading and subleading photons in a prompt photon process](https://root-forum.cern.ch/t/best-way-to-get-the-leading-and-subleading-photons-in-a-prompt-photon-process/53664)

<div class="topic-metadata">

**Author:** [@Raseeb\_Haroon](https://root-forum.cern.ch/u/Raseeb_Haroon)\
**Replies:** 2\
**Last updated:** [February 23, 2023, 4:51am UTC](https://root-forum.cern.ch/t/best-way-to-get-the-leading-and-subleading-photons-in-a-prompt-photon-process/53664 "2023-02-23T04:51:54Z")

</div>

I am using Pythia8 to generate prompt photon processes. I am sure what is the way and if there are better tools within root itself to sort photons with the 3 highest pT and Energies for each event. Any help in the right …

---

## [Saving an Array to a Root File](https://root-forum.cern.ch/t/saving-an-array-to-a-root-file/53723)

<div class="topic-metadata">

**Author:** [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Replies:** 3\
**Last updated:** [February 23, 2023, 12:23am UTC](https://root-forum.cern.ch/t/saving-an-array-to-a-root-file/53723 "2023-02-23T00:23:29Z")

</div>

Hello all, I have a macro that fits hundreds of histograms. I would like to take the mean of each fit and use it in a separate macro. The most straightforward way that I can think of is to: Create an array: Double\_t m…

---

## [Repositioning Stat Box for a Fit to TMultiGraph](https://root-forum.cern.ch/t/repositioning-stat-box-for-a-fit-to-tmultigraph/51381)

<div class="topic-metadata">

**Author:** [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Replies:** 15\
**Last updated:** [February 22, 2023, 7:50am UTC](https://root-forum.cern.ch/t/repositioning-stat-box-for-a-fit-to-tmultigraph/51381 "2023-02-22T07:50:49Z")

</div>

Hello All, I am trying to figure out how to move the stat box for for a fit to a TMultiGraph plot. The following is my attempt: gStyle-\>SetOptFit(1); TMultiGraph\* multiGraph5 = new TMultiGraph(); …

---

## [How to get Chi squared values for a fit](https://root-forum.cern.ch/t/how-to-get-chi-squared-values-for-a-fit/53701)

<div class="topic-metadata">

**Author:** [@Subhu18](https://root-forum.cern.ch/u/Subhu18)\
**Replies:** 3\
**Last updated:** [February 21, 2023, 3:23pm UTC](https://root-forum.cern.ch/t/how-to-get-chi-squared-values-for-a-fit/53701 "2023-02-21T15:23:31Z")

</div>

I am fitting a gaussian to the data, then in order to see that if mt fit is good or bad, what code I should use to get Chi squared value? roomodel.cpp (1.4 KB) you might not be able to execute it as you do not have tha…

---

## [Bad filling in a RooPlot](https://root-forum.cern.ch/t/bad-filling-in-a-rooplot/53632)

<div class="topic-metadata">

**Author:** [@henrique\_legoinha](https://root-forum.cern.ch/u/henrique_legoinha)\
**Replies:** 1\
**Last updated:** [February 21, 2023, 2:28pm UTC](https://root-forum.cern.ch/t/bad-filling-in-a-rooplot/53632 "2023-02-21T14:28:57Z")

</div>

model-\>plotOn(frame, Name(Form("erfc%d\_%s",\_count,pdf.Data())) , Components(Form("erfc%d\_",\_count)), Precision(1e-6), DrawOption("LF"), FillColor(kGreen+4), LineStyle(1), LineColor(kGreen+4), LineWidth(2)); This line(o…

---

## [Loss of information in root file from a pyROOT manipulation prevent me to use uproot (tree.show())](https://root-forum.cern.ch/t/loss-of-information-in-root-file-from-a-pyroot-manipulation-prevent-me-to-use-uproot-tree-show/53628)

<div class="topic-metadata">

**Author:** [@TristanM](https://root-forum.cern.ch/u/TristanM)\
**Replies:** 2\
**Last updated:** [February 21, 2023, 2:27pm UTC](https://root-forum.cern.ch/t/loss-of-information-in-root-file-from-a-pyroot-manipulation-prevent-me-to-use-uproot-tree-show/53628 "2023-02-21T14:27:17Z")

</div>

Hello ROOT expert, I am facing a strange issue, from ROOT files I have build with a Python script based on pyROOT to add sWeights on former ROOT files. You can found there the script in charge of the sFit: FitMass-Run1…

---

## [Problem running ROOT on Windows after installation](https://root-forum.cern.ch/t/problem-running-root-on-windows-after-installation/53713)

<div class="topic-metadata">

**Author:** [@Down](https://root-forum.cern.ch/u/Down)\
**Replies:** 2\
**Last updated:** [February 21, 2023, 11:50am UTC](https://root-forum.cern.ch/t/problem-running-root-on-windows-after-installation/53713 "2023-02-21T11:50:42Z")

</div>

ROOT Version: v6.28.00 Platform: Windows 10 Compiler: Visual Studio 2022 Hi, I’ve tried to install ROOT using the Windows 10 x64 .exe provided for the latest version. I did install beforehand Cmake and Visual Studio …

---

## [Crash due to uncleaned variables?](https://root-forum.cern.ch/t/crash-due-to-uncleaned-variables/53708)

<div class="topic-metadata">

**Author:** [@Stefano\_John](https://root-forum.cern.ch/u/Stefano_John)\
**Replies:** 8\
**Last updated:** [February 21, 2023, 9:35am UTC](https://root-forum.cern.ch/t/crash-due-to-uncleaned-variables/53708 "2023-02-21T09:35:39Z")

</div>

Hi guys, sorry for still newbie questions but, I think, I will never be friend of this software. However, I made a code that keeps a of root file, extract values from it and, after making stuff, it write them on anothe…

---

## [Making histogram from multiple text files](https://root-forum.cern.ch/t/making-histogram-from-multiple-text-files/53695)

<div class="topic-metadata">

**Author:** [@Mona](https://root-forum.cern.ch/u/Mona)\
**Replies:** 1\
**Last updated:** [February 20, 2023, 2:46pm UTC](https://root-forum.cern.ch/t/making-histogram-from-multiple-text-files/53695 "2023-02-20T14:46:10Z")

</div>

Can someone please let me know how can I make a histogram from multiple data files? For one data file with one column only I am doing this: void Only\_one\_file(){ TH1F \*h = new TH1F(“h”, “histogram”,1000,5.,9.); ifstr…

---

## [Making histogram from text file](https://root-forum.cern.ch/t/making-histogram-from-text-file/53689)

<div class="topic-metadata">

**Author:** [@Mona](https://root-forum.cern.ch/u/Mona)\
**Replies:** 4\
**Last updated:** [February 20, 2023, 12:53pm UTC](https://root-forum.cern.ch/t/making-histogram-from-text-file/53689 "2023-02-20T12:53:55Z")

</div>

Hello everyone. I am trying to generate a histogram from my data file but the data files contains a lot colums and I want to read data one by one. For example: 2 4 5 5 7 0 6 1 And I want to read data an…

---

## [A question about Roounfolding cmake error](https://root-forum.cern.ch/t/a-question-about-roounfolding-cmake-error/53680)

<div class="topic-metadata">

**Author:** [@Alexandr\_Yuschenko](https://root-forum.cern.ch/u/Alexandr_Yuschenko)\
**Replies:** 4\
**Last updated:** [February 20, 2023, 9:57am UTC](https://root-forum.cern.ch/t/a-question-about-roounfolding-cmake-error/53680 "2023-02-20T09:57:30Z")

</div>

Hi I tried to compile RooUnfold and got this cmake error: ROOT component Unfold not found. I used root version: 6.28.00 windows msi installer I also tried to compile root from sources under wsl ubuntu22 but got the sa…

---

## [Can someone explain what is happening here and how to fix it?](https://root-forum.cern.ch/t/can-someone-explain-what-is-happening-here-and-how-to-fix-it/53676)

<div class="topic-metadata">

**Author:** [@mbl1230](https://root-forum.cern.ch/u/mbl1230)\
**Replies:** 2\
**Last updated:** [February 19, 2023, 4:41am UTC](https://root-forum.cern.ch/t/can-someone-explain-what-is-happening-here-and-how-to-fix-it/53676 "2023-02-19T04:41:37Z")

</div>

I would like to run a script to read a number of different files, the file determined by an argument. For some reason, selecting the file to read when within an if-then-else statement does not work. A simple example of …

---

## [TGraphErrors Fit, how to determine if a fit is good?](https://root-forum.cern.ch/t/tgrapherrors-fit-how-to-determine-if-a-fit-is-good/53623)

<div class="topic-metadata">

**Author:** [@smeriano](https://root-forum.cern.ch/u/smeriano)\
**Replies:** 9\
**Last updated:** [February 17, 2023, 10:21am UTC](https://root-forum.cern.ch/t/tgrapherrors-fit-how-to-determine-if-a-fit-is-good/53623 "2023-02-17T10:21:58Z")

</div>

\_ grapherror.root (141.2 KB) grapherrorfit.C (457 Bytes) Greetings everyone, I opened this topic in Roofit and RooStats section but I think this is a newbie question. So I’m reopening the topic in the Newbie section. …

---

## [Problem in smearing histogram plotted from a text file](https://root-forum.cern.ch/t/problem-in-smearing-histogram-plotted-from-a-text-file/53641)

<div class="topic-metadata">

**Author:** [@gini](https://root-forum.cern.ch/u/gini)\
**Replies:** 6\
**Last updated:** [February 17, 2023, 8:23am UTC](https://root-forum.cern.ch/t/problem-in-smearing-histogram-plotted-from-a-text-file/53641 "2023-02-17T08:23:48Z")

</div>

Hi, i have the following code for plotting a histogram by reading a text file. To this histogram I want to add my experimental resolution of 3.5. The follwing is the macro : void Analysis() { gStyle-\>SetOptStat(2211);…

---

## [How to feed rule with files from two lists?](https://root-forum.cern.ch/t/how-to-feed-rule-with-files-from-two-lists/53648)

<div class="topic-metadata">

**Author:** [@exo](https://root-forum.cern.ch/u/exo)\
**Replies:** 1\
**Last updated:** [February 16, 2023, 10:57pm UTC](https://root-forum.cern.ch/t/how-to-feed-rule-with-files-from-two-lists/53648 "2023-02-16T22:57:05Z")

</div>

Hi, Is it possible to make the Makefile read directory and parse it in pairs? So what i have a list of files in ./mydir/ that have an infix \_A1\_ and \_A2\_. What I would like to do is to read the content of mydir and past…

---

## [Pad division](https://root-forum.cern.ch/t/pad-division/53655)

<div class="topic-metadata">

**Author:** [@Haidar](https://root-forum.cern.ch/u/Haidar)\
**Replies:** 5\
**Last updated:** [February 16, 2023, 2:53pm UTC](https://root-forum.cern.ch/t/pad-division/53655 "2023-02-16T14:53:03Z")

</div>

Dear Rooters, I am dividing a canvas into three sub-pads; the upper pad about 60% of the canvas and the bottom pads equally divided. When I call the method TPad::Divide, it shrinks the x-axis of the two bottom most pane…

---

## [How to fit an equation containing more that one variables?](https://root-forum.cern.ch/t/how-to-fit-an-equation-containing-more-that-one-variables/53584)

<div class="topic-metadata">

**Author:** [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Replies:** 8\
**Last updated:** [February 15, 2023, 4:11pm UTC](https://root-forum.cern.ch/t/how-to-fit-an-equation-containing-more-that-one-variables/53584 "2023-02-15T16:11:27Z")

</div>

Hello everyone, I have an equation that depends on more than one variable. I know that if the dependence is y=f(x) then I can use the TF1 function, e.g., TF1 \*fit = new TF1("fit", "\[0\] + \[1\]\* x + \[2\]\* x\* x"); However,…

---

## [On Visual Studio 2022 Root running problem](https://root-forum.cern.ch/t/on-visual-studio-2022-root-running-problem/53636)

<div class="topic-metadata">

**Author:** [@Billy](https://root-forum.cern.ch/u/Billy)\
**Replies:** 3\
**Last updated:** [February 15, 2023, 9:14am UTC](https://root-forum.cern.ch/t/on-visual-studio-2022-root-running-problem/53636 "2023-02-15T09:14:37Z")

</div>

\_ROOT Version: 6.28 \_Platform: Windows10, 64bit \_Compiler: Visual studio 2022 It’s a very simple test code. I set the including path, library path, lib input, environment variables. The code is built succeeded. But ca…

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

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