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

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

Inheritance diagram for daqdataformats::MicroSliceConstructor:
daqdataformats::RawDAQDataConstructor

Public Member Functions

 MicroSliceConstructor ()
 
 ~MicroSliceConstructor ()
 
 DEFINE_TESTVALUE_BOOL (MonteCarloFlag)
 
 DEFINE_TESTVALUE (LowWord)
 
 DEFINE_TESTVALUE (HighWord)
 
 DEFINE_TESTVALUE_64 (Time)
 
daqdataformats::RawDAQDatagetFilledDataFormat (const version_t) const
 
daqdataformats::RawDAQDatagetEmptyDataFormat (const 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 getNanoSlicesVersion (const RawMicroSlice *) const
 Gets the NanoSlices version in the MicroSlice. More...
 
virtual version_t getVersion (const daqdataformats::RawDAQData *) const
 Get version of the input dataformat. More...
 
version_t getMaximumVersion () const
 Get maximum version for the dataformat. More...
 

Public Attributes

version_t _currentNanoSliceVersion
 
rawnano::NanoSliceConstructor _nanosliceConstructor
 

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 25 of file MicroSliceConstructor.h.

Constructor & Destructor Documentation

daqdataformats::MicroSliceConstructor::MicroSliceConstructor ( )
daqdataformats::MicroSliceConstructor::~MicroSliceConstructor ( )

Definition at line 20 of file MicroSliceConstructor.cpp.

20 { }

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); }
daqdataformats::MicroSliceConstructor::DEFINE_TESTVALUE ( LowWord  )
daqdataformats::MicroSliceConstructor::DEFINE_TESTVALUE ( HighWord  )
daqdataformats::MicroSliceConstructor::DEFINE_TESTVALUE_64 ( Time  )
daqdataformats::MicroSliceConstructor::DEFINE_TESTVALUE_BOOL ( MonteCarloFlag  )
bool daqdataformats::MicroSliceConstructor::fillDataFormat ( daqdataformats::RawDAQData ) const
virtual

method to Fill the input dataformat

Implements daqdataformats::RawDAQDataConstructor.

Definition at line 35 of file MicroSliceConstructor.cpp.

References _currentNanoSliceVersion, daqdataformats::RawMicroSlice::addNanoSlice(), and daqdataformats::RawMicroSlice::setVersion().

Referenced by getFilledDataFormat().

35  {
37 
38  microslice->setVersion(0);
39  setFieldToTestValue_Time(microslice);
40  setFieldToTestValue_MonteCarloFlag(microslice);
41 
42  rawnano::NanoSliceConstructor nano_constructor;
43 
44  RawNanoSlice* nano1 = (RawNanoSlice*)nano_constructor.getFilledDataFormat(_currentNanoSliceVersion);
45 
46  RawNanoSlice* nano2 = (RawNanoSlice*)nano_constructor.getFilledDataFormat(_currentNanoSliceVersion);
47 
48  if(_currentNanoSliceVersion == 0){
49  nano2->setPulseHeight(nano2->getPulseHeight() + 1);
50  }
51  if(_currentNanoSliceVersion == 1){
52  nano2->setValue1(nano2->getValue1() + 1);
53  }
54 
55  microslice->addNanoSlice(nano1->getBuffer());
56  microslice->addNanoSlice(nano2->getBuffer());
57 
58  delete nano1;
59  delete nano2;
60 
61  return true;
62 }
bool setVersion(const version_t)
Class to hold the MicroSlice data.
Definition: RawMicroSlice.h:48
void addNanoSlice(const void *nanoslice_buffer, const bool check_mc_flag=true)
daqdataformats::RawDAQData * daqdataformats::MicroSliceConstructor::getEmptyDataFormat ( const version_t  ) const
virtual
daqdataformats::RawDAQData * daqdataformats::MicroSliceConstructor::getFilledDataFormat ( const version_t  ) const
virtual

method to create a filled dataformat with a given version

Implements daqdataformats::RawDAQDataConstructor.

Definition at line 23 of file MicroSliceConstructor.cpp.

References daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, fillDataFormat(), getEmptyDataFormat(), and confusionMatrixTree::out.

