[ROOT] CalssDef, ClassImp

From: Peter H Fisher (fisherp@mit.edu)
Date: Thu Oct 19 2000 - 18:50:16 MEST


Hi,

Where are the usages of ClassImp and ClassDef documented?  I am trying to
use my own class and I have included ClassDef and ClassImp as shown in the
Event.cxx and Event.h examples, but I keep getting  

MyEvent::ShowMembers(TMemberInspector&, char*)
MyEvent::Streamer(TBuffer&)
MyEvent::Class_Name(void)
make: *** [treefill] Error 1

My .C and .h files are appended below.

Peter

MyEvent.h:

#ifndef ROOT_MyEvent
#define ROOT_MyEvent

#include "TObject.h"
#include "TClonesArray.h"
#include "TH1.h"
#include "TMath.h"

#include <iostream.h>

class TDirectory;

class MyEvent : public TObject {

public:
  MyEvent();          // Create
  MyEvent(Int_t run, Int_t event, Int_t nhit); // Load header
  Int_t Run();
  Int_t Event();
  Int_t Nhit();
  void Dump();

  ClassDef(MyEvent,0)

private:
  Int_t the_run;
  Int_t the_event;
  Int_t the_nhit;
};
#endif

MyEvent.C:

//
// Mthods for MyEvent
//
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TH2.h"
#include <iostream.h>
#include "MyEvent.h"

ClassImp(MyEvent)

MyEvent::MyEvent(){
}

MyEvent::MyEvent(Int_t run, Int_t event, Int_t nhit){
  the_run=run;
  the_event=event;
  the_nhit=nhit;
}

Int_t MyEvent::Run(){
  return the_run;
}

Int_t MyEvent::Event(){
  return the_event;
}

Int_t MyEvent::Nhit(){
  return the_nhit;
}

void MyEvent::Dump(){
  printf("Dump of this event\n");
  printf("Run %d Event %d\n",the_run,the_event);
  printf("Tracker hits %d\n",the_nhit);
}

Peter Fisher                                   Office 617-253-8561
Associate Professor of Physics                 Fax    617-253-4100
44-118 MIT	                               email  fisherp@mit.edu
Cambridge, MA, 02139



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:35 MET