#ifndef ROOT_XEvent #define ROOT_XEvent ////////////////////////////////////////////////////////////////////////// // // // XEvent // // // // Description of a X event // // // ////////////////////////////////////////////////////////////////////////// #include "TObject.h" #include "TClonesArray.h" class TDirectory; ////////////////////////////////////////////////////////////////// // The vme adc0 class class TVadc : public TObject { private: UShort_t fIndex; // The channel number UShort_t fData; // The adc value public: TVadc() {} TVadc(UShort_t i, UShort_t d ): fIndex(i), fData(d) { } virtual ~TVadc() { } UShort_t Index() {return fIndex;} UShort_t Data() {return fData;} ClassDef( TVadc, 1) }; ////////////////////////////////////////////////////////////////// // The vme tdc class class TVtdc : public TObject { private: UShort_t fIndex; // The channel number UShort_t fData; // The adc value public: TVtdc() {} TVtdc(UShort_t i, UShort_t d ): fIndex(i), fData(d) { } virtual ~TVtdc() { } UShort_t Index() {return fIndex;} UShort_t Data() {return fData;} ClassDef( TVtdc, 1) }; ////////////////////////////////////////////////////////////////// // The xevent structure class XEvent : public TObject { private: UInt_t fEventNo; // event number UShort_t fNVadc; //Number of vme adc0 channels in current event TClonesArray *fVadc; // Pointer to TClonesArray for ADC0 static TClonesArray *fgVadc; //The start of TCA 64 long UShort_t fNVadc1; //Number of vme adc1 channels in current event TClonesArray *fVadc1; //Pointer to TClonesArray for ADC1 static TClonesArray *fgVadc1; //The start of TCA 64 long UShort_t fNVadc2; //Number of vme adc2 channels in current event TClonesArray *fVadc2; //Pointer to TClonesArray for ADC2 static TClonesArray *fgVadc2; //The start of TCA 64 long UShort_t fNVtdc; //Number of vme tdc channels in current event TClonesArray *fVtdc; // Pointer to TClonesArray for TDC0 static TClonesArray *fgVtdc; //The start of TCA 64 long UShort_t fNVtdc1; //Number of vme tdc channels in current event TClonesArray *fVtdc1; //Pointer to TClonesArray for TDC1 static TClonesArray *fgVtdc1; //The start of TCA 64 long UShort_t fNVtdc2; //Number of vme tdc channels in current event TClonesArray *fVtdc2; //Pointer to TClonesArray for TDC2 static TClonesArray *fgVtdc2; //The start of TCA 64 long public: XEvent(); virtual ~XEvent(); void SetEventNumber(UInt_t n) { fEventNo = n; } UInt_t GetEventNumber() { return fEventNo; } void AddVadc(UShort_t i, UShort_t d); // Add TVadc0 obj to TCA TClonesArray *GetVadc() const { return fVadc; } UShort_t GetNVadc(){return fNVadc;} void AddVtdc(UShort_t i, UShort_t d); // Add TVtdc obj to TCA TClonesArray *GetVtdc() const { return fVtdc; } UShort_t GetNVtdc(){return fNVtdc;} void Clear(Option_t *option =""); void PrintAll(); void Reset(Option_t *option=""); ClassDef(XEvent, 1) // XEvent structure //How about delete function it is implemented for TClonesarrays so you could just pass it. }; #endif