psana_examples/src/DumpRayonix.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: DumpRayonix.cpp 7280 2013-12-03 08:00:15Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class DumpRayonix...
00007 //
00008 // Author List:
00009 //      Andy Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "psana_examples/DumpRayonix.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 
00022 //-------------------------------
00023 // Collaborating Class Headers --
00024 //-------------------------------
00025 #include "MsgLogger/MsgLogger.h"
00026 #include "psddl_psana/rayonix.ddl.h"
00027 
00028 //-----------------------------------------------------------------------
00029 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00030 //-----------------------------------------------------------------------
00031 
00032 // This declares this class as psana module
00033 using namespace psana_examples;
00034 PSANA_MODULE_FACTORY(DumpRayonix)
00035 
00036 //              ----------------------------------------
00037 //              -- Public Function Member Definitions --
00038 //              ----------------------------------------
00039 
00040 namespace psana_examples {
00041 
00042 //----------------
00043 // Constructors --
00044 //----------------
00045 DumpRayonix::DumpRayonix (const std::string& name)
00046   : Module(name)
00047   , m_src()
00048 {
00049   // get the values from configuration or use defaults
00050   m_src = configSrc("source", "DetInfo(:Rayonix)");
00051 }
00052 
00053 //--------------
00054 // Destructor --
00055 //--------------
00056 DumpRayonix::~DumpRayonix ()
00057 {
00058 }
00059 
00060 /// Method which is called at the beginning of the run
00061 void 
00062 DumpRayonix::beginRun(Event& evt, Env& env)
00063 {
00064   shared_ptr<Psana::Rayonix::ConfigV1> config1 = env.configStore().get(m_src);
00065   if (config1) {
00066     WithMsgLog(name(), info, str) {
00067       str << "Psana::Rayonix::ConfigV1:";
00068       str << "\n  binning_f = " << int(config1->binning_f());
00069       str << "\n  binning_s = " << int(config1->binning_s());
00070       str << "\n  exposure = " << config1->exposure();
00071       str << "\n  trigger = " << config1->trigger();
00072       str << "\n  rawMode = " << config1->rawMode();
00073       str << "\n  darkFlag = " << config1->darkFlag();
00074       str << "\n  readoutMode = " << config1->readoutMode();
00075       str << "\n  deviceID = " << config1->deviceID();
00076     }
00077   }
00078 
00079   shared_ptr<Psana::Rayonix::ConfigV2> config2 = env.configStore().get(m_src);
00080   if (config2) {
00081     WithMsgLog(name(), info, str) {
00082       str << "Psana::Rayonix::ConfigV2:";
00083       str << "\n  binning_f = " << int(config2->binning_f());
00084       str << "\n  binning_s = " << int(config2->binning_s());
00085       str << "\n  testPattern = " << config2->testPattern();
00086       str << "\n  exposure = " << config2->exposure();
00087       str << "\n  trigger = " << config2->trigger();
00088       str << "\n  rawMode = " << config2->rawMode();
00089       str << "\n  darkFlag = " << config2->darkFlag();
00090       str << "\n  readoutMode = " << config2->readoutMode();
00091       str << "\n  deviceID = " << config2->deviceID();
00092     }
00093   }
00094 
00095 }
00096 
00097 /// Method which is called with event data, this is the only required 
00098 /// method, all other methods are optional
00099 void 
00100 DumpRayonix::event(Event& evt, Env& env)
00101 {
00102 }
00103   
00104 } // namespace psana_examples

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7