# I''m trying to find my steps with ROOT. I've been trying to make a Class with no results. Look what I have done till now:

**URL:** <https://root-forum.cern.ch/t/im-trying-to-find-my-steps-with-root-ive-been-trying-to-make-a-class-with-no-results-look-what-i-have-done-till-now/58392>\
**Category:** Newbie\
**Tags:** tree, hist, root\
**Created:** [March 5, 2024, 7:52pm UTC](https://root-forum.cern.ch/t/im-trying-to-find-my-steps-with-root-ive-been-trying-to-make-a-class-with-no-results-look-what-i-have-done-till-now/58392 "2024-03-05T19:52:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sophocles\_Tsakiropou](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sophocles_tsakiropou/32/35857_2.png) [@Sophocles\_Tsakiropou](https://root-forum.cern.ch/u/Sophocles_Tsakiropou)\
**Post date:** [March 5, 2024, 7:52pm UTC](https://root-forum.cern.ch/t/im-trying-to-find-my-steps-with-root-ive-been-trying-to-make-a-class-with-no-results-look-what-i-have-done-till-now/58392/1 "2024-03-05T19:52:21Z")

</div>

sophoclestsakiropoulos@MacBook-Air-Sophocles ~ % cd download/ #where I keep my _.root filessophoclestsakiropoulos@MacBook-Air-Sophocles download % root -l analysis\_1.root #the file with the tree  
Attaching file analysis\_1.root as \_file1…  
(TFile ) 0x129fbffd0  
root [10] **TFile** f = new **TFile** (“analysis\_1.root”);  
root [11] f-\>ls();  
TFile analysis\_1.root   
TFile_ analysis\_1.root   
KEY: TDirectoryFile mainNtuplizer;1 mainNtuplizer  
root [12] mainNtuplizer-\>cd();  
root [13] .ls  
TDirectoryFile\* mainNtuplizer mainNtuplizer  
KEY: TTree data;1 Event Summary. #data is the treeee  
KEY: TH1F nevents;1   
KEY: TH1F n\_negevents;1   
KEY: TH1F n\_posevents;1   
KEY: TH1F pileup;1   
KEY: TH1F pileuptrue;1   
KEY: TH1F sumWeights;1   
KEY: TH1F sumScaleWeights;1   
KEY: TH1F sumPdfWeights;1   
KEY: TH1F sumAlphasWeights;1   
KEY: TH2F BTaggingEff\_Denom\_b;1   
KEY: TH2F BTaggingEff\_Denom\_c;1   
KEY: TH2F BTaggingEff\_Denom\_udsg;1   
KEY: TH2F LooseBTaggingEff\_Num\_b;1   
KEY: TH2F LooseBTaggingEff\_Num\_c;1   
KEY: TH2F LooseBTaggingEff\_Num\_udsg;1   
KEY: TH2F MediumBTaggingEff\_Num\_b;1   
KEY: TH2F MediumBTaggingEff\_Num\_c;1   
KEY: TH2F MediumBTaggingEff\_Num\_udsg;1   
KEY: TH2F TightBTaggingEff\_Num\_b;1   
KEY: TH2F TightBTaggingEff\_Num\_c;1   
KEY: TH2F TightBTaggingEff\_Num\_udsg;1   
KEY: TH1F metFilter;1

The next I do is this:  
root [16] data-\>MakeClass(“MyClass”);  
**ROOT\_prompt\_16:1:1:**  **error:**  **reference to overloaded function could not be resolved; did you mean to call it?**  
**^~~~**  
**/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.sdk/usr/include/c++/v1/\_\_iterator/data.h:27:6: note:** possible target for call auto data(\_Cont& \_\_c)  
**^**  
**/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.sdk/usr/include/c++/v1/\_\_iterator/data.h:34:6: note:** possible target for call auto data(const \_Cont& \_\_c)  
**^**  
**/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.sdk/usr/include/c++/v1/\_\_iterator/data.h:41:16: note:** possible target for call constexpr \_Tp\* data(\_Tp (&\_\_array)[\_Sz]) noexcept { return \_\_array; }  
**^**  
**/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.sdk/usr/include/c++/v1/\_\_iterator/data.h:45:22: note:** possible target for call constexpr const \_Ep\* data(initializer\_list\<\_Ep\> \_\_il) noexcept { return \_\_il.begin(); }

Please I need some guidance… explain me how to make it run simple! Feel free even to email me I’m a 3 days old phd candidate and I already feel lost. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [March 5, 2024, 8:38pm UTC](https://root-forum.cern.ch/t/im-trying-to-find-my-steps-with-root-ive-been-trying-to-make-a-class-with-no-results-look-what-i-have-done-till-now/58392/2 "2024-03-05T20:38:28Z")

</div>

Hi Sophocles,

Thanks for the post and welcome to the ROOT community!  
No panic. I have three questions which can help move forward:

- Is your local root installation working fine besides this problem?
- Can you try to invoke MakeClass on your tree on a machine where a ROOT installation which is working well can be found? For example a development portal at the institute or lxplus at CERN.
- Can you share your file with us?

Cheers,  
Danilo

---

<div class="post-metadata">

**Author:** ![Sophocles\_Tsakiropou](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sophocles_tsakiropou/32/35857_2.png) [@Sophocles\_Tsakiropou](https://root-forum.cern.ch/u/Sophocles_Tsakiropou)\
**Post date:** [March 6, 2024, 7:33am UTC](https://root-forum.cern.ch/t/im-trying-to-find-my-steps-with-root-ive-been-trying-to-make-a-class-with-no-results-look-what-i-have-done-till-now/58392/4 "2024-03-06T07:33:22Z")

</div>

Good morning! So far root is working fine. I made a link where you can download the file(WeTransfer) called “analysis\_1.root” cause it’s more than 3MB. Thanks for the help!!!  
we.tl/t-FtA7R1Oq7j

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [March 6, 2024, 9:18am UTC](https://root-forum.cern.ch/t/im-trying-to-find-my-steps-with-root-ive-been-trying-to-make-a-class-with-no-results-look-what-i-have-done-till-now/58392/5 "2024-03-06T09:18:17Z")

</div>

Sophocles, I cannot download anything: can you confirm the url?

Cheers,  
D

---

<div class="post-metadata">

**Author:** ![Sophocles\_Tsakiropou](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sophocles_tsakiropou/32/35857_2.png) [@Sophocles\_Tsakiropou](https://root-forum.cern.ch/u/Sophocles_Tsakiropou)\
**Post date:** [March 6, 2024, 11:33am UTC](https://root-forum.cern.ch/t/im-trying-to-find-my-steps-with-root-ive-been-trying-to-make-a-class-with-no-results-look-what-i-have-done-till-now/58392/8 "2024-03-06T11:33:45Z")

</div>

> **[download.tar είναι διαθέσιμο για λήψη](https://www.transfernow.net/en/bld?utm_source=20240306bjQxjdJy)**
>
> Κάντε κλικ για πρόσβαση στη λήψη του αρχείου download.tar (68.5 MB) με το TransferNow

that’s the new url to download the file

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [March 6, 2024, 7:37pm UTC](https://root-forum.cern.ch/t/im-trying-to-find-my-steps-with-root-ive-been-trying-to-make-a-class-with-no-results-look-what-i-have-done-till-now/58392/9 "2024-03-06T19:37:36Z")

</div>

> [@Sophocles\_Tsakiropou](#):
>
> root [16] data-\>MakeClass(“MyClass”);

Because of `std::data` using `data` as a variable name is no longer supported on the prompt.  
So to retrieve the `TTree` named data use:

```auto
auto datatree = f->Get<TTree>("data");

```

Cheers,  
Philippe.

---

<div class="post-metadata">

**Author:** ![Sophocles\_Tsakiropou](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sophocles_tsakiropou/32/35857_2.png) [@Sophocles\_Tsakiropou](https://root-forum.cern.ch/u/Sophocles_Tsakiropou)\
**Post date:** [March 7, 2024, 7:28am UTC](https://root-forum.cern.ch/t/im-trying-to-find-my-steps-with-root-ive-been-trying-to-make-a-class-with-no-results-look-what-i-have-done-till-now/58392/10 "2024-03-07T07:28:43Z")

</div>

That was actually very helpfull! data is inside “mainNtuplizer” so I had to add the folder but you really helped me a lot! Thank you.
