PSXtcInput::DgramSourceFile Class Reference
[PSXtcInput package]

Implementation of IDatagramSource interface which reads data from input files. More...

#include <DgramSourceFile.h>

Inheritance diagram for PSXtcInput::DgramSourceFile:

PSXtcInput::IDatagramSource psana::Configurable List of all members.

Public Member Functions

 DgramSourceFile (const std::string &name)
virtual ~DgramSourceFile ()
virtual void init ()
virtual bool next (std::vector< XtcInput::Dgram > &eventDg, std::vector< XtcInput::Dgram > &nonEventDg)
 Return next datagram(s) from the source.
virtual bool liveAvail (int numEvents)

Protected Member Functions

bool sameEvent (const XtcInput::Dgram &eventDg, const XtcInput::Dgram &otherDg) const
 returns true if two datagrams are part of the same event.
bool fiducialSecondsMatch (const XtcInput::Dgram &dgA, const XtcInput::Dgram &dgB) const
 returns true if two datagrams fiducials match, and their seconds are close

Detailed Description

Implementation of IDatagramSource interface which reads data from input files.

Note:
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Version:
Id
DgramSourceFile.h 12582 2016-09-08 17:45:48Z dubrovin@SLAC.STANFORD.EDU
Author:
Andy Salnikov

Definition at line 60 of file DgramSourceFile.h.


Constructor & Destructor Documentation

PSXtcInput::DgramSourceFile::DgramSourceFile ( const std::string &  name  ) 

Definition at line 91 of file DgramSourceFile.cpp.

References psana::Configurable::configList().

PSXtcInput::DgramSourceFile::~DgramSourceFile (  )  [virtual]

Definition at line 109 of file DgramSourceFile.cpp.

References MsgLog, and psana::Configurable::name().


Member Function Documentation

bool PSXtcInput::DgramSourceFile::fiducialSecondsMatch ( const XtcInput::Dgram &  dgA,
const XtcInput::Dgram &  dgB 
) const [protected]

returns true if two datagrams fiducials match, and their seconds are close

max difference in seconds for clocks can be changed with psana option max_stream_clock_diff, however this should not be neccessary.

Parameters:
dgA first datagram
dgB second datagram
Returns:
true if they match, false otherwise

Definition at line 218 of file DgramSourceFile.cpp.

References absDiff().

Referenced by sameEvent().

void PSXtcInput::DgramSourceFile::init (  )  [virtual]

Initialization method for datagram source, this is typically called in beginJob() method and it may contain initialization code which cannot be executed during construction of an instance.

Implements PSXtcInput::IDatagramSource.

Definition at line 123 of file DgramSourceFile.cpp.

References psana::Configurable::config(), psana::Configurable::configList(), psana::Configurable::configStr(), MsgLog, psana::Configurable::name(), and WithMsgLog.

bool PSXtcInput::DgramSourceFile::liveAvail ( int  numEvents  )  [virtual]

"Returns true if in live mode and the available events on disk is >= the argument numEvents

Reimplemented from PSXtcInput::IDatagramSource.

Definition at line 196 of file DgramSourceFile.cpp.

bool PSXtcInput::DgramSourceFile::next ( std::vector< XtcInput::Dgram > &  eventDg,
std::vector< XtcInput::Dgram > &  nonEventDg 
) [virtual]

Return next datagram(s) from the source.

This method returns two sets of datagrams - eventDg is the set of histograms belonging to the next event, nonEventDg is the set of datagrams which has some other data (like EPICS) which is needed for correct interpretation of current event. Currently eventDg should contain one datagram but potentially in the future we may start event building in offline and that list can grow longer. It nonEventDg is non-empty then it has to be processed first as those datagram should come from earlier time than eventDg and eventDg may contain data that overrides data in nonEventDg (e.g. some EPICS PV data may be contained in both nonEventDg and eventDg).

This method will called repeatedly until it returns false.

Parameters:
[out] eventDg returned set of datagrams for current event
[out] nonEventDg returned set of datagrams containing other information.
Returns:
false if there are no more events, both eventDg and nonEventDg will be empty in this case.

Implements PSXtcInput::IDatagramSource.

Definition at line 174 of file DgramSourceFile.cpp.

References sameEvent().

bool PSXtcInput::DgramSourceFile::sameEvent ( const XtcInput::Dgram &  eventDg,
const XtcInput::Dgram &  otherDg 
) const [protected]

returns true if two datagrams are part of the same event.

For regular data (L1Accept transitions) will only return true if at least one is a ControlStream and there is a sec/fid match. Two non-L1's match if the clocks are the same.

Parameters:
eventDg first datagram
otherDg second datagram
Returns:
false if not part of the same event, true if they are

Definition at line 201 of file DgramSourceFile.cpp.

References clockTimesMatch(), fiducialSecondsMatch(), isFiducialMatchStream(), isL1Accept(), and transitionsMatch().

Referenced by next().


The documentation for this class was generated from the following files:
Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7