00001 #ifndef PSANA_EXPNAMEFROMDS_H 00002 #define PSANA_EXPNAMEFROMDS_H 00003 00004 //-------------------------------------------------------------------------- 00005 // File and Version Information: 00006 // $Id: ExpNameFromDs.h 5435 2013-02-13 01:02:07Z salnikov@SLAC.STANFORD.EDU $ 00007 // 00008 // Description: 00009 // Class ExpNameFromDs. 00010 // 00011 //------------------------------------------------------------------------ 00012 00013 //----------------- 00014 // C/C++ Headers -- 00015 //----------------- 00016 #include <string> 00017 #include <list> 00018 #include <vector> 00019 00020 //---------------------- 00021 // Base Class Headers -- 00022 //---------------------- 00023 #include "PSEnv/IExpNameProvider.h" 00024 00025 //------------------------------- 00026 // Collaborating Class Headers -- 00027 //------------------------------- 00028 00029 //------------------------------------ 00030 // Collaborating Class Declarations -- 00031 //------------------------------------ 00032 00033 // --------------------- 00034 // -- Class Interface -- 00035 // --------------------- 00036 00037 namespace psana { 00038 00039 /** 00040 * @ingroup psana 00041 * 00042 * @brief Experiment name provider which extracts experiment name from XTC 00043 * file names. 00044 * 00045 * This software was developed for the LCLS project. If you use all or 00046 * part of it, please give an appropriate acknowledgment. 00047 * 00048 * @version $Id: ExpNameFromDs.h 5435 2013-02-13 01:02:07Z salnikov@SLAC.STANFORD.EDU $ 00049 * 00050 * @author Andy Salnikov 00051 */ 00052 00053 class ExpNameFromDs : public PSEnv::IExpNameProvider { 00054 public: 00055 00056 /// Constructor takes the list of input file names 00057 ExpNameFromDs(const std::vector<std::string>& files); 00058 00059 // Destructor 00060 virtual ~ExpNameFromDs(); 00061 00062 /// Returns instrument name 00063 virtual const std::string& instrument() const { return m_instr; } 00064 00065 /// Returns experiment name 00066 virtual const std::string& experiment() const { return m_exp; } 00067 00068 /// Returns experiment number or 0 00069 virtual unsigned expNum() const { return m_expNum; } 00070 00071 protected: 00072 00073 private: 00074 00075 std::string m_instr; 00076 std::string m_exp; 00077 unsigned m_expNum; 00078 00079 }; 00080 00081 } // namespace psana 00082 00083 #endif // PSANA_EXPNAMEFROMDS_H