//#include #include #include "TOrdCollection.h" #include "Event.h" #include "Track.h" using namespace std; ClassImp(Event) Event::Event(Int_t id) { fId = id; fTracks = new TOrdCollection; } Event::~Event() { delete fTracks; } void Event::AddTrack(Track *t) { fTracks->Add(t); } Int_t Event::GetNoTracks() const { return fTracks->GetSize(); } Float_t Event::TotalMomentum() { TIter next(fTracks); Track *t; while (t = (Track *)next()) fTotalMom += t->Momentum(); return fTotalMom; } void Event::Print(Option_t *) { cout << "*** Event=" << fId << " No of tracks=" << GetNoTracks() << endl; fTracks->Print(); }