# Newbie

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

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

---

## [How to print (& fill histogram with) two branches that are array using TTreeReaderArray](https://root-forum.cern.ch/t/how-to-print-fill-histogram-with-two-branches-that-are-array-using-ttreereaderarray/60418)

<div class="topic-metadata">

**Author:** [@Mukul](https://root-forum.cern.ch/u/Mukul)\
**Replies:** 10\
**Last updated:** [August 5, 2024, 10:01am UTC](https://root-forum.cern.ch/t/how-to-print-fill-histogram-with-two-branches-that-are-array-using-ttreereaderarray/60418 "2024-08-05T10:01:23Z")

</div>

Hello all. This topic is related to TTreeReaderArray. The goal is to print out the values inside the branches (array) in the terminal. I have branch “energy” and “time” as shown below. root \[19\] OutputTree-\>Scan("det…

---

## [TCanvas is not working, the prompt won't open](https://root-forum.cern.ch/t/tcanvas-is-not-working-the-prompt-wont-open/60372)

<div class="topic-metadata">

**Author:** [@Janhvikene](https://root-forum.cern.ch/u/Janhvikene)\
**Replies:** 3\
**Last updated:** [August 4, 2024, 9:58am UTC](https://root-forum.cern.ch/t/tcanvas-is-not-working-the-prompt-wont-open/60372 "2024-08-04T09:58:42Z")

</div>

ROOT Version:\_ 6.32.02 Platform:\_ windows Compiler:\_ gcc Hello I am a newbie. the TCanvas prompt not opening despite using the command TCanvas c1; How to fix this issue.

---

## [Python error massage "No module named "ROOT"" although ROOT is installed](https://root-forum.cern.ch/t/python-error-massage-no-module-named-root-although-root-is-installed/60410)

<div class="topic-metadata">

**Author:** [@David\_Slany](https://root-forum.cern.ch/u/David_Slany)\
**Replies:** 5\
**Last updated:** [August 4, 2024, 8:46am UTC](https://root-forum.cern.ch/t/python-error-massage-no-module-named-root-although-root-is-installed/60410 "2024-08-04T08:46:33Z")

</div>

Hello, Im a newbie to ROOT and PyROOT and recently installed ROOT via Ubuntu, which i wanted to use for my project. However Python is not able to find the module “ROOT” and I cant figure out why. I will be glad for any …

---

## [ROOT not connecting to python ("module libcppyy could not be found")](https://root-forum.cern.ch/t/root-not-connecting-to-python-module-libcppyy-could-not-be-found/60343)

<div class="topic-metadata">

**Author:** [@AlexanDUHH](https://root-forum.cern.ch/u/AlexanDUHH)\
**Replies:** 6\
**Last updated:** [July 31, 2024, 11:21am UTC](https://root-forum.cern.ch/t/root-not-connecting-to-python-module-libcppyy-could-not-be-found/60343 "2024-07-31T11:21:55Z")

</div>

Please read tips for efficient and successful posting and posting code ROOT Version: 6.32.02 Platform: Windows 11 Compiler: cl.exe (I think) Hello everyone, I hope you are doing well. This is my first time using R…

---

## [My histogram is not working "AttributeError: 'TObject' object has no attribute 'GetEntries'"](https://root-forum.cern.ch/t/my-histogram-is-not-working-attributeerror-tobject-object-has-no-attribute-getentries/60375)

<div class="topic-metadata">

**Author:** [@greentree](https://root-forum.cern.ch/u/greentree)\
**Replies:** 3\
**Last updated:** [July 31, 2024, 11:06am UTC](https://root-forum.cern.ch/t/my-histogram-is-not-working-attributeerror-tobject-object-has-no-attribute-getentries/60375 "2024-07-31T11:06:39Z")

</div>

I have a 3d histogram that I can see from TBrowser that has entries in it. However when I try to print entries i get AttributeError: ‘TObject’ object has no attribute ‘GetEntries’. The type of the object is: \<class cpp…

---

## [CopyTree in combination with AddFriend generates undesired behaviour](https://root-forum.cern.ch/t/copytree-in-combination-with-addfriend-generates-undesired-behaviour/60353)

<div class="topic-metadata">

**Author:** [@Vic](https://root-forum.cern.ch/u/Vic)\
**Replies:** 3\
**Last updated:** [July 30, 2024, 10:04am UTC](https://root-forum.cern.ch/t/copytree-in-combination-with-addfriend-generates-undesired-behaviour/60353 "2024-07-30T10:04:10Z")

</div>

Hi, I am using root 6.26/04. I am reading a TFile with two TTrees, I am trying to make one Tree friend of the other and now I want to remove entries based on a TCut that contains variables on both ttrees. Later I want t…

---

## [2D slice of 3D hist](https://root-forum.cern.ch/t/2d-slice-of-3d-hist/60357)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 2\
**Last updated:** [July 30, 2024, 7:08am UTC](https://root-forum.cern.ch/t/2d-slice-of-3d-hist/60357 "2024-07-30T07:08:44Z")

</div>

Hello. A detailed explanation of what I am trying to do. I have a deposited Energy (dE) vs ADC histogram where dE is in x-axis and ADC is in y-axis. This is 1D histogram and created for mapping purpose. Next, I have TH3…

---

## [How to access to std::vector\<TVector3\> in a TBranch?](https://root-forum.cern.ch/t/how-to-access-to-std-vector-tvector3-in-a-tbranch/60346)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 3\
**Last updated:** [July 29, 2024, 6:19am UTC](https://root-forum.cern.ch/t/how-to-access-to-std-vector-tvector3-in-a-tbranch/60346 "2024-07-29T06:19:36Z")

</div>

Dear experts I want to read a std::vector\<TVector3\> branch and here is what I do: //include files #pragma link C++ class std::vector\<TVector3\>+; void drawShape(){ TFile\* f = new TFile("file.root", "READ"); TTre…

---

## [TSAXParser.h not found while building app with ROOT dependency](https://root-forum.cern.ch/t/tsaxparser-h-not-found-while-building-app-with-root-dependency/60275)

<div class="topic-metadata">

**Author:** [@Bayli019](https://root-forum.cern.ch/u/Bayli019)\
**Replies:** 10\
**Last updated:** [July 26, 2024, 4:47pm UTC](https://root-forum.cern.ch/t/tsaxparser-h-not-found-while-building-app-with-root-dependency/60275 "2024-07-26T16:47:42Z")

</div>

\_ROOT Version: v6-33-01 Platform: Ubuntu 20.04 on Windows (WSL) Compiler: gcc/g++ I think…? Hello, I’m trying to install an application called musrfit, (https://lmu.web.psi.ch/musrfit/user/html/setup-standard.html)…

---

## [tree.CloneTree(0) not working](https://root-forum.cern.ch/t/tree-clonetree-0-not-working/60299)

<div class="topic-metadata">

**Author:** [@greentree](https://root-forum.cern.ch/u/greentree)\
**Replies:** 2\
**Last updated:** [July 25, 2024, 4:04pm UTC](https://root-forum.cern.ch/t/tree-clonetree-0-not-working/60299 "2024-07-25T16:04:28Z")

</div>

The problem: I clone my tree so that I don’t mess up the previous root file: cloned\_tree = tree.CloneTree(0) When I type tree.GetEntries() I see that it prints a large number. But when I do output\_file = ROOT.TFile(…

---

## [I get a "\*\*\* Break \*\*\* segmentation violation" error when calling a JAR library from the main Java project that uses a native ROOT](https://root-forum.cern.ch/t/i-get-a-break-segmentation-violation-error-when-calling-a-jar-library-from-the-main-java-project-that-uses-a-native-root/60316)

<div class="topic-metadata">

**Author:** [@PavleTsotskolauri](https://root-forum.cern.ch/u/PavleTsotskolauri)\
**Replies:** 5\
**Last updated:** [July 25, 2024, 8:33am UTC](https://root-forum.cern.ch/t/i-get-a-break-segmentation-violation-error-when-calling-a-jar-library-from-the-main-java-project-that-uses-a-native-root/60316 "2024-07-25T08:33:10Z")

</div>

Hello ROOT community Goal: I want to create JAR library that will have ROOT function implementations and then use this JAR library from main Java project that handles GUI. Problem: When I am compiling Jar library it, it…

---

## [Can not move mouse on the second TGraph which called SetHighlight()](https://root-forum.cern.ch/t/can-not-move-mouse-on-the-second-tgraph-which-called-sethighlight/60249)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 11\
**Last updated:** [July 23, 2024, 8:57am UTC](https://root-forum.cern.ch/t/can-not-move-mouse-on-the-second-tgraph-which-called-sethighlight/60249 "2024-07-23T08:57:03Z")

</div>

Dear experts I made a GUI to show waveform when the mouse is moving on the TGraph (event display), and I made 2 TGraph where the first one contains points that are not filtered, the second contains points that are filte…

---

## [Is it possible to export data from a 2D histogram?](https://root-forum.cern.ch/t/is-it-possible-to-export-data-from-a-2d-histogram/60252)

<div class="topic-metadata">

**Author:** [@Mariana\_Macedo](https://root-forum.cern.ch/u/Mariana_Macedo)\
**Replies:** 2\
**Last updated:** [July 22, 2024, 2:10pm UTC](https://root-forum.cern.ch/t/is-it-possible-to-export-data-from-a-2d-histogram/60252 "2024-07-22T14:10:56Z")

</div>

Hi, everybody! I am new in ROOT and I have come up with some doubts about graphic analysis. I have a pdf with a 2D Histogram, but i don’t have the .root or .c files with all the data to draw the graphic. Is there any w…

---

## [TLegend make a box on a TF1](https://root-forum.cern.ch/t/tlegend-make-a-box-on-a-tf1/60223)

<div class="topic-metadata">

**Author:** [@bc.pereira](https://root-forum.cern.ch/u/bc.pereira)\
**Replies:** 5\
**Last updated:** [July 21, 2024, 10:55am UTC](https://root-forum.cern.ch/t/tlegend-make-a-box-on-a-tf1/60223 "2024-07-21T10:55:08Z")

</div>

Hello, I am trying to make a box over a TF1 in the Legend. I have something like this: where fstat is a TF1 legendcell = new TLegend(0.67,0.53,0.98,0.7+0.015\*(years.size())); fstat-\>SetLineColor(429); fstat-\>SetFil…

---

## [GetRandom2](https://root-forum.cern.ch/t/getrandom2/60279)

<div class="topic-metadata">

**Author:** [@liz](https://root-forum.cern.ch/u/liz)\
**Replies:** 1\
**Last updated:** [July 21, 2024, 3:55am UTC](https://root-forum.cern.ch/t/getrandom2/60279 "2024-07-21T03:55:30Z")

</div>

Hello, I have a file containing the values of px, py, pz and E for a particle. I organized them in histogram as you can see in the following code: void read\_file(){ TH1F\* hE = new TH1F("hE"," energy",100,0,0); TH1F\*…

---

## [How does GetChisquare() is calculated when you fit data?!](https://root-forum.cern.ch/t/how-does-getchisquare-is-calculated-when-you-fit-data/60255)

<div class="topic-metadata">

**Author:** [@Elena\_Veli](https://root-forum.cern.ch/u/Elena_Veli)\
**Replies:** 4\
**Last updated:** [July 21, 2024, 12:09am UTC](https://root-forum.cern.ch/t/how-does-getchisquare-is-calculated-when-you-fit-data/60255 "2024-07-21T00:09:50Z")

</div>

chi\_square\_ndf = ex.GetChisquare() / ex.GetNDF(); I want to calculate the goodness of my fit, but I cannot find what is the equation behind chi2. Is it like this?: # Calculate chi-square residuals = unique\_charges - …

---

## [Can we use expected value to calculate measured value?](https://root-forum.cern.ch/t/can-we-use-expected-value-to-calculate-measured-value/60261)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 2\
**Last updated:** [July 19, 2024, 4:32pm UTC](https://root-forum.cern.ch/t/can-we-use-expected-value-to-calculate-measured-value/60261 "2024-07-19T16:32:09Z")

</div>

I’m not sure if this is a proper question here (if not please point me to somewhere thanks a lot) I’m trying to fit some drift chamber (not perfect cylinder) data value, where I have measurement t\_m (drift time measurem…

---

## [CMake Error, ROOTConfig.cmake could not be found while building application musrfit](https://root-forum.cern.ch/t/cmake-error-rootconfig-cmake-could-not-be-found-while-building-application-musrfit/60182)

<div class="topic-metadata">

**Author:** [@Bayli019](https://root-forum.cern.ch/u/Bayli019)\
**Replies:** 4\
**Last updated:** [July 19, 2024, 3:25pm UTC](https://root-forum.cern.ch/t/cmake-error-rootconfig-cmake-could-not-be-found-while-building-application-musrfit/60182 "2024-07-19T15:25:35Z")

</div>

\_ROOT Version: v6-33-01 Platform: Ubuntu 20.04 on Windows (WSL) Compiler: gcc/g++ I think…? Hello, I’m attempting to install root as a dependency for a package called musrfit and following the directions as listed …

---

## [G4 adv example 'brachytherapy' root error](https://root-forum.cern.ch/t/g4-adv-example-brachytherapy-root-error/60264)

<div class="topic-metadata">

**Author:** [@ekidna](https://root-forum.cern.ch/u/ekidna)\
**Replies:** 6\
**Last updated:** [July 19, 2024, 2:39pm UTC](https://root-forum.cern.ch/t/g4-adv-example-brachytherapy-root-error/60264 "2024-07-19T14:39:32Z")

</div>

Hello. I thank you in advance for any help. I am trying to use Geant4’s advanced example “brachytherapy”. After running a simulation I can get the file “brachytherapy.root”. Using Root I am able to use “macro.C” and “p…

---

## [Issues in generating dictionaries using root](https://root-forum.cern.ch/t/issues-in-generating-dictionaries-using-root/60215)

<div class="topic-metadata">

**Author:** [@Huang-Brown](https://root-forum.cern.ch/u/Huang-Brown)\
**Replies:** 9\
**Last updated:** [July 18, 2024, 9:57pm UTC](https://root-forum.cern.ch/t/issues-in-generating-dictionaries-using-root/60215 "2024-07-18T21:57:02Z")

</div>

Hello ROOT forum, I am having issues with generating dictionaries. Here’s a standalone, simplified reproducer MG\_reproducer.C. It looks for all udcs / anti quarks in an event and creates a vector of their 4-vectors, and…

---

## [Drawing an event with root while using iTerm2 on macbook does not produce pop-up graphics](https://root-forum.cern.ch/t/drawing-an-event-with-root-while-using-iterm2-on-macbook-does-not-produce-pop-up-graphics/60227)

<div class="topic-metadata">

**Author:** [@P4zmin0](https://root-forum.cern.ch/u/P4zmin0)\
**Replies:** 1\
**Last updated:** [July 16, 2024, 10:25pm UTC](https://root-forum.cern.ch/t/drawing-an-event-with-root-while-using-iterm2-on-macbook-does-not-produce-pop-up-graphics/60227 "2024-07-16T22:25:21Z")

</div>

Hello, I am new to root, c++, all of it - sorry if something is obvious. I needed to double check a particular event in my tree. I did the following in my terminal (iTerm2 running on macOS Monterrey): root -l root://c…

---

## [Abort Trap:6 with 6-dimension vector of 696,000 TH1Ds](https://root-forum.cern.ch/t/abort-trap-6-with-6-dimension-vector-of-696-000-th1ds/60224)

<div class="topic-metadata">

**Author:** [@cmclauchlin](https://root-forum.cern.ch/u/cmclauchlin)\
**Replies:** 2\
**Last updated:** [July 16, 2024, 8:49pm UTC](https://root-forum.cern.ch/t/abort-trap-6-with-6-dimension-vector-of-696-000-th1ds/60224 "2024-07-16T20:49:07Z")

</div>

I’m trying to make a vector of many histograms. I have a similar set of histograms that I make, but when I try and up the ante it seems to run into problems. Here’s the code issue in question: void Histogram::Bin\_Center…

---

## [How can I use my owen header files like #include\<myFunction.h\>](https://root-forum.cern.ch/t/how-can-i-use-my-owen-header-files-like-include-myfunction-h/60205)

<div class="topic-metadata">

**Author:** [@Xibeilius](https://root-forum.cern.ch/u/Xibeilius)\
**Replies:** 3\
**Last updated:** [July 15, 2024, 10:38am UTC](https://root-forum.cern.ch/t/how-can-i-use-my-owen-header-files-like-include-myfunction-h/60205 "2024-07-15T10:38:01Z")

</div>

I have a header file myFunction.h, defined a function prototype wroten by myself. And I implemented this function in a cpp file myFunction.cpp. How can I use the function in my ROOT macro? Like: #include\<myFunction.h\> …

---

## [Info in \<TCanvas::MakeDefCanvas\>: created default TCanvas with name c1 but can't see it in windows](https://root-forum.cern.ch/t/info-in-tcanvas-makedefcanvas-created-default-tcanvas-with-name-c1-but-cant-see-it-in-windows/60066)

<div class="topic-metadata">

**Author:** [@Closedbook](https://root-forum.cern.ch/u/Closedbook)\
**Replies:** 6\
**Last updated:** [July 12, 2024, 9:09am UTC](https://root-forum.cern.ch/t/info-in-tcanvas-makedefcanvas-created-default-tcanvas-with-name-c1-but-cant-see-it-in-windows/60066 "2024-07-12T09:09:57Z")

</div>

Here is a case in Guide: TF1 efunc("efunc","exp(\[0\]+\[1\]\*x)",0.,5.); efunc.SetParameter(0,1); efunc.SetParameter(1,-1); TH1F h("h","example histogram",100,0.,5.); for (int i=0;i\<1000;i++) {h.Fill(efunc.GetRandom());} h.D…

---

## [Get error when generating dictionary](https://root-forum.cern.ch/t/get-error-when-generating-dictionary/60164)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 3\
**Last updated:** [July 11, 2024, 10:53am UTC](https://root-forum.cern.ch/t/get-error-when-generating-dictionary/60164 "2024-07-11T10:53:56Z")

</div>

Dear experts When I tried to generate the dictionary of std::vector\<TVector2\> I got the error while compiling, here is what I did: vector\_of\_TVector2\_LinkDef.h: #ifdef \_\_CLING\_\_ #pragma link C++ class std::vector\<TVec…

---

## [Need Help Determining Flatness in ROOT (ProjectionX)](https://root-forum.cern.ch/t/need-help-determining-flatness-in-root-projectionx/60147)

<div class="topic-metadata">

**Author:** [@Soufiyan-Yachou](https://root-forum.cern.ch/u/Soufiyan-Yachou)\
**Replies:** 2\
**Last updated:** [July 10, 2024, 11:24am UTC](https://root-forum.cern.ch/t/need-help-determining-flatness-in-root-projectionx/60147 "2024-07-10T11:24:29Z")

</div>

\_\_\_Hi everyone, I have a cumulative dose curve for XY and YZ, and I want to determine the flatness for just the first millimeter. I need to fix the Y-axis to measure the flatness in just the first millimeter, but I don’…

---

## [Will a pointer contents been deleted after TTree::Fill()?](https://root-forum.cern.ch/t/will-a-pointer-contents-been-deleted-after-ttree-fill/60142)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 1\
**Last updated:** [July 9, 2024, 10:12pm UTC](https://root-forum.cern.ch/t/will-a-pointer-contents-been-deleted-after-ttree-fill/60142 "2024-07-09T22:12:27Z")

</div>

Dear experts I have a customized class that will been filled to a TTree, I wonder do I need to call delete objectA; objectA = nullptr; after every Fill()?

---

## [Use TTreeFormula to select elements of TTreeReaderArray](https://root-forum.cern.ch/t/use-ttreeformula-to-select-elements-of-ttreereaderarray/60121)

<div class="topic-metadata">

**Author:** [@Simone\_Vallarino](https://root-forum.cern.ch/u/Simone_Vallarino)\
**Replies:** 4\
**Last updated:** [July 6, 2024, 1:29pm UTC](https://root-forum.cern.ch/t/use-ttreeformula-to-select-elements-of-ttreereaderarray/60121 "2024-07-06T13:29:44Z")

</div>

Hi, I’m trying to analyze a root tree using a TTreeReader; the tree is designed to be read by using TTreeReaderArray. In my case, it is defined as: TTreeReaderArrayedm4hep::MCParticleData MCParticles(tree\_reader,“MCPa…

---

## [Cling Load Library Error(?)](https://root-forum.cern.ch/t/cling-load-library-error/60077)

<div class="topic-metadata">

**Author:** [@jbrom](https://root-forum.cern.ch/u/jbrom)\
**Replies:** 6\
**Last updated:** [July 3, 2024, 3:09pm UTC](https://root-forum.cern.ch/t/cling-load-library-error/60077 "2024-07-03T15:09:43Z")

</div>

ROOT Version: 6.32.02 Platform: win64 Compiler: MSVC 19.39.33521.0 I recently installed ROOT on my lab’s PC after about a year and a half of using my laptop (ROOT 6.26/10, win64, MSVC 19.32.31332.0). I’ve noticed tha…

---

## [Get seg fault when trying to call TGMainFrame::Cleanup() then reuse the frame](https://root-forum.cern.ch/t/get-seg-fault-when-trying-to-call-tgmainframe-cleanup-then-reuse-the-frame/59746)

<div class="topic-metadata">

**Author:** [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Replies:** 13\
**Last updated:** [July 3, 2024, 1:42pm UTC](https://root-forum.cern.ch/t/get-seg-fault-when-trying-to-call-tgmainframe-cleanup-then-reuse-the-frame/59746 "2024-07-03T13:42:02Z")

</div>

Dear experts I want to make a GUI which after I click a button it process something and then clean up everything on the main frame, then add new things on it. Here is part of code: EventDisplay::EventDisplay() { …

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

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