EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Packet_A Class Referenceabstract

#include <online_distribution/blob/master/newbasic/packet_A.h>

+ Inheritance diagram for Packet_A:
+ Collaboration diagram for Packet_A:

Public Member Functions

 Packet_A (PACKET_ptr packet_ptr)
 
 Packet_A ()
 
 ~Packet_A ()
 
int getLength () const
 
int getErrorLength () const
 
int getDebugLength () const
 get the length of the debug block
 
int getIdentifier () const
 get the packet identifier
 
int getPadding () const
 get the number of padding units in the packet data.
 
int getStructure () const
 get the structure of the packet data; unformatted, hitlist, etc.
 
int getHitFormat () const
 get the hit format; in case of unformatted get the encoding scheme.
 
int getDataLength () const
 get what the name says...
 
void identify (OSTREAM &=COUT) const
 
void fullIdentify (OSTREAM &=COUT) const
 
void dumpErrorBlock (OSTREAM &=COUT)
 
void dumpDebugBlock (OSTREAM &=COUT)
 
int iValue (const int)
 iValue returns the value of a given channel as an int.
 
int iValue (const int, const char *)
 
int iValue (const int, const int)
 
int iValue (const int, const int, const char *)
 
int iValue (const int channel, const int iy, const int iz)
 
int iValue (const int channel, const int iy, const int iz, const char *what)
 
float rValue (const int)
 
float rValue (const int, const char *)
 
float rValue (const int, const int)
 
int getArraylength (const char *)
 
int fillIntArray (int[], const int, int *, const char *what="")
 
int fillFloatArray (float[], const int, int *, const char *what="")
 fillFloatArray fills an array of floats
 
int * getIntArray (int *, const char *what="")
 
float * getFloatArray (int *, const char *what="")
 getFloatArray creates and returns an array of floats
 
virtual int is_pointer_type () const
 find out what type (pointer- or data based) packet object we have
 
virtual int convert ()
 convert from pointer- to data based object, if it is already data-based, do nothing.
 
int getCheckSumStatus () const
 
int copyMe (int dest[], const int maxlength) const
 
int setInternalParameter (const int p1=0, const int p2=0, const char *what="")
 
- Public Member Functions inherited from Packet
virtual ~Packet ()
 the virtual destructor
 
virtual double dValue (const int channel)
 
virtual double dValue (const int channel, const char *what)
 
virtual double dValue (const int channel, const int iy)
 
virtual long long lValue (const int channel)
 
virtual long long lValue (const int channel, const char *what)
 
virtual long long lValue (const int channel, const int iy)
 
virtual void * pValue (const int chan)
 
virtual void * pValue (const int chan, const char *what)
 
virtual void * pValue (const int chan, const int iy)
 
virtual void identify (std::ostream &os=std::cout) const =0
 see below for comments
 
virtual void fullIdentify (std::ostream &os=std::cout) const
 write an indepth identification message to the supplied OSTREAM.
 
virtual void dump (std::ostream &os=std::cout)=0
 
virtual void gdump (const int how=EVT_HEXADECIMAL, std::ostream &os=std::cout) const =0
 

Protected Member Functions

int standardIntArray (int[], const int, int *, const char *what="")
 
virtual int * decode (int *)=0
 

Static Protected Member Functions

static void fix_endianess (long long *x)
 
static void fix_endianess (double *x)
 
static void fix_endianess (char *str, const int length)
 

Protected Attributes

PACKET_ptr packet
 
int is_data_type
 
int data1_length
 
int data2_length
 
int data3_length
 
int data4_length
 
int data5_length
 
int data6_length
 
int data7_length
 
int data8_length
 
int data9_length
 
int data10_length
 
int * decoded_data1
 
int * decoded_data2
 
int * decoded_data3
 
int * decoded_data4
 
int * decoded_data5
 
int * decoded_data6
 
int * decoded_data7
 
int * decoded_data8
 
int * decoded_data9
 
int * decoded_data10
 

Detailed Description

in order to keep the top-level Packet class fully implementation-independent, we put this Packet_A class in, from which all current implementations derive.

Definition at line 21 of file packet_A.h.

View newest version in sPHENIX GitHub at line 21 of file packet_A.h

Constructor & Destructor Documentation

Packet_A::~Packet_A ( )

Definition at line 68 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 68 of file packet_A.cc