Referenced by daqdataformats::MilliSliceUnitTest::basicFieldGetAndSetChecks(), daqdataformats::MilliSliceConstructor::fillDataFormat(), and daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::MicroBlockConstructor::fillDataFormat().

23  {
25  fillDataFormat(out);
26  return out;
27 }
daqdataformats::RawDAQData * getEmptyDataFormat(const version_t) const
method to create an empty dataformat with a given version
bool fillDataFormat(daqdataformats::RawDAQData *) const
method to Fill the input dataformat
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
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::MicroSliceConstructor::getNanoSlicesVersion ( const RawMicroSlice micro) const

Gets the NanoSlices version in the MicroSlice.

right now it's unknown

loop over nanoslices

Definition at line 66 of file MicroSliceConstructor.cpp.

References _nanosliceConstructor, daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, daqdataformats::RawMicroSlice::getFloatingNanoSlice(), daqdataformats::RawMicroSlice::getNumNanoSlices(), LOG_ERROR, and daqdataformats::RawMicroSlice::setFloatingNanoSlice().

Referenced by daqdataformats::MicroSliceUnitTest::basicFieldGetAndSetChecks(), and daqdataformats::MilliSliceConstructor::getNanoSlicesVersion().

66  {
67 
68  if(micro->getNumNanoSlices() == 0) return rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION;
69 
70  /// right now it's unknown
72 
73  /// loop over nanoslices
74  for(uint32_t inano = 0; inano < micro->getNumNanoSlices(); ++inano){
75  micro->setFloatingNanoSlice(inano);
76 
77  const version_t nano_ver_current = _nanosliceConstructor.getVersion(micro->getFloatingNanoSlice());
78 
80  LOG_ERROR("UNITTEST")<<"Failure in "<<__PRETTY_FUNCTION__<<" at "<<__LINE__<<"\n"
81  <<" Output nanoslice version is rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION\n";
83  }
84 
86  nano_ver = nano_ver_current;
87  }
88  else{
89  if(nano_ver != nano_ver_current){
90  LOG_ERROR("UNITTEST")<<"Failure in "<<__PRETTY_FUNCTION__<<" at "<<__LINE__<<"\n"
91  <<" versions are inconsistent: at nanoslice "<<inano<<"\n"
92  <<"ver0="<<nano_ver<<" ver1="<<nano_ver_current<<"\n";
94  }
95  }
96  }// end of loop over nanoslices
97 
98  return nano_ver;
99 }
rawnano::NanoSliceConstructor _nanosliceConstructor
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
virtual version_t daqdataformats::RawDAQDataConstructor::getVersion ( const daqdataformats::RawDAQData ) const
inlinevirtualinherited

Get version of the input dataformat.

Reimplemented in daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::RunHeaderConstructor, daqdataformats::MilliSliceHeaderConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::EventHeaderConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::NanoSliceHeaderConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationHeaderConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::DataBlockHeaderConstructor, daqdataformats::TriggerHeaderConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::TriggerMaskConstructor, daqdataformats::TriggerTimeConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor, daqdataformats::TriggerTimingMarkerConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::NanoSliceConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::EventTailConstructor, daqdataformats::TriggerConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationNameConstructor, daqdataformats::DataBlockConstructor, daqdataformats::EventConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::MicroBlockHeaderConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationTailConstructor, daqdataformats::TriggerRangeConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::MicroBlockConstructor, daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationBlockConstructor, and daqdataformats::MilliSliceConstructor.

Definition at line 149 of file RawDAQDataConstructor.h.

149 { return -1;}
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::MicroSliceConstructor::_currentNanoSliceVersion
version_t daqdataformats::RawDAQDataConstructor::_maximumVersion
protectedinherited

Maximum version of the dataformat.

Definition at line 162 of file RawDAQDataConstructor.h.

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

rawnano::NanoSliceConstructor daqdataformats::MicroSliceConstructor::_nanosliceConstructor

Definition at line 46 of file MicroSliceConstructor.h.

Referenced by getNanoSlicesVersion().


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