Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
daqdataformats::MilliSliceConstructor Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/DAQDataFormats/cxx/unittest/MilliSliceConstructor.h"

Inheritance diagram for daqdataformats::MilliSliceConstructor:
daqdataformats::RawDAQDataConstructor

Public Member Functions

 MilliSliceConstructor ()
 
 ~MilliSliceConstructor ()
 
daqdataformats::RawDAQDatagetFilledDataFormat (const daqdataformats::version_t) const
 
daqdataformats::RawDAQDatagetEmptyDataFormat (const daqdataformats::version_t) const
 method to create an empty dataformat with a given version More...
 
bool fillDataFormat (daqdataformats::RawDAQData *) const
 method to Fill the input dataformat More...
 
version_t getVersion (const daqdataformats::RawDAQData *inver) const
 Get version of the input dataformat. More...
 
version_t getNanoSlicesVersion (const RawMilliSlice *) const
 Gets the NanoSlices version in the MilliSlice. More...
 
version_t getMaximumVersion () const
 Get maximum version for the dataformat. More...
 

Public Attributes

MicroSliceConstructor _microSliceConstructor
 

Protected Member Functions

uint32_t boolToUint32_t (const bool number) const
 Bool to uint abd backwards conversions. More...
 
bool uint32_tToBool (const uint32_t number) const
 

Protected Attributes

version_t _maximumVersion
 Maximum version of the dataformat. More...
 

Detailed Description

Definition at line 21 of file MilliSliceConstructor.h.

Constructor & Destructor Documentation

daqdataformats::MilliSliceConstructor::MilliSliceConstructor ( )

Definition at line 16 of file MilliSliceConstructor.cpp.

17 {
18 }
daqdataformats::MilliSliceConstructor::~MilliSliceConstructor ( )

Definition at line 19 of file MilliSliceConstructor.cpp.

19 { }

Member Function Documentation

uint32_t daqdataformats::RawDAQDataConstructor::boolToUint32_t ( const bool  number) const
inlineprotectedinherited

Bool to uint abd backwards conversions.

Definition at line 156 of file RawDAQDataConstructor.h.

156 { return ((number) ? 1 : 0); }
bool daqdataformats::MilliSliceConstructor::fillDataFormat ( daqdataformats::RawDAQData ) const
virtual

method to Fill the input dataformat

Implements daqdataformats::RawDAQDataConstructor.

Definition at line 36 of file MilliSliceConstructor.cpp.

References _microSliceConstructor, daqdataformats::RawMilliSlice::addMicroSlice(), daqdataformats::RawMilliSlice::close(), daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, daqdataformats::RawDAQData::getBuffer(), daqdataformats::MicroSliceConstructor::getFilledDataFormat(), daqdataformats::RawMicroSlice::getTime(), daqdataformats::RawMilliSlice::setDiblockId(), daqdataformats::RawMilliSlice::setFrameSEQ(), daqdataformats::RawMilliSlice::setMicroSliceTimeLength_usec(), daqdataformats::RawMilliSlice::setMilliSliceSEQ(), daqdataformats::RawMilliSlice::setMonteCarloFlag(), daqdataformats::RawMilliSlice::setPartition(), daqdataformats::RawMicroSlice::setTime(), daqdataformats::RawMilliSlice::setTimeLength(), daqdataformats::RawMilliSlice::setTimeStartHigh(), and daqdataformats::RawMilliSlice::setTimeStartLow().

Referenced by getFilledDataFormat().

36  {
38 
39  millislice->setDiblockId(5);
40  millislice->setPartition(6);
41  millislice->setTimeStartLow(7);
42  millislice->setTimeStartHigh(8);
43  millislice->setTimeLength(9);
44  millislice->setMilliSliceSEQ(10);
45  millislice->setMicroSliceTimeLength_usec(11);
46  millislice->setMonteCarloFlag(true);
47  millislice->setFrameSEQ(12);
48 
51 
52  micro2->setTime(micro2->getTime() + 500);
53 
54  millislice->addMicroSlice(micro1->getBuffer());
55  millislice->addMicroSlice(micro2->getBuffer());
56 
57  millislice->close(true);
58 
59 
60  delete micro1;
61  delete micro2;
62 
63  return true;
64 }
daqdataformats::RawDAQData * getFilledDataFormat(const version_t) const
bool setPartition(const uint32_t a)
Definition: RawMilliSlice.h:85
bool setFrameSEQ(const uint32_t a)
bool setMilliSliceSEQ(const uint32_t a)
Definition: RawMilliSlice.h:96
bool setMicroSliceTimeLength_usec(const uint32_t a)
Definition: RawMilliSlice.h:97
bool close(const bool produce_crc=false)
bool setDiblockId(const uint32_t a)
Definition: RawMilliSlice.h:80
bool setTimeStartLow(const uint32_t a)
Definition: RawMilliSlice.h:87
bool setMonteCarloFlag(const bool a)
Definition: RawMilliSlice.h:98
bool setTimeLength(const uint32_t a)
Definition: RawMilliSlice.h:89
bool addMicroSlice(const void *microslice_buffer, const bool indexate=false, const bool check_mc_flag=false)
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
bool setTimeStartHigh(const uint32_t a)
Definition: RawMilliSlice.h:88
daqdataformats::RawDAQData * daqdataformats::MilliSliceConstructor::getEmptyDataFormat ( const daqdataformats::version_t  ) const
virtual
daqdataformats::RawDAQData * daqdataformats::MilliSliceConstructor::getFilledDataFormat ( const daqdataformats::version_t  ) const
virtual
version_t daqdataformats::RawDAQDataConstructor::getMaximumVersion ( ) const
inlineinherited

