psana_examples/src/DumpAndor.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: DumpAndor.cpp 7573 2014-01-17 17:12:38Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class DumpAndor...
00007 //
00008 // Author List:
00009 //      Andy Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "psana_examples/DumpAndor.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 
00022 //-------------------------------
00023 // Collaborating Class Headers --
00024 //-------------------------------
00025 #include "MsgLogger/MsgLogger.h"
00026 #include "psddl_psana/andor.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(DumpAndor)
00035 
00036 //              ----------------------------------------
00037 //              -- Public Function Member Definitions --
00038 //              ----------------------------------------
00039 
00040 namespace psana_examples {
00041 
00042 //----------------
00043 // Constructors --
00044 //----------------
00045 DumpAndor::DumpAndor (const std::string& name)
00046   : Module(name)
00047   , m_src()
00048 {
00049   m_src = configSrc("source", "DetInfo(:Andor)");
00050 }
00051 
00052 //--------------
00053 // Destructor --
00054 //--------------
00055 DumpAndor::~DumpAndor ()
00056 {
00057 }
00058 
00059 /// Method which is called at the beginning of the calibration cycle
00060 void 
00061 DumpAndor::beginCalibCycle(Event& evt, Env& env)
00062 {
00063   shared_ptr<Psana::Andor::ConfigV1> config1 = env.configStore().get(m_src);
00064   if (config1) {
00065 
00066     WithMsgLog(name(), info, str) {
00067       str << "Andor::ConfigV1:";
00068       str << "\n  width = " << config1->width();
00069       str << "\n  height = " << config1->height();
00070       str << "\n  orgX = " << config1->orgX();
00071       str << "\n  orgY = " << config1->orgY();
00072       str << "\n  binX = " << config1->binX();
00073       str << "\n  binY = " << config1->binY();
00074       str << "\n  exposureTime = " << config1->exposureTime();
00075       str << "\n  coolingTemp = " << config1->coolingTemp();
00076       str << "\n  fanMode = " << int(config1->fanMode());
00077       str << "\n  baselineClamp = " << int(config1->baselineClamp());
00078       str << "\n  highCapacity = " << int(config1->highCapacity());
00079       str << "\n  gainIndex = " << int(config1->gainIndex());
00080       str << "\n  readoutSpeedIndex = " << config1->readoutSpeedIndex();
00081       str << "\n  exposureEventCode = " << config1->exposureEventCode();
00082       str << "\n  numDelayShots = " << config1->numDelayShots();
00083       str << "\n  frameSize = " << config1->frameSize();
00084       str << "\n  numPixels = " << config1->numPixels();
00085     }
00086 
00087   }
00088 }
00089 
00090 /// Method which is called with event data, this is the only required 
00091 /// method, all other methods are optional
00092 void 
00093 DumpAndor::event(Event& evt, Env& env)
00094 {
00095   shared_ptr<Psana::Andor::FrameV1> frame1 = evt.get(m_src);
00096   if (frame1) {
00097     WithMsgLog(name(), info, str) {
00098       str << "Andor::FrameV1:";
00099       str << "\n  shotIdStart = " << frame1->shotIdStart();
00100       str << "\n  readoutTime = " << frame1->readoutTime();
00101       str << "\n  temperature = " << frame1->temperature();
00102       str << "\n  data = " << frame1->data();
00103     }
00104   }
00105 }
00106 
00107 } // namespace psana_examples

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7