How to define multiple versions of a class for RTTI

I have a custom class called Event. In Event.h before the closing brace I call the ClassDef macro, ClassDef(Event,1). But now I want to add some data members to this class and create version 2 of class Event. Because of RTTI, I will have the ability to read objects of version 1 or version 2 from different root trees. I don’t understand where I will implement version 2 of the class Event.

The documentation seems to imply that I simply update the class and make sure to change the ClassDef statement to ClassDef(Event,2). It seems to me that if I try to compile on a different computer, which has no knowledge of version 1, it can’t read version 1 objects from files or trees. I would think that I need to keep all definitions implemented somewhere for this system to work, so where do I define version 2 of Event?

Thank you for your help.

ROOT User’s Guide - Chapter 11. Input/Output - Schema Evolution

Thanks Wile E., but I have read Chapter 11. I believe I understand how to increment the ClassVersionID and properly declare classes in LinkDef.h. My question is regarding definitions for previous versions of a class. For example, if I change a data member in Event.h and increment the version and recompile the automatic streamer should be updated. Then presume that I give my code to a colleague, who has no DictEvent.cxx file, because he has never compiled my code on his machine before. If he has been given version 2 of Event.h to compile, and generates the dictionary for the first time, how will his machine know how to handle version 1 Event objects read from TTrees? In this situation, it seems like he would first need to get a copy of version 1 of Event, compile and generate the automatic streamer in the dictionary, then redefine Event to version 2 and recompile again. But I’m sure the process is more simple. Please explain.