# Creating a new type?

**URL:** <https://root-forum.cern.ch/t/creating-a-new-type/41204>\
**Category:** Newbie\
**Tags:** tree\
**Created:** [August 29, 2020, 6:50am UTC](https://root-forum.cern.ch/t/creating-a-new-type/41204 "2020-08-29T06:50:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Knew](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/0ea827/32.png) [@Knew](https://root-forum.cern.ch/u/Knew)\
**Post date:** [August 29, 2020, 6:50am UTC](https://root-forum.cern.ch/t/creating-a-new-type/41204/1 "2020-08-29T06:50:25Z")

</div>

Hello.  
I am trying to create a new type with  
Event \*event= new Event();  
Inside a tree, but I face this error,  
error : Unknown type name ‘Event’ .  
Can anyone help me to fix it?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![yus](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/9fc348/32.png) [@yus](https://root-forum.cern.ch/u/yus)\
**Post date:** [August 29, 2020, 12:33pm UTC](https://root-forum.cern.ch/t/creating-a-new-type/41204/2 "2020-08-29T12:33:51Z")

</div>

Hi,

is the `Event` class known to your code? Is it defined in some header? Is this header included from your code?

---

<div class="post-metadata">

**Author:** ![Knew](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/0ea827/32.png) [@Knew](https://root-forum.cern.ch/u/Knew)\
**Post date:** [August 29, 2020, 1:17pm UTC](https://root-forum.cern.ch/t/creating-a-new-type/41204/3 "2020-08-29T13:17:30Z")

</div>

I load this cxx file  
root[] .L /pathto/Event.cxx  
And in this case I get warning Event:EventHeader has no streamer or dictionary, data member « fEvtHdr » will not be saved.  
Would you please help me what Is the header I should include?

---

<div class="post-metadata">

**Author:** ![ahesam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahesam/32/19455_2.png) [@ahesam](https://root-forum.cern.ch/u/ahesam)\
**Post date:** [August 29, 2020, 1:20pm UTC](https://root-forum.cern.ch/t/creating-a-new-type/41204/4 "2020-08-29T13:20:52Z")

</div>

Here you can find the relevant documentation: [https://root.cern.ch/root/html534/guides/users-guide/AddingaClass.html](https://root.cern.ch/root/html534/guides/users-guide/AddingaClass.html)

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [August 29, 2020, 7:00pm UTC](https://root-forum.cern.ch/t/creating-a-new-type/41204/5 "2020-08-29T19:00:24Z")

</div>

👍 @ahesam!

There is an overhauled version of what @ahesam posted:

> **[Adding a class to ROOT](https://root.cern/manual/adding_a_class_to_root/)**
>
> Data Analysis Framework

If it’s helpful (or not helpful!), we would be happy to hear some feedback.
