#ifndef OAEMFIELD_IFIELDMAPDESCRIPTION_HXX #define OAEMFIELD_IFIELDMAPDESCRIPTION_HXX #include #include #include #include #include #include namespace COMET { class IFieldMapDescription; } /// Implement the FieldDescription for field-map files. /// Persists the original filename and the MD5 check-sum so that the same field /// can be loaded back in even the file might not be stored in the same /// directory. class COMET::IFieldMapDescription:public COMET::IElementFieldDescription{ public: IFieldMapDescription(); IFieldMapDescription(const std::string& fieldMapFile, Double_t scale, Double_t gradient, Double_t timeOffset, TVector3 translation, TRotation rotation); virtual ~IFieldMapDescription(); virtual void ls(Option_t* opt = "") const; virtual COMET::IElementField* Recreate()const; /// Add a directory to be searched for fieldmaps files. /// Entries can contain environment variables (escaped as ${..}), which /// will be expanded when searching for files. static void AddFieldmapPath(const std::string& path){ SetupFilePath(); fFieldmapPaths.insert(fFieldmapPaths.begin(),path); } /// Print the list of paths that are used to find fieldmaps static void PrintFieldmapSearchPaths(bool use_error_stream=false); private: std::string FindFullFilename()const; static void SetupFilePath(); private: std::string fFilename; TMD5* fCheckSum; Double_t fScaling; Double_t fGradient; Double_t fTimeOffset; TVector3 fTranslation; TRotation fRotation; /// List of paths that should be searched for fieldmaps. /// Entries can contain environment variables typedef std::vector PathList; //! static std::vector fFieldmapPaths; //! ClassDef(IFieldMapDescription,1); }; #endif // OAEMFIELD_IFIELDMAPDESCRIPTION_HXX