References decoded_data1, decoded_data10, decoded_data2, decoded_data3, decoded_data4, decoded_data5, decoded_data6, decoded_data7, decoded_data8, decoded_data9, is_data_type, and packet.

Member Function Documentation

int Packet_A::convert ( )
virtual

convert from pointer- to data based object, if it is already data-based, do nothing.

Implements Packet.

Definition at line 134 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 134 of file packet_A.cc

References getLength(), is_data_type, k, and packet.

+ Here is the call graph for this function:

int Packet_A::copyMe ( int  dest[],
const int  maxlength 
) const
virtual

Reimplemented from Packet.

Definition at line 514 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 514 of file packet_A.cc

References getLength(), and packet.

+ Here is the call graph for this function:

void Packet_A::dumpDebugBlock ( OSTREAM out = COUT)

Definition at line 649 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 649 of file packet_A.cc

References COUT, data, findPacketDebugStart(), getCheckSumStatus(), getDebugLength(), getLength(), packet, and SETW.

Referenced by Packet_cdevwcm::dump(), Packet_w1::dump(), Packet_cdevmadch::dump(), Packet_hbd_fpga::dump(), Packet_hbd_fpgashort::dump(), Packet_cdevbpm::dump(), Packet_cdevpoltarget::dump(), Packet_w2::dump(), Packet_cdevpolarimeter::dump(), and Packet_w4::dump().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Packet_A::dumpErrorBlock ( OSTREAM out = COUT)

Definition at line 612 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 612 of file packet_A.cc

References COUT, data, findPacketErrorStart(), getErrorLength(), getLength(), packet, and SETW.

Referenced by Packet_cdevwcm::dump(), Packet_w1::dump(), Packet_cdevmadch::dump(), Packet_hbd_fpga::dump(), Packet_hbd_fpgashort::dump(), Packet_cdevbpm::dump(), Packet_cdevpoltarget::dump(), Packet_w2::dump(), Packet_cdevpolarimeter::dump(), and Packet_w4::dump().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Packet_A::fillFloatArray ( float  destination[],
const int  length,
int *  nw,
const char *  what = "" 
)
virtual

fillFloatArray fills an array of floats

Implements Packet.

Definition at line 533 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 533 of file packet_A.cc

References data1_length, decode(), and decoded_data1.

Referenced by getFloatArray().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Packet_A::fillIntArray ( int  destination[],
const int  length,
int *  nw,
const char *  what = "" 
)
virtual

fillIntArray and fillFloatArray fill existing (user-supplied) arrays with the decoded data

Implements Packet.

Reimplemented in Packet_gl1p.

Definition at line 426 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 426 of file packet_A.cc

References standardIntArray().

Referenced by getIntArray().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void Packet_A::fix_endianess ( long long *  x)
staticprotected

Referenced by Packet_cdevir::decode(), and Packet_cdevwcm::decode().

+ Here is the caller graph for this function:

void Packet_A::fix_endianess ( double *  x)
staticprotected

Definition at line 696 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 696 of file packet_A.cc

void Packet_A::fix_endianess ( char *  str,
const int  length 
)
staticprotected

Definition at line 704 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 704 of file packet_A.cc

References buffer::i4swap().

+ Here is the call graph for this function:

void Packet_A::fullIdentify ( OSTREAM out = COUT) const

Definition at line 203 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 203 of file packet_A.cc

References getPacketDataDescrLength(), getPacketDebugLength(), getPacketEndianism(), getPacketErrorLength(), getPacketHdrLength(), getPacketHdrVersion(), getPacketId(), getPacketLength(), getPacketPadding(), getPacketStatus(), getStructure(), hitArray, hitList, packet, Packets, and Unstructured.

+ Here is the call graph for this function:

int Packet_A::getArraylength ( const char *  what)
virtual

getArraylength returns the length of the array needed to store the decoded values.

Implements Packet.

Definition at line 410 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 410 of file packet_A.cc

References data1_length, decode(), and decoded_data1.

+ Here is the call graph for this function:

int Packet_A::getCheckSumStatus ( ) const
virtual

This functiion returns the status of the DCM transfer checksum. 0 = cannot be calculated for this packet 1 = ok -1 = fail

Reimplemented from Packet.

Definition at line 714 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 714 of file packet_A.cc

References d, getDebugLength(), getLength(), and packet.

