# Newbie

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

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

---

## [User defined class](https://root-forum.cern.ch/t/user-defined-class/47943)

<div class="topic-metadata">

**Author:** [@Natilus](https://root-forum.cern.ch/u/Natilus)\
**Replies:** 15\
**Last updated:** [January 12, 2022, 10:01am UTC](https://root-forum.cern.ch/t/user-defined-class/47943 "2022-01-12T10:01:45Z")

</div>

Dear experts, I have written a class (AdditionalCuts.h) with some members and functions to take two strings (input filename and decay mode) to open the input file and read a tree and apply some cuts and save it in a tre…

---

## [PyRoot TLine Struggles](https://root-forum.cern.ch/t/pyroot-tline-struggles/48311)

<div class="topic-metadata">

**Author:** [@Nabiro](https://root-forum.cern.ch/u/Nabiro)\
**Replies:** 4\
**Last updated:** [January 11, 2022, 3:22am UTC](https://root-forum.cern.ch/t/pyroot-tline-struggles/48311 "2022-01-11T03:22:18Z")

</div>

Hello everyone! This is my first forum post and I wanted to ask about the TLine() function in regards to drawing a line on an existing plot like a histogram plot for example but even before that I’m struggling with just…

---

## [Adding stats box to legend](https://root-forum.cern.ch/t/adding-stats-box-to-legend/48306)

<div class="topic-metadata">

**Author:** [@Voldemort](https://root-forum.cern.ch/u/Voldemort)\
**Replies:** 2\
**Last updated:** [January 10, 2022, 3:59pm UTC](https://root-forum.cern.ch/t/adding-stats-box-to-legend/48306 "2022-01-10T15:59:12Z")

</div>

Is it possible to put stat box info in the legend? instead of having them in two separate boxes?

---

## [Can't install ROOT using Home-brew on Mac, problem with python@2](https://root-forum.cern.ch/t/cant-install-root-using-home-brew-on-mac-problem-with-python-2/48315)

<div class="topic-metadata">

**Author:** [@eggsAndCoffee](https://root-forum.cern.ch/u/eggsAndCoffee)\
**Replies:** 1\
**Last updated:** [January 9, 2022, 11:07pm UTC](https://root-forum.cern.ch/t/cant-install-root-using-home-brew-on-mac-problem-with-python-2/48315 "2022-01-09T23:07:48Z")

</div>

Hi all, I’m trying to install ROOT on my Mac (OS Monterey 12.1) using Homebrew. I have the BASH shell enabled. However, I get the following error when I try to run “brew install root”: FormulaUnavailableError: No avail…

---

## [Problem about CMSSW and Higgs Analysis](https://root-forum.cern.ch/t/problem-about-cmssw-and-higgs-analysis/48278)

<div class="topic-metadata">

**Author:** [@XxXx](https://root-forum.cern.ch/u/XxXx)\
**Replies:** 1\
**Last updated:** [January 7, 2022, 1:13pm UTC](https://root-forum.cern.ch/t/problem-about-cmssw-and-higgs-analysis/48278 "2022-01-07T13:13:01Z")

</div>

When I tried to use the CMSSW and Higgs Analysis, but an error happened: Fatal in \<TROOT::InitInterpreter\>: cannot load library /cvmfs/cms.cern.ch/slc7\_amd64\_gcc700/cms/cmssw/CMSSW\_10\_2\_13/external/slc7\_amd64\_gcc700/lib…

---

## [TCanvas as a private variable of class](https://root-forum.cern.ch/t/tcanvas-as-a-private-variable-of-class/48235)

<div class="topic-metadata">

**Author:** [@Gundi](https://root-forum.cern.ch/u/Gundi)\
**Replies:** 8\
**Last updated:** [January 7, 2022, 5:58am UTC](https://root-forum.cern.ch/t/tcanvas-as-a-private-variable-of-class/48235 "2022-01-07T05:58:06Z")

</div>

Hello, I am having a problem when trying to use a TCanvas as a private variable in a class, and using it in a method of that class! Here are the files in which there is a problem: File Functor.h class Functor { public…

---

## [Compiling a Geant4 based software, but get an error in root](https://root-forum.cern.ch/t/compiling-a-geant4-based-software-but-get-an-error-in-root/48041)

<div class="topic-metadata">

**Author:** [@El\_Abbassi\_Abderezza](https://root-forum.cern.ch/u/El_Abbassi_Abderezza)\
**Replies:** 4\
**Last updated:** [January 5, 2022, 4:03pm UTC](https://root-forum.cern.ch/t/compiling-a-geant4-based-software-but-get-an-error-in-root/48041 "2022-01-05T16:03:31Z")

</div>

Hi Root community, Can you give me a hint about this compiling problem of a software that uses root and it’s Geant4 based, here I get a root compiling problem with make only. However it’s compiled fine in the first att…

---

## [Incorrect drawing of fit from roofit](https://root-forum.cern.ch/t/incorrect-drawing-of-fit-from-roofit/48216)

<div class="topic-metadata">

**Author:** [@Bryzol](https://root-forum.cern.ch/u/Bryzol)\
**Replies:** 4\
**Last updated:** [January 5, 2022, 3:52pm UTC](https://root-forum.cern.ch/t/incorrect-drawing-of-fit-from-roofit/48216 "2022-01-05T15:52:28Z")

</div>

\_ROOT Version: JupyROOT 6.24/06 \_Platform: Linux Ubuntu 20.04 \_Compiler: Python 3.9.7 Hello, While fitting cdf function, I come across incorrect drawing of the fit, the parameters however are correct (checked in Im…

---

## [How to use ROOT?](https://root-forum.cern.ch/t/how-to-use-root/48268)

<div class="topic-metadata">

**Author:** [@vasco](https://root-forum.cern.ch/u/vasco)\
**Replies:** 1\
**Last updated:** [January 5, 2022, 1:03pm UTC](https://root-forum.cern.ch/t/how-to-use-root/48268 "2022-01-05T13:03:14Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: Not Provided Platform: Ubuntu Compiler: g++ Hi! I’m new to ROOT and I’m just trying to learn the basics. So I’m want to draw an h…

---

## [Using ROOT in a c++ code](https://root-forum.cern.ch/t/using-root-in-a-c-code/48257)

<div class="topic-metadata">

**Author:** [@DavideLP](https://root-forum.cern.ch/u/DavideLP)\
**Replies:** 4\
**Last updated:** [January 4, 2022, 4:51pm UTC](https://root-forum.cern.ch/t/using-root-in-a-c-code/48257 "2022-01-04T16:51:17Z")

</div>

Hi, I’m coding as a project a c++ simulation of ALICE experiment. I need to use the various ROOT classes and features in my code: but I don’t know -1) What should I include (and where: only in my main? or every where I …

---

## [Install root and pyroot under MacOS Monterey](https://root-forum.cern.ch/t/install-root-and-pyroot-under-macos-monterey/47934)

<div class="topic-metadata">

**Author:** [@j.slim](https://root-forum.cern.ch/u/j.slim)\
**Replies:** 5\
**Last updated:** [January 4, 2022, 4:12pm UTC](https://root-forum.cern.ch/t/install-root-and-pyroot-under-macos-monterey/47934 "2022-01-04T16:12:32Z")

</div>

I just want want to install root on MacOS Monterey with python support, i.e. I want to use pyROOT.

---

## [Attemp of merge histogram failling](https://root-forum.cern.ch/t/attemp-of-merge-histogram-failling/48224)

<div class="topic-metadata">

**Author:** [@Lucas\_Santos\_Sousa](https://root-forum.cern.ch/u/Lucas_Santos_Sousa)\
**Replies:** 1\
**Last updated:** [December 31, 2021, 5:06am UTC](https://root-forum.cern.ch/t/attemp-of-merge-histogram-failling/48224 "2021-12-31T05:06:32Z")

</div>

void k() { TFile \*f1 = TFile::Open("/home/lucas/Downloads/aasd/asd/a.root"); TTree \*tr1 = (TTree \*) f1-\>Get("a"); tr1-\>Draw("hist"); TFile \*f2 = TFile::Open("/home/lucas/Downloads/aasd/asd/b.root"); TTree \*tr2 = (TTree \*…

---

## [Get integral of the histogram from TDirectory](https://root-forum.cern.ch/t/get-integral-of-the-histogram-from-tdirectory/48206)

<div class="topic-metadata">

**Author:** [@beg1nner](https://root-forum.cern.ch/u/beg1nner)\
**Replies:** 2\
**Last updated:** [December 28, 2021, 12:35pm UTC](https://root-forum.cern.ch/t/get-integral-of-the-histogram-from-tdirectory/48206 "2021-12-28T12:35:28Z")

</div>

Hello, I have an ntuple which has 2 subdirectories (TDirectoryFile) and in those subdirectories there are TH1 histograms. I want to access the integral of those histograms. Is it somehow possible to do this from the ter…

---

## [2 TTrees are generated for the same ROOT file despite only defining one](https://root-forum.cern.ch/t/2-ttrees-are-generated-for-the-same-root-file-despite-only-defining-one/48186)

<div class="topic-metadata">

**Author:** [@Ali\_Esha](https://root-forum.cern.ch/u/Ali_Esha)\
**Replies:** 6\
**Last updated:** [December 28, 2021, 11:41am UTC](https://root-forum.cern.ch/t/2-ttrees-are-generated-for-the-same-root-file-despite-only-defining-one/48186 "2021-12-28T11:41:50Z")

</div>

\_ROOT Version: 6.20/04 \_Platform: I can find two trees inside the root file, although I only created a single Tree called Events. Why is this happening? In any root file, I generate in my system, the same is happeni…

---

## [Incorrect Legend in RooFit fit plot](https://root-forum.cern.ch/t/incorrect-legend-in-roofit-fit-plot/48198)

<div class="topic-metadata">

**Author:** [@Shailesh](https://root-forum.cern.ch/u/Shailesh)\
**Replies:** 2\
**Last updated:** [December 28, 2021, 6:24am UTC](https://root-forum.cern.ch/t/incorrect-legend-in-roofit-fit-plot/48198 "2021-12-28T06:24:56Z")

</div>

\_ROOT Version:\_6.24 Platform: Ubuntu 20.04 I am generating random numbers to fill a histogram h. Then, I try to fit a Gaussian on h using RooFit. When I add the Legend, the fit curve is represented as Histogram points …

---

## [COLZ is not showing the axis numbers fully](https://root-forum.cern.ch/t/colz-is-not-showing-the-axis-numbers-fully/48154)

<div class="topic-metadata">

**Author:** [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Replies:** 4\
**Last updated:** [December 23, 2021, 8:56pm UTC](https://root-forum.cern.ch/t/colz-is-not-showing-the-axis-numbers-fully/48154 "2021-12-23T20:56:38Z")

</div>

Hello experts, I am having an issue when plotting a 2D histogram with the “colz” option. When I look at the z-axis, the numbers on the ticks are not fully displayed. It is as if the numbers go beyond what the canvas can…

---

## [Plotting ProfileX for different 2D histograms in multiple pads](https://root-forum.cern.ch/t/plotting-profilex-for-different-2d-histograms-in-multiple-pads/48160)

<div class="topic-metadata">

**Author:** [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Replies:** 2\
**Last updated:** [December 23, 2021, 3:42pm UTC](https://root-forum.cern.ch/t/plotting-profilex-for-different-2d-histograms-in-multiple-pads/48160 "2021-12-23T15:42:22Z")

</div>

Hello Experts, I have been working on a macro that is very specific to the root files I look at and analyze. I have been able to do everything I want the macro to do, except for one thing. For a specific set of 2D histo…

---

## [How to plot mca data(channel vs counts)](https://root-forum.cern.ch/t/how-to-plot-mca-data-channel-vs-counts/47914)

<div class="topic-metadata">

**Author:** [@pijushjana](https://root-forum.cern.ch/u/pijushjana)\
**Replies:** 1\
**Last updated:** [December 21, 2021, 12:56pm UTC](https://root-forum.cern.ch/t/how-to-plot-mca-data-channel-vs-counts/47914 "2021-12-21T12:56:20Z")

</div>

ROOT Version: 6.24/06 Platform: ubuntu 20.04 Compiler: gcc

---

## [Issue with rootcint in Root 6.24/02](https://root-forum.cern.ch/t/issue-with-rootcint-in-root-6-24-02/48116)

<div class="topic-metadata">

**Author:** [@Farrukh](https://root-forum.cern.ch/u/Farrukh)\
**Replies:** 3\
**Last updated:** [December 20, 2021, 10:22am UTC](https://root-forum.cern.ch/t/issue-with-rootcint-in-root-6-24-02/48116 "2021-12-20T10:22:33Z")

</div>

Dear All using rootcint in the following line (you’ll see my local .h etc) gives the following error : “rootcint: for the -s option: may not occur within a group!” The actual line in the script is : rootcint -f styl…

---

## [Read 2-dimensional c-array branch with RDataFrame](https://root-forum.cern.ch/t/read-2-dimensional-c-array-branch-with-rdataframe/47964)

<div class="topic-metadata">

**Author:** [@mtROOT](https://root-forum.cern.ch/u/mtROOT)\
**Replies:** 3\
**Last updated:** [December 18, 2021, 9:03pm UTC](https://root-forum.cern.ch/t/read-2-dimensional-c-array-branch-with-rdataframe/47964 "2021-12-18T21:03:12Z")

</div>

Hi, I created a RDataFrame reading a TTree. The Tree has branches: const int kNPmax = 250; int brStdHepN; // Number of particles in particle array double brStdHepP4 \[kNPmax\]\[4\]; // 4-…

---

## [Error: Unable to find FitPanel plug-in](https://root-forum.cern.ch/t/error-unable-to-find-fitpanel-plug-in/48082)

<div class="topic-metadata">

**Author:** [@Aldo](https://root-forum.cern.ch/u/Aldo)\
**Replies:** 9\
**Last updated:** [December 17, 2021, 10:50am UTC](https://root-forum.cern.ch/t/error-unable-to-find-fitpanel-plug-in/48082 "2021-12-17T10:50:45Z")

</div>

Hi, I have a problem opening the FitPanel on an histogram: Unable to find The FitPanel plug-in Do you have any suggestion? Thanks Aldo ROOT Version: 6.24/06 Platform: CentOS7

---

## [I have ROOT Version 6.22/02.I need to update the version with C++14](https://root-forum.cern.ch/t/i-have-root-version-6-22-02-i-need-to-update-the-version-with-c-14/48094)

<div class="topic-metadata">

**Author:** [@pjana](https://root-forum.cern.ch/u/pjana)\
**Replies:** 1\
**Last updated:** [December 17, 2021, 8:09am UTC](https://root-forum.cern.ch/t/i-have-root-version-6-22-02-i-need-to-update-the-version-with-c-14/48094 "2021-12-17T08:09:11Z")

</div>

I have ROOT Version 6.22/02.I need to update the version with C++14 supported.Can anyone please tell me how to do that?Thanks!!

---

## [memory leak in TTree-\>fill() (multitree)](https://root-forum.cern.ch/t/memory-leak-in-ttree-fill-multitree/48078)

<div class="topic-metadata">

**Author:** [@mingzhe](https://root-forum.cern.ch/u/mingzhe)\
**Replies:** 1\
**Last updated:** [December 16, 2021, 8:48am UTC](https://root-forum.cern.ch/t/memory-leak-in-ttree-fill-multitree/48078 "2021-12-16T08:48:29Z")

</div>

Hello, I’m working on the analysis code to read a xAOD file and generate my own root file. However I have the problems with memory leak like this Package.EventLoop INFO Memory increase/change during the job:…

---

## [Unable to upload the figure?](https://root-forum.cern.ch/t/unable-to-upload-the-figure/48055)

<div class="topic-metadata">

**Author:** [@manish1](https://root-forum.cern.ch/u/manish1)\
**Replies:** 1\
**Last updated:** [December 16, 2021, 8:37am UTC](https://root-forum.cern.ch/t/unable-to-upload-the-figure/48055 "2021-12-16T08:37:23Z")

</div>

Dear expert, When I tried to upload the distribution to explain the quire clearly. But the distribution did not upload after long time and status shows process uploading. Can you suggest me why this happen and the same …

---

## [Understanding usage of RDataFrame Filter and Define functions on distributed data](https://root-forum.cern.ch/t/understanding-usage-of-rdataframe-filter-and-define-functions-on-distributed-data/47933)

<div class="topic-metadata">

**Author:** [@Chinmay](https://root-forum.cern.ch/u/Chinmay)\
**Replies:** 16\
**Last updated:** [December 15, 2021, 12:42pm UTC](https://root-forum.cern.ch/t/understanding-usage-of-rdataframe-filter-and-define-functions-on-distributed-data/47933 "2021-12-15T12:42:01Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 6.22 Platform: Ubuntu 20.04 Compiler: GCC \>= 7. Hi. I want to do something like following : int main(int argc, char\*\* argv) { Te…

---

## [ROOT C++ notebook inside vscode](https://root-forum.cern.ch/t/root-c-notebook-inside-vscode/48059)

<div class="topic-metadata">

**Author:** [@Nirmal](https://root-forum.cern.ch/u/Nirmal)\
**Replies:** 3\
**Last updated:** [December 15, 2021, 11:33am UTC](https://root-forum.cern.ch/t/root-c-notebook-inside-vscode/48059 "2021-12-15T11:33:40Z")

</div>

Hi, I would like to run the Jupyter notebook with a ROOT C++ kernel inside vscode. I saw that vscode allows one to chose a kernel, but I cannot see the ROOT C++ kernel in my list of dropdown kernels (screenshot below) …

---

## [Generate random points inside a TCutG](https://root-forum.cern.ch/t/generate-random-points-inside-a-tcutg/48051)

<div class="topic-metadata">

**Author:** [@jgomez2](https://root-forum.cern.ch/u/jgomez2)\
**Replies:** 1\
**Last updated:** [December 14, 2021, 8:01am UTC](https://root-forum.cern.ch/t/generate-random-points-inside-a-tcutg/48051 "2021-12-14T08:01:26Z")

</div>

I have made a TCutG using a TH2 and am now looking to randomly generate and points that are inside of it. Is there a quick way to do this? I could generate many x,y values and just ask ‘isinside’ , but that feels very …

---

## [Is there an easier way to create multiple canvases using functions and loops?](https://root-forum.cern.ch/t/is-there-an-easier-way-to-create-multiple-canvases-using-functions-and-loops/41742)

<div class="topic-metadata">

**Author:** [@Cepheides](https://root-forum.cern.ch/u/Cepheides)\
**Replies:** 3\
**Last updated:** [December 14, 2021, 1:26pm UTC](https://root-forum.cern.ch/t/is-there-an-easier-way-to-create-multiple-canvases-using-functions-and-loops/41742 "2021-12-14T13:26:31Z")

</div>

I am trying to follow this worksheet from Hance and recreate the invariant mass plot below from his root file. I have attached my code and the root file can be downloaded from the website.HEP\_practiceV6.C (33.3 KB) (uplo…

---

## [How to draw optimization of 2D between two variables?](https://root-forum.cern.ch/t/how-to-draw-optimization-of-2d-between-two-variables/48052)

<div class="topic-metadata">

**Author:** [@chanchal](https://root-forum.cern.ch/u/chanchal)\
**Replies:** 3\
**Last updated:** [December 14, 2021, 10:57am UTC](https://root-forum.cern.ch/t/how-to-draw-optimization-of-2d-between-two-variables/48052 "2021-12-14T10:57:37Z")

</div>

Dear Expert, I plotted the 1D distribution of photon energy and asymmetry energy ratio. Both are strongly correlated. But I want to draw the optimization of 2D distribution between both variables. I also attached the 1D…

---

## [Trouble with shared libraries ROOT v6\_18\_04d on ubuntu 20.04](https://root-forum.cern.ch/t/trouble-with-shared-libraries-root-v6-18-04d-on-ubuntu-20-04/48057)

<div class="topic-metadata">

**Author:** [@Farrukh](https://root-forum.cern.ch/u/Farrukh)\
**Replies:** 1\
**Last updated:** [December 14, 2021, 9:20am UTC](https://root-forum.cern.ch/t/trouble-with-shared-libraries-root-v6-18-04d-on-ubuntu-20-04/48057 "2021-12-14T09:20:42Z")

</div>

Dear Folks I succesfully installed cvmfs on ubuntu laptop and then attempted to use root . /cvmfs/larsoft.opensciencegrid.org/products/setup which root /cvmfs/larsoft.opensciencegrid.org/products/root/v6\_18\_04d/Linux…

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

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