00001 #ifndef PSANA_PRINTEVENTID_H 00002 #define PSANA_PRINTEVENTID_H 00003 00004 //-------------------------------------------------------------------------- 00005 // File and Version Information: 00006 // $Id: PrintEventId.h 3319 2012-05-02 23:14:22Z salnikov@SLAC.STANFORD.EDU $ 00007 // 00008 // Description: 00009 // Class PrintEventId. 00010 // 00011 //------------------------------------------------------------------------ 00012 00013 //----------------- 00014 // C/C++ Headers -- 00015 //----------------- 00016 00017 //---------------------- 00018 // Base Class Headers -- 00019 //---------------------- 00020 #include "psana/Module.h" 00021 00022 //------------------------------- 00023 // Collaborating Class Headers -- 00024 //------------------------------- 00025 00026 //------------------------------------ 00027 // Collaborating Class Declarations -- 00028 //------------------------------------ 00029 00030 // --------------------- 00031 // -- Class Interface -- 00032 // --------------------- 00033 00034 namespace psana { 00035 00036 /** 00037 * @brief Example module class for psana which prints event ID from current event 00038 * 00039 * This software was developed for the LCLS project. If you use all or 00040 * part of it, please give an appropriate acknowledgment. 00041 * 00042 * @version \$Id: PrintEventId.h 3319 2012-05-02 23:14:22Z salnikov@SLAC.STANFORD.EDU $ 00043 * 00044 * @author Andrei Salnikov 00045 */ 00046 00047 class PrintEventId : public Module { 00048 public: 00049 00050 // Default constructor 00051 PrintEventId (const std::string& name) ; 00052 00053 // Destructor 00054 virtual ~PrintEventId () ; 00055 00056 /// Method which is called once at the beginning of the job 00057 virtual void beginJob(Event& evt, Env& env); 00058 00059 /// Method which is called at the beginning of the run 00060 virtual void beginRun(Event& evt, Env& env); 00061 00062 /// Method which is called at the beginning of the calibration cycle 00063 virtual void beginCalibCycle(Event& evt, Env& env); 00064 00065 /// Method which is called with event data, this is the only required 00066 /// method, all other methods are optional 00067 virtual void event(Event& evt, Env& env); 00068 00069 /// Method which is called at the end of the calibration cycle 00070 virtual void endCalibCycle(Event& evt, Env& env); 00071 00072 /// Method which is called at the end of the run 00073 virtual void endRun(Event& evt, Env& env); 00074 00075 /// Method which is called once at the end of the job 00076 virtual void endJob(Event& evt, Env& env); 00077 00078 protected: 00079 00080 /// fetch and print event ID 00081 void printId(Event& evt); 00082 00083 private: 00084 }; 00085 00086 } // namespace psana 00087 00088 #endif // PSANA_PRINTEVENTID_H