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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-30/DAQDataFormats/cxx/include/RawDataBlockV0.h"

Inheritance diagram for daqdataformats::VERSION_NAMESPACE::RawDataBlock:

Public Member Functions

void init ()
 
void print (std::ostream &os=std::cout) const
 
uint32_t sizeofdata () const
 
bool setBufferSource (const void *pointer)
 
voidreadData (const void *)
 
daqdataformats::RawDataBlockHeadergetHeader () const
 
daqdataformats::RawMicroBlockgetFloatingMicroBlock () const
 
bool addMicroBlock1 (const void *microblock_buffer, const bool check_mc_flag)
 
bool addMicroBlock2 (const void *microblock_buffer, const uint32_t microblock_size, const bool check_mc_flag)
 
bool addMicroBlock3 (const void *millislice_buffer, const void *microslice_buffer, const version_t microblock_version, const bool check_mc_flag)
 
bool addMicroBlock4 (const void *millislice_buffer, const void *microslice_buffer, const uint32_t microslice_size, const version_t microblock_version, const bool check_mc_flag)
 
bool setMarker (const uint32_t)
 
bool addDroppedMicroblock (const void *)
 
bool addDCMData1 (const void *)
 
bool addDCMData2 (const void *, const uint32_t)
 
void tprintf (unsigned lvl, const char *fmt,...) __attribute__((format(printf
 
bool addDroppedMicroblock (const void *droppedmicroblock_buffer)
 
daqdataformats::RawSummaryDroppedMicroblockgetDroppedMicroblock ()
 
bool addDCMData1 (const void *)
 
bool addDCMData2 (const void *, const uint32_t)
 
bool addDCMData1 (const void *dcmdata_buffer)
 
bool addDCMData2 (const void *dcmdata_buffer, const uint32_t dcmdata_size)
 
RawSummaryDCMDatagetDCMData ()
 

Protected Member Functions

 RawDataBlock (const version_t, const uint32_t tlvl)
 Constructors. More...
 
 RawDataBlock (const RawDataBlock &)
 
 ~RawDataBlock ()
 Destructor. More...
 
uint32_t getPredeterminedSize () const
 
readDataStatus readDataUnknownVersion (const int)
 
 INIT_FIRST (readDataFromFileDescriptor,, readDataStatus, const int)
 
 INIT_FIRST (close,, bool, const bool)
 
 INIT_FIRST (setFloatingMicroBlockToBufferSource, const, bool, const void *)
 
 INIT_FIRST (clear,, bool,)
 
 INIT_FIRST (softclear,, bool,)
 
 INIT_FIRST (getVersion, const, uint32_t,)
 
 INIT_FIRST (getMarker, const, uint32_t,)
 
 INIT_FIRST (getTrigNumLo, const, uint32_t,)
 
 INIT_FIRST (getTrigNumHi, const, uint32_t,)
 
 INIT_FIRST (getTrigNum, const, uint64_t,)
 
 INIT_FIRST (getNumMicroBlocks, const, uint16_t,)
 
 INIT_FIRST (getBuffId, const, uint16_t,)
 
 INIT_FIRST (getDataSize, const, uint32_t,)
 
 INIT_FIRST (getMonteCarloFlag, const, bool,)
 
 INIT_FIRST (isCRCCalculationUsed, const, bool,)
 
 INIT_FIRST (isConnectionInitialization, const, bool,)
 
 INIT_FIRST (isCloseConnection, const, bool,)
 
 INIT_FIRST (isMissingData, const, bool,)
 
 INIT_FIRST (setFloatingMicroBlock, const, bool, const uint32_t)
 
 INIT_FIRST (getCRC, const, uint32_t,)
 
 INIT_FIRST (setTrigNumLo,, bool, const uint32_t)
 
 INIT_FIRST (setTrigNumHi,, bool, const uint32_t)
 
 INIT_FIRST (setTrigNum,, bool, const uint64_t)
 
 INIT_FIRST (setBuffId,, bool, const uint16_t)
 
 INIT_FIRST (setConnectionInitialization,, bool, const bool)
 
 INIT_FIRST (setMonteCarloFlag,, bool, const bool)
 
 INIT_FIRST (setCloseConnection,, bool, const bool)
 
 INIT_FIRST (setMissingData,, bool, const bool)
 
 INIT_CUSTOM_DELEGATE (addMicroBlock1, bool, const void *, const bool)
 
 INIT_CUSTOM_DELEGATE (addMicroBlock2, bool, const void *, const uint32_t, const bool)
 
 INIT_CUSTOM_DELEGATE (addMicroBlock3, bool, const void *, const void *, const version_t, const bool)
 
 INIT_CUSTOM_DELEGATE (addMicroBlock4, bool, const void *, const void *, const uint32_t, const version_t, const bool)
 
 RawDataBlock (const version_t, const uint32_t tlvl)
 Constructors. More...
 
 RawDataBlock (const RawDataBlock &)
 
 ~RawDataBlock ()
 Destructor. More...
 
 INIT_FIRST (setMarker,, bool, const uint32_t)
 
 INIT_CUSTOM_DELEGATE (addDroppedMicroblock, bool, const void *)
 
 RawDataBlock (const version_t, const uint32_t tlvl)
 Constructors. More...
 
 RawDataBlock (const RawDataBlock &)
 
 ~RawDataBlock ()
 Destructor. More...
 
 INIT_CUSTOM_DELEGATE (addDCMData1, bool, const void *)
 
 INIT_CUSTOM_DELEGATE (addDCMData2, bool, const void *, const uint32_t)
 

Protected Attributes

daqdataformats::RawDataBlockHeader_Header
 
daqdataformats::RawMicroBlock_FloatingMicroBlock
 DataBlock header. More...
 
int _FloatingMicroBlockNumber
 Floating MicroBlock. More...
 
version_t _microBlockVersion
 Floating MicroBlock Number. More...
 
uint32_t _tlvl
 
size_t _fd_read_bytes
 

Detailed Description

Definition at line 27 of file RawDataBlockV0.h.

Constructor & Destructor Documentation

daqdataformats::VERSION_NAMESPACE::RawDataBlock::RawDataBlock ( const version_t  version,
const uint32_t  tlvl 
)
protected

Constructors.

Definition at line 31 of file RawDataBlockV0.cpp.

31  :
33  ,_function_readDataFromFileDescriptor(&RawDataBlock::readDataUnknownVersion)
35  ,ZEROOUT_FUNCTION(setFloatingMicroBlockToBufferSource)
37  ,ZEROOUT_FUNCTION(softclear)
38  ,ZEROOUT_FUNCTION(getVersion)
39  ,ZEROOUT_FUNCTION(getMarker)
40  ,ZEROOUT_FUNCTION(getTrigNumLo)
41  ,ZEROOUT_FUNCTION(getTrigNumHi)
42  ,ZEROOUT_FUNCTION(getTrigNum)
43  ,ZEROOUT_FUNCTION(getNumMicroBlocks)
44  ,ZEROOUT_FUNCTION(getBuffId)
45  ,ZEROOUT_FUNCTION(getDataSize)
46  ,ZEROOUT_FUNCTION(getMonteCarloFlag)
47  ,ZEROOUT_FUNCTION(isCRCCalculationUsed)
48  ,ZEROOUT_FUNCTION(isConnectionInitialization)
49  ,ZEROOUT_FUNCTION(isCloseConnection)
50  ,ZEROOUT_FUNCTION(isMissingData)
51  ,ZEROOUT_FUNCTION(setFloatingMicroBlock)
52  ,ZEROOUT_FUNCTION(getCRC)
53  ,ZEROOUT_FUNCTION(setTrigNumLo)
54  ,ZEROOUT_FUNCTION(setTrigNumHi)
55  ,ZEROOUT_FUNCTION(setTrigNum)
56  ,ZEROOUT_FUNCTION(setBuffId)
57  ,ZEROOUT_FUNCTION(setConnectionInitialization)
58  ,ZEROOUT_FUNCTION(setMonteCarloFlag)
59  ,ZEROOUT_FUNCTION(setCloseConnection)
60  ,ZEROOUT_FUNCTION(setMissingData)
65  ,_Header (NULL)
66  ,_FloatingMicroBlock (NULL)
69  ,_tlvl (tlvl)
70  ,_fd_read_bytes (0)
71 {}
#define ZEROOUT_FUNCTION(FUNC)
Definition: FunctionBind.h:52
#define sizeofdata_t
Definition: FunctionBind.h:30
daqdataformats::RawMicroBlock * _FloatingMicroBlock
DataBlock header.
bool addMicroBlock4(const void *millislice_buffer, const void *microslice_buffer, const uint32_t microslice_size, const version_t microblock_version, const bool check_mc_flag)
vector< vector< double > > clear
bool addMicroBlock1(const void *microblock_buffer, const bool check_mc_flag)
version_t _microBlockVersion
Floating MicroBlock Number.
daqdataformats::RawDataBlockHeader * _Header
const XML_Char * version
Definition: expat.h:187
bool addMicroBlock2(const void *microblock_buffer, const uint32_t microblock_size, const bool check_mc_flag)
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
bool addMicroBlock3(const void *millislice_buffer, const void *microslice_buffer, const version_t microblock_version, const bool check_mc_flag)
procfile close()
daqdataformats::VERSION_NAMESPACE::RawDataBlock::RawDataBlock ( const RawDataBlock copyin)
protected

Definition at line 73 of file RawDataBlockV0.cpp.

73  :
74  RawDAQData(copyin)
75  ,DEEPCOPY_FUNCTION(readDataFromFileDescriptor)
77  ,DEEPCOPY_FUNCTION(setFloatingMicroBlockToBufferSource)
79  ,DEEPCOPY_FUNCTION(softclear)
80  ,DEEPCOPY_FUNCTION(getVersion)
81  ,DEEPCOPY_FUNCTION(getMarker)
82  ,DEEPCOPY_FUNCTION(getTrigNumLo)
83  ,DEEPCOPY_FUNCTION(getTrigNumHi)
84  ,DEEPCOPY_FUNCTION(getTrigNum)
85  ,DEEPCOPY_FUNCTION(getNumMicroBlocks)
86  ,DEEPCOPY_FUNCTION(getBuffId)
87  ,DEEPCOPY_FUNCTION(getDataSize)
88  ,DEEPCOPY_FUNCTION(getMonteCarloFlag)
89  ,DEEPCOPY_FUNCTION(isCRCCalculationUsed)
90  ,DEEPCOPY_FUNCTION(isConnectionInitialization)
91  ,DEEPCOPY_FUNCTION(isCloseConnection)
92  ,DEEPCOPY_FUNCTION(isMissingData)
93  ,DEEPCOPY_FUNCTION(setFloatingMicroBlock)
94  ,DEEPCOPY_FUNCTION(getCRC)
95  ,DEEPCOPY_FUNCTION(setTrigNumLo)
96  ,DEEPCOPY_FUNCTION(setTrigNumHi)
97  ,DEEPCOPY_FUNCTION(setTrigNum)
98  ,DEEPCOPY_FUNCTION(setBuffId)
99  ,DEEPCOPY_FUNCTION(setConnectionInitialization)
100  ,DEEPCOPY_FUNCTION(setMonteCarloFlag)
101  ,DEEPCOPY_FUNCTION(setCloseConnection)
102  ,DEEPCOPY_FUNCTION(setMissingData)
107  ,_Header (NULL)
108  ,_FloatingMicroBlock (NULL)
110  ,_microBlockVersion (copyin._microBlockVersion)
111  ,_tlvl (copyin._tlvl)
112  ,_fd_read_bytes (copyin._fd_read_bytes)
113 { }
#define DEEPCOPY_FUNCTION(FUNC)
Definition: FunctionBind.h:40
daqdataformats::RawMicroBlock * _FloatingMicroBlock
DataBlock header.
bool addMicroBlock4(const void *millislice_buffer, const void *microslice_buffer, const uint32_t microslice_size, const version_t microblock_version, const bool check_mc_flag)
vector< vector< double > > clear
bool addMicroBlock1(const void *microblock_buffer, const bool check_mc_flag)
version_t _microBlockVersion
Floating MicroBlock Number.
daqdataformats::RawDataBlockHeader * _Header
bool addMicroBlock2(const void *microblock_buffer, const uint32_t microblock_size, const bool check_mc_flag)
bool addMicroBlock3(const void *millislice_buffer, const void *microslice_buffer, const version_t microblock_version, const bool check_mc_flag)
procfile close()
daqdataformats::VERSION_NAMESPACE::RawDataBlock::~RawDataBlock ( )
protected

Destructor.

Definition at line 117 of file RawDataBlockV0.cpp.

References _fd_read_bytes, _FloatingMicroBlock, _Header, clear, and daqdataformats::RawDAQData::clear().

117  {
118  if(_Header) delete _Header;
120 }
daqdataformats::RawMicroBlock * _FloatingMicroBlock
DataBlock header.
daqdataformats::RawDataBlockHeader * _Header
daqdataformats::VERSION_NAMESPACE::RawDataBlock::RawDataBlock ( const version_t  ,
const uint32_t  tlvl 
)
protected

Constructors.

daqdataformats::VERSION_NAMESPACE::RawDataBlock::RawDataBlock ( const RawDataBlock )
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::~RawDataBlock ( )
protected

Destructor.

daqdataformats::VERSION_NAMESPACE::RawDataBlock::RawDataBlock ( const version_t  ,
const uint32_t  tlvl 
)
protected

Constructors.

daqdataformats::VERSION_NAMESPACE::RawDataBlock::RawDataBlock ( const RawDataBlock )
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::~RawDataBlock ( )
protected

Destructor.

Member Function Documentation

bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addDCMData1 ( const void dcmdata_buffer)
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addDCMData1 ( const void )
inline

Definition at line 39 of file RawDataBlockV1.h.

References GENERATE_FUNCTION_IS_NOT_ALLOWED.

#define GENERATE_FUNCTION_IS_NOT_ALLOWED
calling functionIsNotAllowed
Definition: RawDAQData.h:21
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addDCMData1 ( const void dcmdata_buffer)
inline

Construct a temporary nanoslice with external buffer

Definition at line 89 of file RawDataBlockV0.h.

References GENERATE_FUNCTION_IS_NOT_ALLOWED.

#define GENERATE_FUNCTION_IS_NOT_ALLOWED
calling functionIsNotAllowed
Definition: RawDAQData.h:21
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addDCMData2 ( const void dcmdata_buffer,
const uint32_t  dcmdata_size 
)
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addDCMData2 ( const void ,
const uint32_t   
)
inline

Definition at line 40 of file RawDataBlockV1.h.

References GENERATE_FUNCTION_IS_NOT_ALLOWED, INIT_CUSTOM_DELEGATE(), INIT_FIRST(), and setMarker().

#define GENERATE_FUNCTION_IS_NOT_ALLOWED
calling functionIsNotAllowed
Definition: RawDAQData.h:21
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addDCMData2 ( const void dcmdata_buffer,
const uint32_t  dcmdata_size 
)
inline

Before reading, we need to adjust the size of the DataBlock Cannot rely on the size adjustment from readDataGeneral, because we don't read CRC from dcmdata

If buffer is internal, we need to adjust its size

Dcmdata size is the size of the header and the microslice

Add the dcmdata size

Check pointers after each read or resize buffer

Read the Dcmdata to the _Buffer starting from the previous position -1 because of CRC

Check pointers after each read or resize buffer

Change the DataBlock header appropriately

This should already have been set by addDroppedMicroblock...

Definition at line 90 of file RawDataBlockV0.h.

References GENERATE_FUNCTION_IS_NOT_ALLOWED.

#define GENERATE_FUNCTION_IS_NOT_ALLOWED
calling functionIsNotAllowed
Definition: RawDAQData.h:21
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addDroppedMicroblock ( const void droppedmicroblock_buffer)

Add the Dropped MicroBlock Summary to _Buffer. The setMarker function will be called to indicate that this is a Summary Block

bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addDroppedMicroblock ( const void droppedmicroblock_buffer)
inline

Before reading, we need to adjust the size of the DataBlock Cannot rely on the size adjustment from readDataGeneral, because we don't read CRC from microblock

If buffer is internal, we need to adjust its size

Microblock size is the size of the header and the microslice

Add the microblock size

Check pointers after each read or resize buffer

Read the MicroBlock to the _Buffer starting from the previous position -1 because of CRC

Check pointers after each read or resize buffer

Change the DataBlock header appropriately

This is critical...flip the license plate on the RawDataBlock to make it a RawSummaryBlock...

Definition at line 86 of file RawDataBlockV0.h.

References GENERATE_FUNCTION_IS_NOT_ALLOWED.

#define GENERATE_FUNCTION_IS_NOT_ALLOWED
calling functionIsNotAllowed
Definition: RawDAQData.h:21
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addMicroBlock1 ( const void microblock_buffer,
const bool  check_mc_flag 
)

Add the MicroBlock to _Buffer. If check_mc_flag = true, the method checks whether the microslice in the microblock is MC generatedand adds an appropriate flag to the DataBlock Header.

Construct a temporary nanoslice with external buffer

Check the MicroBlock version

Definition at line 154 of file RawDataBlockV0.cpp.

References _microBlockVersion, addMicroBlock2(), daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, PRINT_ON_DEBUG, and RETURN_FUNCTION.

Referenced by getFloatingMicroBlock().

154  {
155 
156  PRINT_ON_DEBUG("In "<<__PRETTY_FUNCTION__<<" 0. Version "<<_microBlockVersion);
157 
158  /// Construct a temporary nanoslice with external buffer
159  const daqdataformats::RawMicroBlock tmp_microblock(microblock_buffer, _microBlockVersion);
160 
161  PRINT_ON_DEBUG("In "<<__PRETTY_FUNCTION__<<" 1");
162 
163  /// Check the MicroBlock version
165  _microBlockVersion = tmp_microblock.getHeader()->getVersion();
166  }// end of checking the MicroBlock version
167 
168  PRINT_ON_DEBUG("In "<<__PRETTY_FUNCTION__<<" 2");
169  PRINT_ON_DEBUG("About to add "<<tmp_microblock.sizeofdata()<<" words");
170 
171  RETURN_FUNCTION(addMicroBlock2)(microblock_buffer, tmp_microblock.sizeofdata(), check_mc_flag);
172 }
#define RETURN_FUNCTION(FULLFUNCTIONNAME)
Definition: Macros.h:57
version_t _microBlockVersion
Floating MicroBlock Number.
bool addMicroBlock2(const void *microblock_buffer, const uint32_t microblock_size, const bool check_mc_flag)
#define PRINT_ON_DEBUG(x)
Definition: RawDAQData.h:35
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addMicroBlock2 ( const void microblock_buffer,
const uint32_t  microblock_size,
const bool  check_mc_flag 
)

Add the MicroBlock of a known size to _Buffer. If check_mc_flag = true, the method checks whether the microslice in the microblock is MC generatedand adds an appropriate flag to the DataBlock Header.

Before reading, we need to adjust the size of the DataBlock Cannot rely on the size adjustment from readDataGeneral, because we don't read CRC from microblock

If buffer is internal, we need to adjust its size

Microblock size is the size of the header and the microslice

Add the microblock size

Check pointers after each read or resize buffer

Read the MicroBlock to the _Buffer starting from the previous position -1 because of CRC

Check pointers after each read or resize buffer

Change the DataBlock header appropriately

Check if the MicroSlice in the MicroBlock is MC generated If it is, set the appropriate DataBlock MC flag

Definition at line 176 of file RawDataBlockV0.cpp.

References _Header, _microBlockVersion, EXECUTE_FUNCTION, PRINT_ON_DEBUG, and sizeofdata().

Referenced by addMicroBlock1(), and getFloatingMicroBlock().

176  {
177 
178  PRINT_ON_DEBUG("In "<<__PRETTY_FUNCTION__<<" 0");
179 
180  PRINT_ON_DEBUG("Size of internal buffer before reading "<<_InternalBuffer.size());
181 
182 
183  /// Before reading, we need to adjust the size of the DataBlock
184  /// Cannot rely on the size adjustment from readDataGeneral, because we don't read CRC from microblock
185  const uint32_t new_sizeofdata = EXECUTE_FUNCTION(sizeofdata)() + microblock_size;
186 
187  /// If buffer is internal, we need to adjust its size
188  if(_shouldBufferBeInternal) {
189  /// Microblock size is the size of the header and the microslice
190 
191  /// Add the microblock size
192  resizeInternalBuffer(new_sizeofdata);
193 
194  /// Check pointers after each read or resize buffer
195  checkBufferInternalness();
196  }// end of adjusting the internal buffer size
197 
198  /// Read the MicroBlock to the _Buffer starting from the previous position
199  /// -1 because of CRC
200  readDataGeneral(microblock_buffer, microblock_size, EXECUTE_FUNCTION(sizeofdata)() - 1);
201  /// Check pointers after each read or resize buffer
202  checkBufferInternalness();
203 
204  PRINT_ON_DEBUG("Size of internal buffer after reading "<<_InternalBuffer.size());
205 
206  /// Change the DataBlock header appropriately
207  _Header->setDataSize(new_sizeofdata);
208  _Header->advanceNumMicroBlocks();
209 
210  /// Check if the MicroSlice in the MicroBlock is MC generated
211  /// If it is, set the appropriate DataBlock MC flag
212  if(check_mc_flag){
213  daqdataformats::RawMicroBlock tmp_microblock(microblock_buffer, _microBlockVersion);
214  setMonteCarloFlag(tmp_microblock.getMicroSlice()->getMonteCarloFlag());
215  }
216 
217  return true;
218 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
version_t _microBlockVersion
Floating MicroBlock Number.
daqdataformats::RawDataBlockHeader * _Header
#define PRINT_ON_DEBUG(x)
Definition: RawDAQData.h:35
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addMicroBlock3 ( const void millislice_buffer,
const void microslice_buffer,
const version_t  microblock_version,
const bool  check_mc_flag 
)

Add the MicroBlock to _Buffer by passing the references of the MilliSlice and the MicroSlice. MilliSlice is the one that contains the MicroSlice. If check_mc_flag = true, the method checks whether the microslice in the microblock is MC generatedand adds an appropriate flag to the DataBlock Header.

Add the MicroBlock to _Buffer by passing the references of the MilliSlice and the MicroSlice. MilliSlice is the one that contains the MicroSlice.

Definition at line 222 of file RawDataBlockV0.cpp.

References addMicroBlock4(), daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, and EXECUTE_FUNCTION.

Referenced by getFloatingMicroBlock().

227 {
228  const daqdataformats::RawMicroSliceHeader tmp_microslice_header(microslice_buffer, rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION);
229 
230  EXECUTE_FUNCTION(addMicroBlock4)(millislice_buffer, microslice_buffer, tmp_microslice_header.getMicroSliceSize(), microblock_version, check_mc_flag);
231  return true;
232 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
bool addMicroBlock4(const void *millislice_buffer, const void *microslice_buffer, const uint32_t microslice_size, const version_t microblock_version, const bool check_mc_flag)
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::addMicroBlock4 ( const void millislice_buffer,
const void microslice_buffer,
const uint32_t  microslice_size,
const version_t  microblock_version,
const bool  check_mc_flag 
)

Add the MicroBlock to _Buffer by passing the references of the MilliSlice and the MicroSlice of a known size. MilliSlice is the one that contains the MicroSlice. If check_mc_flag = true, the method checks whether the microslice in the microblock is MC generatedand adds an appropriate flag to the DataBlock Header.

Add the MicroBlock to _Buffer by passing the references of the MilliSlice and the MicroSlice of a known size. MilliSlice is the one that contains the MicroSlice.

Size of the MicroBlock that we are adding Start with the microslice size

Now, add microBlock Header size to it. If floating Microblock already exists, get its header size.

Need to figure out the header size for a given version

If buffer is internal, we need to adjust its size

Microblock size is the size of the header and the microslice

Add the microblock size

Check pointers after each read or resize buffer

Setup the DataBlock header by adding the size and the number of MicroBlocks in the DataBlock Need to have DataSize setup before setting FloatingMicroBlock This is because there is a check for going outside sizeofdata, so it's going to fail otherwise.

Set the floating microblock

Need to initialize the header version and such

Read the MicroBlockHeader and the MicroSlice

Check if the MicroSlice in the MicroBlock is MC generated If it is, set the appropriate DataBlock MC flag

Definition at line 238 of file RawDataBlockV0.cpp.

References _FloatingMicroBlock, _Header, _microBlockVersion, b, daqdataformats::RawDataBlock::close(), EXECUTE_FUNCTION, sizeofdata(), and make_root_from_grid_output::tr.

Referenced by addMicroBlock3(), and getFloatingMicroBlock().

238  {
239 
240  _microBlockVersion = microblock_version;
241 
242  /// Size of the MicroBlock that we are adding
243  /// Start with the microslice size
244  uint32_t microblock_size = microslice_size;
245 
246  /// Now, add microBlock Header size to it.
247  /// If floating Microblock already exists, get its header size.
249  microblock_size += _FloatingMicroBlock->getHeader()->sizeofdata();
250  }
251  else{
252  /// Need to figure out the header size for a given version
254  microblock_size += tmp_header.sizeofdata();
255  }
256 
257  const uint32_t new_sizeofdata = EXECUTE_FUNCTION(sizeofdata)() + microblock_size;
258 
259  /// If buffer is internal, we need to adjust its size
260  if(_shouldBufferBeInternal) {
261  /// Microblock size is the size of the header and the microslice
262 
263  /// Add the microblock size
264  resizeInternalBuffer(new_sizeofdata);
265 
266  /// Check pointers after each read or resize buffer
267  checkBufferInternalness();
268  }// end of adjusting the internal buffer size
269 
270  const uint32_t current_number_of_microblocks = EXECUTE_FUNCTION(getNumMicroBlocks)();
271 
272  /// Setup the DataBlock header by adding the size and the number of MicroBlocks in the DataBlock
273  /// Need to have DataSize setup before setting FloatingMicroBlock
274  /// This is because there is a check for going outside sizeofdata, so it's going to fail otherwise.
275  _Header->setDataSize(new_sizeofdata);
276  _Header->setNumMicroBlocks(current_number_of_microblocks + 1);
277 
278  /// Set the floating microblock
279  EXECUTE_FUNCTION(setFloatingMicroBlock)(current_number_of_microblocks);
280 
281  /// Need to initialize the header version and such
282  _FloatingMicroBlock->getHeader()->init();
283 
284  /// Read the MicroBlockHeader and the MicroSlice
285  _FloatingMicroBlock->setMicroBlockHeader(millislice_buffer);
286  _FloatingMicroBlock->setMicroSlice(microslice_buffer);
287  /// Check if the MicroSlice in the MicroBlock is MC generated
288  /// If it is, set the appropriate DataBlock MC flag
289  if(check_mc_flag){
290  setMonteCarloFlag(_FloatingMicroBlock->getMicroSlice()->getMonteCarloFlag());
291  }// end of checking MC flag
292 
293  return true;
294 
295 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
daqdataformats::RawMicroBlock * _FloatingMicroBlock
DataBlock header.
version_t _microBlockVersion
Floating MicroBlock Number.
daqdataformats::RawDataBlockHeader * _Header
daqdataformats::RawSummaryDCMData * daqdataformats::VERSION_NAMESPACE::RawDataBlock::getDCMData ( )

Definition at line 109 of file RawDataBlockV2.cpp.

References _Header, and RAWBUFF32.

110  {
111  //The DroppedMicroblock Summary should always be first, and it's 4 words long
112  // The DCMData follows.
113  void* pointer = (void*)&RAWBUFF32[_Header->sizeofdata() + 4];
114  return new daqdataformats::RawSummaryDCMData(pointer , 0);
115  }
daqdataformats::RawDataBlockHeader * _Header
#define RAWBUFF32
Definition: RawDAQData.h:16
daqdataformats::RawSummaryDroppedMicroblock * daqdataformats::VERSION_NAMESPACE::RawDataBlock::getDroppedMicroblock ( )

Definition at line 97 of file RawDataBlockV1.cpp.

References _Header, and RAWBUFF32.

98  {
99  //The DroppedMicroblock Summary should always be first...
100  void* pointer = (void*)&RAWBUFF32[_Header->sizeofdata()];
101  return new daqdataformats::RawSummaryDroppedMicroblock(pointer , 0);
102  }
daqdataformats::RawDataBlockHeader * _Header
#define RAWBUFF32
Definition: RawDAQData.h:16
daqdataformats::RawMicroBlock* daqdataformats::VERSION_NAMESPACE::RawDataBlock::getFloatingMicroBlock ( ) const
inline

Definition at line 47 of file RawDataBlockV0.h.

References _FloatingMicroBlock, addMicroBlock1(), addMicroBlock2(), addMicroBlock3(), and addMicroBlock4().

47 { return _FloatingMicroBlock; }
daqdataformats::RawMicroBlock * _FloatingMicroBlock
DataBlock header.
daqdataformats::RawDataBlockHeader* daqdataformats::VERSION_NAMESPACE::RawDataBlock::getHeader ( ) const
inline

Definition at line 46 of file RawDataBlockV0.h.

References _Header.

46 { return _Header; }
daqdataformats::RawDataBlockHeader * _Header
uint32_t daqdataformats::VERSION_NAMESPACE::RawDataBlock::getPredeterminedSize ( ) const
inlineprotected

Definition at line 94 of file RawDataBlockV0.h.

References clear, close(), INIT_CUSTOM_DELEGATE(), INIT_FIRST(), and readDataUnknownVersion().

94 {return 1;}
void daqdataformats::VERSION_NAMESPACE::RawDataBlock::init ( )

This is needed for the formats with variable size If buffer is internal, need to resize it

Check pointers after each read or resize buffer

Initialize _FloatingMicroBlockNumber

Definition at line 136 of file RawDataBlockV0.cpp.

References _FloatingMicroBlockNumber, and _Header.

Referenced by demo.App::__init__(), testem0.App::__init__(), Lesson1.App::__init__(), and ExN03.App::__init__().

136  {
137 
138  /// This is needed for the formats with variable size
139  /// If buffer is internal, need to resize it
140  if(_shouldBufferBeInternal){
141  resizeInternalBuffer(_Header->sizeofdata() + 1);
142  /// Check pointers after each read or resize buffer
143  checkBufferInternalness();
144  }
145 
146  _Header->init();
147 
148  /// Initialize _FloatingMicroBlockNumber
150 }
daqdataformats::RawDataBlockHeader * _Header
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_CUSTOM_DELEGATE ( addDCMData1  ,
bool  ,
const void  
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_CUSTOM_DELEGATE ( addDCMData2  ,
bool  ,
const void ,
const uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_CUSTOM_DELEGATE ( addDroppedMicroblock  ,
bool  ,
const void  
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_CUSTOM_DELEGATE ( addMicroBlock1  ,
bool  ,
const void ,
const bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_CUSTOM_DELEGATE ( addMicroBlock2  ,
bool  ,
const void ,
const uint32_t  ,
const bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_CUSTOM_DELEGATE ( addMicroBlock3  ,
bool  ,
const void ,
const void ,
const version_t  ,
const bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_CUSTOM_DELEGATE ( addMicroBlock4  ,
bool  ,
const void ,
const void ,
const uint32_t  ,
const version_t  ,
const bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setMarker  ,
bool  ,
const uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( readDataFromFileDescriptor  ,
readDataStatus  ,
const int   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( close  ,
bool  ,
const bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setFloatingMicroBlockToBufferSource  ,
const  ,
bool  ,
const void  
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( clear  ,
bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( softclear  ,
bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( getVersion  ,
const  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( getMarker  ,
const  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( getTrigNumLo  ,
const  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( getTrigNumHi  ,
const  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( getTrigNum  ,
const  ,
uint64_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( getNumMicroBlocks  ,
const  ,
uint16_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( getBuffId  ,
const  ,
uint16_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( getDataSize  ,
const  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( getMonteCarloFlag  ,
const  ,
bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( isCRCCalculationUsed  ,
const  ,
bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( isConnectionInitialization  ,
const  ,
bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( isCloseConnection  ,
const  ,
bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( isMissingData  ,
const  ,
bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setFloatingMicroBlock  ,
const  ,
bool  ,
const uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( getCRC  ,
const  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setTrigNumLo  ,
bool  ,
const uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setTrigNumHi  ,
bool  ,
const uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setTrigNum  ,
bool  ,
const uint64_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setBuffId  ,
bool  ,
const uint16_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setConnectionInitialization  ,
bool  ,
const bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setMonteCarloFlag  ,
bool  ,
const bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setCloseConnection  ,
bool  ,
const bool   
)
protected
daqdataformats::VERSION_NAMESPACE::RawDataBlock::INIT_FIRST ( setMissingData  ,
bool  ,
const bool   
)
protected
void daqdataformats::VERSION_NAMESPACE::RawDataBlock::print ( std::ostream &  os = std::cout) const

Print all MicroBlocks

Definition at line 639 of file RawDataBlockV0.cpp.

References _Header, samweb_client.client::_version, allTimeWatchdog::endl, EXECUTE_FUNCTION, novadaq::HexUtils::format(), GENERATE_DATAFORMAT_EXCEPTION, MECModelEnuComparisons::i, sizeofdata(), and string.

639  {
640 
641  const uint32_t size_of_data = EXECUTE_FUNCTION(sizeofdata)();
642 
643  os<<boost::format("\n---RawDataBlock----------------------------------------------------(size=%u, version=%u)\n")
644  % size_of_data % _version;
645 
646  printBuffer(os);
647 
648  _Header->print(os);
649 
650  for(uint32_t i = 0; i < size_of_data; ++i){
651  os<<" ";
652  printWord(i, false, os);
653  os<<"\n";
654  }
655 
656 
657  const uint32_t num_microblocks = _Header->getNumMicroBlocks();
658  os<<"Number of MicroBlocks = "<<num_microblocks<<std::endl;
659  if(num_microblocks){
660  daqdataformats::RawDataBlock datablock_copy(_Buffer, _version, 0);
661 
662  /// Print all MicroBlocks
663  for(uint32_t imicroblock = 0; imicroblock <num_microblocks ; ++imicroblock){
664  if(!datablock_copy.setFloatingMicroBlock(imicroblock)){
665  const std::string error_message = "Some failure during setFloatingMicroBlock number "
666  + boost::lexical_cast<std::string>(imicroblock)
667  + ". Total number of microblocks = "
668  + boost::lexical_cast<std::string>(num_microblocks)
669  + "\n";
670  os<<error_message;
671  GENERATE_DATAFORMAT_EXCEPTION(error_message);
672  return;
673  }
674 
675  //os<<"Micro "<<imicroblock<<" MicroBuff="<<datablock_copy.getBuffer()<<"\n";
676  datablock_copy.getFloatingMicroBlock()->print(os);
677  }// end of looping over microblocks
678  }
679 
680  if(isCRCCalculationUsed())os<<"--- CRC = "<<getCRC()<<"\n";
681 
682 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
#define GENERATE_DATAFORMAT_EXCEPTION(msg)
daqdataformats::RawDataBlockHeader * _Header
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14
enum BeamMode string
void * daqdataformats::VERSION_NAMESPACE::RawDataBlock::readData ( const void datablock_buffer)

Check pointers after each read or resize buffer

Check pointers after each read or resize buffer

Definition at line 441 of file RawDataBlockV0.cpp.

References _fd_read_bytes, _Header, daqdataformats::VERSION_NAMESPACE::CURRENT_FIELDS_SUB_NAMESPACE::DATABLOCKHEADER_SIZE, EXECUTE_FUNCTION, fd, daqdataformats::rds_complete, daqdataformats::rds_error, daqdataformats::rds_incomplete, daqdataformats::RawDAQData::readData(), sizeofdata(), ss, and tprintf().

Referenced by PandAna.core.core.loader::Go(), and sizeofdata().

441  {
442 
443  //Read the header and unpack it
444  void* datablock_buffer_new = readDataGeneral(datablock_buffer, datablockheader::DATABLOCKHEADER_SIZE, 0);
445 
446  /// Check pointers after each read or resize buffer
447  checkBufferInternalness();
448 
449  // read the rest of
450  datablock_buffer_new = readDataGeneral(datablock_buffer_new, EXECUTE_FUNCTION(sizeofdata)() - datablockheader::DATABLOCKHEADER_SIZE, datablockheader::DATABLOCKHEADER_SIZE);
451 
452  /// Check pointers after each read or resize buffer
453  checkBufferInternalness();
454 
455  return datablock_buffer_new;
456 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
readDataStatus daqdataformats::VERSION_NAMESPACE::RawDataBlock::readDataUnknownVersion ( const int  fd)
protected

See if we already read the header Identifying the size of the bytes to read

Now that we know the version, initialize function pointers

Need to construct all Headers and stuff

Now need to adjust the internal buffer size

Reset buffer source, so that we can construct other things (like headers and such)

Definition at line 541 of file RawDataBlockV0.cpp.

References _fd_read_bytes, _Header, samweb_client.client::_version, daqdataformats::VERSION_NAMESPACE::CURRENT_FIELDS_SUB_NAMESPACE::DATABLOCKHEADER_SIZE, EXECUTE_FUNCTION, RAWBUFF32, daqdataformats::rds_complete, daqdataformats::rds_error, daqdataformats::rds_incomplete, daqdataformats::RawDAQData::readData(), sizeofdata(), ss, and tprintf().

Referenced by getPredeterminedSize().

542 {
543  if (fd >= 0)
544  {
545  if (isInternalBuffer())
546  {
547  size_t bytes_to_read;
548 
549  /// See if we already read the header
550  /// Identifying the size of the bytes to read
552  { const size_t min_words = datablockheader::DATABLOCKHEADER_SIZE;
553  const size_t min_bytes = min_words*sizeof (uint32_t);
554 
555  if (_InternalBuffer.size() < min_words)
556  {
557  _InternalBuffer.resize(min_words);
558  _Buffer = (void*)(&_InternalBuffer[0]);
559  }
560 
561  bytes_to_read = min_bytes - _fd_read_bytes;
562  }
563  else
564  { const uint32_t size_of_data = EXECUTE_FUNCTION(sizeofdata)();
565  // check before using size
566  if ( (!_Header->checkMarker())
567  || (size_of_data > 0x400000/*arbitrary val*/) )
568  { return rds_error;
569  }
570  if (_InternalBuffer.size() < (size_t)size_of_data)
571  { _InternalBuffer.resize(size_of_data);
572  _Buffer = (void*)(&_InternalBuffer[0]);
573  }
574  bytes_to_read = (size_t)size_of_data*sizeof(uint32_t) - _fd_read_bytes;
575  }
576 
577  const ssize_t ss = read(fd, (char*)_Buffer+_fd_read_bytes, bytes_to_read );
578  if (ss==-1)
579  { perror("read");
580  return rds_error;
581  }
582  else if (ss==0)
583  { tprintf( 5, "connection closed\n" );
584  return rds_error;
585  }
586 
587  _fd_read_bytes += ss;
588  if (ss != (int)bytes_to_read)
589  { return rds_incomplete;
590  }
591 
592  // at this point, the header should have been read in and the
593  // size from within can be examined.
594  // check for reasonableness
595 
596  _version = figureOutTheVersion(_Buffer);
597 
598  /// Now that we know the version, initialize function pointers
599  setFunctionPointers();
600 
601  /// Need to construct all Headers and stuff
602  resetBufferSource();
603 
604  /// Now need to adjust the internal buffer size
605  const uint32_t size_of_data = EXECUTE_FUNCTION(sizeofdata)();
606  resizeInternalBuffer(size_of_data);
607 
608  /// Reset buffer source, so that we can construct other things (like headers and such)
609  resetBufferSource();
610 
611  if ( (!_Header->checkMarker())
612  || (size_of_data > 0x400000/*arbitrary val*/) )
613  { return rds_error;
614  }
615 
616  if (((size_t)size_of_data*sizeof (uint32_t)) == _fd_read_bytes)
617  return rds_complete;
618  return rds_incomplete;
619  }
620  else
621  {
622  // assume there is enough space???
623  return RawDAQData::readData(fd);
624  }
625  }
626  return rds_error;
627 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
Float_t ss
Definition: plot.C:24
void tprintf(unsigned lvl, const char *fmt,...) __attribute__((format(printf
daqdataformats::RawDataBlockHeader * _Header
void * readData(const void *buffer)
Shallow copy constructor.
Definition: RawDAQData.cpp:181
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::setBufferSource ( const void pointer)

Set the Buffer and its header pointers

If Header is already defined, then set its buffer source Otherwise, need to construct it

It's possible that Floating Microblock was already constructed. If so, need to reassign its pointer

See how many Microblocks in the new buffer. If it's greater, then make the floating MicroBlock non-valid.

New Floating MicroBlock pointer

< version of the DataBlockSliceHeader equals the version of the DataBlockSlice

Definition at line 341 of file RawDataBlockV0.cpp.

References _FloatingMicroBlock, _FloatingMicroBlockNumber, _Header, _microBlockVersion, samweb_client.client::_version, daqdataformats::VERSION_NAMESPACE::CURRENT_FIELDS_SUB_NAMESPACE::DATABLOCKHEADER_SIZE, EXECUTE_FUNCTION, makeTrainCVSamples::int, PRINT_ON_DEBUG, RAWBUFF32, RETURN_FUNCTION, sizeofdata(), and sizeofdata_t.

Referenced by sizeofdata().

341  {
342 
343  PRINT_ON_DEBUG(__PRETTY_FUNCTION__<<"version = "<<_version);
344 
345  /// Set the Buffer and its header pointers
346  const uint32_t* old_buffer = (uint32_t*)_Buffer;
347  _Buffer = (void*)pointer;
348  _shouldBufferBeInternal = isInternalBuffer();
349 
350  /// If Header is already defined, then set its buffer source
351  /// Otherwise, need to construct it
352  if(_Header){
353  _Header->setBufferSource(pointer);
354 
355  /// It's possible that Floating Microblock was already constructed.
356  /// If so, need to reassign its pointer
357  if(_FloatingMicroBlockNumber > -1){
358 
359  /// See how many Microblocks in the new buffer.
360  /// If it's greater, then make the floating MicroBlock non-valid.
361  if(_FloatingMicroBlockNumber > _Header->getNumMicroBlocks()){
363  return true;
364  }// end of checking number of microblocks
365 
366  /// New Floating MicroBlock pointer
367  const uint32_t* floating_microblock_pointer =((uint32_t*)_Buffer) + ((uint32_t*)_FloatingMicroBlock->getBuffer() - old_buffer);
368  RETURN_FUNCTION(setFloatingMicroBlockToBufferSource)(floating_microblock_pointer);
369  }// end of setting new floating MicroBlock pointer
370 
371  return true;
372  }
373 
374  PRINT_ON_DEBUG("Setting Header "<<"version = "<<_version);
375  _Header = new daqdataformats::RawDataBlockHeader(_Buffer, _version); ///< version of the DataBlockSliceHeader equals the version of the DataBlockSlice
376 
377  _function_sizeofdata = (sizeofdata_t) &version0::RawDataBlock::sizeofdata;
378 
379  return true;
380 }
#define sizeofdata_t
Definition: FunctionBind.h:30
daqdataformats::RawMicroBlock * _FloatingMicroBlock
DataBlock header.
#define RETURN_FUNCTION(FULLFUNCTIONNAME)
Definition: Macros.h:57
daqdataformats::RawDataBlockHeader * _Header
#define PRINT_ON_DEBUG(x)
Definition: RawDAQData.h:35
bool daqdataformats::VERSION_NAMESPACE::RawDataBlock::setMarker ( const uint32_t  mar)
inline

Definition at line 85 of file RawDataBlockV0.h.

References GENERATE_FUNCTION_IS_NOT_ALLOWED.

Referenced by addDCMData2().

#define GENERATE_FUNCTION_IS_NOT_ALLOWED
calling functionIsNotAllowed
Definition: RawDAQData.h:21
uint32_t daqdataformats::VERSION_NAMESPACE::RawDataBlock::sizeofdata ( ) const
inline
void daqdataformats::VERSION_NAMESPACE::RawDataBlock::tprintf ( unsigned  lvl,
const char *  fmt,
  ... 
)

Definition at line 685 of file RawDataBlockV0.cpp.

References _tlvl, art::detail::indent(), local, printf(), and submit_syst::str.

Referenced by readData(), and readDataUnknownVersion().

686 { if (lvl > 31) lvl=31;
687  if (_tlvl & (1<<lvl))
688  { timeval tv;
689  char str[80];
690  time_t local;
691  const char* indent=" ";//32 spaces
692  va_list ap;
693  va_start( ap, fmt);
694  gettimeofday( &tv, NULL );
695  local = tv.tv_sec;
696  strftime( str, sizeof(str), "%T", localtime(&local) );
697  printf( "%s.%06ld%s", str, (long)tv.tv_usec, &indent[31-lvl] );
698  vprintf( fmt, ap );
699  }
700 } // tprintf
#define local
Definition: gzguts.h:107
std::string indent(std::size_t const i)
printf("%d Experimental points found\n", nlines)

Member Data Documentation

size_t daqdataformats::VERSION_NAMESPACE::RawDataBlock::_fd_read_bytes
protected

Definition at line 140 of file RawDataBlockV0.h.

Referenced by readData(), readDataUnknownVersion(), and ~RawDataBlock().

daqdataformats::RawMicroBlock* daqdataformats::VERSION_NAMESPACE::RawDataBlock::_FloatingMicroBlock
mutableprotected

DataBlock header.

Definition at line 135 of file RawDataBlockV0.h.

Referenced by addMicroBlock4(), getFloatingMicroBlock(), setBufferSource(), and ~RawDataBlock().

int daqdataformats::VERSION_NAMESPACE::RawDataBlock::_FloatingMicroBlockNumber
mutableprotected

Floating MicroBlock.

Definition at line 136 of file RawDataBlockV0.h.

Referenced by init(), and setBufferSource().

daqdataformats::RawDataBlockHeader* daqdataformats::VERSION_NAMESPACE::RawDataBlock::_Header
protected
version_t daqdataformats::VERSION_NAMESPACE::RawDataBlock::_microBlockVersion
protected

Floating MicroBlock Number.

Version of the MicroBlock

Definition at line 137 of file RawDataBlockV0.h.

Referenced by addMicroBlock1(), addMicroBlock2(), addMicroBlock4(), and setBufferSource().

uint32_t daqdataformats::VERSION_NAMESPACE::RawDataBlock::_tlvl
protected

Definition at line 139 of file RawDataBlockV0.h.

Referenced by tprintf().


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