# Intersection points between TF1 and TH1

**URL:** <https://root-forum.cern.ch/t/intersection-points-between-tf1-and-th1/49550>\
**Category:** ROOT\
**Created:** [April 11, 2022, 8:43pm UTC](https://root-forum.cern.ch/t/intersection-points-between-tf1-and-th1/49550 "2022-04-11T20:43:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![issa](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/issa/32/29388_2.png) [@issa](https://root-forum.cern.ch/u/issa)\
**Post date:** [April 11, 2022, 8:43pm UTC](https://root-forum.cern.ch/t/intersection-points-between-tf1-and-th1/49550/1 "2022-04-11T20:43:27Z")

</div>

Hello,

I am looking for a command to get automatically the x value of an intersection between TF1 and TH1 ?

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 12, 2022, 5:27am UTC](https://root-forum.cern.ch/t/intersection-points-between-tf1-and-th1/49550/2 "2022-04-12T05:27:38Z")

</div>

Try to find the keyword “intersection” on the search field of this forum. There is some  
posts with can help you. May be @moneta has some idea.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [April 12, 2022, 8:03am UTC](https://root-forum.cern.ch/t/intersection-points-between-tf1-and-th1/49550/3 "2022-04-12T08:03:45Z")

</div>

Hi,  
There is no automatic way to get this in ROOT.  
This posts can help you: [TF1 intersection - #2 by brun](https://root-forum.cern.ch/t/tf1-intersection/5795/2)  
where you need to replace one of the TF1 with the TH1. Ini case of multiple interceptions the code above needs to be adapted and one need to search in different ranges for the multiple intersection points.

Lorenzo

---

<div class="post-metadata">

**Author:** ![issa](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/issa/32/29388_2.png) [@issa](https://root-forum.cern.ch/u/issa)\
**Post date:** [April 12, 2022, 7:55pm UTC](https://root-forum.cern.ch/t/intersection-points-between-tf1-and-th1/49550/4 "2022-04-12T19:55:16Z")

</div>

In case of TH1, how to replace f2-\>EvalPar () ?

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [April 12, 2022, 9:51pm UTC](https://root-forum.cern.ch/t/intersection-points-between-tf1-and-th1/49550/5 "2022-04-12T21:51:31Z")

</div>

`h1->GetBinContent(h1->FindBin(x));`

---

<div class="post-metadata">

**Author:** ![issa](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/issa/32/29388_2.png) [@issa](https://root-forum.cern.ch/u/issa)\
**Post date:** [April 12, 2022, 10:40pm UTC](https://root-forum.cern.ch/t/intersection-points-between-tf1-and-th1/49550/6 "2022-04-12T22:40:00Z")

</div>

Thank You !

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [April 26, 2022, 10:40pm UTC](https://root-forum.cern.ch/t/intersection-points-between-tf1-and-th1/49550/7 "2022-04-26T22:40:27Z")

</div>

Closed on April 26, 2022, 10:40pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
