ATLAS Offline Software
Loading...
Searching...
No Matches
v40_write_ROBFragment.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5*/
6
7
17
18#ifndef OFFLINE_EFORMAT_V40_WRITE_ROBFRAGMENT_H
19#define OFFLINE_EFORMAT_V40_WRITE_ROBFRAGMENT_H
20
21#include "eformat/write/node.h"
22#include "eformat/Version.h"
24
25namespace offline_eformat {
26
27 namespace v40_write {
28
29 class FullEventFragment; //forward
30
35 {
36 public:
37
55 ROBFragment (uint32_t source_id,
56 uint32_t run_no,
57 uint32_t lvl1_id,
58 uint32_t bc_id,
59 uint32_t lvl1_type,
60 uint32_t detev_type,
61 uint32_t ndata,
62 const uint32_t* data,
63 uint32_t status_position);
64
83 ROBFragment (uint32_t rob_source_id,
84 uint32_t rod_source_id,
85 uint32_t run_no,
86 uint32_t lvl1_id,
87 uint32_t bc_id,
88 uint32_t lvl1_type,
89 uint32_t detev_type,
90 uint32_t ndata,
91 const uint32_t* data,
92 uint32_t status_position);
93
101 ROBFragment ();
102
118 ROBFragment (const ROBFragment& other);
119
128 ROBFragment (const uint32_t* rod, uint32_t size_word);
129
142 ROBFragment (const uint32_t* rob);
143
147 virtual ~ROBFragment ();
148
163 ROBFragment& operator= (const ROBFragment& other);
164
180 void copy_header(const uint32_t* other);
181 void copy_header(const ROBFragment& other);
182
191 void status (uint32_t n, const uint32_t* status);
192
196 inline uint32_t nstatus (void) const { return m_node[0].base[5]; }
197
201 inline const uint32_t* status (void) const { return m_node[1].base; }
202
208 inline void minor_version (uint16_t v)
209 { m_node[0].base[3] &= 0xffff0000;
210 m_node[0].base[3] |= v; }
211
215 inline uint16_t minor_version (void) const
216 { return 0xffff & m_node[0].base[3]; }
217
226 void rod_status (uint32_t n, const uint32_t* status);
227
231 inline uint32_t rod_nstatus (void) const { return m_node[6].base[0]; }
232
237 inline const uint32_t* rod_status (void) const { return m_node[4].base; }
238
245 void status_position (uint32_t v);
246
250 inline uint32_t status_position (void) const
251 { return m_node[6].base[2]; }
252
258 inline void rod_minor_version (uint16_t v)
259 { m_node[3].base[2] = eformat::DEFAULT_ROD_VERSION | v; }
260
264 inline uint16_t rod_minor_version (void) const
265 { return 0xffff & m_node[3].base[2]; }
266
275 void rod_data (uint32_t n, const uint32_t* data);
276
280 inline uint32_t rod_ndata (void) const { return m_node[6].base[1]; }
281
285 inline const uint32_t* rod_data (void) const { return m_node[5].base; }
286
294 inline void source_id (uint32_t s)
295 { m_node[0].base[4] = m_node[3].base[3] = s; }
296
302 inline void rod_source_id (uint32_t s) { m_node[3].base[3] = s; }
303
309 inline void rob_source_id (uint32_t s) { m_node[0].base[4] = s; }
310
316 inline uint32_t source_id (void) const { return m_node[0].base[4]; }
317
321 inline uint32_t rob_source_id (void) const { return source_id(); }
322
326 inline uint32_t rod_source_id (void) const { return m_node[3].base[3]; }
327
337 void checksum_type (uint32_t s);
338
342 inline uint32_t checksum_type (void) const { return m_node[2].base[0]; }
343
349 inline void rod_run_no (uint32_t s)
350 { m_node[3].base[4] = (s & 0x7fffffff); }
351
355 inline uint32_t rod_run_no (void) const
356 { return m_node[3].base[4]; }
357
363 inline void rod_lvl1_id (uint32_t s)
364 { m_node[3].base[5] = s; }
365
369 inline uint32_t rod_lvl1_id (void) const
370 { return m_node[3].base[5]; }
371
377 inline void rod_bc_id (uint32_t s)
378 { m_node[3].base[6] = s; }
379
383 inline uint32_t rod_bc_id (void) const
384 { return m_node[3].base[6]; }
385
391 inline void rod_lvl1_type (uint32_t s)
392 { m_node[3].base[7] = s; }
393
397 inline uint32_t rod_lvl1_type (void) const
398 { return m_node[3].base[7]; }
399
405 inline void rod_detev_type (uint32_t s)
406 { m_node[3].base[8] = s; }
407
411 inline uint32_t rod_detev_type (void) const
412 { return m_node[3].base[8]; }
413
419 inline uint32_t meta_size_word (void) const
423
427 inline uint32_t size_word (void) const
428 { return meta_size_word() + rod_ndata(); }
429
433 inline uint32_t rob_header_size_word (void) const
434 { return 7 + m_node[0].base[5]; }
435
439 inline uint32_t rob_trailer_size_word (void) const
440 { return (checksum_type()?1:0); }
441
445 inline uint32_t page_count (void) const
446 { return 7 + (checksum_type()?1:0); }
447
451 inline uint32_t rod_page_count (void) const { return 4; }
452
456 inline const uint32_t* rod_header (void) const
457 { return m_node[3].base; }
458
462 inline uint32_t rod_header_size_word (void) const
463 { return m_node[3].size_word; }
464
468 inline const uint32_t* rod_trailer (void) const
469 { return m_node[6].base; }
470
474 inline uint32_t rod_trailer_size_word (void) const
475 { return m_node[6].size_word; }
476
481 eformat::write::node_t* bind (void);
482
487 const eformat::write::node_t* rod_bind (void);
488
495 { m_parent = ros; }
496
500 inline const v40_write::FullEventFragment* parent (void) const { return m_parent; }
501
507 inline void next (ROBFragment* n) { m_next = n; }
508
512 inline const ROBFragment* next (void) const { return m_next; }
513 inline ROBFragment* next (void) { return m_next; }
514
515 private: //to make the code simpler
516
521 void initialize(void);
522
523 private: //representation
524
525 uint32_t m_header[7];
526 uint32_t m_rod_header[9];
527 uint32_t m_rod_trailer[3];
528 uint32_t m_checksum;
529 eformat::write::node_t m_node[8];
532
533 };
534
535 }
536
537}
538
539#endif /* OFFLINE_EFORMAT_V40_WRITE_ROBFRAGMENT_H */
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Define macros for attributes used to control the static checker.
Defines a helper class to aid the creation of FullEvent fragments.
Defines a helper class to aid the creation of ROB fragments.
void rod_bc_id(uint32_t s)
Changes the bunch crossing identifier in the ROD fragment.
uint32_t rod_detev_type(void) const
Returns the detector event type identifier for the ROD fragment.
uint32_t rob_header_size_word(void) const
Returns the total size of the ROB header.
uint32_t rod_bc_id(void) const
Returns the bunch crossing identifier for the ROD fragment.
void parent(v40_write::FullEventFragment *ros)
This sets the parent fragment.
v40_write::ROBFragment * m_next
Next sibling.
const v40_write::FullEventFragment * parent(void) const
This returns the parent fragment.
void rob_source_id(uint32_t s)
Changes the source identifier for only the ROB fragment.
eformat::write::node_t m_node[8]
Node representation.
uint32_t rod_run_no(void) const
Returns the run number for the ROD fragment.
void rod_lvl1_type(uint32_t s)
Changes the lvl1 trigger type in the ROD fragment.
const ROBFragment * next(void) const
Returns the next sibling.
const eformat::write::node_t * rod_bind(void)
Outputs a concatenation of eformat::write::node making up a list with the contents of the underlying ...
const uint32_t * status(void) const
Returns a pointer to the first status word to be used by this fragment.
void rod_minor_version(uint16_t v)
Changes the minor version number of the underlying ROD fragment.
void initialize(void)
Initializes the internal fields of this ROB fragment with the standard values.
uint32_t checksum_type(void) const
Returns the check sum type for this fragment.
ROBFragment()
Builds a new "empty" ROB fragment, otherwise invalid.
void next(ROBFragment *n)
Sets the next sibling.
uint32_t rob_source_id(void) const
Returns the source identifier of the ROB fragment.
uint32_t source_id(void) const
Returns the source identifier of the ROB fragment.
ROBFragment & operator=(const ROBFragment &other)
Assignment operator.
uint32_t rod_trailer_size_word(void) const
Returns the size of a ROD header.
eformat::write::node_t * bind(void)
Outputs a concatenation of eformat::write::node making up a list with the contents of this ROB fragme...
const uint32_t * rod_data(void) const
Returns a pointer to the first of the data words at the ROD fragment.
void status(uint32_t n, const uint32_t *status)
Changes the number of status words and the status words themselves from the fragment.
uint32_t page_count(void) const
Returns the number of pages of memory I have.
void rod_detev_type(uint32_t s)
Changes the detector event type in the ROD fragment.
void rod_run_no(uint32_t s)
Changes the run number for the ROD fragment.
const uint32_t * rod_status(void) const
Returns a pointer to the first ROD status word to be used by this fragment.
ROBFragment(uint32_t source_id, uint32_t run_no, uint32_t lvl1_id, uint32_t bc_id, uint32_t lvl1_type, uint32_t detev_type, uint32_t ndata, const uint32_t *data, uint32_t status_position)
Builds a new ROB fragment from scratch.
const uint32_t * rod_trailer(void) const
Returns a pointer to the ROD trailer.
v40_write::FullEventFragment * m_parent
My parent.
void rod_lvl1_id(uint32_t s)
Changes the lvl1 identifier in the ROD fragment.
uint32_t rod_lvl1_id(void) const
Returns the lvl1 identifier for the ROD fragment.
uint32_t rob_trailer_size_word(void) const
Returns the total size of the ROB header.
uint32_t nstatus(void) const
Returns the number of status wors in this fragment.
const uint32_t * rod_header(void) const
Returns a pointer to the ROD header.
uint32_t rod_ndata(void) const
Returns the number of data words at the ROD fragment.
uint32_t size_word(void) const
Returns the total size for this fragment, in words.
uint16_t minor_version(void) const
Returns the minor version number of the fragment.
uint16_t rod_minor_version(void) const
Gets the minor version number of the underlying ROD fragment.
void status_position(uint32_t v)
Changes the order of the status and data blocks in the ROD fragment.
void rod_source_id(uint32_t s)
Changes the source identifier for only the ROD fragment.
uint32_t rod_header_size_word(void) const
Returns the size of a ROD header.
uint32_t rod_lvl1_type(void) const
Returns the lvl1 event type identifier for the ROD fragment.
uint32_t meta_size_word(void) const
Returns the total size for the meta data (everything that does not encompass the contents of the m_da...
void copy_header(const uint32_t *other)
Copies the header (meta data information) from another ROBFragment.
uint32_t rod_source_id(void) const
Returns the source identifier of the ROD fragment.
void source_id(uint32_t s)
Changes the source identifier for both the ROB and the ROD fragments.
void minor_version(uint16_t v)
Changes the minor version number of the fragment.
uint32_t status_position(void) const
Returns the current status position.
uint32_t rod_page_count(void) const
Returns the number of pages of memory I have for the ROD fragment.
uint32_t rod_nstatus(void) const
Returns the number of status wors in this fragment.