# How to do gain matching from a calibrated data?

**URL:** <https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289>\
**Category:** Newbie\
**Tags:** root\
**Created:** [September 3, 2020, 5:06pm UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289 "2020-09-03T17:06:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![arorastacy](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/arorastacy/32/21238_2.png) [@arorastacy](https://root-forum.cern.ch/u/arorastacy)\
**Post date:** [September 3, 2020, 5:06pm UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289/1 "2020-09-03T17:06:43Z")

</div>

Hi All,  
I have data of Eu152 source and I want to do gain matching from the calibrated data. How can I proceed further?  
Any suggestions would be really helpful.

_ROOT Version:_ Not Provided  
_Platform:_ Not Provided  
_Compiler:_ Not Provided

* * *

---

<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:** [September 4, 2020, 6:45am UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289/2 "2020-09-04T06:45:05Z")

</div>

Do you have you some preliminary ROOT code already ?

---

<div class="post-metadata">

**Author:** ![arorastacy](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/arorastacy/32/21238_2.png) [@arorastacy](https://root-forum.cern.ch/u/arorastacy)\
**Post date:** [September 4, 2020, 12:16pm UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289/3 "2020-09-04T12:16:31Z")

</div>

Thanks @couet  
I made a macro for calibration part and I am posting it below.  
[eff\_1.C](https://root-forum.cern.ch/uploads/short-url/zZPjabSSNR8UuWDpQcYJzo7iSgd.C) (1.7 KB)

---

<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:** [September 7, 2020, 8:18am UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289/4 "2020-09-07T08:18:20Z")

</div>

```auto
root [0] .x eff_1.C
Processing eff_1.C...
Error in <TFile::TFile>: file eff_6.root does not exist
Failed to open eff_6.root!
root [1] 

```

---

<div class="post-metadata">

**Author:** ![arorastacy](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/arorastacy/32/21238_2.png) [@arorastacy](https://root-forum.cern.ch/u/arorastacy)\
**Post date:** [September 7, 2020, 5:06pm UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289/5 "2020-09-07T17:06:23Z")

</div>

@couet  
[eff\_6.root](https://root-forum.cern.ch/uploads/short-url/9EZsFxvLoiKg61WKnN50HIoDEl6.root) (32.6 KB)

---

<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:** [September 8, 2020, 7:33am UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289/6 "2020-09-08T07:33:08Z")

</div>

Your macro gives me the following plot. What is wrong with it ?

 ![Screenshot 2020-09-08 at 09.32.19](https://root-forum.cern.ch/uploads/default/original/3X/3/d/3d7f922c4a07cc9905349c5990a48302af3e62b7.jpeg)

---

<div class="post-metadata">

**Author:** ![arorastacy](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/arorastacy/32/21238_2.png) [@arorastacy](https://root-forum.cern.ch/u/arorastacy)\
**Post date:** [September 8, 2020, 9:58am UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289/7 "2020-09-08T09:58:13Z")

</div>

Thanks @couet  
Yes, this is what my macro shows. This macro does the calibration part correctly.  
Now suppose if I want to proceed for gain matching how can I proceed further? What should I include in my macro for gain matching part?

---

<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:** [September 8, 2020, 10:52am UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289/8 "2020-09-08T10:52:38Z")

</div>

I am not sure. May be @moneta has an 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:** [September 15, 2020, 2:14pm UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289/9 "2020-09-15T14:14:47Z")

</div>

Hi,  
I am also not sure what you really want. This is maybe a more analysis question specific for your problem domain than a ROOT question

Lorenzo

---

<div class="post-metadata">

**Author:** ![Shaffy](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/shaffy/32/25576_2.png) [@Shaffy](https://root-forum.cern.ch/u/Shaffy)\
**Post date:** [April 16, 2021, 3:51am UTC](https://root-forum.cern.ch/t/how-to-do-gain-matching-from-a-calibrated-data/41289/10 "2021-04-16T03:51:02Z")

</div>

Hello, Stacy  
I also want to perform gain matching in a similar way. Can you help me out with this?  
I have the calibrated files. The next step is to do match the gain. Thanks in advance!!!
