Creating a new type?

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.


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

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?

Here you can find the relevant documentation:

:+1: @ahesam!

There is an overhauled version of what @ahesam posted:

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