psana_examples/src/DumpPrinceton.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: DumpPrinceton.cpp 5929 2013-03-25 18:58:56Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class DumpPrinceton...
00007 //
00008 // Author List:
00009 //      Andrei Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "psana_examples/DumpPrinceton.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 
00022 //-------------------------------
00023 // Collaborating Class Headers --
00024 //-------------------------------
00025 #include "MsgLogger/MsgLogger.h"
00026 #include "psddl_psana/princeton.ddl.h"
00027 
00028 //-----------------------------------------------------------------------
00029 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00030 //-----------------------------------------------------------------------
00031 
00032 using namespace psana_examples;
00033 PSANA_MODULE_FACTORY(DumpPrinceton)
00034 
00035 //              ----------------------------------------
00036 //              -- Public Function Member Definitions --
00037 //              ----------------------------------------
00038 
00039 namespace psana_examples {
00040 
00041 //----------------
00042 // Constructors --
00043 //----------------
00044 DumpPrinceton::DumpPrinceton (const std::string& name)
00045   : Module(name)
00046 {
00047   m_src = configSrc("source", "DetInfo(:Princeton)");
00048 }
00049 
00050 //--------------
00051 // Destructor --
00052 //--------------
00053 DumpPrinceton::~DumpPrinceton ()
00054 {
00055 }
00056 
00057 // Method which is called at the beginning of the calibration cycle
00058 void 
00059 DumpPrinceton::beginCalibCycle(Event& evt, Env& env)
00060 {
00061   MsgLog(name(), trace, "in beginCalibCycle()");
00062 
00063   shared_ptr<Psana::Princeton::ConfigV1> config1 = env.configStore().get(m_src);
00064   if (config1) {
00065     
00066     WithMsgLog(name(), info, str) {
00067       str << "Princeton::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  readoutSpeedIndex = " << config1->readoutSpeedIndex();
00077       str << "\n  readoutEventCode = " << config1->readoutEventCode();
00078       str << "\n  delayMode = " << config1->delayMode();
00079       str << "\n  frameSize = " << config1->frameSize();
00080       str << "\n  numPixels = " << config1->numPixels();
00081     }
00082     
00083   }
00084 
00085   shared_ptr<Psana::Princeton::ConfigV2> config2 = env.configStore().get(m_src);
00086   if (config2) {
00087     
00088     WithMsgLog(name(), info, str) {
00089       str << "Princeton::ConfigV2:";
00090       str << "\n  width = " << config2->width();
00091       str << "\n  height = " << config2->height();
00092       str << "\n  orgX = " << config2->orgX();
00093       str << "\n  orgY = " << config2->orgY();
00094       str << "\n  binX = " << config2->binX();
00095       str << "\n  binY = " << config2->binY();
00096       str << "\n  exposureTime = " << config2->exposureTime();
00097       str << "\n  coolingTemp = " << config2->coolingTemp();
00098       str << "\n  gainIndex = " << config2->gainIndex();
00099       str << "\n  readoutSpeedIndex = " << config2->readoutSpeedIndex();
00100       str << "\n  readoutEventCode = " << config2->readoutEventCode();
00101       str << "\n  delayMode = " << config2->delayMode();
00102       str << "\n  frameSize = " << config2->frameSize();
00103       str << "\n  numPixels = " << config2->numPixels();
00104     }
00105     
00106   }
00107 
00108   shared_ptr<Psana::Princeton::ConfigV3> config3 = env.configStore().get(m_src);
00109   if (config3) {
00110     
00111     WithMsgLog(name(), info, str) {
00112       str << "Princeton::ConfigV3:";
00113       str << "\n  width = " << config3->width();
00114       str << "\n  height = " << config3->height();
00115       str << "\n  orgX = " << config3->orgX();
00116       str << "\n  orgY = " << config3->orgY();
00117       str << "\n  binX = " << config3->binX();
00118       str << "\n  binY = " << config3->binY();
00119       str << "\n  exposureTime = " << config3->exposureTime();
00120       str << "\n  coolingTemp = " << config3->coolingTemp();
00121       str << "\n  gainIndex = " << int(config3->gainIndex());
00122       str << "\n  readoutSpeedIndex = " << int(config3->readoutSpeedIndex());
00123       str << "\n  exposureEventCode = " << config3->exposureEventCode();
00124       str << "\n  numDelayShots = " << config3->numDelayShots();
00125       str << "\n  frameSize = " << config3->frameSize();
00126       str << "\n  numPixels = " << config3->numPixels();
00127     }
00128     
00129   }
00130 
00131   shared_ptr<Psana::Princeton::ConfigV4> config4 = env.configStore().get(m_src);
00132   if (config4) {
00133 
00134     WithMsgLog(name(), info, str) {
00135       str << "Princeton::ConfigV4:";
00136       str << "\n  width = " << config4->width();
00137       str << "\n  height = " << config4->height();
00138       str << "\n  orgX = " << config4->orgX();
00139       str << "\n  orgY = " << config4->orgY();
00140       str << "\n  binX = " << config4->binX();
00141       str << "\n  binY = " << config4->binY();
00142       str << "\n  maskedHeight = " << config4->maskedHeight();
00143       str << "\n  kineticHeight = " << config4->kineticHeight();
00144       str << "\n  vsSpeed = " << config4->vsSpeed();
00145       str << "\n  exposureTime = " << config4->exposureTime();
00146       str << "\n  coolingTemp = " << config4->coolingTemp();
00147       str << "\n  gainIndex = " << int(config4->gainIndex());
00148       str << "\n  readoutSpeedIndex = " << int(config4->readoutSpeedIndex());
00149       str << "\n  exposureEventCode = " << config4->exposureEventCode();
00150       str << "\n  numDelayShots = " << config4->numDelayShots();
00151       str << "\n  frameSize = " << config4->frameSize();
00152       str << "\n  numPixels = " << config4->numPixels();
00153     }
00154 
00155   }
00156 
00157   shared_ptr<Psana::Princeton::ConfigV5> config5 = env.configStore().get(m_src);
00158   if (config5) {
00159 
00160     WithMsgLog(name(), info, str) {
00161       str << "Princeton::ConfigV5:";
00162       str << "\n  width = " << config5->width();
00163       str << "\n  height = " << config5->height();
00164       str << "\n  orgX = " << config5->orgX();
00165       str << "\n  orgY = " << config5->orgY();
00166       str << "\n  binX = " << config5->binX();
00167       str << "\n  binY = " << config5->binY();
00168       str << "\n  exposureTime = " << config5->exposureTime();
00169       str << "\n  coolingTemp = " << config5->coolingTemp();
00170       str << "\n  gainIndex = " << config5->gainIndex();
00171       str << "\n  readoutSpeedIndex = " << config5->readoutSpeedIndex();
00172       str << "\n  maskedHeight = " << config5->maskedHeight();
00173       str << "\n  kineticHeight = " << config5->kineticHeight();
00174       str << "\n  vsSpeed = " << config5->vsSpeed();
00175       str << "\n  infoReportInterval = " << config5->infoReportInterval();
00176       str << "\n  exposureEventCode = " << config5->exposureEventCode();
00177       str << "\n  numDelayShots = " << config5->numDelayShots();
00178       str << "\n  frameSize = " << config5->frameSize();
00179       str << "\n  numPixels = " << config5->numPixels();
00180     }
00181 
00182   }
00183 }
00184 
00185 // Method which is called with event data
00186 void 
00187 DumpPrinceton::event(Event& evt, Env& env)
00188 {
00189   shared_ptr<Psana::Princeton::FrameV1> frame1 = evt.get(m_src);
00190   if (frame1) {
00191     WithMsgLog(name(), info, str) {
00192       str << "Princeton::FrameV1:";
00193       str << "\n  shotIdStart = " << frame1->shotIdStart();
00194       str << "\n  readoutTime = " << frame1->readoutTime();
00195       str << "\n  data = " << frame1->data();
00196     }
00197   }
00198 
00199   shared_ptr<Psana::Princeton::FrameV2> frame2 = evt.get(m_src);
00200   if (frame2) {
00201     WithMsgLog(name(), info, str) {
00202       str << "Princeton::FrameV2:";
00203       str << "\n  shotIdStart = " << frame2->shotIdStart();
00204       str << "\n  readoutTime = " << frame2->readoutTime();
00205       str << "\n  temperature = " << frame2->temperature();
00206       str << "\n  data = " << frame2->data();
00207     }
00208   }
00209 
00210   shared_ptr<Psana::Princeton::InfoV1> info1 = evt.get(m_src);
00211   if (info1) {
00212     WithMsgLog(name(), info, str) {
00213       str << "Princeton::InfoV1:";
00214       str << "\n  temperature = " << info1->temperature();
00215     }
00216   }
00217 }
00218   
00219 } // namespace psana_examples

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7