psana_examples/src/DumpEpixSampler.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: DumpEpixSampler.cpp 7280 2013-12-03 08:00:15Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class DumpEpixSampler...
00007 //
00008 // Author List:
00009 //      Andy Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "psana_examples/DumpEpixSampler.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 
00022 //-------------------------------
00023 // Collaborating Class Headers --
00024 //-------------------------------
00025 #include "MsgLogger/MsgLogger.h"
00026 #include "psddl_psana/epixsampler.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(DumpEpixSampler)
00035 
00036 //              ----------------------------------------
00037 //              -- Public Function Member Definitions --
00038 //              ----------------------------------------
00039 
00040 namespace psana_examples {
00041 
00042 //----------------
00043 // Constructors --
00044 //----------------
00045 DumpEpixSampler::DumpEpixSampler (const std::string& name)
00046   : Module(name)
00047   , m_src()
00048 {
00049   m_src = configSrc("source", "DetInfo(:EpixSampler)");
00050 }
00051 
00052 //--------------
00053 // Destructor --
00054 //--------------
00055 DumpEpixSampler::~DumpEpixSampler ()
00056 {
00057 }
00058 
00059 /// Method which is called at the beginning of the run
00060 void 
00061 DumpEpixSampler::beginRun(Event& evt, Env& env)
00062 {
00063   shared_ptr<Psana::EpixSampler::ConfigV1> config1 = env.configStore().get(m_src);
00064   if (config1) {
00065     WithMsgLog(name(), info, str) {
00066       str << "Psana::EpixSampler::ConfigV1:";
00067       str << "\n  version = " << config1->version();
00068       str << "\n  runTrigDelay = " << config1->runTrigDelay();
00069       str << "\n  daqTrigDelay = " << config1->daqTrigDelay();
00070       str << "\n  daqSetting = " << config1->daqSetting();
00071       str << "\n  adcClkHalfT = " << config1->adcClkHalfT();
00072       str << "\n  adcPipelineDelay = " << config1->adcPipelineDelay();
00073       str << "\n  digitalCardId0 = " << config1->digitalCardId0();
00074       str << "\n  digitalCardId1 = " << config1->digitalCardId1();
00075       str << "\n  analogCardId0 = " << config1->analogCardId0();
00076       str << "\n  analogCardId1 = " << config1->analogCardId1();
00077       str << "\n  numberOfChannels = " << config1->numberOfChannels();
00078       str << "\n  samplesPerChannel = " << config1->samplesPerChannel();
00079       str << "\n  baseClockFrequency = " << config1->baseClockFrequency();
00080       str << "\n  testPatternEnable = " << int(config1->testPatternEnable());
00081     }
00082   }
00083 }
00084 
00085 /// Method which is called with event data, this is the only required 
00086 /// method, all other methods are optional
00087 void 
00088 DumpEpixSampler::event(Event& evt, Env& env)
00089 {
00090   Pds::Src actualSrc;
00091   shared_ptr<Psana::EpixSampler::ElementV1> data1 = evt.get(m_src, "", &actualSrc);
00092   if (data1) {
00093 
00094     WithMsgLog(name(), info, str) {
00095       str << "EpixSampler::ElementV1 at " << actualSrc
00096           << "\n  vc = " << int(data1->vc())
00097           << "\n  lane = " << int(data1->lane())
00098           << "\n  acqCount = " << data1->acqCount()
00099           << "\n  frameNumber = " << data1->frameNumber()
00100           << "\n  ticks = " << data1->ticks()
00101           << "\n  fiducials = " << data1->fiducials()
00102           << "\n  temperatures = " << data1->temperatures()
00103           << "\n  frame = " << data1->frame();
00104     }
00105   }
00106 }
00107 
00108 } // namespace psana_examples

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7