Date: Thu, 28 Mar 2024 22:04:46 -0700 (PDT) Message-ID: <1113487652.8254.1711688686362@co.atl-prod-01> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8253_84557098.1711688686362" ------=_Part_8253_84557098.1711688686362 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The Xtc package defines several classes.
An xtc file is a collection of datagrams (Dgram). This is an iterator to= loop through all datagrams in a file.
Public Member Functions:
// Co= nstructor and destructor XtcFileIterator(int fd, size_t maxDgramSize); ~XtcFileIterator(); Dgram* next();
Datagram - structure of a piece of information within the xtc file.
A datagram contains: Sequence, Env and Xtc.
= Dgram -------------------------------------- | | | Sequence Env Xtc
Public Attributes:
PD= S_DGRAM_STRUCT // #define PDS_DGRAM_STRUCT Sequence seq; Env env; Xtc xtc
Defined in pdsdata/xtc/Sequence.hh
.
Public Types:
enu= m Type {Event =3D 0, Occurrence =3D 1, Marker =3D 2}; enum {NumberOfTypes =3D 3};
Public Member Functions:
// = Constructors Sequence() {} Sequence(const Sequence&); Sequence(const ClockTime& clock, const TimeStamp& stamp); Sequence(Type, TransitionId::Value, const ClockTime&, const TimeSta= mp&); Type type() const; TransitionId::Value service() const; bool isExtended() const; bool isEvent() const; const ClockTime& clock() const {return _clock;} const TimeStamp& stamp() const {return _stamp;} Sequence& operator=3D(const Sequence&);
Defined in pdsdata/xtc/Env.hh
Public Member Functions
// = Constructors Env() {} Env(const Env& in) : _env(in._env) {} Env(uint32_t env); uint32_t value() const; const Env& operator=3D(const Env& that);
This class defines a container for data stored in an xtc file. An event = is a collection of such containers. The size and location of the unspecifie= d data contained are defined by the "sizeofPayload" and "payload" functions= . To iterate over a set of such containers see "XtcIterator.hh".
Public Member Functions:
Constructors:
//C= onstructor used to create an empty, unlabeled Xtc() : damage(0), extent(0) {}; // Copy constructor, will copy everything, but NOT the payload. Xtc(const Xtc& xtc) : damage(xtc.damage), src(xtc.src), contains(xtc.contains), extent(size= of(Xtc)) {} // Xtc(const TypeId& type) : damage(0), contains(type), extent(sizeof(Xtc)) {} Xtc(const TypeId& type, const Src& _src) : damage(0), src(_src), contains(type), extent(sizeof(Xtc)) {} Xtc(const TypeId& _tag, const Src& _src, unsigned _damage) : damage(_damage), src(_src), contains(_tag), extent(sizeof(Xtc)) {} Xtc(const TypeId& _tag, const Src& _src, const Damage& _dam= age) : damage(_damage), src(_src), contains(_tag), extent(sizeof(Xtc)) {}
Overloaded allocation operators to allow the insertion of a dummy "Xtc" = within a datagram.
voi= d* operator new(size_t size, char* p) { return (void*)p; } void* operator new(size_t size, Xtc* p) { return p->alloc(size)= ; }
// = Return a pointer (of unspecified type) to the payload associated with this = class char* payload() const { return (char*)(this+1); } // Return the size (in bytes) of the payload associated with the class. int sizeofPayload() const { return extent - sizeof(Xtc); } // Return the Xtc which is immediately following an object of this clas= s. Xtc* next() { return (Xtc*)((char*)this+extent); } const Xtc* next() const { return (const Xtc*)((char*)this+exte= nt); } void* alloc(uint32_t size) { void* buffer =3D next(); extent +=3D= size; return buffer; }
Public Attributes:
Dam= age damage; Src src; TypeId contains; uint32_t extent;
This class allows iteration over a collection of "Xtc" objects. An "even= t" generated from DataFlow consists of data described by a collection of "X= tc" objects. Therefore, this class is instrumental in the navigation of an = event's data. The set of "Xtc"s is determined by passing (typically to the = constructor) a root "Xtc" which describes the collection of "Xtc"s to proce= ss. This root, for example is provided by an event's datagram.
As this is an Abstract-Base-Class, it is expected that an application wi= ll subclass from this class, providing an implementation of the "process" m= ethod. This method will be called back for each "Xtc" in the collection. No= te that the "Xtc" to process is passed as an argument. If the "process" met= hod wishes to abort the iteration a zero (0) value is returned. The iterati= on is initiated by calling the "iterate" member function.
Public Member Functions:
Constructors and destructor:
Xtc= Iterator(Xtc* root); XtcIterator() {} virtual ~XtcIterator() {}
The first constructor takes an argument the "Xtc" which defines the coll= ection to iterate over.
vir= tual int process(Xtc* xtc) =3D 0;
This function is pure virtual and must be implemented by all derived cla= sses.
voi= d iterate();
This function commences iteration over the collection specified by the c= onstructor.
voi= d iterate(Xtc*);
Iterate over the collection specifed as an argument to the function. For= each "Xtc" found call back the "process" function. If the "process" functi= on returns zero (0) the iteration is aborted and control is returned to the= caller. Otherwise, control is returned when all elements of the collection= have been scanned.
con= st Xtc* root() const;
This function returns the collection specified by the constructor.
Defined in pdsdata/xtc/Level.hh
Public Types:
enum = Type{Control, Source, Segment, Event, Recorder, Observer, Reporter, NumberOfLevels};
Static Public Member Functions
stati= c const char* name(Type type);
Public Types:
enu= m Value { Unknown, Reset, Map, Unmap, Configure, Unconfigure, BeginRun, EndRun, BeginCalibCycle, EndCalibCycle, Enable, Disable, L1Accept, NumberOf };
Static Public Member Functions:
sta= tic const char* name(TransitionId::Value id);
This is a base class for any source of information in the xtc file (e.g.=
Detector, Beamline, Process). Defined in pdsdata/xtc/Src.hh
=
p>
Public Member Functions:
// = Constructors Src(); Src(Level::Type level); uint32_t log() const; // logical identifier uint32_t phy() const; // physical identifier Level::Type level() const; // level bool operator=3D=3D(const Src& s) const;
Protected Attributes
uin= t32_t _log; // logical identifier uint32_t _phy; // physical identifier
Beamline data Information. This is a derived class that inherits from Sr=
c.
Defined in pdsdata/xtc/BldInfo.hh
Public Types:
enu= m Type { EBeam =3D 0, PhaseCavity =3D 1, FEEGasDetEnergy =3D 2, NumberOf = =3D 3 };
Public Member Functions
Bld= Info() {} BldInfo(uint32_t processId, Type type);
uin= t32_t processId() const; Type type() const;
Static Public Member Functions
sta= tic const char* name(const BldInfo&);
Process information class. This is a derived class that inherits from Sr=
c.
Holds process info for all Levels except Source.
Public Member Functions:
// = Constructor ProcInfo(Level::Type level, // uint32_t processId, // uint32_t ipAddr); // uint32_t processId() const; uint32_t ipAddr() const; void ipAddr(int);
Detector information. Inherits from Src. Defined in pdsdata/xtc/De=
tInfo.hh
and implemented in pdsdata/xtc/src/DetInfo.cc
.=
Public Types:
enu= m Detector { NoDetector =3D 0, AmoIms =3D 1, // AMO Ion Momentum Spectrometer AmoGasdet =3D 2, // AMO Gas Detector (in FrontEnd Enclosure) AmoETof =3D 3, // AMO Electron Time-of-flight AmoITof =3D 4, // AMO Ion Time-of-flight AmoMbes =3D 5, // AMO Magnetic bottle electron spectrometer AmoVmi =3D 6, // AMO Velocity map imaging AmoBps =3D 7, // AMO Beam position screen Camp =3D 8, // CFel-ASG-Multi-Purpose EndStation EpicsArch =3D 9, // BldEb =3D 10, SxrBeamline =3D 11, SxrEndstation =3D 12, XppSb1Ipm =3D 13, XppSb1Pim =3D 14, XppMonPim =3D 15, XppSb2Ipm =3D 16, XppSb3Ipm =3D 17, XppSb3Pim =3D 18, XppSb4Pim =3D 19, XppGon =3D 20, XppLas =3D 21, XppEndstation =3D 22, AmoEndstation =3D 23, CxiEndstation =3D 24, XcsEndstation =3D 25, MecEndstation =3D 26, NumDetector =3D 27 }; enum Device { NoDevice =3D 0, Evr =3D 1, Acqiris =3D 2, Opal1000 =3D 3, TM6740 =3D 4, pnCCD =3D 5, Princeton =3D 6, Fccd =3D 7, Ipimb =3D 8, Encoder =3D 9, Cspad =3D 10, NumDevice =3D 11 };
Public Member Functions
// = Constructors DetInfo() {} DetInfo(uint32_t processId, // Detector det, // uint32_t detId, // Device dev, // uint32_t devId); // bool operator=3D=3D(const DetInfo &) const; uint32_t processId() const; Detector detector() const; Device device() const; uint32_t detId() const; uint32_t devId() const;
Static Public Member Functions
sta= tic const char *name(Detector); static const char *name(Device); static const char *name(const DetInfo &);
Defined in pdsdata/xtc/ClockTime.hh
.
Public Member Functions:
Clo= ckTime(); ClockTime(const ClockTime& t); ClockTime(unsigned sec, unsigned nsec);
uns= igned seconds () const {return _high;} unsigned nanoseconds() const {return _low;}
Clo= ckTime& operator=3D(const ClockTime&); bool operator> (const ClockTime&) const; bool operator=3D=3D(const ClockTime&) const;
Defined in pdsdata/xtc/Damage.hh
, inline implementation.
Public Types:
enu= m Value { DroppedContribution =3D 1, OutOfOrder =3D 12, OutOfSynch =3D 13, UserDefined =3D 14, IncompleteContribution =3D 15, ContainsIncomplete =3D 16 }; // reserve the top byte to augment user defined errors enum {NotUserBitsMask=3D0x00FFFFFF, UserBitsShift =3D 24};
Bit M= ask Name ----------------------------------- 1 0x00002 DroppedContribution 12 0x01000 OutOfOrder 13 0x02000 OutOfSynch 14 0x04000 UserDefined 15 0x08000 IncompleteContribution 16 0x10000 ContainsIncomplete Bit =3D n means 1<<n, i.e. 1 shifted left n bits: Decimal Binary int32_t value =3D 1 00000000000000000000000000000001 | | | | DroppedContribution 00000000000000000000000000000010 OutOfOrder 00000000000000000001000000000000 OutOfSynch 00000000000000000010000000000000 UserDefined 00000000000000000100000000000000 IncompleteContribution 00000000000000001000000000000000 ContainsIncomplete 00000000000000010000000000000000
Public Member Functions:
// = Constructor Damage(uint32_t v) : _damage(v) {} uint32_t value() const { return _damage; } void increase(Damage::Value v) { _damage |=3D ((1<<v) & = NotUserBitsMask); } void increase(uint32_t v) { _damage |=3D v & NotUserBitsM= ask; } uint32_t bits() const { return _damage & NotUserBitsM= ask;} uint32_t userBits() const { return _damage >> UserBitsS= hift; } void userBits(uint32_t v) { _damage &=3D NotUserBitsMask; _damage |=3D (v << UserBitsShift); }
Public Types:
enu= m {NumFiducialBits =3D 17}; enum {MaxFiducials =3D (1<<17)-32}; enum {ErrFiducial =3D (1<<17)-1};
Public Member Functions:
Tim= eStamp(); TimeStamp(const TimeStamp&); TimeStamp(const TimeStamp&, unsigned control); TimeStamp(unsigned ticks, unsigned fiducials, unsigned vector, unsigned= control=3D0); unsigned ticks () const; unsigned fiducials() const; unsigned control () const; unsigned vector () const; TimeStamp& operator=3D (const TimeStamp&); bool operator=3D=3D(const TimeStamp&) const; bool operator>=3D(const TimeStamp&) const; bool operator<=3D(const TimeStamp&) const; bool operator< (const TimeStamp&) const; bool operator> (const TimeStamp&) const;
Public Types:
enu= m Type { Any, Id_Xtc, // generic hierarchical container Id_Frame, // raw image Id_AcqWaveform, Id_AcqConfig, Id_TwoDGaussian, // 2-D Gaussian + covariances Id_Opal1kConfig, Id_FrameFexConfig, Id_EvrConfig, Id_TM6740Config, Id_ControlConfig, Id_pnCCDframe, Id_pnCCDconfig, Id_Epics, // Epics Data Type Id_FEEGasDetEnergy, Id_EBeam, Id_PhaseCavity, Id_PrincetonFrame, Id_PrincetonConfig, Id_EvrData, Id_FrameFccdConfig, Id_FccdConfig, Id_IpimbData, Id_IpimbConfig, Id_EncoderData, Id_EncoderConfig, Id_EvrIOConfig, Id_PrincetonInfo, Id_CspadElement, Id_CspadConfig, Id_IpmFexConfig, // LUSI Diagnostics Id_IpmFex, Id_DiodeFexConfig, Id_DiodeFex, Id_PimImageConfig, NumberOf};
Public Member Functions:
Typ= eId() {} TypeId(const TypeId& v); TypeId(Type type, uint32_t version); Type id() const; uint32_t version() const; uint32_t value() const; static const char* name(Type type);