# Change type of member of a class stored in a tree

**URL:** <https://root-forum.cern.ch/t/change-type-of-member-of-a-class-stored-in-a-tree/18039>\
**Category:** ROOT\
**Created:** [August 11, 2014, 7:39am UTC](https://root-forum.cern.ch/t/change-type-of-member-of-a-class-stored-in-a-tree/18039 "2014-08-11T07:39:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [August 15, 2014, 3:04pm UTC](https://root-forum.cern.ch/t/change-type-of-member-of-a-class-stored-in-a-tree/18039/3 "2014-08-15T15:04:17Z")

</div>

The “[Adding Your Class to ROOT: ClassDef](http://root.cern.ch/drupal/content/adding-your-class-root-classdef)” web page contains a bit not-up-to-date informations.  
See:

> [@Simple way to create and merge shared libraries?](https://root-forum.cern.ch/t/simple-way-to-create-and-merge-shared-libraries/11652/6):
>
> [quote]as far as I remember, you need “ClassDef” / “ClassImp” macros for a class only if you want to use ROOT I/O on its objects. So, if you do NOT need it, you can remove them (even if the class inherits from TObject).[/quote]Please note that neither ClassDef nor ClassImp is needed to to ROOT I/O. All you need for ROOT I/O is to generate the dictionary for the class. Note that ClassDef provides an optimizations, object with a ClassDef will be smaller on file and will be read slightly faster. …

> [@Adding a class: hand holding requested](https://root-forum.cern.ch/t/adding-a-class-hand-holding-requested/13893/10):
>
> I’d just change “.cxx” into “.cc” directly here … and learn the “-p” flag … you will often need it … rootcint -f [dictionary.cc](http://dictionary.cc) -c -p TestClass.hh Root\_LinkDef.h Also, as you plan to use “std:: vector”, maybe it would be good to: #include in your “TestClass.hh” file. One more thing. If you ever use “ClassDef”, remember that it must be the last line in your class definition AND it must be PUBLIC: class MyClass { public: // something protected: // something else private: // yet somethi…

See also: [ROOT User’s Guide → Adding a Class](http://root.cern.ch/root/html534/guides/users-guide/AddingaClass.html)

---

_[View the full topic](https://root-forum.cern.ch/t/change-type-of-member-of-a-class-stored-in-a-tree/18039)._
