# Newbie

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

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

---

## [How to terminate TApplication::Run() process?](https://root-forum.cern.ch/t/how-to-terminate-tapplication-run-process/54683)

<div class="topic-metadata">

**Author:** [@grattoni](https://root-forum.cern.ch/u/grattoni)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 6:16am UTC](https://root-forum.cern.ch/t/how-to-terminate-tapplication-run-process/54683 "2023-05-01T06:16:38Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided I am making a program where a bunch of root graphs are displayed on th…

---

## [Combine TMultiGraphs](https://root-forum.cern.ch/t/combine-tmultigraphs/54676)

<div class="topic-metadata">

**Author:** [@alex14](https://root-forum.cern.ch/u/alex14)\
**Replies:** 1\
**Last updated:** [April 28, 2023, 7:09pm UTC](https://root-forum.cern.ch/t/combine-tmultigraphs/54676 "2023-04-28T19:09:56Z")

</div>

Hi all, I have a problem with plotting several TMultiGraphs on one canvas (combining them). I have 5 TMultiGraphs in 5 different files. In a macro, I try to call them and plot them together on one canvas, but I get a \*\*…

---

## [Why using pointer of classes](https://root-forum.cern.ch/t/why-using-pointer-of-classes/54657)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 6\
**Last updated:** [April 28, 2023, 4:48am UTC](https://root-forum.cern.ch/t/why-using-pointer-of-classes/54657 "2023-04-28T04:48:11Z")

</div>

Dear Experts I’m new to c++, I saw many people using pointer to define ROOT class member like: TTree\* t = //some Get function TH2D\* h = new TH2D(); TCanvas\* c = new Canvas(); instead of TTree t = //some Get function …

---

## [GSLRandomEngine undefined symbols](https://root-forum.cern.ch/t/gslrandomengine-undefined-symbols/54650)

<div class="topic-metadata">

**Author:** [@JSHeines](https://root-forum.cern.ch/u/JSHeines)\
**Replies:** 2\
**Last updated:** [April 26, 2023, 2:21pm UTC](https://root-forum.cern.ch/t/gslrandomengine-undefined-symbols/54650 "2023-04-26T14:21:14Z")

</div>

Hi, I’m trying to use the GSLRandomEngine class in a compiled program. #include \<iostream\> #include \<Math/GSLRndmEngines.h\> int main() { ROOT::Math::GSLRandomEngine rng; rng.Initialize(); std::cout \<\< rng.Rnd…

---

## [Segfault on creating canvases and pads in a loop with pyroot](https://root-forum.cern.ch/t/segfault-on-creating-canvases-and-pads-in-a-loop-with-pyroot/44729)

<div class="topic-metadata">

**Author:** [@pmajor](https://root-forum.cern.ch/u/pmajor)\
**Replies:** 12\
**Last updated:** [April 26, 2023, 9:58am UTC](https://root-forum.cern.ch/t/segfault-on-creating-canvases-and-pads-in-a-loop-with-pyroot/44729 "2023-04-26T09:58:16Z")

</div>

Dear Experts, I am trying to make a few ratio plots for histograms stored in several root files. I use a loop to open the files for updating and draw the canvases sequentially. I am unfortunately getting a segfault. Her…

---

## [How to append root to your PATH environment](https://root-forum.cern.ch/t/how-to-append-root-to-your-path-environment/54623)

<div class="topic-metadata">

**Author:** [@Mona](https://root-forum.cern.ch/u/Mona)\
**Replies:** 1\
**Last updated:** [April 25, 2023, 9:20am UTC](https://root-forum.cern.ch/t/how-to-append-root-to-your-path-environment/54623 "2023-04-25T09:20:40Z")

</div>

Hello everyone, Can someone please let me know how I can correctly append source bin/thisroot.sh to my PATH environment so that I do not need to do it every time? Please read tips for efficient and successful posting …

---

## [Tgraph interpolation problem](https://root-forum.cern.ch/t/tgraph-interpolation-problem/54583)

<div class="topic-metadata">

**Author:** [@ROOTer1](https://root-forum.cern.ch/u/ROOTer1)\
**Replies:** 2\
**Last updated:** [April 22, 2023, 9:12pm UTC](https://root-forum.cern.ch/t/tgraph-interpolation-problem/54583 "2023-04-22T21:12:43Z")

</div>

Dear, I have the following TGraph, and when I use the line option, the interpolation looks weird. Is there any fix to make sure the interpolation happens from one point to the neighbouring point? Many thanks!

---

## [Need Intensity Values from 2D Histogram](https://root-forum.cern.ch/t/need-intensity-values-from-2d-histogram/51503)

<div class="topic-metadata">

**Author:** [@YanPan](https://root-forum.cern.ch/u/YanPan)\
**Replies:** 7\
**Last updated:** [April 20, 2023, 5:27pm UTC](https://root-forum.cern.ch/t/need-intensity-values-from-2d-histogram/51503 "2023-04-20T17:27:59Z")

</div>

Hello, I ran a SPECT simulation in Gate and received \*.root output Singles data containing events, globalPosX,Y,Z, time & energy, etc. From the output, I was able to plot this 2D histogram with the following code. Howev…

---

## [Baseline for spectrum](https://root-forum.cern.ch/t/baseline-for-spectrum/54538)

<div class="topic-metadata">

**Author:** [@iRush](https://root-forum.cern.ch/u/iRush)\
**Replies:** 2\
**Last updated:** [April 20, 2023, 12:31am UTC](https://root-forum.cern.ch/t/baseline-for-spectrum/54538 "2023-04-20T00:31:25Z")

</div>

\_ROOT Version: 6.26 \_Platform: Linux \_Compiler: GCC 8.5.0 Hi all, Newbie here. I want to know what class and functions should I use to calculate the baseline of the TH1F spectrum below, and also, how to constrain th…

---

## [What is the recommanded directory and install structure for a root lib?](https://root-forum.cern.ch/t/what-is-the-recommanded-directory-and-install-structure-for-a-root-lib/54485)

<div class="topic-metadata">

**Author:** [@YannickPatois](https://root-forum.cern.ch/u/YannickPatois)\
**Replies:** 3\
**Last updated:** [April 18, 2023, 4:16pm UTC](https://root-forum.cern.ch/t/what-is-the-recommanded-directory-and-install-structure-for-a-root-lib/54485 "2023-04-18T16:16:43Z")

</div>

Hi, I have a piece of C++ code (several tens of files) linking with ROOT to create a library that can be then loaded in root (gSystem-\>Load()) and be used, a rootlogon.C file that configure this and a few other things (…

---

## [Can not compile my C++ code including headers from ROOT](https://root-forum.cern.ch/t/can-not-compile-my-c-code-including-headers-from-root/54542)

<div class="topic-metadata">

**Author:** [@grattoni](https://root-forum.cern.ch/u/grattoni)\
**Replies:** 7\
**Last updated:** [April 18, 2023, 2:09pm UTC](https://root-forum.cern.ch/t/can-not-compile-my-c-code-including-headers-from-root/54542 "2023-04-18T14:09:06Z")

</div>

\_ROOT Version: 6.26/06 Platform: macOS 12.4 Compiler: g++ / clang ? I can compile the root macros written in C with root /path/to/mymacro.c command just fine but I can’t compile a C++ file including headers from RO…

---

## [TTreeReaderArray with enum type](https://root-forum.cern.ch/t/ttreereaderarray-with-enum-type/54283)

<div class="topic-metadata">

**Author:** [@mbalogh](https://root-forum.cern.ch/u/mbalogh)\
**Replies:** 8\
**Last updated:** [April 17, 2023, 6:19pm UTC](https://root-forum.cern.ch/t/ttreereaderarray-with-enum-type/54283 "2023-04-17T18:19:42Z")

</div>

Dear experts, I have a TTree, that has a branch containing vector of structures, with structure containing enum type called someEnum. I am trying to read it with selector in maybe a bit unconventional way using the TTre…

---

## [Reading TClonesArray as a TChain in pyroot](https://root-forum.cern.ch/t/reading-tclonesarray-as-a-tchain-in-pyroot/54520)

<div class="topic-metadata">

**Author:** [@ROOTer1](https://root-forum.cern.ch/u/ROOTer1)\
**Replies:** 5\
**Last updated:** [April 17, 2023, 2:09pm UTC](https://root-forum.cern.ch/t/reading-tclonesarray-as-a-tchain-in-pyroot/54520 "2023-04-17T14:09:58Z")

</div>

Dear, I have a rootfile with a set of TClonesArray’s, I was wondering how I can read it in a loop in the same way as for TChain: chain = ROOT.TChain() chain.Add("path\_to\_rootfile/tree") TD\_hist = ROOT.TH2F() for iev i…

---

## [How Set axis titles](https://root-forum.cern.ch/t/how-set-axis-titles/54515)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 1\
**Last updated:** [April 17, 2023, 6:13am UTC](https://root-forum.cern.ch/t/how-set-axis-titles/54515 "2023-04-17T06:13:48Z")

</div>

Dear experts I want to set titles of axis, the flow is: c-\>cd(4); gPad-\>DrawFrame(-850,-850,850,850); DrawCDC(); hitmap\_wireEven-\>GetXaxis()-\>SetTitle("X \[mm\]"); hitmap\_wireEven-\>GetYaxi…

---

## [Undefined symbols for architecture arm64 when trying to build](https://root-forum.cern.ch/t/undefined-symbols-for-architecture-arm64-when-trying-to-build/54501)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 8\
**Last updated:** [April 17, 2023, 1:58am UTC](https://root-forum.cern.ch/t/undefined-symbols-for-architecture-arm64-when-trying-to-build/54501 "2023-04-17T01:58:02Z")

</div>

Dear experts I got an error when I tried to build my program with ROOT, the error is: Undefined symbols for architecture arm64 "TSpectrum2::SearchHighRes(double\*\*, double\*\*, int, int, double, double, bool, int, bool, …

---

## [Summation of elements of unknown array in group](https://root-forum.cern.ch/t/summation-of-elements-of-unknown-array-in-group/54468)

<div class="topic-metadata">

**Author:** [@Saradindu](https://root-forum.cern.ch/u/Saradindu)\
**Replies:** 9\
**Last updated:** [April 15, 2023, 7:01pm UTC](https://root-forum.cern.ch/t/summation-of-elements-of-unknown-array-in-group/54468 "2023-04-15T19:01:20Z")

</div>

Dear all, I have unknown array of 500 numbers. Based on the criteria i need to sum 100 elements sometimes , sometimes 20 elements like that… sum 1 : 100 elements of unknown array sum2 : 20 elements of unknown array s…

---

## [Crystal ball function initial parameters](https://root-forum.cern.ch/t/crystal-ball-function-initial-parameters/54497)

<div class="topic-metadata">

**Author:** [@arazquin](https://root-forum.cern.ch/u/arazquin)\
**Replies:** 2\
**Last updated:** [April 15, 2023, 9:56am UTC](https://root-forum.cern.ch/t/crystal-ball-function-initial-parameters/54497 "2023-04-15T09:56:00Z")

</div>

ROOT Version: 6.18/00 Platform: Red Hat 8.5.0-16 Compiler: gcc version 8.5.0 Hello everyone, I want to fit a histogram (see figure) with the crystal ball function following the code: TF1 \*fitFunction = new TF1("fit…

---

## [ROOT Version and Delphi's](https://root-forum.cern.ch/t/root-version-and-delphis/54490)

<div class="topic-metadata">

**Author:** [@FCasa23](https://root-forum.cern.ch/u/FCasa23)\
**Replies:** 1\
**Last updated:** [April 14, 2023, 6:31pm UTC](https://root-forum.cern.ch/t/root-version-and-delphis/54490 "2023-04-14T18:31:22Z")

</div>

Hi, I use a macOS Monterey 12.6.3 and I work on MadGraph5 and Delphes for detector simulations. This week, I need to update my MacPorts, and my ROOT6 has been updated too( ROOT Version: 6.28/02). When I want to make som…

---

## [Applying weights to the branches of a TTree](https://root-forum.cern.ch/t/applying-weights-to-the-branches-of-a-ttree/54488)

<div class="topic-metadata">

**Author:** [@jinglis](https://root-forum.cern.ch/u/jinglis)\
**Replies:** 11\
**Last updated:** [April 14, 2023, 4:32pm UTC](https://root-forum.cern.ch/t/applying-weights-to-the-branches-of-a-ttree/54488 "2023-04-14T16:32:03Z")

</div>

Hi ROOT experts, I am new to ROOT and I am looking at generating Drell-Yan MC samples. I have been using AnalysisTop to produce a tree where eahch branch contains my relevant variables for each event, which I want to fi…

---

## [Sphericity and aplanarity](https://root-forum.cern.ch/t/sphericity-and-aplanarity/54300)

<div class="topic-metadata">

**Author:** [@ampudia](https://root-forum.cern.ch/u/ampudia)\
**Replies:** 2\
**Last updated:** [April 14, 2023, 1:14am UTC](https://root-forum.cern.ch/t/sphericity-and-aplanarity/54300 "2023-04-14T01:14:41Z")

</div>

Hello! Is there a relatively straightforward way of calculating the sphericity and the aplanarity of an event using Root? Thank you very much in advance.

---

## [Cannot run macro](https://root-forum.cern.ch/t/cannot-run-macro/54466)

<div class="topic-metadata">

**Author:** [@Sabiha\_Tasneem\_JC](https://root-forum.cern.ch/u/Sabiha_Tasneem_JC)\
**Replies:** 3\
**Last updated:** [April 13, 2023, 12:07pm UTC](https://root-forum.cern.ch/t/cannot-run-macro/54466 "2023-04-13T12:07:15Z")

</div>

i am working in root. i have a code to open a root file, retrieve a histogram and find integral of a given range. but my code is not working. the code is working in my supervisor’s computer, but not in my computer. how c…

---

## [How to use CMake to compile with ROOT libraries](https://root-forum.cern.ch/t/how-to-use-cmake-to-compile-with-root-libraries/54458)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 1\
**Last updated:** [April 13, 2023, 5:20am UTC](https://root-forum.cern.ch/t/how-to-use-cmake-to-compile-with-root-libraries/54458 "2023-04-13T05:20:27Z")

</div>

Dear experts I’m new with CMake, I wrote one .cxx and .hxx file and the .hxx contains like: #include \<TFile.h\> And in my CMakeLists.txt it’s like: cmake\_minimum\_required(VERSION 3.3 FATAL\_ERROR) project(CRTTracking) …

---

## [SetLogx() gives me empty histogram](https://root-forum.cern.ch/t/setlogx-gives-me-empty-histogram/54442)

<div class="topic-metadata">

**Author:** [@tachyon](https://root-forum.cern.ch/u/tachyon)\
**Replies:** 4\
**Last updated:** [April 12, 2023, 11:30am UTC](https://root-forum.cern.ch/t/setlogx-gives-me-empty-histogram/54442 "2023-04-12T11:30:14Z")

</div>

Hi, I’m trying to draw a histogram in log x scale, so I set SetLogx() for my canvas. But this gives empty histogram. linear x scale → always works with any option log x scale → works well with “hist” or “bar” option.…

---

## [Where do I find a list of what all the RooFitResult status codes mean?](https://root-forum.cern.ch/t/where-do-i-find-a-list-of-what-all-the-roofitresult-status-codes-mean/54445)

<div class="topic-metadata">

**Author:** [@JackLindon](https://root-forum.cern.ch/u/JackLindon)\
**Replies:** 1\
**Last updated:** [April 12, 2023, 6:16am UTC](https://root-forum.cern.ch/t/where-do-i-find-a-list-of-what-all-the-roofitresult-status-codes-mean/54445 "2023-04-12T06:16:16Z")

</div>

Hi, where do I find a list of what all the RooFitResult status codes mean? (specifically with Minuit2 but ideally a list of with any minimizer). e.g. Status : MINIMIZE=-1 HESSE=302 When I look up online I can’t find an…

---

## [Problem reading TTree with PyRoot](https://root-forum.cern.ch/t/problem-reading-ttree-with-pyroot/54237)

<div class="topic-metadata">

**Author:** [@asanchezcastillo](https://root-forum.cern.ch/u/asanchezcastillo)\
**Replies:** 1\
**Last updated:** [April 11, 2023, 10:02am UTC](https://root-forum.cern.ch/t/problem-reading-ttree-with-pyroot/54237 "2023-04-11T10:02:19Z")

</div>

Hi, I am trying to read a TTree with PyRoot. The code I am running is the following: import ROOT import numpy as np f = ROOT.TFile.Open('Files/TimingCalibration\_provisional.root') tree = f.Get("Tree") MyCut=ROOT.TCu…

---

## [Splitting THnSparse](https://root-forum.cern.ch/t/splitting-thnsparse/54431)

<div class="topic-metadata">

**Author:** [@cmclauchlin](https://root-forum.cern.ch/u/cmclauchlin)\
**Replies:** 6\
**Last updated:** [April 10, 2023, 6:30pm UTC](https://root-forum.cern.ch/t/splitting-thnsparse/54431 "2023-04-10T18:30:07Z")

</div>

I have a 7-dimensional THnSparse histogram (hist\_7d) and want to be able to split it up into a 2d vector of 5-dimensional THnSparse (hist\_5d\[i\]\[j\]) where the i and j indices correspond to specific bins in the first two a…

---

## [Failed to import libcppyy3\_9. Please check that ROOT has been built for Python 3.9](https://root-forum.cern.ch/t/failed-to-import-libcppyy3-9-please-check-that-root-has-been-built-for-python-3-9/54432)

<div class="topic-metadata">

**Author:** [@Xavier\_James](https://root-forum.cern.ch/u/Xavier_James)\
**Replies:** 6\
**Last updated:** [April 10, 2023, 5:04pm UTC](https://root-forum.cern.ch/t/failed-to-import-libcppyy3-9-please-check-that-root-has-been-built-for-python-3-9/54432 "2023-04-10T17:04:31Z")

</div>

Hello, I am new to ROOT. Currently, I am using anaconda to run PyROOT. However, I keep running into this error message: “Failed to import libcppyy3\_9. Please check that ROOT has been built for Python 3.9”. From there, …

---

## [Pyroot code filling THStack from json does not fill canvas properly](https://root-forum.cern.ch/t/pyroot-code-filling-thstack-from-json-does-not-fill-canvas-properly/54413)

<div class="topic-metadata">

**Author:** [@Alkass](https://root-forum.cern.ch/u/Alkass)\
**Replies:** 3\
**Last updated:** [April 9, 2023, 9:37am UTC](https://root-forum.cern.ch/t/pyroot-code-filling-thstack-from-json-does-not-fill-canvas-properly/54413 "2023-04-09T09:37:34Z")

</div>

Hi I have a simple pyRoot code that read a json and fills two THStack histos. However, the canvas is still empty . Any ideas? import ROOT import json from ROOT import gROOT, TCanvas, TFile, TGraphErrors, TMath, SetO…

---

## [Relative error and Chi-Squared-Test](https://root-forum.cern.ch/t/relative-error-and-chi-squared-test/54380)

<div class="topic-metadata">

**Author:** [@RootFruit](https://root-forum.cern.ch/u/RootFruit)\
**Replies:** 1\
**Last updated:** [April 6, 2023, 5:15pm UTC](https://root-forum.cern.ch/t/relative-error-and-chi-squared-test/54380 "2023-04-06T17:15:41Z")

</div>

Hi ROOT experts, I have a histogram A that holds a distribution describing kinematics. Now I want to approximate that distribution by other distributions that were made under simplified assumptions. Then I want to quant…

---

## [Create a folder in a root file](https://root-forum.cern.ch/t/create-a-folder-in-a-root-file/54384)

<div class="topic-metadata">

**Author:** [@Emil\_R](https://root-forum.cern.ch/u/Emil_R)\
**Replies:** 1\
**Last updated:** [April 6, 2023, 7:31am UTC](https://root-forum.cern.ch/t/create-a-folder-in-a-root-file/54384 "2023-04-06T07:31:21Z")

</div>

Hi everyone, I want to create a folder inside of a root file, so that when I browse the file, I see several folders, which contain files. This probably has an extremely simple solution, but I can’t seem to find the rig…

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

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