# Newbie

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

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

---

## [Create an histogram with a txt file](https://root-forum.cern.ch/t/create-an-histogram-with-a-txt-file/50352)

<div class="topic-metadata">

**Author:** [@rrapo](https://root-forum.cern.ch/u/rrapo)\
**Replies:** 6\
**Last updated:** [June 10, 2022, 8:04pm UTC](https://root-forum.cern.ch/t/create-an-histogram-with-a-txt-file/50352 "2022-06-10T20:04:05Z")

</div>

ROOT Version: 6.26/02 Platform: macOs \_Compiler: Xcode Hi everyone. i am sorry for my bad English, I hope you will forgive me. i have some little issues with creating a histogram: I already tried to look for someth…

---

## [Binning of a histogram, read from a root file](https://root-forum.cern.ch/t/binning-of-a-histogram-read-from-a-root-file/50360)

<div class="topic-metadata">

**Author:** [@pjana](https://root-forum.cern.ch/u/pjana)\
**Replies:** 2\
**Last updated:** [June 10, 2022, 6:46pm UTC](https://root-forum.cern.ch/t/binning-of-a-histogram-read-from-a-root-file/50360 "2022-06-10T18:46:34Z")

</div>

Hello, I have one root file, variables are saved as histograms. I plot one histogram from that root file. But I could not modify the bin size. Can anyone please help me? Thanks!! aco.root (7.0 KB) TCanvas\* c = new…

---

## [Getting the number of bins from histogram in root](https://root-forum.cern.ch/t/getting-the-number-of-bins-from-histogram-in-root/50314)

<div class="topic-metadata">

**Author:** [@AAA1](https://root-forum.cern.ch/u/AAA1)\
**Replies:** 7\
**Last updated:** [June 10, 2022, 10:35am UTC](https://root-forum.cern.ch/t/getting-the-number-of-bins-from-histogram-in-root/50314 "2022-06-10T10:35:06Z")

</div>

\_Hello I have a histogram and I want to get the number of bins of this his. But I cant find any thing about that in the root manual . Is there any way to do that. Thanks in advance

---

## [Adding points from TGraph into another TGraph](https://root-forum.cern.ch/t/adding-points-from-tgraph-into-another-tgraph/50316)

<div class="topic-metadata">

**Author:** [@zmomtaz](https://root-forum.cern.ch/u/zmomtaz)\
**Replies:** 11\
**Last updated:** [June 10, 2022, 9:01am UTC](https://root-forum.cern.ch/t/adding-points-from-tgraph-into-another-tgraph/50316 "2022-06-10T09:01:54Z")

</div>

Hi, I have 2 TGraph2D (gHadron\_2D\_1 and gHadron\_2D\_2) , one has a range of 0-1.5 in x-axis and the other has a range of 1.5-4 in x-axis. I want to connect these 2 Graphes. I tried to do this following code but the outpu…

---

## [How to get the Min and max value from a tree variable](https://root-forum.cern.ch/t/how-to-get-the-min-and-max-value-from-a-tree-variable/50341)

<div class="topic-metadata">

**Author:** [@Dil](https://root-forum.cern.ch/u/Dil)\
**Replies:** 3\
**Last updated:** [June 9, 2022, 3:39pm UTC](https://root-forum.cern.ch/t/how-to-get-the-min-and-max-value-from-a-tree-variable/50341 "2022-06-09T15:39:05Z")

</div>

Hello Rooters, I need to get the Min and Max value from the tree variable. I have 4 variables. QSq,xBj , ixB(xB bin numbers), jQ2(QSq bin numbers) I can read the variables properly. But I need to find the QSq min an…

---

## [How to plot 3D data in a TH2 or TH3, with z of the data as an adjustable parameter](https://root-forum.cern.ch/t/how-to-plot-3d-data-in-a-th2-or-th3-with-z-of-the-data-as-an-adjustable-parameter/50326)

<div class="topic-metadata">

**Author:** [@Yue\_Feng](https://root-forum.cern.ch/u/Yue_Feng)\
**Replies:** 1\
**Last updated:** [June 9, 2022, 6:04am UTC](https://root-forum.cern.ch/t/how-to-plot-3d-data-in-a-th2-or-th3-with-z-of-the-data-as-an-adjustable-parameter/50326 "2022-06-09T06:04:23Z")

</div>

Hi, I am trying to plot a 3D dataset as histograms. It has two position dimensions and one intensity dimension. The way I want to present is, show how many points above a specific intensity are distributed in the two po…

---

## [Read Valgrind log](https://root-forum.cern.ch/t/read-valgrind-log/49557)

<div class="topic-metadata">

**Author:** [@EVTO](https://root-forum.cern.ch/u/EVTO)\
**Replies:** 23\
**Last updated:** [June 8, 2022, 2:41pm UTC](https://root-forum.cern.ch/t/read-valgrind-log/49557 "2022-06-08T14:41:25Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided Hi. We have a macro and when we run it (on the same or on different ma…

---

## [TTree::Scan/Draw an element of a std::vector over entries](https://root-forum.cern.ch/t/ttree-scan-draw-an-element-of-a-std-vector-over-entries/50311)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 2:11pm UTC](https://root-forum.cern.ch/t/ttree-scan-draw-an-element-of-a-std-vector-over-entries/50311 "2022-06-08T14:11:43Z")

</div>

Dear experts I tried to Scan (and Draw) a certain element of a std::vector in a Tree, but failed to use std::at(), like tree-\>Scan("x0.at(pos)") where pos is another value saved in the tree (int). Is there any way to …

---

## [2D histogram boundary lines](https://root-forum.cern.ch/t/2d-histogram-boundary-lines/50304)

<div class="topic-metadata">

**Author:** [@Dil](https://root-forum.cern.ch/u/Dil)\
**Replies:** 1\
**Last updated:** [June 8, 2022, 6:10am UTC](https://root-forum.cern.ch/t/2d-histogram-boundary-lines/50304 "2022-06-08T06:10:06Z")

</div>

Hello, Can I know,Is there a way to find the boundary lines of a 2D histogram? As an example Q2 vs xBj.

---

## [How to use TF1 with variables?](https://root-forum.cern.ch/t/how-to-use-tf1-with-variables/50306)

<div class="topic-metadata">

**Author:** [@scheng5134](https://root-forum.cern.ch/u/scheng5134)\
**Replies:** 3\
**Last updated:** [June 8, 2022, 6:08am UTC](https://root-forum.cern.ch/t/how-to-use-tf1-with-variables/50306 "2022-06-08T06:08:52Z")

</div>

Hello I’m having trouble learning how to use the TF1 function properly, due to my unfamiliarity with coding. I want to add some modifiers to a Poisson function. So a standard function would be void fplot() { TF1 \*Po…

---

## [Unable to get value of TLeaf in TTree without first \`Scan()\`-ing it](https://root-forum.cern.ch/t/unable-to-get-value-of-tleaf-in-ttree-without-first-scan-ing-it/50293)

<div class="topic-metadata">

**Author:** [@ammitra](https://root-forum.cern.ch/u/ammitra)\
**Replies:** 2\
**Last updated:** [June 7, 2022, 12:58pm UTC](https://root-forum.cern.ch/t/unable-to-get-value-of-tleaf-in-ttree-without-first-scan-ing-it/50293 "2022-06-07T12:58:40Z")

</div>

ROOT Version: 6.20/07 Platform: linuxx8664gcc Compiler: Not Provided Hello, I have a bunch of ROOT files with TTree named Events, under which I’ve saved a few TLeaves containing information about the number of event…

---

## [Odd Seg Fault When Drawing TRatioPlot if doing SetGraphDrawOpt("E0")](https://root-forum.cern.ch/t/odd-seg-fault-when-drawing-tratioplot-if-doing-setgraphdrawopt-e0/50279)

<div class="topic-metadata">

**Author:** [@JackLindon](https://root-forum.cern.ch/u/JackLindon)\
**Replies:** 1\
**Last updated:** [June 7, 2022, 6:24am UTC](https://root-forum.cern.ch/t/odd-seg-fault-when-drawing-tratioplot-if-doing-setgraphdrawopt-e0/50279 "2022-06-07T06:24:11Z")

</div>

Hi, I am receiving an odd seg fault from TRatioPlot. I am unfortunately so far unable to reproduce this without using data internal to ATLAS, but I can give a basic explanation and code snippet/pseudocode, perhaps there…

---

## [Issue using Chi2Test() regarding a bin with less than 1 event](https://root-forum.cern.ch/t/issue-using-chi2test-regarding-a-bin-with-less-than-1-event/50266)

<div class="topic-metadata">

**Author:** [@Fr4nk](https://root-forum.cern.ch/u/Fr4nk)\
**Replies:** 6\
**Last updated:** [June 4, 2022, 10:52pm UTC](https://root-forum.cern.ch/t/issue-using-chi2test-regarding-a-bin-with-less-than-1-event/50266 "2022-06-04T22:52:27Z")

</div>

Hi All, I am currently attempting to use the Chi2Test() method to compare two normalized histograms. Upon execution I received the following message: Info in \<TH1F::Chi2TestX\>: There is a bin in h1 with less than 1 eve…

---

## [Increase free parameters accuracy for fits with 20 parameters](https://root-forum.cern.ch/t/increase-free-parameters-accuracy-for-fits-with-20-parameters/50273)

<div class="topic-metadata">

**Author:** [@Nyx](https://root-forum.cern.ch/u/Nyx)\
**Replies:** 2\
**Last updated:** [June 4, 2022, 7:47pm UTC](https://root-forum.cern.ch/t/increase-free-parameters-accuracy-for-fits-with-20-parameters/50273 "2022-06-04T19:47:32Z")

</div>

I am trying to use a fitting function that consists of a sum of 20 cosine functions of the form \[0\]\*exp(-x/\[1\])\*( 1.0+\[2\]\*cos(\[3\]\*x-\[j\])). The order of magnitude for the parameters are 10^5 for p0, 10^1 for p1, 10^-1 for…

---

## [Root Ttree memory](https://root-forum.cern.ch/t/root-ttree-memory/50247)

<div class="topic-metadata">

**Author:** [@Dil](https://root-forum.cern.ch/u/Dil)\
**Replies:** 1\
**Last updated:** [June 2, 2022, 7:21pm UTC](https://root-forum.cern.ch/t/root-ttree-memory/50247 "2022-06-02T19:21:01Z")

</div>

Hello experts, I tried to store my xB and Q2 values(12 bins) in a Tree. But unfortunately I got a memory issue. I using root 6.20 Could you please help me to figure out this? I saw many examples about this in the foru…

---

## [Linker Error: undefined reference to \`TDatabasePDG::TDatabasePDG()'](https://root-forum.cern.ch/t/linker-error-undefined-reference-to-tdatabasepdg-tdatabasepdg/50256)

<div class="topic-metadata">

**Author:** [@andrew](https://root-forum.cern.ch/u/andrew)\
**Replies:** 3\
**Last updated:** [June 3, 2022, 1:12pm UTC](https://root-forum.cern.ch/t/linker-error-undefined-reference-to-tdatabasepdg-tdatabasepdg/50256 "2022-06-03T13:12:36Z")

</div>

When I compile an executable (see an example below) with #!/bin/bash g++ -std=c++17 $1 \`root-config --cflags --glibs\` -o PT\_CHECKS I get the following linker error: /cvmfs/sft.cern.ch/lcg/releases/binutils/2.36.1-a969…

---

## [TGraph and TH1F on same canvas, setting axis](https://root-forum.cern.ch/t/tgraph-and-th1f-on-same-canvas-setting-axis/50245)

<div class="topic-metadata">

**Author:** [@Fr4nk](https://root-forum.cern.ch/u/Fr4nk)\
**Replies:** 2\
**Last updated:** [June 2, 2022, 10:08pm UTC](https://root-forum.cern.ch/t/tgraph-and-th1f-on-same-canvas-setting-axis/50245 "2022-06-02T22:08:34Z")

</div>

Hi All, I am currently trying to get a TGraph and TH1F to appear on the same canvas. As of now I am using: auto c1 = new TCanvas("c1","c1",200,10,600,400); ... h1-\>Draw("HIST"); TGraph\* gr = new TGraph(c,x,y); gr-\>Dr…

---

## [How to use the error provided by the TFractionFitter](https://root-forum.cern.ch/t/how-to-use-the-error-provided-by-the-tfractionfitter/49951)

<div class="topic-metadata">

**Author:** [@LongHoa](https://root-forum.cern.ch/u/LongHoa)\
**Replies:** 16\
**Last updated:** [June 2, 2022, 3:34pm UTC](https://root-forum.cern.ch/t/how-to-use-the-error-provided-by-the-tfractionfitter/49951 "2022-06-02T15:34:45Z")

</div>

Hello, I am doing a study that fits two MC histograms (signal and background) to a toy histogram using TFractionFitter. By repeating the fit on different toys generated from the same original distribution, I can obtain …

---

## [Optimal way to compare and validate simulation and experimental data](https://root-forum.cern.ch/t/optimal-way-to-compare-and-validate-simulation-and-experimental-data/50207)

<div class="topic-metadata">

**Author:** [@Fr4nk](https://root-forum.cern.ch/u/Fr4nk)\
**Replies:** 4\
**Last updated:** [June 1, 2022, 9:30pm UTC](https://root-forum.cern.ch/t/optimal-way-to-compare-and-validate-simulation-and-experimental-data/50207 "2022-06-01T21:30:25Z")

</div>

Hi All, I currently have two histograms, both TH1F, 75 bins, one experimental data, the other data from a Geant4 simulation. The histograms represent frequency of photoelectrons detected in a photomultiplier tube; count…

---

## [Creating a end of bin histogram](https://root-forum.cern.ch/t/creating-a-end-of-bin-histogram/50205)

<div class="topic-metadata">

**Author:** [@Mitchem](https://root-forum.cern.ch/u/Mitchem)\
**Replies:** 4\
**Last updated:** [June 1, 2022, 2:57pm UTC](https://root-forum.cern.ch/t/creating-a-end-of-bin-histogram/50205 "2022-06-01T14:57:48Z")

</div>

\_ROOT Version: 6.22/08 \_Platform: Ubuntu 20.04.2 LTS \_Compiler: g++ I made a post a year ago about the ability to fit at the end of a bin. I was told there was no direct way to do it. However, I was told another met…

---

## [Taking TF2 Eval](https://root-forum.cern.ch/t/taking-tf2-eval/50206)

<div class="topic-metadata">

**Author:** [@Dil](https://root-forum.cern.ch/u/Dil)\
**Replies:** 4\
**Last updated:** [June 1, 2022, 2:44pm UTC](https://root-forum.cern.ch/t/taking-tf2-eval/50206 "2022-06-01T14:44:30Z")

</div>

Hello all, My code is crashing when I introduce the following line? h\_logLisum\[Q2binning\]\[xBbinning\]-\>Fill(xBj,QSq,flogli\[Q2binning\]\[xBbinning\]-\>Eval(xBj,QSq)); flogli\[Q2binning\]\[xBbinning\]-\>Eval(xBj,QSq) this is the …

---

## [Why Canvas don't create window](https://root-forum.cern.ch/t/why-canvas-dont-create-window/50213)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 9\
**Last updated:** [June 1, 2022, 2:24pm UTC](https://root-forum.cern.ch/t/why-canvas-dont-create-window/50213 "2022-06-01T14:24:45Z")

</div>

Dear Experts I want to see some plot after running a program, so I wrote TCanvas\* Canvas = new TCanvas(); TH2D\* histo = new TH2D(xxx,xxx,xxx,xxx); // some code Canvas-\>cd(); histo-\>Draw(); But after the program finish…

---

## [Does not entry(mean) table show of two histogram when trying to plot two different histogram in a single canvas](https://root-forum.cern.ch/t/does-not-entry-mean-table-show-of-two-histogram-when-trying-to-plot-two-different-histogram-in-a-single-canvas/50201)

<div class="topic-metadata">

**Author:** [@Anil\_Kumar](https://root-forum.cern.ch/u/Anil_Kumar)\
**Replies:** 2\
**Last updated:** [May 31, 2022, 6:29pm UTC](https://root-forum.cern.ch/t/does-not-entry-mean-table-show-of-two-histogram-when-trying-to-plot-two-different-histogram-in-a-single-canvas/50201 "2022-05-31T18:29:08Z")

</div>

Hi All, I have two histograms with different entries such as hs and his. Find the sreenshots below. When I am trying to plot these histograms in a single canvas. Plot is fine and entry of hs table also is fine but…

---

## [Error in installing ROOT in conda environment for python 2.7: Failed to import libcppyy](https://root-forum.cern.ch/t/error-in-installing-root-in-conda-environment-for-python-2-7-failed-to-import-libcppyy/50194)

<div class="topic-metadata">

**Author:** [@mike\_f](https://root-forum.cern.ch/u/mike_f)\
**Replies:** 2\
**Last updated:** [May 31, 2022, 4:40pm UTC](https://root-forum.cern.ch/t/error-in-installing-root-in-conda-environment-for-python-2-7-failed-to-import-libcppyy/50194 "2022-05-31T16:40:06Z")

</div>

ROOT Version: 6.22.0 Platform: Mac 11.4 Python2.7 Hello! Sorry if I am not expressing myself in the correct jargon, but I am fairly new with these topics. I have ROOT already running on my local machine, now I am wo…

---

## [How to save canvas (or histogram) in a tree?](https://root-forum.cern.ch/t/how-to-save-canvas-or-histogram-in-a-tree/50169)

<div class="topic-metadata">

**Author:** [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Replies:** 2\
**Last updated:** [May 31, 2022, 10:42am UTC](https://root-forum.cern.ch/t/how-to-save-canvas-or-histogram-in-a-tree/50169 "2022-05-31T10:42:25Z")

</div>

I am just curious to know if it is possible to save the canvas or histogram in a tree. I mean currently, I am writing the canvas (or histogram) directly in a root file, without creating a tree. Here is the pseudo-code of…

---

## [Fitting issue](https://root-forum.cern.ch/t/fitting-issue/50189)

<div class="topic-metadata">

**Author:** [@franciuska](https://root-forum.cern.ch/u/franciuska)\
**Replies:** 4\
**Last updated:** [May 31, 2022, 8:49am UTC](https://root-forum.cern.ch/t/fitting-issue/50189 "2022-05-31T08:49:50Z")

</div>

Hello. I am using ROOT version 6.22/02 on Ubuntu 18.04. My code is in attachment. If, when i fit the graph, I write the fitting region as TF1 \*func = new TF1("fit",fitf,16, 21,2); everything works fine, but if …

---

## [How to plot two graph in one canvas from two separate root file, the key of the graph is canvas](https://root-forum.cern.ch/t/how-to-plot-two-graph-in-one-canvas-from-two-separate-root-file-the-key-of-the-graph-is-canvas/50013)

<div class="topic-metadata">

**Author:** [@pjana](https://root-forum.cern.ch/u/pjana)\
**Replies:** 13\
**Last updated:** [May 30, 2022, 12:31pm UTC](https://root-forum.cern.ch/t/how-to-plot-two-graph-in-one-canvas-from-two-separate-root-file-the-key-of-the-graph-is-canvas/50013 "2022-05-30T12:31:08Z")

</div>

Hello, I want to plot two graph from two separate root files into one canvas. I am able to get one plot but I could not able to plot two in one canvas. The key of the plot in the root file is canvas. I have attached my…

---

## [Drawing two graphs in one canvas properly with ROOT](https://root-forum.cern.ch/t/drawing-two-graphs-in-one-canvas-properly-with-root/50123)

<div class="topic-metadata">

**Author:** [@ALI\_MERT\_TURACLAR](https://root-forum.cern.ch/u/ALI_MERT_TURACLAR)\
**Replies:** 2\
**Last updated:** [May 30, 2022, 8:32am UTC](https://root-forum.cern.ch/t/drawing-two-graphs-in-one-canvas-properly-with-root/50123 "2022-05-30T08:32:42Z")

</div>

I’m trying to plot two graphs in one canvas using Cern ROOT. When I use gr -\> Draw("ap") and gr2 -\> Draw("p1 same"), the lines of the plots are not visible, only the markers are visible. When I use gr1 -\> Draw("") and gr…

---

## [Installation error on windows](https://root-forum.cern.ch/t/installation-error-on-windows/50165)

<div class="topic-metadata">

**Author:** [@Mario\_Baravetto](https://root-forum.cern.ch/u/Mario_Baravetto)\
**Replies:** 7\
**Last updated:** [May 29, 2022, 7:12am UTC](https://root-forum.cern.ch/t/installation-error-on-windows/50165 "2022-05-29T07:12:45Z")

</div>

I’m trying to install root for windows but i’m having some issues. when I input “make -j4” it always stops at \[ 75%\] Built target CLING \[ 75%\] Built target clad \[ 75%\] Built target LLVMRES CMake Error at XROOTD-stam…

---

## [How to save canvas in tree?](https://root-forum.cern.ch/t/how-to-save-canvas-in-tree/50161)

<div class="topic-metadata">

**Author:** [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Replies:** 2\
**Last updated:** [May 28, 2022, 10:36pm UTC](https://root-forum.cern.ch/t/how-to-save-canvas-in-tree/50161 "2022-05-28T22:36:27Z")

</div>

Hi, I am new to root. I know how to save a histogram but how to save the canvas in the tree or in the root file. Thanks.

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

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