Referenced by dumpDebugBlock().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Packet_A::getDataLength ( ) const
virtual

get what the name says...

Implements Packet.

Definition at line 196 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 196 of file packet_A.cc

References getPacketDataLength(), and packet.

Referenced by Packet_fvtx_dcm0::calculate_parity(), Packet_id2evt::decode(), Packet_id4evt::decode(), Packet_iddigitizerv2::decode(), Packet_gl1_evclocks::decode(), Packet_idcstr::decode(), Packet_idcdevdescr::decode(), Packet_starscaler::decode(), Packet_cdevmadch::decode(), Packet_cdevbpm::decode(), Packet_hbd_fpgashort::decode(), Packet_hbd_fpga::decode(), Packet_fvtx_dcm0::decode(), Packet_gl1p::decode(), Packet_id4scaler::decode(), Packet_gl1::decode(), Packet_fvtx_dcm0::decode_misc(), Packet_gl1p::demangle(), Packet_gl1::demangle(), Packet_gl1_evclocks::dump(), Packet_idcdevdescr::dump(), Packet_gl1p::dump(), Packet_gl1::dump(), Packet_w1::gdump(), Packet_w2::gdump(), Packet_w4::gdump(), Packet_gl1_evclocks::iValue(), and standardIntArray().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Packet_A::getDebugLength ( ) const
virtual

get the length of the debug block

Implements Packet.

Definition at line 164 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 164 of file packet_A.cc

References getPacketDebugLength(), and packet.

Referenced by dumpDebugBlock(), and getCheckSumStatus().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Packet_A::getErrorLength ( ) const
virtual

Implements Packet.

Definition at line 160 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 160 of file packet_A.cc

References getPacketErrorLength(), and packet.

Referenced by dumpErrorBlock(), and identify().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float * Packet_A::getFloatArray ( int *  nw,
const char *  = "" 
)
virtual

getFloatArray creates and returns an array of floats

Implements Packet.

Definition at line 588 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 588 of file packet_A.cc

References data1_length, decode(), decoded_data1, and fillFloatArray().

+ Here is the call graph for this function:

int Packet_A::getHitFormat ( ) const
virtual

get the hit format; in case of unformatted get the encoding scheme.

Implements Packet.

Definition at line 183 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 183 of file packet_A.cc

References getUnstructPacketHitFormat(), and packet.

Referenced by Packet_fvtx_dcm0::calculate_parity(), Packet_gl1psum::decode(), Packet_iddigitizerv2::decode(), Packet_cdevbuckets::decode(), Packet_cdevring::decode(), Packet_fvtx_dcm0::decode(), Packet_cdevringnopol::decode(), Packet_cdevpolarimeter::decode(), identify(), and Packet_hbd_fpga::Packet_hbd_fpga().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Packet_A::getIdentifier ( ) const
virtual

get the packet identifier

Implements Packet.

Definition at line 168 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 168 of file packet_A.cc

References getPacketId(), and packet.

Referenced by identify().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int * Packet_A::getIntArray ( int *  nw,
const char *  = "" 
)
virtual

getIntArray and getFloatArray create a new array of the approriate size fill it with the decoded values, and return a pointer to the array. nw is the length of the array created.

Implements Packet.

Definition at line 563 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 563 of file packet_A.cc

References data1_length, decode(), decoded_data1, and fillIntArray().

+ Here is the call graph for this function:

int Packet_A::getLength ( ) const
virtual

getLength() returns the length of the raw packet data. If you were to copy the data somewhere, the destination must be able to hold as many words.

Implements Packet.

Definition at line 154 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 154 of file packet_A.cc

References getPacketLength(), and packet.

Referenced by convert(), copyMe(), dumpDebugBlock(), dumpErrorBlock(), Packet_w1::gdump(), Packet_w2::gdump(), Packet_w4::gdump(), getCheckSumStatus(), identify(), and standardIntArray().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Packet_A::getPadding ( ) const
virtual

get the number of padding units in the packet data.

Implements Packet.

Definition at line 171 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 171 of file packet_A.cc

References getPacketPadding(), and packet.

Referenced by Packet_w4::gdump().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Packet_A::getStructure ( ) const
virtual

get the structure of the packet data; unformatted, hitlist, etc.

Implements Packet.

Definition at line 177 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 177 of file packet_A.cc

