// ESAF : Euso Simulation and Analysis Framework // Reconstruction module data object // $Id: RecoModuleData.hh,v 1.8 2004/11/25 18:49:28 naumov Exp $ // Marco Pallavicini created Feb, 10 2004 // // This class is a container of various type of data that is used by // each RecoModule to store its output data // Each data has a name attached to it. // It can be: // Double_t // integer (boolean not supported; use integers instead) // a pointer to ANY object, including a map or a vector or a TMap or .... // The class internally just stores a pointer to the object as a void* // History: // #ifndef __RECOMODULEDATA_HH_ #define __RECOMODULEDATA_HH_ #include #include #include "euso.hh" #include "EsafMsgSource.hh" class RecoModule; class RecoModuleData: public EsafMsgSource { private: // private ctor needed by rootcint streamers RecoModuleData() : pModule(0) {}; public: // ctor RecoModuleData(RecoModule*); // dtor virtual ~RecoModuleData(); // add an integer value to the map // returns 0 if OK, 1 if value already existing Int_t Add(const string&, const Int_t&); // add an integer value to the map // returns 0 if OK, 1 if value already existing Int_t Add(const string&, const Double_t&); // add an integer value to the map // returns 0 if OK, 1 if value already existing Int_t Add(const string&, void*); // returns an Int_t Int_t GetInt(const string&) const; // returns a Double_t Double_t GetDouble(const string&) const; // returns any other object type // the user must know the object type and cast it void* GetObj(const string&) const; // remove an object // the object is NOT deleted; user should do it by hand Bool_t RemoveObj(const string&); private: // check name Bool_t CheckName(const string&); // map of integers map fIntMap; // map of Double_t map fDoubleMap; // map of pointers to any object // the user must know which type the object is map fObjMap; // pointer to parent module RecoModule *pModule; inline RecoModule* GetOwner() const { return pModule;} // clean integer and Double_t maps void CleanMaps(); friend class RecoModule; ClassDef(RecoModuleData,0) }; #endif /* __RECOMODULEDATA_HH_ */