psana_examples/src/DumpPulnix.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: DumpPulnix.cpp 5355 2013-02-05 22:07:12Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class DumpPulnix...
00007 //
00008 // Author List:
00009 //      Andrei Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "psana_examples/DumpPulnix.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 
00022 //-------------------------------
00023 // Collaborating Class Headers --
00024 //-------------------------------
00025 #include "MsgLogger/MsgLogger.h"
00026 #include "psddl_psana/pulnix.ddl.h"
00027 
00028 //-----------------------------------------------------------------------
00029 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00030 //-----------------------------------------------------------------------
00031 
00032 using namespace psana_examples;
00033 PSANA_MODULE_FACTORY(DumpPulnix)
00034 
00035 //              ----------------------------------------
00036 //              -- Public Function Member Definitions --
00037 //              ----------------------------------------
00038 
00039 namespace psana_examples {
00040 
00041 //----------------
00042 // Constructors --
00043 //----------------
00044 DumpPulnix::DumpPulnix (const std::string& name)
00045   : Module(name)
00046 {
00047   m_src = configSrc("source", "DetInfo(:Tm6740)");
00048 }
00049 
00050 //--------------
00051 // Destructor --
00052 //--------------
00053 DumpPulnix::~DumpPulnix ()
00054 {
00055 }
00056 
00057 // Method which is called at the beginning of the calibration cycle
00058 void 
00059 DumpPulnix::beginCalibCycle(Event& evt, Env& env)
00060 {
00061   MsgLog(name(), trace, "in beginCalibCycle()");
00062 
00063   shared_ptr<Psana::Pulnix::TM6740ConfigV1> config1 = env.configStore().get(m_src);
00064   if (config1) {
00065     
00066     WithMsgLog(name(), info, str) {
00067       str << "Pulnix::TM6740ConfigV1:";
00068       str << "\n  gain_a = " << config1->gain_a();
00069       str << "\n  gain_b = " << config1->gain_b();
00070       str << "\n  vref = " << config1->vref();
00071       str << "\n  shutter_width = " << config1->shutter_width();
00072       str << "\n  gain_balance = " << int(config1->gain_balance());
00073       str << "\n  output_resolution = " << config1->output_resolution();
00074       str << "\n  horizontal_binning = " << config1->horizontal_binning();
00075       str << "\n  vertical_binning = " << config1->vertical_binning();
00076       str << "\n  lookuptable_mode = " << config1->lookuptable_mode();
00077       str << "\n  output_resolution_bits = " << int(config1->output_resolution_bits());
00078     }
00079     
00080   }
00081 
00082   shared_ptr<Psana::Pulnix::TM6740ConfigV2> config2 = env.configStore().get(m_src);
00083   if (config2) {
00084     
00085     WithMsgLog(name(), info, str) {
00086       str << "Pulnix::TM6740ConfigV2:";
00087       str << "\n  gain_a = " << config2->gain_a();
00088       str << "\n  gain_b = " << config2->gain_b();
00089       str << "\n  vref_a = " << config2->vref_a();
00090       str << "\n  vref_b = " << config2->vref_b();
00091       str << "\n  gain_balance = " << int(config2->gain_balance());
00092       str << "\n  output_resolution = " << config2->output_resolution();
00093       str << "\n  horizontal_binning = " << config2->horizontal_binning();
00094       str << "\n  vertical_binning = " << config2->vertical_binning();
00095       str << "\n  lookuptable_mode = " << config2->lookuptable_mode();
00096       str << "\n  output_resolution_bits = " << int(config2->output_resolution_bits());
00097     }
00098     
00099   }
00100 }
00101 
00102 // Method which is called with event data
00103 void 
00104 DumpPulnix::event(Event& evt, Env& env)
00105 {
00106 }
00107   
00108 } // namespace psana_examples

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7