References getPacketStructure(), and packet.

Referenced by fullIdentify(), and identify().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Packet_A::identify ( OSTREAM out = COUT) const
int Packet_A::is_pointer_type ( ) const
virtual

find out what type (pointer- or data based) packet object we have

Implements Packet.

Definition at line 126 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 126 of file packet_A.cc

References is_data_type.

int Packet_A::iValue ( const int  channel)
virtual

iValue returns the value of a given channel as an int.

Implements Packet.

Reimplemented in Packet_starscaler, Packet_idcstr, and Packet_gl1psum.

Definition at line 301 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 301 of file packet_A.cc

References data1_length, decode(), and decoded_data1.

+ Here is the call graph for this function:

int Packet_A::iValue ( const int  channel,
const char *  what 
)
virtual

with the "what" parameter you can decide which aspect of the data you want to see (for devices which have more than one)

Implements Packet.

Reimplemented in Packet_gl1, Packet_cdevpolarimeter, Packet_id4scaler, Packet_fvtx_dcm0, Packet_gl1p, Packet_cdevpoltarget, Packet_cdevbpm, Packet_hbd_fpga, Packet_hbd_fpgashort, Packet_cdevmadch, Packet_cdevbuckets, Packet_cdevring, Packet_cdevringnopol, Packet_starscaler, Packet_cdevwcm, Packet_gl1_evclocks, Packet_gl1psum, and Packet_iddigitizerv2.

Definition at line 319 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 319 of file packet_A.cc

References data1_length, decode(), and decoded_data1.

+ Here is the call graph for this function:

int Packet_A::iValue ( const int  channel,
const int  iy 
)
virtual

this supports devices which are inherently organized as two-dimensional data, such as flash ADC's (channel vs time slice)

Implements Packet.

Reimplemented in Packet_gl1, Packet_fvtx_dcm0, Packet_gl1p, Packet_hbd_fpga, Packet_hbd_fpgashort, Packet_gl1_evclocks, and Packet_iddigitizerv2.

Definition at line 337 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 337 of file packet_A.cc

References data1_length, decode(), and decoded_data1.

+ Here is the call graph for this function:

int Packet_A::iValue ( const int  channel,
const int  y,
const char *  what 
)
inlinevirtual

we have a few recent devices which have one more dimension (such as card, time sample, channel)

Implements Packet.

Definition at line 74 of file packet_A.h.

View newest version in sPHENIX GitHub at line 74 of file packet_A.h

int Packet_A::iValue ( const int  channel,
const int  iy,
const int  iz 
)
inlinevirtual

this supports devices organized as three-dimensional data (card vs channel vs time slice )

Implements Packet.

Definition at line 75 of file packet_A.h.

View newest version in sPHENIX GitHub at line 75 of file packet_A.h

int Packet_A::iValue ( const int  channel,
const int  iy,
const int  iz,
const char *  what 
)
inlinevirtual

this supports devices organized as three-dimensional data (card vs channel vs time slice, with a "what" selection )

Implements Packet.

Definition at line 76 of file packet_A.h.

View newest version in sPHENIX GitHub at line 76 of file packet_A.h

float Packet_A::rValue ( const int  channel)
virtual

rValue returns the value of a given channel as a float

Implements Packet.

Definition at line 355 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 355 of file packet_A.cc

References data1_length, decode(), and decoded_data1.

+ Here is the call graph for this function:

float Packet_A::rValue ( const int  channel,
const char *  what 
)
virtual

with the "what" parameter you can decide which aspect of the data you want to see (for devices which have more than one)

Implements Packet.

Reimplemented in Packet_cdevpolarimeter, Packet_cdevdvm, Packet_cdevbpm, and Packet_cdevwcm.

Definition at line 373 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 373 of file packet_A.cc

References data1_length, decode(), and decoded_data1.

+ Here is the call graph for this function:

float Packet_A::rValue ( const int  channel,
const int  iy 
)
virtual

this supports devices which are inherently organized as two-dimensional data, such as flash ADC's (channel vs time slice)

Implements Packet.

Reimplemented in Packet_cdevwcm.

Definition at line 391 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 391 of file packet_A.cc

References data1_length, decode(), and decoded_data1.

+ Here is the call graph for this function:

int Packet_A::setInternalParameter ( const int  p1 = 0,
const int  p2 = 0,
const char *  what = "" 
)
inlinevirtual

