# Newbie

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

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

---

## [How to pass values from a tree variable to histogram?](https://root-forum.cern.ch/t/how-to-pass-values-from-a-tree-variable-to-histogram/50146)

<div class="topic-metadata">

**Author:** [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Replies:** 3\
**Last updated:** [May 27, 2022, 3:16am UTC](https://root-forum.cern.ch/t/how-to-pass-values-from-a-tree-variable-to-histogram/50146 "2022-05-27T03:16:07Z")

</div>

Hello everyone, I want to pass values from a tree variable to the histogram. For that, I wrote the following code, // Histogram "h" TH1F \*h = new TH1F("h", "h", 100, -150, 150); // "X\_tree" is the tree. // "X\_trck\[0\]"…

---

## [Trouble storing a plot as a .txt file](https://root-forum.cern.ch/t/trouble-storing-a-plot-as-a-txt-file/50128)

<div class="topic-metadata">

**Author:** [@Nisha](https://root-forum.cern.ch/u/Nisha)\
**Replies:** 6\
**Last updated:** [May 26, 2022, 8:31pm UTC](https://root-forum.cern.ch/t/trouble-storing-a-plot-as-a-txt-file/50128 "2022-05-26T20:31:08Z")

</div>

Dear Experts, I have a plot with multiple peaks. I used TSpectrum to identify peaks and in a for loop, I am zooming each peak and storing the peaks as .pdf file. However, I also want to store the data as .txt files with…

---

## [How to get the covariance matrix from a fit](https://root-forum.cern.ch/t/how-to-get-the-covariance-matrix-from-a-fit/50133)

<div class="topic-metadata">

**Author:** [@rrapo](https://root-forum.cern.ch/u/rrapo)\
**Replies:** 4\
**Last updated:** [May 26, 2022, 9:54am UTC](https://root-forum.cern.ch/t/how-to-get-the-covariance-matrix-from-a-fit/50133 "2022-05-26T09:54:45Z")

</div>

Hi, i have an issue with che covariance matrix: I did an experiment on the band-pass filter (using a RCL-series circuit ) and i am trying to find the resonance frequency from a fit. the program should be ok, but i copi…

---

## [Seg Fault when using TObject::Get()](https://root-forum.cern.ch/t/seg-fault-when-using-tobject-get/50119)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 2\
**Last updated:** [May 25, 2022, 2:18pm UTC](https://root-forum.cern.ch/t/seg-fault-when-using-tobject-get/50119 "2022-05-25T14:18:53Z")

</div>

Dear experts I want to use a TF2 function from a root file, I use TF2\* func = (TF2\*)file-\>Get("func") it doesn’t give error but after when I use func-\>Print() it gives seg fault… Any clue of why this happens? Pleas…

---

## [Can't compile with gcc in zsh shell](https://root-forum.cern.ch/t/cant-compile-with-gcc-in-zsh-shell/50107)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 5\
**Last updated:** [May 25, 2022, 9:06am UTC](https://root-forum.cern.ch/t/cant-compile-with-gcc-in-zsh-shell/50107 "2022-05-25T09:06:01Z")

</div>

Dear Experts I’m a newbie for ROOT, using MacOS zsh and gcc 11. When I try to compile my code using g++ \`root-config --cflags --libs\` -lMinuit -o proton proton.cxx I got the error g++-11: error: unrecognized command-…

---

## [Using predefined color palettes from root 6 to root 5](https://root-forum.cern.ch/t/using-predefined-color-palettes-from-root-6-to-root-5/41835)

<div class="topic-metadata">

**Author:** [@AR10](https://root-forum.cern.ch/u/AR10)\
**Replies:** 4\
**Last updated:** [May 24, 2022, 11:13am UTC](https://root-forum.cern.ch/t/using-predefined-color-palettes-from-root-6-to-root-5/41835 "2022-05-24T11:13:25Z")

</div>

Hi, I’m trying to used the kBlackBody colour palette for my histogram, unfortunately its only available on root 6 while I’m still using root 5.38. Is there any way for me to still use this palette?

---

## [TF2 Function](https://root-forum.cern.ch/t/tf2-function/50074)

<div class="topic-metadata">

**Author:** [@Dil](https://root-forum.cern.ch/u/Dil)\
**Replies:** 3\
**Last updated:** [May 23, 2022, 4:08pm UTC](https://root-forum.cern.ch/t/tf2-function/50074 "2022-05-23T16:08:28Z")

</div>

Hello Rooters, I need to look at the following function for Q2 vs XB plot. xBj^alpha \* (1-xBj)^beta \* (1+Q^2/LambdaSq)^(-gamma) So I tried it as follows. TF2 \*floglisum = new TF2("floglisum","LogxBQSq",0.0,1.0,1.5,1…

---

## [Drawing two histograms after normalising from different rootfiles](https://root-forum.cern.ch/t/drawing-two-histograms-after-normalising-from-different-rootfiles/50075)

<div class="topic-metadata">

**Author:** [@gini](https://root-forum.cern.ch/u/gini)\
**Replies:** 5\
**Last updated:** [May 23, 2022, 3:28pm UTC](https://root-forum.cern.ch/t/drawing-two-histograms-after-normalising-from-different-rootfiles/50075 "2022-05-23T15:28:23Z")

</div>

Hi, I have written the following macro to plot two histograms (from two different root files) on the same plot after normalizing them : void Exp\_Theo\_Mass\_Events() { Double\_t s1, s2, s3; TCanvas \*c1 = new TCanvas("c1"…

---

## ['Point number' not displayed in TBrowser](https://root-forum.cern.ch/t/point-number-not-displayed-in-tbrowser/50068)

<div class="topic-metadata">

**Author:** [@Snowy](https://root-forum.cern.ch/u/Snowy)\
**Replies:** 5\
**Last updated:** [May 23, 2022, 1:06pm UTC](https://root-forum.cern.ch/t/point-number-not-displayed-in-tbrowser/50068 "2022-05-23T13:06:05Z")

</div>

I’ve finally managed to install ROOT 7 on my own Mac, making the use of the lab PC in the university obsolete. However I encountered a problem at the switch to ROOT 7 from a previous version on the other PC: I’m missing …

---

## [Problem drawing TGraphError error bars](https://root-forum.cern.ch/t/problem-drawing-tgrapherror-error-bars/50053)

<div class="topic-metadata">

**Author:** [@gorsedh](https://root-forum.cern.ch/u/gorsedh)\
**Replies:** 3\
**Last updated:** [May 23, 2022, 11:17am UTC](https://root-forum.cern.ch/t/problem-drawing-tgrapherror-error-bars/50053 "2022-05-23T11:17:14Z")

</div>

Hello there, I’m trying to draw a TGraphError but i can’t understand why i can’t get error bars to show. Here’s my code: void errplot(TString channel = "pk", TString bdtCut = "0.0", TString configuration = "3.3.3.-3")…

---

## [Question about RooWorkspace Print](https://root-forum.cern.ch/t/question-about-rooworkspace-print/50040)

<div class="topic-metadata">

**Author:** [@Kuanyu\_Chen](https://root-forum.cern.ch/u/Kuanyu_Chen)\
**Replies:** 2\
**Last updated:** [May 23, 2022, 9:55am UTC](https://root-forum.cern.ch/t/question-about-rooworkspace-print/50040 "2022-05-23T09:55:41Z")

</div>

Please read tips for efficient and successful posting and posting code Hi! I am use print to show what I store RooWorkspace, the result show in below I want to ask is anyone know what is the 0.0197432 meaning ? Mor…

---

## [How to fit Gaussian on temporary histogram without Fit panel?](https://root-forum.cern.ch/t/how-to-fit-gaussian-on-temporary-histogram-without-fit-panel/50051)

<div class="topic-metadata">

**Author:** [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Replies:** 1\
**Last updated:** [May 22, 2022, 4:37am UTC](https://root-forum.cern.ch/t/how-to-fit-gaussian-on-temporary-histogram-without-fit-panel/50051 "2022-05-22T04:37:54Z")

</div>

Hi, I am plotting the histogram with the command similar to tree → Draw(“variable\>\>(bins, x-axis min, x-axis max”); This creates a temporary histogram plot. I want to fit a Gaussian on this histogram without the fit…

---

## [Snippet of pyRoot code works in one place in the script and then fails in another](https://root-forum.cern.ch/t/snippet-of-pyroot-code-works-in-one-place-in-the-script-and-then-fails-in-another/50047)

<div class="topic-metadata">

**Author:** [@mhadley](https://root-forum.cern.ch/u/mhadley)\
**Replies:** 1\
**Last updated:** [May 21, 2022, 5:41pm UTC](https://root-forum.cern.ch/t/snippet-of-pyroot-code-works-in-one-place-in-the-script-and-then-fails-in-another/50047 "2022-05-21T17:41:16Z")

</div>

Hi, I have the following code: tree0 = d.Get('tree') for event in tree0: #do some stuff When I have this code in the beginning of my pyRoot script, the code runs successfully. However, later on in the script, if …

---

## [How to create a dat file from a 2D histogram?](https://root-forum.cern.ch/t/how-to-create-a-dat-file-from-a-2d-histogram/50045)

<div class="topic-metadata">

**Author:** [@aviphy](https://root-forum.cern.ch/u/aviphy)\
**Replies:** 5\
**Last updated:** [May 21, 2022, 5:19pm UTC](https://root-forum.cern.ch/t/how-to-create-a-dat-file-from-a-2d-histogram/50045 "2022-05-21T17:19:16Z")

</div>

Hi, I am using the following line of codes to generate an ASCII file from a 1D histogram: { using std::cout; using std::endl; std::ofstream myFile1; myFile1.open("file.txt"); myFile1 \<\< "BinNo" \<\< "\\t" \<\< "Start" \<\< …

---

## [Trying to define imaginary error function](https://root-forum.cern.ch/t/trying-to-define-imaginary-error-function/50032)

<div class="topic-metadata">

**Author:** [@analyce](https://root-forum.cern.ch/u/analyce)\
**Replies:** 8\
**Last updated:** [May 20, 2022, 8:54am UTC](https://root-forum.cern.ch/t/trying-to-define-imaginary-error-function/50032 "2022-05-20T08:54:01Z")

</div>

I need to use the imaginary error function to fit some data. ROOT does not have a predefined erfi(), so I tried using the definition erfi(z) = -i \* erf(i\*z) I found an error function in RooMath that will take complex z…

---

## [How to write two histograms with different bin size in a single histogram](https://root-forum.cern.ch/t/how-to-write-two-histograms-with-different-bin-size-in-a-single-histogram/50014)

<div class="topic-metadata">

**Author:** [@Anil\_Kumar](https://root-forum.cern.ch/u/Anil_Kumar)\
**Replies:** 14\
**Last updated:** [May 20, 2022, 7:50am UTC](https://root-forum.cern.ch/t/how-to-write-two-histograms-with-different-bin-size-in-a-single-histogram/50014 "2022-05-20T07:50:45Z")

</div>

Hii All, I am trying to add two histograms with different bin size in a single histogram. Finally the single histogram write to a root file instead of plotting. After execution, it gives error for TH1Merger. Error: r…

---

## [Alternative for TSpectrum?](https://root-forum.cern.ch/t/alternative-for-tspectrum/49984)

<div class="topic-metadata">

**Author:** [@afyqazraei](https://root-forum.cern.ch/u/afyqazraei)\
**Replies:** 12\
**Last updated:** [May 20, 2022, 7:29am UTC](https://root-forum.cern.ch/t/alternative-for-tspectrum/49984 "2022-05-20T07:29:03Z")

</div>

Hi! We are currently doing some spectrum analysis on a dataset obtained from a fiber scintillator detector setup. Our old code uses TSpectrum in it. Since it’s mentioned that TSpectrum is now legacy, are there any gener…

---

## [TSlider creating a slider with no sliding space!](https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000)

<div class="topic-metadata">

**Author:** [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Replies:** 6\
**Last updated:** [May 19, 2022, 6:58pm UTC](https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000 "2022-05-19T18:58:22Z")

</div>

Hello, I was trying to recreate the TSlider example posted here: classTSlider.html. I slightly modified the xyslider.C macro. The code is attached here. xyslider.C (729 Bytes) action.C (441 Bytes) Here is the compari…

---

## [LD\_LIBRARY\_PATH variable and Delphes library](https://root-forum.cern.ch/t/ld-library-path-variable-and-delphes-library/50016)

<div class="topic-metadata">

**Author:** [@surrutiaquir](https://root-forum.cern.ch/u/surrutiaquir)\
**Replies:** 2\
**Last updated:** [May 19, 2022, 2:42pm UTC](https://root-forum.cern.ch/t/ld-library-path-variable-and-delphes-library/50016 "2022-05-19T14:42:22Z")

</div>

I installed ROOT using conda on my new laptop, and I need to run a macro that uses the Delphes and ExRootAnalysis libraries. The last time I had this issue, someone else helped me (apparently by modifying the LD\_LIBRARY\_…

---

## [Creating an array with the name of the histograms inside a .root file](https://root-forum.cern.ch/t/creating-an-array-with-the-name-of-the-histograms-inside-a-root-file/50028)

<div class="topic-metadata">

**Author:** [@Daumann](https://root-forum.cern.ch/u/Daumann)\
**Replies:** 3\
**Last updated:** [May 19, 2022, 2:18pm UTC](https://root-forum.cern.ch/t/creating-an-array-with-the-name-of-the-histograms-inside-a-root-file/50028 "2022-05-19T14:18:33Z")

</div>

Dear experts, I need to do some operations with the histograms in a file that has almost 300k histograms in it. doing it in pure python takes a very long time, so I would want to create a NumPy array that stores the nam…

---

## [Macro in directory with a complicated name](https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015)

<div class="topic-metadata">

**Author:** [@surrutiaquir](https://root-forum.cern.ch/u/surrutiaquir)\
**Replies:** 6\
**Last updated:** [May 19, 2022, 1:09pm UTC](https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015 "2022-05-19T13:09:01Z")

</div>

If I have a very simple macro named helloscript.cc in /Users/surrutiaquir/Downloads, void helloscript() { cout \<\< "hello world!" \<\< endl; } I’m able to run it smoothly: $ root -l -b helloscript.cc root \[0\] Processi…

---

## [TCanvas resolution&quality changes if diving to pads](https://root-forum.cern.ch/t/tcanvas-resolution-quality-changes-if-diving-to-pads/49980)

<div class="topic-metadata">

**Author:** [@armin.kadlecsik](https://root-forum.cern.ch/u/armin.kadlecsik)\
**Replies:** 7\
**Last updated:** [May 19, 2022, 4:45am UTC](https://root-forum.cern.ch/t/tcanvas-resolution-quality-changes-if-diving-to-pads/49980 "2022-05-19T04:45:07Z")

</div>

Hello I’m trying to add a legend to one of my figures that doesn’t fit on the figure itself. So I’d like to add it next to it, and I thought I’d do that by doubling the size of the canvas, and making two pads, one for t…

---

## [Dataframe Snapshot - file larger than 100 GB](https://root-forum.cern.ch/t/dataframe-snapshot-file-larger-than-100-gb/49794)

<div class="topic-metadata">

**Author:** [@adrobac](https://root-forum.cern.ch/u/adrobac)\
**Replies:** 4\
**Last updated:** [May 18, 2022, 7:46pm UTC](https://root-forum.cern.ch/t/dataframe-snapshot-file-larger-than-100-gb/49794 "2022-05-18T19:46:32Z")

</div>

Hi there, I am working in pyroot (ROOT version 6.22/00) and am attempting to write a number of rather large dataframes to an output file using Snapshot(). The command I’m using is something like frames\[systematic\].Snap…

---

## [Transferring externally allocatted (pinned, aligned) columns to/from TTrees and files](https://root-forum.cern.ch/t/transferring-externally-allocatted-pinned-aligned-columns-to-from-ttrees-and-files/48983)

<div class="topic-metadata">

**Author:** [@ericcano](https://root-forum.cern.ch/u/ericcano)\
**Replies:** 3\
**Last updated:** [May 17, 2022, 8:34pm UTC](https://root-forum.cern.ch/t/transferring-externally-allocatted-pinned-aligned-columns-to-from-ttrees-and-files/48983 "2022-05-17T20:34:07Z")

</div>

Hello, I am trying to find a way to efficiently (with a minimum of copies) transfer externally allocated columns of data (mostly build-in types, integers or floats) into a TTree, and eventually a file. Multiples columns…

---

## [Multiplying histogram by TEfficiency](https://root-forum.cern.ch/t/multiplying-histogram-by-tefficiency/49968)

<div class="topic-metadata">

**Author:** [@renyhp](https://root-forum.cern.ch/u/renyhp)\
**Replies:** 3\
**Last updated:** [May 17, 2022, 7:39am UTC](https://root-forum.cern.ch/t/multiplying-histogram-by-tefficiency/49968 "2022-05-17T07:39:08Z")

</div>

Hi, I have computed a binned efficiency via TEfficiency, and I have a histogram of a different sample from the ones in the TEfficiency, with the same binnings. I want to multiply the two, in order to know what is the ex…

---

## [Memory problem debugging](https://root-forum.cern.ch/t/memory-problem-debugging/49985)

<div class="topic-metadata">

**Author:** [@Ailema](https://root-forum.cern.ch/u/Ailema)\
**Replies:** 1\
**Last updated:** [May 16, 2022, 10:57am UTC](https://root-forum.cern.ch/t/memory-problem-debugging/49985 "2022-05-16T10:57:52Z")

</div>

Dear experts, I have a class used for data analysis, and I have some problems with the residual memory which is continuously increasing so I suspect a memory leak ( and I have to remain under the 2.5GB threshold ). My …

---

## [Use of upar.add](https://root-forum.cern.ch/t/use-of-upar-add/49976)

<div class="topic-metadata">

**Author:** [@tappourc](https://root-forum.cern.ch/u/tappourc)\
**Replies:** 5\
**Last updated:** [May 16, 2022, 9:15am UTC](https://root-forum.cern.ch/t/use-of-upar-add/49976 "2022-05-16T09:15:33Z")

</div>

Hi guys, I have a question on the usage of upar.add. My problem is the following, I minimize using Minuit2 with about 150 parameters. All parameters are fine but one for which I know that its value should be different…

---

## [Toeplitz Matrix (diagonal-constant matrix)](https://root-forum.cern.ch/t/toeplitz-matrix-diagonal-constant-matrix/49969)

<div class="topic-metadata">

**Author:** [@hvsouza](https://root-forum.cern.ch/u/hvsouza)\
**Replies:** 6\
**Last updated:** [May 16, 2022, 2:03am UTC](https://root-forum.cern.ch/t/toeplitz-matrix-diagonal-constant-matrix/49969 "2022-05-16T02:03:05Z")

</div>

Hello all, I want to create a Toeplitz matrix which I need to invert. Do anyone know a good way to create one? The way I have take way too many steps. Int\_t n = 3; // n x n matrix Double\_t a\[\] = {1,2,3}; TVectorD aa; a…

---

## [\*Break\* segmentation violation and failed to access leaf in array from tree contains CORSIKA data](https://root-forum.cern.ch/t/break-segmentation-violation-and-failed-to-access-leaf-in-array-from-tree-contains-corsika-data/49939)

<div class="topic-metadata">

**Author:** [@Anil\_Kumar](https://root-forum.cern.ch/u/Anil_Kumar)\
**Replies:** 9\
**Last updated:** [May 15, 2022, 2:10pm UTC](https://root-forum.cern.ch/t/break-segmentation-violation-and-failed-to-access-leaf-in-array-from-tree-contains-corsika-data/49939 "2022-05-15T14:10:23Z")

</div>

Hello Everyone, I have recently started data analysis with ROOT. It is a good platform for data analysis. I have simulated cosmic ray event with CORSIKA which generated binary output file. The .root file contains a TTre…

---

## [Create histogram from textfile with several binning boundaries](https://root-forum.cern.ch/t/create-histogram-from-textfile-with-several-binning-boundaries/49912)

<div class="topic-metadata">

**Author:** [@zmomtaz](https://root-forum.cern.ch/u/zmomtaz)\
**Replies:** 13\
**Last updated:** [May 12, 2022, 2:25pm UTC](https://root-forum.cern.ch/t/create-histogram-from-textfile-with-several-binning-boundaries/49912 "2022-05-12T14:25:54Z")

</div>

Dear all, I want to create a histogram from a txt.file. The first 6 columns are the bin boundaries for the 3 parameter m, pt and y. The 7th column is the yield and the 8th one is the uncertainty. I have created a funct…

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

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