psddl_psana/include/acqiris.ddl.h

Go to the documentation of this file.
00001 #ifndef PSANA_ACQIRIS_DDL_H
00002 #define PSANA_ACQIRIS_DDL_H 1
00003 
00004 // *** Do not edit this file, it is auto-generated ***
00005 
00006 #include <vector>
00007 #include <iosfwd>
00008 #include <cstring>
00009 #include "ndarray/ndarray.h"
00010 #include "pdsdata/xtc/TypeId.hh"
00011 namespace Psana {
00012 namespace Acqiris {
00013 
00014 /** @class VertV1
00015 
00016   Class containing Acqiris configuration data for vertical axis.
00017 */
00018 
00019 
00020 class VertV1 {
00021 public:
00022 
00023   /** Coupling modes */
00024   enum Coupling {
00025     GND,
00026     DC,
00027     AC,
00028     DC50ohm,
00029     AC50ohm,
00030   };
00031   enum Bandwidth {
00032     None,
00033     MHz25,
00034     MHz700,
00035     MHz200,
00036     MHz20,
00037     MHz35,
00038   };
00039   VertV1(double arg__fullScale, double arg__offset, uint32_t arg__coupling, uint32_t arg__bandwidth)
00040     : _fullScale(arg__fullScale), _offset(arg__offset), _coupling(arg__coupling), _bandwidth(arg__bandwidth)
00041   {
00042   }
00043   VertV1() {}
00044   /** Full vertical scale. */
00045   double fullScale() const { return _fullScale; }
00046   /** Offset value. */
00047   double offset() const { return _offset; }
00048   /** Coupling mode. */
00049   uint32_t coupling() const { return _coupling; }
00050   /** Bandwidth enumeration. */
00051   uint32_t bandwidth() const { return _bandwidth; }
00052   /** Calculated slope. */
00053   double slope() const;
00054   static uint32_t _sizeof() { return 24; }
00055 private:
00056   double        _fullScale;     /**< Full vertical scale. */
00057   double        _offset;        /**< Offset value. */
00058   uint32_t      _coupling;      /**< Coupling mode. */
00059   uint32_t      _bandwidth;     /**< Bandwidth enumeration. */
00060 };
00061 std::ostream& operator<<(std::ostream& str, Acqiris::VertV1::Coupling enval);
00062 std::ostream& operator<<(std::ostream& str, Acqiris::VertV1::Bandwidth enval);
00063 
00064 /** @class HorizV1
00065 
00066   Class containing Acqiris configuration data for horizontal axis.
00067 */
00068 
00069 
00070 class HorizV1 {
00071 public:
00072   HorizV1(double arg__sampInterval, double arg__delayTime, uint32_t arg__nbrSamples, uint32_t arg__nbrSegments)
00073     : _sampInterval(arg__sampInterval), _delayTime(arg__delayTime), _nbrSamples(arg__nbrSamples), _nbrSegments(arg__nbrSegments)
00074   {
00075   }
00076   HorizV1() {}
00077   /** Interval for single sample. */
00078   double sampInterval() const { return _sampInterval; }
00079   /** Delay time. */
00080   double delayTime() const { return _delayTime; }
00081   /** Number of samples. */
00082   uint32_t nbrSamples() const { return _nbrSamples; }
00083   /** Number of segments. */
00084   uint32_t nbrSegments() const { return _nbrSegments; }
00085   static uint32_t _sizeof() { return 24; }
00086 private:
00087   double        _sampInterval;  /**< Interval for single sample. */
00088   double        _delayTime;     /**< Delay time. */
00089   uint32_t      _nbrSamples;    /**< Number of samples. */
00090   uint32_t      _nbrSegments;   /**< Number of segments. */
00091 };
00092 
00093 /** @class TrigV1
00094 
00095   Class containing Acqiris configuration data for triggering.
00096 */
00097 
00098 
00099 class TrigV1 {
00100 public:
00101 
00102   /** Trigger source. */
00103   enum Source {
00104     Internal = 1,
00105     External = -1,
00106   };
00107   enum Coupling {
00108     DC = 0,
00109     AC = 1,
00110     HFreject = 2,
00111     DC50ohm = 3,
00112     AC50ohm = 4,
00113   };
00114 
00115   /** Triggering slope. */
00116   enum Slope {
00117     Positive,
00118     Negative,
00119     OutOfWindow,
00120     IntoWindow,
00121     HFDivide,
00122     SpikeStretcher,
00123   };
00124   TrigV1(uint32_t arg__coupling, uint32_t arg__input, uint32_t arg__slope, double arg__level)
00125     : _coupling(arg__coupling), _input(arg__input), _slope(arg__slope), _level(arg__level)
00126   {
00127   }
00128   TrigV1() {}
00129   uint32_t coupling() const { return _coupling; }
00130   /** Trigger source */
00131   uint32_t input() const { return _input; }
00132   /** Triggering slope. */
00133   uint32_t slope() const { return _slope; }
00134   /** Trigger level. */
00135   double level() const { return _level; }
00136   static uint32_t _sizeof() { return 20; }
00137 private:
00138   uint32_t      _coupling;
00139   uint32_t      _input; /**< Trigger source */
00140   uint32_t      _slope; /**< Triggering slope. */
00141   double        _level; /**< Trigger level. */
00142 };
00143 std::ostream& operator<<(std::ostream& str, Acqiris::TrigV1::Source enval);
00144 std::ostream& operator<<(std::ostream& str, Acqiris::TrigV1::Coupling enval);
00145 std::ostream& operator<<(std::ostream& str, Acqiris::TrigV1::Slope enval);
00146 
00147 /** @class ConfigV1
00148 
00149   Class containing all Acqiris configuration data.
00150 */
00151 
00152 
00153 class ConfigV1 {
00154 public:
00155   enum { TypeId = Pds::TypeId::Id_AcqConfig /**< XTC type ID value (from Pds::TypeId class) */ };
00156   enum { Version = 1 /**< XTC type version number */ };
00157   enum { MaxChan = 20 /**< Maximum number of the configured channels. */ };
00158   virtual ~ConfigV1();
00159   /** Number of ADCs per channel. */
00160   virtual uint32_t nbrConvertersPerChannel() const = 0;
00161   /** Bit mask for channels. */
00162   virtual uint32_t channelMask() const = 0;
00163   /** Total number of banks. */
00164   virtual uint32_t nbrBanks() const = 0;
00165   /** Trigger configuration. */
00166   virtual const Acqiris::TrigV1& trig() const = 0;
00167   /** Configuration for horizontal axis */
00168   virtual const Acqiris::HorizV1& horiz() const = 0;
00169   /** Configuration for vertical axis (one per channel). */
00170   virtual ndarray<const Acqiris::VertV1, 1> vert() const = 0;
00171   /** Number of channels calculated from channel bit mask. */
00172   virtual uint32_t nbrChannels() const = 0;
00173 };
00174 
00175 /** @class TimestampV1
00176 
00177   Class representing Acqiris timestamp value.
00178 */
00179 
00180 
00181 class TimestampV1 {
00182 public:
00183   TimestampV1(double arg__horPos, uint32_t arg__timeStampLo, uint32_t arg__timeStampHi)
00184     : _horPos(arg__horPos), _timeStampLo(arg__timeStampLo), _timeStampHi(arg__timeStampHi)
00185   {
00186   }
00187   TimestampV1() {}
00188   /** Horizontal position, for the segment, of the first (nominal) data point with respect 
00189             to the origin of the nominal trigger delay in seconds. */
00190   double pos() const { return _horPos; }
00191   uint32_t timeStampLo() const { return _timeStampLo; }
00192   uint32_t timeStampHi() const { return _timeStampHi; }
00193   /** 64-bit trigger timestamp, in units of picoseconds. The timestamp is the trigger time 
00194                 with respect to an arbitrary time origin. */
00195   uint64_t value() const;
00196   static uint32_t _sizeof() { return 16; }
00197 private:
00198   double        _horPos;        /**< Horizontal position, for the segment, of the first (nominal) data point with respect 
00199             to the origin of the nominal trigger delay in seconds. */
00200   uint32_t      _timeStampLo;
00201   uint32_t      _timeStampHi;
00202 };
00203 
00204 /** @class DataDescV1Elem
00205 
00206   Class representing Acqiris waveforms from single channel.
00207 */
00208 
00209 class ConfigV1;
00210 
00211 class DataDescV1Elem {
00212 public:
00213   enum { NumberOfBits = 10 };
00214   enum { BitShift = 6 };
00215   enum { _extraSize = 32 };
00216   virtual ~DataDescV1Elem();
00217   /** Number of samples in one segment. */
00218   virtual uint32_t nbrSamplesInSeg() const = 0;
00219   virtual uint32_t indexFirstPoint() const = 0;
00220   /** Number of segments. */
00221   virtual uint32_t nbrSegments() const = 0;
00222   /** Timestamps, one timestamp per segment. */
00223   virtual ndarray<const Acqiris::TimestampV1, 1> timestamp() const = 0;
00224   /** Waveforms data, two-dimensional array [nbrSegments()]*[nbrSamplesInSeg()]. Note that 
00225             unlike in pdsdata this already takes into account value of the indexFirstPoint so
00226             that client code does not need to correct for this offset. */
00227   virtual ndarray<const int16_t, 2> waveforms() const = 0;
00228 };
00229 
00230 /** @class DataDescV1
00231 
00232   Class containing waveform data (DataDescV1Elem) for all channels.
00233 */
00234 
00235 class ConfigV1;
00236 
00237 class DataDescV1 {
00238 public:
00239   enum { TypeId = Pds::TypeId::Id_AcqWaveform /**< XTC type ID value (from Pds::TypeId class) */ };
00240   enum { Version = 1 /**< XTC type version number */ };
00241   virtual ~DataDescV1();
00242   /** Waveform data, one object per channel. */
00243   virtual const Acqiris::DataDescV1Elem& data(uint32_t i0) const = 0;
00244   /** Method which returns the shape (dimensions) of the data returned by data() method. */
00245   virtual std::vector<int> data_shape() const = 0;
00246 };
00247 
00248 /** @class TdcChannel
00249 
00250   Configuration for Acqiris TDC channel.
00251 */
00252 
00253 
00254 class TdcChannel {
00255 public:
00256 
00257   /** Types of channels. */
00258   enum Channel {
00259     Veto = -2,
00260     Common = -1,
00261     Input1 = 1,
00262     Input2 = 2,
00263     Input3 = 3,
00264     Input4 = 4,
00265     Input5 = 5,
00266     Input6 = 6,
00267   };
00268   enum Mode {
00269     Active = 0,
00270     Inactive = 1,
00271   };
00272   enum Slope {
00273     Positive,
00274     Negative,
00275   };
00276   TdcChannel(Acqiris::TdcChannel::Channel arg__channel, Acqiris::TdcChannel::Slope arg__bf_slope, Acqiris::TdcChannel::Mode arg__bf_mode, double arg__level)
00277     : _channel(arg__channel), _mode(((arg__bf_slope) & 0x1)|(((arg__bf_mode) & 0x1)<<31)), _level(arg__level)
00278   {
00279   }
00280   TdcChannel() {}
00281   /** Channel type as integer number, clients should use channel() method instead. */
00282   Acqiris::TdcChannel::Channel channel() const { return Acqiris::TdcChannel::Channel(_channel); }
00283   /** Bitfield value, should not be used directly. Use mode() and slope()
00284                 in the client code. */
00285   uint32_t _mode_int() const { return _mode; }
00286   Acqiris::TdcChannel::Slope slope() const { return Slope(this->_mode & 0x1); }
00287   Acqiris::TdcChannel::Mode mode() const { return Mode((this->_mode>>31) & 0x1); }
00288   double level() const { return _level; }
00289   static uint32_t _sizeof() { return 16; }
00290 private:
00291   int32_t       _channel;       /**< Channel type as integer number, clients should use channel() method instead. */
00292   uint32_t      _mode;  /**< Bitfield value, should not be used directly. Use mode() and slope()
00293                 in the client code. */
00294   double        _level;
00295 };
00296 std::ostream& operator<<(std::ostream& str, Acqiris::TdcChannel::Channel enval);
00297 std::ostream& operator<<(std::ostream& str, Acqiris::TdcChannel::Mode enval);
00298 std::ostream& operator<<(std::ostream& str, Acqiris::TdcChannel::Slope enval);
00299 
00300 /** @class TdcAuxIO
00301 
00302   configuration for auxiliary IO channel.
00303 */
00304 
00305 
00306 class TdcAuxIO {
00307 public:
00308   enum Channel {
00309     IOAux1 = 1,
00310     IOAux2 = 2,
00311   };
00312   enum Mode {
00313     BankSwitch = 1,
00314     Marker = 2,
00315     OutputLo = 32,
00316     OutputHi = 33,
00317   };
00318   enum Termination {
00319     ZHigh = 0,
00320     Z50 = 1,
00321   };
00322   TdcAuxIO(Acqiris::TdcAuxIO::Channel arg__channel, Acqiris::TdcAuxIO::Mode arg__signal, Acqiris::TdcAuxIO::Termination arg__qualifier)
00323     : _channel(arg__channel), _signal(arg__signal), _qualifier(arg__qualifier)
00324   {
00325   }
00326   TdcAuxIO() {}
00327   Acqiris::TdcAuxIO::Channel channel() const { return Acqiris::TdcAuxIO::Channel(_channel); }
00328   Acqiris::TdcAuxIO::Mode mode() const { return Acqiris::TdcAuxIO::Mode(_signal); }
00329   Acqiris::TdcAuxIO::Termination term() const { return Acqiris::TdcAuxIO::Termination(_qualifier); }
00330   static uint32_t _sizeof() { return 12; }
00331 private:
00332   uint32_t      _channel;
00333   uint32_t      _signal;
00334   uint32_t      _qualifier;
00335 };
00336 std::ostream& operator<<(std::ostream& str, Acqiris::TdcAuxIO::Channel enval);
00337 std::ostream& operator<<(std::ostream& str, Acqiris::TdcAuxIO::Mode enval);
00338 std::ostream& operator<<(std::ostream& str, Acqiris::TdcAuxIO::Termination enval);
00339 
00340 /** @class TdcVetoIO
00341 
00342   Class with configuration data for Veto IO channel.
00343 */
00344 
00345 
00346 class TdcVetoIO {
00347 public:
00348   enum Channel {
00349     ChVeto = 13,
00350   };
00351   enum Mode {
00352     Veto = 1,
00353     SwitchVeto = 2,
00354     InvertedVeto = 3,
00355     InvertedSwitchVeto = 4,
00356   };
00357   enum Termination {
00358     ZHigh = 0,
00359     Z50 = 1,
00360   };
00361   TdcVetoIO(Acqiris::TdcVetoIO::Mode mode, Acqiris::TdcVetoIO::Termination term)
00362     : _channel(ChVeto), _signal(mode), _qualifier(term)
00363   {
00364   }
00365   TdcVetoIO() {}
00366   Acqiris::TdcVetoIO::Channel channel() const { return Acqiris::TdcVetoIO::Channel(_channel); }
00367   Acqiris::TdcVetoIO::Mode mode() const { return Acqiris::TdcVetoIO::Mode(_signal); }
00368   Acqiris::TdcVetoIO::Termination term() const { return Acqiris::TdcVetoIO::Termination(_qualifier); }
00369   static uint32_t _sizeof() { return 12; }
00370 private:
00371   uint32_t      _channel;
00372   uint32_t      _signal;
00373   uint32_t      _qualifier;
00374 };
00375 std::ostream& operator<<(std::ostream& str, Acqiris::TdcVetoIO::Channel enval);
00376 std::ostream& operator<<(std::ostream& str, Acqiris::TdcVetoIO::Mode enval);
00377 std::ostream& operator<<(std::ostream& str, Acqiris::TdcVetoIO::Termination enval);
00378 
00379 /** @class TdcConfigV1
00380 
00381   Class with complete Acqiris TDC configuration.
00382 */
00383 
00384 
00385 class TdcConfigV1 {
00386 public:
00387   enum { TypeId = Pds::TypeId::Id_AcqTdcConfig /**< XTC type ID value (from Pds::TypeId class) */ };
00388   enum { Version = 1 /**< XTC type version number */ };
00389   enum { NChannels = 8 /**< Total number of channel configurations. */ };
00390   enum { NAuxIO = 2 /**< Total number of auxiliary IO configurations. */ };
00391   virtual ~TdcConfigV1();
00392   /** Channel configurations, one object per channel. */
00393   virtual ndarray<const Acqiris::TdcChannel, 1> channels() const = 0;
00394   /** Axiliary configurations, one object per channel. */
00395   virtual ndarray<const Acqiris::TdcAuxIO, 1> auxio() const = 0;
00396   virtual const Acqiris::TdcVetoIO& veto() const = 0;
00397 };
00398 
00399 /** @class TdcDataV1_Item
00400 
00401   Base class for all Acqiris TDC data objects.
00402 */
00403 
00404 
00405 class TdcDataV1_Item {
00406 public:
00407 
00408   /** Enum for types of data objects. Comm means data object has TdcDataV1Common
00409               type, AuxIO means TdcDataV1Marker class, all others are for TdcDataV1Channel. */
00410   enum Source {
00411     Comm,
00412     Chan1,
00413     Chan2,
00414     Chan3,
00415     Chan4,
00416     Chan5,
00417     Chan6,
00418     AuxIO,
00419   };
00420   TdcDataV1_Item(uint32_t arg__bf_val, Acqiris::TdcDataV1_Item::Source arg__bf_source, uint8_t arg__bf_ovf)
00421     : _value(((arg__bf_val) & 0xfffffff)|(((arg__bf_source) & 0x7)<<28)|(((arg__bf_ovf) & 0x1)<<31))
00422   {
00423   }
00424   TdcDataV1_Item() {}
00425   /** Value as integer number whiis composed of several bit fields. Do not use value directly,
00426                 instead cast this object to one of the actual types and use corresponding methods. */
00427   uint32_t value() const { return _value; }
00428   uint32_t bf_val_() const { return uint32_t(this->_value & 0xfffffff); }
00429   /** Source of this data object, use returned enum to distinguish between actual 
00430                 types of data objecs and cast appropriately. */
00431   Acqiris::TdcDataV1_Item::Source source() const { return Source((this->_value>>28) & 0x7); }
00432   uint8_t bf_ofv_() const { return uint8_t((this->_value>>31) & 0x1); }
00433   static uint32_t _sizeof() { return 4; }
00434 private:
00435   uint32_t      _value; /**< Value as integer number whiis composed of several bit fields. Do not use value directly,
00436                 instead cast this object to one of the actual types and use corresponding methods. */
00437 };
00438 std::ostream& operator<<(std::ostream& str, Acqiris::TdcDataV1_Item::Source enval);
00439 
00440 /** @class TdcDataV1Common
00441 
00442   Class for the "common" TDC data object.
00443 */
00444 
00445 
00446 class TdcDataV1Common: public TdcDataV1_Item {
00447 public:
00448   TdcDataV1Common() {}
00449   /** Returns number of hits. */
00450   uint32_t nhits() const;
00451   /** Returns overflow status. */
00452   uint8_t overflow() const;
00453   static uint32_t _sizeof() { return ((((Acqiris::TdcDataV1_Item::_sizeof())+1)-1)/1)*1; }
00454 };
00455 
00456 /** @class TdcDataV1Channel
00457 
00458   Class for the "channel" TDC data object.
00459 */
00460 
00461 
00462 class TdcDataV1Channel: public TdcDataV1_Item {
00463 public:
00464   TdcDataV1Channel() {}
00465   /** Returns number of ticks. */
00466   uint32_t ticks() const;
00467   /** Returns overflow status. */
00468   uint8_t overflow() const;
00469   /** Ticks converted to time, tick resolution is 50 picosecond. */
00470   double time() const;
00471   static uint32_t _sizeof() { return ((((Acqiris::TdcDataV1_Item::_sizeof())+1)-1)/1)*1; }
00472 };
00473 
00474 /** @class TdcDataV1Marker
00475 
00476   Class for the "marker" TDC data object.
00477 */
00478 
00479 
00480 class TdcDataV1Marker: public TdcDataV1_Item {
00481 public:
00482 
00483   /** Enum for the type of marker. */
00484   enum Type {
00485     AuxIOSwitch = 0,
00486     EventCntSwitch = 1,
00487     MemFullSwitch = 2,
00488     AuxIOMarker = 16,
00489   };
00490   TdcDataV1Marker() {}
00491   /** Returns type of the marker. */
00492   Acqiris::TdcDataV1Marker::Type type() const;
00493   static uint32_t _sizeof() { return ((((Acqiris::TdcDataV1_Item::_sizeof())+1)-1)/1)*1; }
00494 };
00495 std::ostream& operator<<(std::ostream& str, Acqiris::TdcDataV1Marker::Type enval);
00496 
00497 /** @class TdcDataV1
00498 
00499   Acqiris TDS data object is a container for TdcDataV1_Item object (or their
00500             sub-types).
00501 */
00502 
00503 
00504 class TdcDataV1 {
00505 public:
00506   enum { TypeId = Pds::TypeId::Id_AcqTdcData /**< XTC type ID value (from Pds::TypeId class) */ };
00507   enum { Version = 1 /**< XTC type version number */ };
00508   virtual ~TdcDataV1();
00509   /** Access TDC data items. */
00510   virtual ndarray<const Acqiris::TdcDataV1_Item, 1> data() const = 0;
00511 };
00512 } // namespace Acqiris
00513 } // namespace Psana
00514 #endif // PSANA_ACQIRIS_DDL_H

Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7