Implements Packet.

Reimplemented in Packet_hbd_fpga, and Packet_hbd_fpgashort.

Definition at line 96 of file packet_A.h.

View newest version in sPHENIX GitHub at line 96 of file packet_A.h

int Packet_A::standardIntArray ( int  iarr[],
const int  nlen,
int *  nwout,
const char *  what = "" 
)
protected

Definition at line 439 of file packet_A.cc.

View newest version in sPHENIX GitHub at line 439 of file packet_A.cc

References data1_length, decode(), decoded_data1, findPacketDataStart(), getDataLength(), getLength(), and packet.

Referenced by fillIntArray().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

int Packet_A::data10_length
protected

Definition at line 118 of file packet_A.h.

View newest version in sPHENIX GitHub at line 118 of file packet_A.h

Referenced by Packet_A().

int Packet_A::data2_length
protected

Definition at line 110 of file packet_A.h.

View newest version in sPHENIX GitHub at line 110 of file packet_A.h

Referenced by Packet_fvtx_dcm0::decode(), and Packet_A().

int Packet_A::data3_length
protected

Definition at line 111 of file packet_A.h.

View newest version in sPHENIX GitHub at line 111 of file packet_A.h

Referenced by Packet_fvtx_dcm0::decode(), and Packet_A().

int Packet_A::data4_length
protected

Definition at line 112 of file packet_A.h.

View newest version in sPHENIX GitHub at line 112 of file packet_A.h

Referenced by Packet_fvtx_dcm0::decode(), and Packet_A().

int Packet_A::data5_length
protected

Definition at line 113 of file packet_A.h.

View newest version in sPHENIX GitHub at line 113 of file packet_A.h

Referenced by Packet_fvtx_dcm0::iValue(), and Packet_A().

int Packet_A::data6_length
protected

Definition at line 114 of file packet_A.h.

View newest version in sPHENIX GitHub at line 114 of file packet_A.h

Referenced by Packet_A().

int Packet_A::data7_length
protected

Definition at line 115 of file packet_A.h.

View newest version in sPHENIX GitHub at line 115 of file packet_A.h

Referenced by Packet_A().

int Packet_A::data8_length
protected

Definition at line 116 of file packet_A.h.

View newest version in sPHENIX GitHub at line 116 of file packet_A.h

Referenced by Packet_A().

int Packet_A::data9_length
protected

Definition at line 117 of file packet_A.h.

View newest version in sPHENIX GitHub at line 117 of file packet_A.h

Referenced by Packet_A().

int* Packet_A::decoded_data10
protected

Definition at line 129 of file packet_A.h.

View newest version in sPHENIX GitHub at line 129 of file packet_A.h

Referenced by Packet_A(), and ~Packet_A().

int* Packet_A::decoded_data2
protected
int* Packet_A::decoded_data3
protected
int* Packet_A::decoded_data4
protected
int* Packet_A::decoded_data5
protected

Definition at line 124 of file packet_A.h.

View newest version in sPHENIX GitHub at line 124 of file packet_A.h

Referenced by Packet_fvtx_dcm0::iValue(), Packet_A(), and ~Packet_A().

int* Packet_A::decoded_data6
protected

Definition at line 125 of file packet_A.h.

View newest version in sPHENIX GitHub at line 125 of file packet_A.h

Referenced by Packet_A(), and ~Packet_A().

int* Packet_A::decoded_data7
protected

Definition at line 126 of file packet_A.h.

View newest version in sPHENIX GitHub at line 126 of file packet_A.h

Referenced by Packet_A(), and ~Packet_A().

int* Packet_A::decoded_data8
protected

Definition at line 127 of file packet_A.h.

View newest version in sPHENIX GitHub at line 127 of file packet_A.h

Referenced by Packet_A(), and ~Packet_A().

int* Packet_A::decoded_data9
protected

Definition at line 128 of file packet_A.h.

View newest version in sPHENIX GitHub at line 128 of file packet_A.h

Referenced by Packet_A(), and ~Packet_A().

int Packet_A::is_data_type
protected

Definition at line 107 of file packet_A.h.

View newest version in sPHENIX GitHub at line 107 of file packet_A.h

Referenced by convert(), is_pointer_type(), Packet_A(), and ~Packet_A().


The documentation for this class was generated from the following files: