Tracks : Inheritance III
In our analysis code, if we use the base class we can easily reuse our code for analyzing tracks of the 2 types (or more if they come.)
// Function to do some analysis with our track
int doMyTrackAnalysis(StTrack* track) { // do something }
// can call it with globals obtained from event->nodes()
for (StTrackIterator ti = nodes.begin(); ti!=nodes.end(); ++ti)
// or primaries obtained from event->primaryVertex()->daughters()
for (StTrackIterator ti = primaries.begin(); ti!=primaries.end(); ++ti)