--- gp2root/pEvent.h 2006/04/19 23:35:57 1.1 +++ gp2root/pEvent.h 2006/10/22 08:26:52 1.2 @@ -11,15 +11,25 @@ #include "pPdetMgr.h" #include "pPheaMgr.h" +//#ifndef __GNUC__ +#include "TObject.h" +//#endif + using std::string; -class pEvent { +//#ifndef __GNUC__ +class pEvent: public TObject { +// #else +// class pEvent { +// #endif public: pEvent( ){ _pphitmgr = pPhitMgr::Get(); _ppdetmgr = pPdetMgr::Get(); _ppheamgr = pPheaMgr::Get(); + _pheader=0; + } void AddDetector(const string &name, pDetector *pd){ @@ -27,7 +37,9 @@ } void AddDetector(const string &name){ - _pdetmap[name]=_ppdetmgr->GetpDet(name); + pDetector *temp=_ppdetmgr->GetpDet(name); + if(temp!=0) _pdetmap[name]=temp; + } void AddHit(const string &name, const char *c){ @@ -51,20 +63,24 @@ void Print(){ - _pheader->Print(); + if(_pheader!=0) _pheader->Print(); for(pDetMap::iterator i=_pdetmap.begin(); i!=_pdetmap.end();++i){ (*i->second).Print(); } } + //#ifndef __GNUC__ + ClassDef(pEvent,1); + //#endif - private: - +private: pDetMap _pdetmap; - pHeader *_pheader; - pPhitMgr *_pphitmgr; - pPdetMgr *_ppdetmgr; - pPheaMgr *_ppheamgr; + pHeader *_pheader; + pPhitMgr *_pphitmgr; //! + pPdetMgr *_ppdetmgr; //! + pPheaMgr *_ppheamgr; //! + }; #endif //PEVENT_H +