# Newbie

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

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

---

## [Help with linear fit](https://root-forum.cern.ch/t/help-with-linear-fit/59263)

<div class="topic-metadata">

**Author:** [@liz](https://root-forum.cern.ch/u/liz)\
**Replies:** 3\
**Last updated:** [May 14, 2024, 7:06am UTC](https://root-forum.cern.ch/t/help-with-linear-fit/59263 "2024-05-14T07:06:55Z")

</div>

Hello, I need help with a very simple problem: a linear fit. I don’t understand what is wrong with this code… The data shows up on the graph but not the fit… #include "TCanvas.h" #include "TFile.h" #include "TH1.h" #inc…

---

## [Not able to set font type for TLegend using GUI?](https://root-forum.cern.ch/t/not-able-to-set-font-type-for-tlegend-using-gui/59268)

<div class="topic-metadata">

**Author:** [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Replies:** 10\
**Last updated:** [May 13, 2024, 1:58pm UTC](https://root-forum.cern.ch/t/not-able-to-set-font-type-for-tlegend-using-gui/59268 "2024-05-13T13:58:45Z")

</div>

Hi all, I added a legend to existing canvas using the \`\`BuildLegend()\` I am not able to set the font type to ‘times’ as doing that through the GUI seems to have no effect on the entry labels ? Although, the font size …

---

## [Can anyone please guide me to how can open the example 4a root file?](https://root-forum.cern.ch/t/can-anyone-please-guide-me-to-how-can-open-the-example-4a-root-file/59231)

<div class="topic-metadata">

**Author:** [@Ratilal\_Meher](https://root-forum.cern.ch/u/Ratilal_Meher)\
**Replies:** 2\
**Last updated:** [May 13, 2024, 1:51pm UTC](https://root-forum.cern.ch/t/can-anyone-please-guide-me-to-how-can-open-the-example-4a-root-file/59231 "2024-05-13T13:51:56Z")

</div>

root \[0\] root -l B4.root ROOT\_prompt\_0:1:7: error: use of undeclared identifier ‘l’ root -l B4.root ^ root \[1\] root -l B4.root ROOT\_prompt\_1:1:7: error: use of undeclared identifier ‘l’ root -l B4.root ^ root \[2\]…

---

## [Option to include root macros in latex lstlisings?](https://root-forum.cern.ch/t/option-to-include-root-macros-in-latex-lstlisings/59239)

<div class="topic-metadata">

**Author:** [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Replies:** 2\
**Last updated:** [May 13, 2024, 1:41pm UTC](https://root-forum.cern.ch/t/option-to-include-root-macros-in-latex-lstlisings/59239 "2024-05-13T13:41:03Z")

</div>

HI, is there any predefined option for ROOT syntax highlighting while including macros in a LaTeX document using \\lstlistings ? Thanks a lot

---

## [How to get the data for only one branch](https://root-forum.cern.ch/t/how-to-get-the-data-for-only-one-branch/59240)

<div class="topic-metadata">

**Author:** [@KillianUB](https://root-forum.cern.ch/u/KillianUB)\
**Replies:** 26\
**Last updated:** [May 13, 2024, 11:39am UTC](https://root-forum.cern.ch/t/how-to-get-the-data-for-only-one-branch/59240 "2024-05-13T11:39:33Z")

</div>

Hello, here is a code i write as a noob at root : TFile f("RAW148OS\_treeFF01.root"); std::unique\_ptr\<TTree\> tv\_\_tree(static\_cast\<TTree\*\>(f.Get("Analysis\_All"))); tv\_\_tree-\>Draw("Psd\_All\_Shift\>\>h1(8000,0,8000)","","colz…

---

## [How can I access those data?](https://root-forum.cern.ch/t/how-can-i-access-those-data/59308)

<div class="topic-metadata">

**Author:** [@KillianUB](https://root-forum.cern.ch/u/KillianUB)\
**Replies:** 3\
**Last updated:** [May 12, 2024, 9:59am UTC](https://root-forum.cern.ch/t/how-can-i-access-those-data/59308 "2024-05-12T09:59:22Z")

</div>

Hello, first I would like to apologize about my spaming on the forum this one will be the last. Here is the data I would like to get to finally plot my number of detections according to the number of detectors that d…

---

## [How can I use data that is entangled with other data?](https://root-forum.cern.ch/t/how-can-i-use-data-that-is-entangled-with-other-data/59300)

<div class="topic-metadata">

**Author:** [@KillianUB](https://root-forum.cern.ch/u/KillianUB)\
**Replies:** 3\
**Last updated:** [May 11, 2024, 7:59pm UTC](https://root-forum.cern.ch/t/how-can-i-use-data-that-is-entangled-with-other-data/59300 "2024-05-11T19:59:43Z")

</div>

Hello again, I’m trying to use data in a Branch, but those data are enangled in ROOT::VecOps::RVec\<UShort\_t\>. I’ve used RDF but I’m defenetly not able to get what i want from this. Is there something I am missing ? Her’…

---

## [Periodically write TNtuple to ROOT file and clear TNtuple object from memory in EventLoop](https://root-forum.cern.ch/t/periodically-write-tntuple-to-root-file-and-clear-tntuple-object-from-memory-in-eventloop/59301)

<div class="topic-metadata">

**Author:** [@SumanK](https://root-forum.cern.ch/u/SumanK)\
**Replies:** 2\
**Last updated:** [May 11, 2024, 10:10am UTC](https://root-forum.cern.ch/t/periodically-write-tntuple-to-root-file-and-clear-tntuple-object-from-memory-in-eventloop/59301 "2024-05-11T10:10:30Z")

</div>

ROOT Version: 6.28/04 and 6.22/00 Platform: CENT OS 7 on CERN CVMFS NAME=“CentOS Linux” VERSION=“7 (Core)” ID=“centos” ID\_LIKE=“rhel fedora” VERSION\_ID=“7” PRETTY\_NAME=“CentOS Linux 7 (Core)” gcc version 8.3.0 (…

---

## [I'm Stuck with my code](https://root-forum.cern.ch/t/im-stuck-with-my-code/59293)

<div class="topic-metadata">

**Author:** [@KillianUB](https://root-forum.cern.ch/u/KillianUB)\
**Replies:** 2\
**Last updated:** [May 10, 2024, 5:30pm UTC](https://root-forum.cern.ch/t/im-stuck-with-my-code/59293 "2024-05-10T17:30:49Z")

</div>

Hello, I’m trying to extract the data from Branch named as Psd\_All\_Shift. Those data are Column ROOT::VecOps::RVec\<UShort\_t\> has type ROOT::VecOps::RVec\<UShort\_t\>. TTree::Scan(“Psd\_All\_Shift”) returns me : wish is e…

---

## [Leaf with array!](https://root-forum.cern.ch/t/leaf-with-array/59285)

<div class="topic-metadata">

**Author:** [@Saurav](https://root-forum.cern.ch/u/Saurav)\
**Replies:** 2\
**Last updated:** [May 10, 2024, 5:15am UTC](https://root-forum.cern.ch/t/leaf-with-array/59285 "2024-05-10T05:15:36Z")

</div>

Dear Experts, If I have a leaf named Interaction that looks like Interaction\[hit\]\[4\] in the header file with \[hit\] of dimension 100 ,and \[4\] refers 0 as x, 1 as y, 2 as z and 3 as t coordinates. In my c++ macro I am …

---

## [Unable to fill a 2d histogram](https://root-forum.cern.ch/t/unable-to-fill-a-2d-histogram/59264)

<div class="topic-metadata">

**Author:** [@Rana](https://root-forum.cern.ch/u/Rana)\
**Replies:** 2\
**Last updated:** [May 10, 2024, 1:06am UTC](https://root-forum.cern.ch/t/unable-to-fill-a-2d-histogram/59264 "2024-05-10T01:06:05Z")

</div>

Hi Experts, I am trying to fill a 2D histogram with hits on x vs z values. I am unable to fill the histogram, however doing a cout I get the result. I am attaching the block of the code as well the screenshot of the te…

---

## [Solving set of equations](https://root-forum.cern.ch/t/solving-set-of-equations/59281)

<div class="topic-metadata">

**Author:** [@Noor1](https://root-forum.cern.ch/u/Noor1)\
**Replies:** 1\
**Last updated:** [May 9, 2024, 7:47pm UTC](https://root-forum.cern.ch/t/solving-set-of-equations/59281 "2024-05-09T19:47:47Z")

</div>

\_\_\_Dear all, I am trying to solve a set of equations and I am using the “ROOT::Math::MultiRootFinder” But I am not sure about the final output. I wrote the following script ROOT::Math::MultiRootFinder\* r = new ROOT:…

---

## [Scale main TAxis with a user defined function](https://root-forum.cern.ch/t/scale-main-taxis-with-a-user-defined-function/59279)

<div class="topic-metadata">

**Author:** [@LeonardoPalombini](https://root-forum.cern.ch/u/LeonardoPalombini)\
**Replies:** 1\
**Last updated:** [May 9, 2024, 5:21pm UTC](https://root-forum.cern.ch/t/scale-main-taxis-with-a-user-defined-function/59279 "2024-05-09T17:21:18Z")

</div>

Hello ROOTers I’m wondering whether ther is a way to scale the main X/Y axis in a pad using a user defined function (the same way it happens using SetLogX/Y, so with all data and TF1s scaling as well). Thank you Leona…

---

## [Wrong branch type detection](https://root-forum.cern.ch/t/wrong-branch-type-detection/59236)

<div class="topic-metadata">

**Author:** [@umute97](https://root-forum.cern.ch/u/umute97)\
**Replies:** 27\
**Last updated:** [May 8, 2024, 10:50am UTC](https://root-forum.cern.ch/t/wrong-branch-type-detection/59236 "2024-05-08T10:50:59Z")

</div>

Hello, I am trying to read in a root file containing a structure like this: wfm w0 (containing arrays of doubles) w1 (containing arrays of doubles) … meta pos (containing arrays of ints) For this purpose, I have …

---

## [Sorting to find coincident events](https://root-forum.cern.ch/t/sorting-to-find-coincident-events/59168)

<div class="topic-metadata">

**Author:** [@RasmusWallentin](https://root-forum.cern.ch/u/RasmusWallentin)\
**Replies:** 6\
**Last updated:** [May 7, 2024, 8:49am UTC](https://root-forum.cern.ch/t/sorting-to-find-coincident-events/59168 "2024-05-07T08:49:29Z")

</div>

I have a large TTree with three branches: “Timestamp”: time from start of measurement in picoseconds. “Channel”: The TTree contains data from 8 different detectors and the channel specifies which detector the specific …

---

## [Content per bins do not fit with the Histogram](https://root-forum.cern.ch/t/content-per-bins-do-not-fit-with-the-histogram/59234)

<div class="topic-metadata">

**Author:** [@KillianUB](https://root-forum.cern.ch/u/KillianUB)\
**Replies:** 5\
**Last updated:** [May 6, 2024, 2:01pm UTC](https://root-forum.cern.ch/t/content-per-bins-do-not-fit-with-the-histogram/59234 "2024-05-06T14:01:29Z")

</div>

Can someone pleas explain me why the value of my content per bins dosn’t fit with my histogram ? TFile f{"RAW148OS\_treeFF01.root"}; std::unique\_ptr\<TTree\> tv\_\_tree{static\_cast\<TTree\*\>(f.Get("Analysis\_All"))}; tv\_\_tree-\>D…

---

## [Trying to get each evenement independently](https://root-forum.cern.ch/t/trying-to-get-each-evenement-independently/59219)

<div class="topic-metadata">

**Author:** [@KillianUB](https://root-forum.cern.ch/u/KillianUB)\
**Replies:** 31\
**Last updated:** [May 6, 2024, 10:52am UTC](https://root-forum.cern.ch/t/trying-to-get-each-evenement-independently/59219 "2024-05-06T10:52:09Z")

</div>

Hello; I would like to analyse evenements in several neutron/gamma detectors independently wish mean evenement per evenement to know if the same evenement happens in two detector at the same time. But unfortunately i’m…

---

## [About plotting multidimensional histogram](https://root-forum.cern.ch/t/about-plotting-multidimensional-histogram/59188)

<div class="topic-metadata">

**Author:** [@Rana](https://root-forum.cern.ch/u/Rana)\
**Replies:** 4\
**Last updated:** [May 6, 2024, 12:49am UTC](https://root-forum.cern.ch/t/about-plotting-multidimensional-histogram/59188 "2024-05-06T00:49:21Z")

</div>

Hello Experts, I wanted to fill a histogram from a multidimensional array and I got a canvas with the histogram when I wrote this command in terminal: root \[1\] TH2F \*h12 = new TH2F(“h12”,“x vs z”,100,1000,2000,100, -40…

---

## [Plotting a histogram from entries containing arrays of instances](https://root-forum.cern.ch/t/plotting-a-histogram-from-entries-containing-arrays-of-instances/59194)

<div class="topic-metadata">

**Author:** [@boris\_haydukov](https://root-forum.cern.ch/u/boris_haydukov)\
**Replies:** 9\
**Last updated:** [May 5, 2024, 1:27pm UTC](https://root-forum.cern.ch/t/plotting-a-histogram-from-entries-containing-arrays-of-instances/59194 "2024-05-05T13:27:49Z")

</div>

\_ROOT Version:6.12/06 \_Platform:Linux Mint 19.2 Compiler: Not Provided Hello, So i need to create a histogram from a TTree in a .root file, i used MakeClass() to create a skeleton and everything i have been able to …

---

## [Problem in histogram calibration](https://root-forum.cern.ch/t/problem-in-histogram-calibration/59176)

<div class="topic-metadata">

**Author:** [@gini](https://root-forum.cern.ch/u/gini)\
**Replies:** 8\
**Last updated:** [May 2, 2024, 8:02am UTC](https://root-forum.cern.ch/t/problem-in-histogram-calibration/59176 "2024-05-02T08:02:41Z")

</div>

Hi, I am trying to do the energy calibration of a histogram using a second degree polynomial function : Double\_t HP\_Ge::channel\_Energy(Double\_t x) { Double\_t v; v = -78.61 + (0.6816\*LaBr3Raw\[3\]) + (1.043\*TMath::Pow…

---

## [Empty bins after calibration](https://root-forum.cern.ch/t/empty-bins-after-calibration/36046)

<div class="topic-metadata">

**Author:** [@Christoph\_Vogl](https://root-forum.cern.ch/u/Christoph_Vogl)\
**Replies:** 25\
**Last updated:** [April 30, 2024, 9:45am UTC](https://root-forum.cern.ch/t/empty-bins-after-calibration/36046 "2024-04-30T09:45:12Z")

</div>

Greetings, I am having difficulties calibrating an energy spectrum. I have a vector ENERGY which I fill an histogram with. The result looks fine (uncal.pdf). However, after I apply the calibration ENERGY\_CAL\[i\] = cha…

---

## [Meaning of Delphes "Track" outputs (on .root file)](https://root-forum.cern.ch/t/meaning-of-delphes-track-outputs-on-root-file/59170)

<div class="topic-metadata">

**Author:** [@Muon\_Neutrino](https://root-forum.cern.ch/u/Muon_Neutrino)\
**Replies:** 1\
**Last updated:** [April 29, 2024, 7:36pm UTC](https://root-forum.cern.ch/t/meaning-of-delphes-track-outputs-on-root-file/59170 "2024-04-29T19:36:01Z")

</div>

Hello, I have a very newbie question to ask. It is more closely related to Delphes, but I thought I could use some help here. I was told that Delphes does not reconstruct the trajectory of the particles, as it is a fast…

---

## [Automatically write all histograms created in a macro?](https://root-forum.cern.ch/t/automatically-write-all-histograms-created-in-a-macro/59166)

<div class="topic-metadata">

**Author:** [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Replies:** 1\
**Last updated:** [April 29, 2024, 6:19pm UTC](https://root-forum.cern.ch/t/automatically-write-all-histograms-created-in-a-macro/59166 "2024-04-29T18:19:09Z")

</div>

Hi all, Though not of much use but, Is there some feature to automatically write out all the histograms into a root file which are created in a macro ? That is without specifying hist-\>Write() for each and every histog…

---

## [Creating a TH2Poly](https://root-forum.cern.ch/t/creating-a-th2poly/59153)

<div class="topic-metadata">

**Author:** [@atha.stam](https://root-forum.cern.ch/u/atha.stam)\
**Replies:** 8\
**Last updated:** [April 29, 2024, 5:12pm UTC](https://root-forum.cern.ch/t/creating-a-th2poly/59153 "2024-04-29T17:12:45Z")

</div>

I have a TGraph that its point represents two nuclear properties for different nucleus. I would like to create a TH2Poly and weigh the points by a 3rd nuclear property. I create the TGraph from the first two columns (1…

---

## [Draw histogram lines with uncertainties](https://root-forum.cern.ch/t/draw-histogram-lines-with-uncertainties/59149)

<div class="topic-metadata">

**Author:** [@JanEric](https://root-forum.cern.ch/u/JanEric)\
**Replies:** 2\
**Last updated:** [April 29, 2024, 7:47am UTC](https://root-forum.cern.ch/t/draw-histogram-lines-with-uncertainties/59149 "2024-04-29T07:47:35Z")

</div>

Hi, i am trying to draw plots like in Figure 4 here. What i currently have is 3 histograms, one for data with full uncertainties, one for data with stat. uncertainties and one for MC with total uncertainties. Currently…

---

## [Fatal error while starting ROOT](https://root-forum.cern.ch/t/fatal-error-while-starting-root/59155)

<div class="topic-metadata">

**Author:** [@theta\_pi](https://root-forum.cern.ch/u/theta_pi)\
**Replies:** 2\
**Last updated:** [April 27, 2024, 12:08pm UTC](https://root-forum.cern.ch/t/fatal-error-while-starting-root/59155 "2024-04-27T12:08:29Z")

</div>

ROOT Version: 6.30.04-1 Platform: Arch Linux Compiler: Terminal? Good morning, I am new to ROOT on a Linux machine. I have just installed the software via the pacman package manager (sudo pacman -Syu root) from the e…

---

## [Fill 'nan' or empty value for an entry](https://root-forum.cern.ch/t/fill-nan-or-empty-value-for-an-entry/59110)

<div class="topic-metadata">

**Author:** [@Mukul](https://root-forum.cern.ch/u/Mukul)\
**Replies:** 10\
**Last updated:** [April 26, 2024, 9:53pm UTC](https://root-forum.cern.ch/t/fill-nan-or-empty-value-for-an-entry/59110 "2024-04-26T21:53:11Z")

</div>

Hi. I am trying to add a new Branch in a given TTree. For example, I have a tree with 50 entries. I want to add another branch in this tree so that only the first 10 entries have some values, and the remaining 40 entri…

---

## [ROOT importation problem for the use of PyROOT](https://root-forum.cern.ch/t/root-importation-problem-for-the-use-of-pyroot/59133)

<div class="topic-metadata">

**Author:** [@SarahBlind](https://root-forum.cern.ch/u/SarahBlind)\
**Replies:** 5\
**Last updated:** [April 26, 2024, 8:44am UTC](https://root-forum.cern.ch/t/root-importation-problem-for-the-use-of-pyroot/59133 "2024-04-26T08:44:07Z")

</div>

Dear root users, I want to use PyROOT for a Gate root files analysis. When I try to import ROOT with python I get the following error \>\>\> import ROOT Traceback (most recent call last): File "\<stdin\>", line 1, in \<mod…

---

## [Aborting with "std::align\_val\_t is not implemented yet", RHEL 9.2](https://root-forum.cern.ch/t/aborting-with-std-align-val-t-is-not-implemented-yet-rhel-9-2/55989)

<div class="topic-metadata">

**Author:** [@etmachado](https://root-forum.cern.ch/u/etmachado)\
**Replies:** 23\
**Last updated:** [April 25, 2024, 6:03pm UTC](https://root-forum.cern.ch/t/aborting-with-std-align-val-t-is-not-implemented-yet-rhel-9-2/55989 "2024-04-25T18:03:24Z")

</div>

ROOT Version: 6.28/04 Platform: RockyLinux 9.2 (RHEL 9.2) Compiler: gcc 11.3.1 Hi, I have been compiling/porting our app onto newer versions of linux, with the latest version of root. I have been using dnf to install…

---

## [Random position of Popup Menus](https://root-forum.cern.ch/t/random-position-of-popup-menus/59136)

<div class="topic-metadata">

**Author:** [@rckd](https://root-forum.cern.ch/u/rckd)\
**Replies:** 2\
**Last updated:** [April 25, 2024, 11:00am UTC](https://root-forum.cern.ch/t/random-position-of-popup-menus/59136 "2024-04-25T11:00:07Z")

</div>

ROOT Version: 6.30/06 Platform: WSL (Ubuntu 22.04) Compiler: g++ (it’s the one I use to compile C++ code in WSL) I’m new to ROOT, I’ve recently installed it following the site of Mattia Lopresti on “how to install ro…

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

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