psana_examples/src/DumpFli.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: DumpFli.cpp 3359 2012-05-09 12:04:08Z ofte@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class DumpFli...
00007 //
00008 // Author List:
00009 //      Ingrid Ofte
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "psana_examples/DumpFli.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 
00022 //-------------------------------
00023 // Collaborating Class Headers --
00024 //-------------------------------
00025 #include "MsgLogger/MsgLogger.h"
00026 #include "psddl_psana/fli.ddl.h"
00027 
00028 //-----------------------------------------------------------------------
00029 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00030 //-----------------------------------------------------------------------
00031 
00032 using namespace psana_examples;
00033 PSANA_MODULE_FACTORY(DumpFli)
00034 
00035 //              ----------------------------------------
00036 //              -- Public Function Member Definitions --
00037 //              ----------------------------------------
00038 
00039 namespace psana_examples {
00040 
00041 //----------------
00042 // Constructors --
00043 //----------------
00044 DumpFli::DumpFli (const std::string& name)
00045   : Module(name)
00046 {
00047   m_src = configSrc("source", "DetInfo(:Fli)");
00048 }
00049 
00050 //--------------
00051 // Destructor --
00052 //--------------
00053 DumpFli::~DumpFli ()
00054 {
00055 }
00056 
00057 // Method which is called at the beginning of the calibration cycle
00058 void 
00059 DumpFli::beginCalibCycle(Event& evt, Env& env)
00060 {
00061   MsgLog(name(), trace, "in beginCalibCycle()");
00062 
00063   shared_ptr<Psana::Fli::ConfigV1> config1 = env.configStore().get(m_src);
00064   if (config1) {
00065     
00066     WithMsgLog(name(), info, str) {
00067       str << "Fli::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  exposureEventCode = " << config1->exposureEventCode();
00075       str << "\n  exposureTime = " << config1->exposureTime();
00076       str << "\n  coolingTemp = " << config1->coolingTemp();
00077       str << "\n  gainIndex = " << int(config1->gainIndex());
00078       str << "\n  readoutSpeedIndex = " << int(config1->readoutSpeedIndex());
00079       str << "\n  numDelayShots = " << config1->numDelayShots();
00080       str << "\n  frameSize = " << config1->frameSize();
00081       str << "\n  numPixels = " << config1->numPixels();
00082       str << "\n  numPixelsX = " << config1->numPixelsX();
00083       str << "\n  numPixelsY = " << config1->numPixelsY();
00084     }
00085     
00086   }
00087 
00088 }
00089 
00090 // Method which is called with event data
00091 void 
00092 DumpFli::event(Event& evt, Env& env)
00093 {
00094   shared_ptr<Psana::Fli::FrameV1> frame = evt.get(m_src);
00095   if (frame) {
00096     WithMsgLog(name(), info, str) {
00097       str << "Fli::FrameV1:";
00098       str << "\n  shotIdStart = " << frame->shotIdStart();
00099       str << "\n  readoutTime = " << frame->readoutTime();
00100       str << "\n  temprature = " << frame->temperature();
00101       str << "\n  data = " << frame->data();
00102     }
00103   }
00104 }
00105   
00106 } // namespace psana_examples

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7