Get maximum version for the dataformat.

Definition at line 152 of file RawDAQDataConstructor.h.

References daqdataformats::RawDAQDataConstructor::_maximumVersion.

152 {return _maximumVersion;}
version_t _maximumVersion
Maximum version of the dataformat.
version_t daqdataformats::MilliSliceConstructor::getNanoSlicesVersion ( const RawMilliSlice milli) const

Gets the NanoSlices version in the MilliSlice.

right now it's unknown

loop over nanoslices

If number of Nanoslices in Microslice is zero, then skip it

Definition at line 68 of file MilliSliceConstructor.cpp.

References _microSliceConstructor, daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, daqdataformats::RawMilliSlice::getFloatingMicroSlice(), daqdataformats::RawMilliSlice::getMicrosliceNumber(), daqdataformats::MicroSliceConstructor::getNanoSlicesVersion(), daqdataformats::RawMicroSlice::getNumNanoSlices(), LOG_ERROR, and daqdataformats::RawMilliSlice::setFloatingMicroSlice().

Referenced by daqdataformats::MilliSliceUnitTest::basicFieldGetAndSetChecks(), and getVersion().

68  {
69 
70  if(milli->getMicrosliceNumber() == 0) return rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION;
71 
72  /// right now it's unknown
74 
75  /// loop over nanoslices
76  for(uint32_t imicro = 0; imicro < milli->getMicrosliceNumber(); ++imicro){
77  milli->setFloatingMicroSlice(imicro);
78 
79  /// If number of Nanoslices in Microslice is zero, then skip it
80  if(milli->getFloatingMicroSlice()->getNumNanoSlices() == 0) continue;
81 
82  const version_t nano_ver_current = _microSliceConstructor.getNanoSlicesVersion(milli->getFloatingMicroSlice());
83 
85  LOG_ERROR("UNITTEST")<<"Failure in "<<__PRETTY_FUNCTION__<<" at "<<__LINE__<<"\n"
86  <<" Output nanoslice version is rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION\n";
88  }
89 
91  nano_ver = nano_ver_current;
92  }
93  else{
94  if(nano_ver != nano_ver_current){
95  LOG_ERROR("UNITTEST")<<"Failure in "<<__PRETTY_FUNCTION__<<" at "<<__LINE__<<"\n"
96  <<" versions are inconsistent: at microslice "<<imicro<<"\n"
97  <<"ver0="<<nano_ver<<" ver1="<<nano_ver_current<<"\n";
99  }
100  }
101  }// end of loop over nanoslices
102 
103  return nano_ver;
104 }
version_t getNanoSlicesVersion(const RawMicroSlice *) const
Gets the NanoSlices version in the MicroSlice.
int32_t version_t
Definition: RawDAQData.h:72
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
#define LOG_ERROR(stream)
Definition: Messenger.h:129
version_t daqdataformats::MilliSliceConstructor::getVersion ( const daqdataformats::RawDAQData ) const
inlinevirtual

Get version of the input dataformat.

Reimplemented from daqdataformats::RawDAQDataConstructor.

Definition at line 30 of file MilliSliceConstructor.h.

References getNanoSlicesVersion(), and daqdataformats::RawMilliSlice::getVersion().

30  {
31  const RawMilliSlice* nano_ver = (const RawMilliSlice*)inver;
32  return nano_ver->getVersion();
33  }
bool daqdataformats::RawDAQDataConstructor::uint32_tToBool ( const uint32_t  number) const
inlineprotectedinherited

Definition at line 157 of file RawDAQDataConstructor.h.

157 { return ((number) ? true : false); }

Member Data Documentation

version_t daqdataformats::RawDAQDataConstructor::_maximumVersion
protectedinherited

Maximum version of the dataformat.

Definition at line 162 of file RawDAQDataConstructor.h.

Referenced by daqdataformats::RawDAQDataConstructor::getMaximumVersion().

MicroSliceConstructor daqdataformats::MilliSliceConstructor::_microSliceConstructor

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