# Newbie

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

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

---

## [Reweighting multiple histograms quickly](https://root-forum.cern.ch/t/reweighting-multiple-histograms-quickly/51166)

<div class="topic-metadata">

**Author:** [@abunka](https://root-forum.cern.ch/u/abunka)\
**Replies:** 1\
**Last updated:** [August 12, 2022, 8:57pm UTC](https://root-forum.cern.ch/t/reweighting-multiple-histograms-quickly/51166 "2022-08-12T20:57:25Z")

</div>

Hello ROOTers What would be the fastest way to reweight all the histograms in a file? I’m guessing a nested for loop to go over each histogram and then each bin? The reweighting value is the same for each bin/hist. How…

---

## [How to read D exponential notation](https://root-forum.cern.ch/t/how-to-read-d-exponential-notation/51175)

<div class="topic-metadata">

**Author:** [@robygru](https://root-forum.cern.ch/u/robygru)\
**Replies:** 3\
**Last updated:** [August 12, 2022, 6:07pm UTC](https://root-forum.cern.ch/t/how-to-read-d-exponential-notation/51175 "2022-08-12T18:07:21Z")

</div>

Hi! i’ve a problem reading an external file in D+ exponential notation on root. Are there some tips to convert in E+ or have I to do manually from txt editor?

---

## [How can I save values to .txt file with RDataFrame?](https://root-forum.cern.ch/t/how-can-i-save-values-to-txt-file-with-rdataframe/51118)

<div class="topic-metadata">

**Author:** [@beg1nner](https://root-forum.cern.ch/u/beg1nner)\
**Replies:** 12\
**Last updated:** [August 11, 2022, 5:49pm UTC](https://root-forum.cern.ch/t/how-can-i-save-values-to-txt-file-with-rdataframe/51118 "2022-08-11T17:49:16Z")

</div>

Dear experts, I am trying to save to the .txt file values of basic variables, such as event and run number for cases, when the transverse mass is bigger than 90. How can one do that? I was thinking about a filter, but …

---

## [CMake File issue](https://root-forum.cern.ch/t/cmake-file-issue/51148)

<div class="topic-metadata">

**Author:** [@Abhinab\_Mukhopadhyay](https://root-forum.cern.ch/u/Abhinab_Mukhopadhyay)\
**Replies:** 3\
**Last updated:** [August 10, 2022, 8:36pm UTC](https://root-forum.cern.ch/t/cmake-file-issue/51148 "2022-08-10T20:36:03Z")

</div>

Hi, I am running a GEANT4 program that calls upon ROOT files and headers. In the cmake file I have included ROOT directories : # Locate sources and headers for this project # include\_directories(${PROJECT\_SOURCE\_DIR}/in…

---

## [Unable to run root on windows](https://root-forum.cern.ch/t/unable-to-run-root-on-windows/51124)

<div class="topic-metadata">

**Author:** [@Sawan](https://root-forum.cern.ch/u/Sawan)\
**Replies:** 2\
**Last updated:** [August 10, 2022, 5:00pm UTC](https://root-forum.cern.ch/t/unable-to-run-root-on-windows/51124 "2022-08-10T17:00:50Z")

</div>

I installed root along with window sdk, MinGW installer and visual studio code. but when I am running the root, it is showing the error " input\_line\_1:1:10: fatal error: ‘new’ file not found #include ^~~~~ Asser…

---

## [How to use two given vectors of numbers rather than a formula such as "sin(x)"](https://root-forum.cern.ch/t/how-to-use-two-given-vectors-of-numbers-rather-than-a-formula-such-as-sin-x/51144)

<div class="topic-metadata">

**Author:** [@Jerome\_Kunegis](https://root-forum.cern.ch/u/Jerome_Kunegis)\
**Replies:** 2\
**Last updated:** [August 10, 2022, 4:29pm UTC](https://root-forum.cern.ch/t/how-to-use-two-given-vectors-of-numbers-rather-than-a-formula-such-as-sin-x/51144 "2022-08-10T16:29:31Z")

</div>

I’m following the tutorial and have this, which works (I’m compiling it, and then running it – no interactivity): TCanvas c("c", title.c\_str(), 0, 0, width, height); TF1 f1("f1","sin(x)", -5, 5); f1.SetTitle(title.c\_…

---

## [libNew.so and TCanvas](https://root-forum.cern.ch/t/libnew-so-and-tcanvas/51039)

<div class="topic-metadata">

**Author:** [@DanielCussol](https://root-forum.cern.ch/u/DanielCussol)\
**Replies:** 8\
**Last updated:** [August 10, 2022, 3:55pm UTC](https://root-forum.cern.ch/t/libnew-so-and-tcanvas/51039 "2022-08-10T15:55:32Z")

</div>

Hello ROOTers, I tried to use TMapFiles and plot the content of them but ROOT crashes every time I try to draw a histogram. Here is a simple example using rootn.exe: TMapFile \*mf=TMapFile::Create("test.map","recreate")…

---

## [TGraph2D No Output](https://root-forum.cern.ch/t/tgraph2d-no-output/51137)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 3\
**Last updated:** [August 10, 2022, 2:36pm UTC](https://root-forum.cern.ch/t/tgraph2d-no-output/51137 "2022-08-10T14:36:15Z")

</div>

I am trying to create 2D graph as shown below. My code: n = 82560 g = ROOT.TGraph2D() for x in range(128): for y in range(645): for z in adc13\[x\]: g.SetPoint(n,x,y,z) c1 = ROOT.TCanvas("c…

---

## [Root fit boundry conditions](https://root-forum.cern.ch/t/root-fit-boundry-conditions/51082)

<div class="topic-metadata">

**Author:** [@Mitchem](https://root-forum.cern.ch/u/Mitchem)\
**Replies:** 12\
**Last updated:** [August 10, 2022, 10:26am UTC](https://root-forum.cern.ch/t/root-fit-boundry-conditions/51082 "2022-08-10T10:26:26Z")

</div>

Does fitting in root have an option to set boundary conditions on a fit? I know you can fix a parameter, but in my specific case, that would not work. Just to use a simple example, lets say I know my data will be y = 100…

---

## [How to read the output file properly? specifically FitResults](https://root-forum.cern.ch/t/how-to-read-the-output-file-properly-specifically-fitresults/51125)

<div class="topic-metadata">

**Author:** [@scheng5134](https://root-forum.cern.ch/u/scheng5134)\
**Replies:** 1\
**Last updated:** [August 10, 2022, 7:29am UTC](https://root-forum.cern.ch/t/how-to-read-the-output-file-properly-specifically-fitresults/51125 "2022-08-10T07:29:56Z")

</div>

So I have a code that reads through data files, does some modifications then plots it into a histogram named “h0” and “h1” then I do a fitting on it with a function, I then write the results to a file so I can go back to…

---

## [Error on FitResult::Scan](https://root-forum.cern.ch/t/error-on-fitresult-scan/51014)

<div class="topic-metadata">

**Author:** [@lilina](https://root-forum.cern.ch/u/lilina)\
**Replies:** 5\
**Last updated:** [August 9, 2022, 4:05pm UTC](https://root-forum.cern.ch/t/error-on-fitresult-scan/51014 "2022-08-09T16:05:24Z")

</div>

Hi, I am trying to perform a Chi2 scan using the fitter.Result().Scan function but I get a segmentation error when implementing it. I have attached the testing example. Can anyone help me to construct the function corre…

---

## [Cuts with two different ttrees](https://root-forum.cern.ch/t/cuts-with-two-different-ttrees/50216)

<div class="topic-metadata">

**Author:** [@Ailema](https://root-forum.cern.ch/u/Ailema)\
**Replies:** 10\
**Last updated:** [August 9, 2022, 2:04pm UTC](https://root-forum.cern.ch/t/cuts-with-two-different-ttrees/50216 "2022-08-09T14:04:53Z")

</div>

Dear experts, I have two TTrees with different number of entries. What I would like to have a correlation between these two trees in order to plot one variable from one tree with cuts applied on a variable from the othe…

---

## [Segment Violation Error in PyROOT](https://root-forum.cern.ch/t/segment-violation-error-in-pyroot/51107)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 5\
**Last updated:** [August 9, 2022, 11:24am UTC](https://root-forum.cern.ch/t/segment-violation-error-in-pyroot/51107 "2022-08-09T11:24:03Z")

</div>

I am trying to run the code below in PyROOT but it keeps on giving an error. I tried the same style code in ROOT and it worked fine. My code: 3 import ROOT 4 import sys 5 import array as arr 6 7 file = ROOT.T…

---

## [Sum of a RVec\<bool\> \[RDataFrame\]](https://root-forum.cern.ch/t/sum-of-a-rvec-bool-rdataframe/51096)

<div class="topic-metadata">

**Author:** [@Daumann](https://root-forum.cern.ch/u/Daumann)\
**Replies:** 2\
**Last updated:** [August 8, 2022, 6:12pm UTC](https://root-forum.cern.ch/t/sum-of-a-rvec-bool-rdataframe/51096 "2022-08-08T18:12:15Z")

</div>

Dear root experts, I want to make some plots in a no b-tag region of my phase space. I am reading a ‘Jet\_btag’ vector from my ntuples, which has the type ‘ROOT::VecOps::RVec’. This vector has a boolean entry for each je…

---

## [Cannot build ROOT from source](https://root-forum.cern.ch/t/cannot-build-root-from-source/51100)

<div class="topic-metadata">

**Author:** [@HungBuiTien](https://root-forum.cern.ch/u/HungBuiTien)\
**Replies:** 2\
**Last updated:** [August 8, 2022, 3:35pm UTC](https://root-forum.cern.ch/t/cannot-build-root-from-source/51100 "2022-08-08T15:35:53Z")

</div>

Dear all, I’m new in ROOT. I have built the source with some following commands # The latest stable branch gets updated automatically on each release. # You may update your local copy by issuing a \`git pull\` command fr…

---

## [Draw multiple fitted histograms in single canvas](https://root-forum.cern.ch/t/draw-multiple-fitted-histograms-in-single-canvas/51043)

<div class="topic-metadata">

**Author:** [@diwakar](https://root-forum.cern.ch/u/diwakar)\
**Replies:** 3\
**Last updated:** [August 8, 2022, 11:20am UTC](https://root-forum.cern.ch/t/draw-multiple-fitted-histograms-in-single-canvas/51043 "2022-08-08T11:20:02Z")

</div>

Dear experts, I have 3 histograms, h18, h17, h16 and i want to fit each of them with gaussian function. After fitting, i want to draw all three of them in a single canvas - the points as well as the fitted curve. I wro…

---

## [Chi-square definition in ROOT](https://root-forum.cern.ch/t/chi-square-definition-in-root/51083)

<div class="topic-metadata">

**Author:** [@yamabuki-shan](https://root-forum.cern.ch/u/yamabuki-shan)\
**Replies:** 10\
**Last updated:** [August 8, 2022, 8:51am UTC](https://root-forum.cern.ch/t/chi-square-definition-in-root/51083 "2022-08-08T08:51:59Z")

</div>

Hi All, My co-worker and I, using different tools, were trying to fit some histograms. Surprisingly, we found the chi2 of our results were different by 1.5 to 2 times. Here is a toy histogram for example: Bin centres: …

---

## [Using a predefined TH2D in RDataframe to compute new quantiy](https://root-forum.cern.ch/t/using-a-predefined-th2d-in-rdataframe-to-compute-new-quantiy/50881)

<div class="topic-metadata">

**Author:** [@tancredi](https://root-forum.cern.ch/u/tancredi)\
**Replies:** 9\
**Last updated:** [August 5, 2022, 5:41am UTC](https://root-forum.cern.ch/t/using-a-predefined-th2d-in-rdataframe-to-compute-new-quantiy/50881 "2022-08-05T05:41:11Z")

</div>

Hello, I have a probability as a function of two variable x,y. Typically stored in a 2d-histogram. How can I make this available in RDataFrame ? e.g for each track in the detector (RVec) I would like to get the probab…

---

## [Looping to create new Branches with different data](https://root-forum.cern.ch/t/looping-to-create-new-branches-with-different-data/51044)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 9\
**Last updated:** [August 4, 2022, 6:42pm UTC](https://root-forum.cern.ch/t/looping-to-create-new-branches-with-different-data/51044 "2022-08-04T18:42:09Z")

</div>

I am trying to create new branches (different names) with different data through looping. However, the data keeps adding up in all the branches. I believe it is due to reference argument of TBranch. Here is my code. Plea…

---

## [How to get maximum X range value](https://root-forum.cern.ch/t/how-to-get-maximum-x-range-value/51068)

<div class="topic-metadata">

**Author:** [@John2](https://root-forum.cern.ch/u/John2)\
**Replies:** 1\
**Last updated:** [August 4, 2022, 1:47pm UTC](https://root-forum.cern.ch/t/how-to-get-maximum-x-range-value/51068 "2022-08-04T13:47:59Z")

</div>

Hi Rooters, I was wondering if there is a way to set maximum X range of the histo from the data automatically? The Histogram class: TH1D \*h1 = new TH1D(“h1”,“”,100,0,100); takes value of xmin and xmax and these values…

---

## [Segmentation fault when building example](https://root-forum.cern.ch/t/segmentation-fault-when-building-example/51060)

<div class="topic-metadata">

**Author:** [@louisld](https://root-forum.cern.ch/u/louisld)\
**Replies:** 7\
**Last updated:** [August 4, 2022, 12:29pm UTC](https://root-forum.cern.ch/t/segmentation-fault-when-building-example/51060 "2022-08-04T12:29:34Z")

</div>

I built ROOT from sources using the following commands: git clone --branch latest-stable --depth=1 https://github.com/root-project/root.git root\_src cmake -G"Visual Studio 17 2022" -A x64 -Thost=x64 -DCMAKE\_INSTALL\_PRE…

---

## [AttributeError: 'TObject' object has no attribute 'SetDirectory'](https://root-forum.cern.ch/t/attributeerror-tobject-object-has-no-attribute-setdirectory/51052)

<div class="topic-metadata">

**Author:** [@Taylor\_Carnahan1](https://root-forum.cern.ch/u/Taylor_Carnahan1)\
**Replies:** 2\
**Last updated:** [August 4, 2022, 10:52am UTC](https://root-forum.cern.ch/t/attributeerror-tobject-object-has-no-attribute-setdirectory/51052 "2022-08-04T10:52:29Z")

</div>

Dear experts, I have a python script that is attempting to create Data cards from a hadded root file, but when I attempt to access SetDirectory for the root file, my error occurs. My code portion that is relevant is: s…

---

## [Pull distribution is not equal to 1](https://root-forum.cern.ch/t/pull-distribution-is-not-equal-to-1/51054)

<div class="topic-metadata">

**Author:** [@Edesa\_Behaj](https://root-forum.cern.ch/u/Edesa_Behaj)\
**Replies:** 2\
**Last updated:** [August 4, 2022, 8:16am UTC](https://root-forum.cern.ch/t/pull-distribution-is-not-equal-to-1/51054 "2022-08-04T08:16:46Z")

</div>

hello, i am performing a gaussian toy study, but there seems to be a problem with my pull distribution, it’s not centered at 1, but 0.5, anyone can help? void histogram () { TCanvas \*c = new TCanvas("Toy study"…

---

## [Data Structure Error while Converting CSV file to ROOT file](https://root-forum.cern.ch/t/data-structure-error-while-converting-csv-file-to-root-file/50992)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 8\
**Last updated:** [August 3, 2022, 4:44pm UTC](https://root-forum.cern.ch/t/data-structure-error-while-converting-csv-file-to-root-file/50992 "2022-08-03T16:44:52Z")

</div>

Here’s the code I found to convert csv file into root file 1 { 2 auto fileName = "output.csv"; 3 auto rdf = ROOT::RDF::MakeCsvDataFrame(fileName); 4 rdf.Snapshot("myTree", "myFile.root");…

---

## [Reading csv file using PyROOT](https://root-forum.cern.ch/t/reading-csv-file-using-pyroot/51027)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 4\
**Last updated:** [August 3, 2022, 4:43pm UTC](https://root-forum.cern.ch/t/reading-csv-file-using-pyroot/51027 "2022-08-03T16:43:19Z")

</div>

I am having trouble reading csv file and making a histogram using pyroot. Here’s my code: 1 import ROOT 2 import csv 3 import array 4 import numpy 5 #canvas = ROOT.TCanvas("canvas", "canvas title", 800, 600) …

---

## [Saving Histogram in a Tree](https://root-forum.cern.ch/t/saving-histogram-in-a-tree/51038)

<div class="topic-metadata">

**Author:** [@TheScientist](https://root-forum.cern.ch/u/TheScientist)\
**Replies:** 2\
**Last updated:** [August 2, 2022, 11:05am UTC](https://root-forum.cern.ch/t/saving-histogram-in-a-tree/51038 "2022-08-02T11:05:56Z")

</div>

I am trying to create a root file with a tree and save a generated histogram in there. It is not working. Here is my code. Thank you. void TFileCreate() 4 { 5 TFile \*filename = new TFile("filename.root", "RE…

---

## [Using ROOT GUI in a multithread application](https://root-forum.cern.ch/t/using-root-gui-in-a-multithread-application/50915)

<div class="topic-metadata">

**Author:** [@DanielCussol](https://root-forum.cern.ch/u/DanielCussol)\
**Replies:** 4\
**Last updated:** [August 2, 2022, 8:50am UTC](https://root-forum.cern.ch/t/using-root-gui-in-a-multithread-application/50915 "2022-08-02T08:50:54Z")

</div>

Hello ROOTers! I try to build a multi-thread application using GUI ROOT classes. It seems that some collisions appears between threads leading to a crash of my application. Is there any mandatory things to indicate in m…

---

## [Source root installed from snap](https://root-forum.cern.ch/t/source-root-installed-from-snap/51025)

<div class="topic-metadata">

**Author:** [@Shailesh](https://root-forum.cern.ch/u/Shailesh)\
**Replies:** 4\
**Last updated:** [August 1, 2022, 10:49am UTC](https://root-forum.cern.ch/t/source-root-installed-from-snap/51025 "2022-08-01T10:49:50Z")

</div>

Hello All, I am using root in Ubuntu OS. It was pre-installed by someone using snap. So, I can’t seem to find the version info there. I need to source it because I need it to install some other packages where ROOT is r…

---

## [How to access elements of std.vector\<double\> object type in PyROOT](https://root-forum.cern.ch/t/how-to-access-elements-of-std-vector-double-object-type-in-pyroot/50998)

<div class="topic-metadata">

**Author:** [@Austin\_Shipley](https://root-forum.cern.ch/u/Austin_Shipley)\
**Replies:** 2\
**Last updated:** [July 29, 2022, 8:14am UTC](https://root-forum.cern.ch/t/how-to-access-elements-of-std-vector-double-object-type-in-pyroot/50998 "2022-07-29T08:14:41Z")

</div>

I am fairly new to using ROOT, so please bear with me. Currently, I am trying to comb through the data from a ROOT file and access the particular entries of a tree. The issue I am having is that I don’t know how to inte…

---

## [ROOT file vs SQLite](https://root-forum.cern.ch/t/root-file-vs-sqlite/50736)

<div class="topic-metadata">

**Author:** [@1010111001000011](https://root-forum.cern.ch/u/1010111001000011)\
**Replies:** 5\
**Last updated:** [July 28, 2022, 9:49am UTC](https://root-forum.cern.ch/t/root-file-vs-sqlite/50736 "2022-07-28T09:49:03Z")

</div>

Not a ROOT user and having a very generic question: How does a ROOT file compares to an SQLite file? Advantages and disadvantages, etc. Context: I am doing my PhD in radiation detectors. I use Python a lot, but practica…

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

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