ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
offline_eformat::v40_write::FullEventFragment Class Reference

Defines a helper class to aid the creation of FullEvent fragments. More...

#include <v40_write_FullEventFragment.h>

Collaboration diagram for offline_eformat::v40_write::FullEventFragment:

Public Member Functions

 FullEventFragment (uint32_t source_id, uint32_t bc_time_secs, uint32_t bc_time_nsec, uint32_t global_id, uint32_t run_type, uint32_t run_no, uint16_t lumi_block, uint32_t lvl1_id, uint16_t bc_id, uint8_t lvl1_type)
 Builds a new FullEvent fragment from scratch, using the current time as the time label. More...
 
 FullEventFragment (const uint32_t *fe)
 Builds a new FullEvent fragment from an existing FullEvent fragment in contiguous memory. More...
 
 FullEventFragment ()
 Builds a new empty FullEventFragment, otherwise invalid. More...
 
 FullEventFragment (const FullEventFragment &other)=delete
 
FullEventFragmentoperator= (const FullEventFragment &other)=delete
 
virtual ~FullEventFragment ()
 Base destructor. More...
 
void copy_header (const uint32_t *other)
 Copies the header (meta data information) from another existing FullEvent Fragment. More...
 
void copy_header (const FullEventFragment &other)
 
void status (uint32_t n, const uint32_t *status)
 Changes the number of status words and the status words themselves from the fragment. More...
 
uint32_t nstatus (void) const
 Returns the number of status wors in this fragment. More...
 
const uint32_t * status (void) const
 Returns a pointer to the first status word to be used by this fragment. More...
 
void minor_version (uint16_t v)
 Changes the minor version number of the fragment. More...
 
uint16_t minor_version (void) const
 Returns the minor version number of the fragment. More...
 
void source_id (uint32_t s)
 Changes the source identifier for this fragment. More...
 
uint32_t source_id (void) const
 Returns the source identifier of this fragment. More...
 
void checksum_type (uint32_t s)
 Changes the check-sum type for this fragment. More...
 
uint32_t checksum_type (void) const
 Returns the check sum type of this fragment. More...
 
void bc_time_seconds (uint32_t s)
 Changes the bunch crossing time (seconds) this fragment was produced at. More...
 
void bc_time_nanoseconds (uint32_t s)
 Changes the bunch crossing time (the nanoseconds part) this fragment was produced at. More...
 
uint32_t bc_time_seconds (void) const
 Returns the time since the (unix) origin, in seconds, for this fragment. More...
 
uint32_t bc_time_nanoseconds (void) const
 Returns the additional amount of nanoseconds, for this fragment's bunch crossing time. More...
 
void global_id (uint32_t s)
 Changes the global identifier for this event. More...
 
uint32_t global_id (void) const
 Returns the global identifier for this event. More...
 
void run_type (uint32_t s)
 Changes the run type. More...
 
uint32_t run_type (void) const
 Returns the run type for this fragment. More...
 
void run_no (uint32_t s)
 Changes the run number. More...
 
uint32_t run_no (void) const
 Returns the run number for this fragment. More...
 
void lumi_block (uint16_t s)
 Changes the luminosity block number. More...
 
uint16_t lumi_block (void) const
 Returns the luminosity block number for this fragment. More...
 
void lvl1_id (uint32_t s)
 Changes the lvl1 identifier in this fragment. More...
 
uint32_t lvl1_id (void) const
 Returns the lvl1 identifier for this fragment. More...
 
void bc_id (uint16_t s)
 Changes the bunch crossing identifier in this fragment. More...
 
uint16_t bc_id (void) const
 Returns the bunch crossing identifier for this fragment. More...
 
void lvl1_trigger_type (uint8_t s)
 Changes the lvl1 trigger type in this fragment. More...
 
uint8_t lvl1_trigger_type (void) const
 Returns the lvl1 trigger type for this fragment. More...
 
void lvl1_trigger_info (uint32_t n, const uint32_t *data)
 Changes the LVL1 trigger info words from the fragment. More...
 
uint32_t nlvl1_trigger_info (void) const
 Returns the number of status wors in this fragment. More...
 
const uint32_t * lvl1_trigger_info (void) const
 Returns a pointer to the first LVL1 trigger info to be used by this fragment. More...
 
void lvl2_trigger_info (uint32_t n, const uint32_t *data)
 Changes the LVL2 trigger info words from the fragment. More...
 
uint32_t nlvl2_trigger_info (void) const
 Returns the number of status wors in this fragment. More...
 
const uint32_t * lvl2_trigger_info (void) const
 Returns a pointer to the first LVL2 trigger info to be used by this fragment. More...
 
void event_filter_info (uint32_t n, const uint32_t *data)
 Changes the EF trigger info words from the fragment. More...
 
uint32_t nevent_filter_info (void) const
 Returns the number of status wors in this fragment. More...
 
const uint32_t * event_filter_info (void) const
 Returns a pointer to the first EF trigger info to be used by this fragment. More...
 
uint32_t nstream_tag (void) const
 Returns the number of stream tag words in this fragment. More...
 
void stream_tag (uint32_t n, const uint32_t *data)
 Changes the stream tag words from the fragment. More...
 
const uint32_t * stream_tag (void) const
 Returns a pointer to the first stream tag word to be used by this fragment. More...
 
uint32_t meta_size_word (void) const
 Returns the size of this fragments header. More...
 
uint32_t size_word (void) const
 Returns the total size for this fragment, in words. More...
 
void append (v40_write::ROBFragment *rob)
 Appends a new ROB fragment to this FullEvent fragment. More...
 
void append_unchecked (const uint32_t *rob)
 Appends an unchecked (read-only) ROB fragment to the current FullEvent. More...
 
uint32_t nunchecked_fragments (void) const
 Returns the number of unchecked ROBs there are. More...
 
const uint32_t * unchecked_fragment (uint32_t n) const
 Returns a particular unchecked ROB fragment. More...
 
const v40_write::ROBFragmentfirst_child (void) const
 This returns the first child of this fragment. More...
 
void size_change (uint32_t o, uint32_t n)
 This method is used by children of this fragment to notify fragment size changes. More...
 
uint32_t page_count (void) const
 Returns the total number of (raw memory) pages this fragment is composed of. More...
 
const eformat::write::node_t * bind (void)
 Returns the first node of a list of nodes that represent the fragment you have constructed. More...
 

Private Member Functions

void initialize (void)
 Initializes the internal fields of this ROB fragment with the standard values. More...
 

Private Attributes

uint32_t m_header [20]
 The FullEvent Header. More...
 
eformat::write::node_t m_node [12]
 Node representation. More...
 
v40_write::ROBFragmentm_child
 my children More...
 
v40_write::ROBFragmentm_last
 my last child More...
 
uint32_t m_checksum
 My payload's checksum, if asked. More...
 
uint32_t m_n_unchecked
 The number of unchecked nodes attached. More...
 
eformat::write::node_t m_unchecked [MAX_UNCHECKED_FRAGMENTS]
 Unchecked nodes. More...
 

Detailed Description

Defines a helper class to aid the creation of FullEvent fragments.

Definition at line 38 of file v40_write_FullEventFragment.h.

Constructor & Destructor Documentation

◆ FullEventFragment() [1/4]

offline_eformat::v40_write::FullEventFragment::FullEventFragment ( uint32_t  source_id,
uint32_t  bc_time_secs,
uint32_t  bc_time_nsec,
uint32_t  global_id,
uint32_t  run_type,
uint32_t  run_no,
uint16_t  lumi_block,
uint32_t  lvl1_id,
uint16_t  bc_id,
uint8_t  lvl1_type 
)

Builds a new FullEvent fragment from scratch, using the current time as the time label.

Parameters
source_idThe source identifier to be using for this FullEvent
bc_time_secsThe bunch crossing time in seconds, since the (unix) orgin
bc_time_nsecThe additional amount of nanoseconds since the
global_idThe global identifier for this fragment
run_typeThe run type for this fragment
run_noThe run number for this fragment
lumi_blockThe luminosity block number (16-bits)
lvl1_idThe LVL1 trigger identifier for this fragment
bc_idThe bunch crossing identifier (12-bits)
lvl1_typeThe LVL1 trigger type for this fragment (8-bits)

Definition at line 76 of file v40_write_FullEventFragment.cxx.

81 {
82  initialize();
83  this->source_id(source_id);
84  bc_time_seconds(bc_time_secs);
85  bc_time_nanoseconds(bc_time_nsec);
86  this->global_id(global_id);
87  this->run_type(run_type);
88  this->run_no(run_no);
89  this->lumi_block(lumi_block);
90  this->lvl1_id(lvl1_id);
91  this->bc_id(bc_id);
92  lvl1_trigger_type(lvl1_type);
93 }

◆ FullEventFragment() [2/4]

offline_eformat::v40_write::FullEventFragment::FullEventFragment ( const uint32_t *  fe)

Builds a new FullEvent fragment from an existing FullEvent fragment in contiguous memory.

Parameters
feThe existing FullEvent fragment

Definition at line 95 of file v40_write_FullEventFragment.cxx.

96 {
97  initialize();
98  copy_header(fe);
100  if (read.payload_size_word() > 0) {
101  const uint32_t* tmp;
102  m_node[9].next = &m_node[10];
103  read.payload(tmp);
104  set(m_node[10], tmp, read.payload_size_word(), 0);
105  m_header[1] += read.payload_size_word();
106  }
107 }

◆ FullEventFragment() [3/4]

offline_eformat::v40_write::FullEventFragment::FullEventFragment ( )

Builds a new empty FullEventFragment, otherwise invalid.

This is useful for array builds and standard containers.

Definition at line 109 of file v40_write_FullEventFragment.cxx.

110 {
111  initialize();
112 }

◆ FullEventFragment() [4/4]

offline_eformat::v40_write::FullEventFragment::FullEventFragment ( const FullEventFragment other)
delete

◆ ~FullEventFragment()

offline_eformat::v40_write::FullEventFragment::~FullEventFragment ( )
virtual

Base destructor.

Definition at line 114 of file v40_write_FullEventFragment.cxx.

115 {
116 }

Member Function Documentation

◆ append()

void offline_eformat::v40_write::FullEventFragment::append ( v40_write::ROBFragment rob)

Appends a new ROB fragment to this FullEvent fragment.

Warning
This will change the page structure of the last ROS fragment inserted here, in order to concatenate the ROS fragments together. Please note that this operation is not compatible with multiple threads of operation, if you would like to share eformat::write::Fragment's between threads. A better strategy would be create, for every thread of operation, a proper ROSFragment instead.
Parameters
robThe ROB fragment to be appended to myself

Definition at line 240 of file v40_write_FullEventFragment.cxx.

242 {
243  rob->parent(this);
244  rob->next(0); //reset any previous relationship
245  m_node[0].base[1] += rob->size_word();
246 
247  //adjust `m_last' and `m_child' to point to the new last ROB
248  if (m_last) m_last->next(rob);
249  else m_child = rob;
250  m_last = rob;
251 }

◆ append_unchecked()

void offline_eformat::v40_write::FullEventFragment::append_unchecked ( const uint32_t *  rob)

Appends an unchecked (read-only) ROB fragment to the current FullEvent.

The fragment will be appended after the writable ROB fragments inserted with append().

Unchecked fragments are appended to the end of the fragment stream, in the order they are received. This is done so we make sure that damaged fragments would only happen in the end of the stream and not on its begin - which could cause good fragments to be skipped.

Despite being unchecked the ROB fragment still has to fullfill two constraints:

  1. It has to start with the proper ROB fragment header marker
  2. The second word from the top should indicate its correct size in words
Parameters
rob_fragmentA pointer to the unchecked ROB fragment will be inserted as part of the current fragment. This ROB fragment must still fullfill the two requirements above.

Definition at line 253 of file v40_write_FullEventFragment.cxx.

254 {
256  throw EFORMAT_TOO_MANY_UNCHECKED(MAX_UNCHECKED_FRAGMENTS);
257  v40::ROBFragment frag(rob);
258  if (m_n_unchecked) //more fragments are available before this one
260  set(m_unchecked[m_n_unchecked++], rob, frag.fragment_size_word(), 0);
261  m_node[0].base[1] += frag.fragment_size_word();
262 }

◆ bc_id() [1/2]

void offline_eformat::v40_write::FullEventFragment::bc_id ( uint16_t  s)
inline

Changes the bunch crossing identifier in this fragment.

Parameters
sThe new value to set

Definition at line 274 of file v40_write_FullEventFragment.h.

275  { m_node[2].base[8] = s; }

◆ bc_id() [2/2]

uint16_t offline_eformat::v40_write::FullEventFragment::bc_id ( void  ) const
inline

Returns the bunch crossing identifier for this fragment.

Definition at line 280 of file v40_write_FullEventFragment.h.

281  { return m_node[2].base[8]; }

◆ bc_time_nanoseconds() [1/2]

void offline_eformat::v40_write::FullEventFragment::bc_time_nanoseconds ( uint32_t  s)
inline

Changes the bunch crossing time (the nanoseconds part) this fragment was produced at.

Parameters
sThe new value to set

Definition at line 182 of file v40_write_FullEventFragment.h.

183  { m_node[2].base[2] = s; }

◆ bc_time_nanoseconds() [2/2]

uint32_t offline_eformat::v40_write::FullEventFragment::bc_time_nanoseconds ( void  ) const
inline

Returns the additional amount of nanoseconds, for this fragment's bunch crossing time.

Definition at line 196 of file v40_write_FullEventFragment.h.

197  { return m_node[2].base[2]; }

◆ bc_time_seconds() [1/2]

void offline_eformat::v40_write::FullEventFragment::bc_time_seconds ( uint32_t  s)
inline

Changes the bunch crossing time (seconds) this fragment was produced at.

Parameters
sThe new value to set

Definition at line 173 of file v40_write_FullEventFragment.h.

174  { m_node[2].base[1] = s; }

◆ bc_time_seconds() [2/2]

uint32_t offline_eformat::v40_write::FullEventFragment::bc_time_seconds ( void  ) const
inline

Returns the time since the (unix) origin, in seconds, for this fragment.

Definition at line 189 of file v40_write_FullEventFragment.h.

190  { return m_node[2].base[1]; }

◆ bind()

const eformat::write::node_t * offline_eformat::v40_write::FullEventFragment::bind ( void  )

Returns the first node of a list of nodes that represent the fragment you have constructed.

To make use of it, just browse the list as defined in node.h

Definition at line 273 of file v40_write_FullEventFragment.cxx.

274 {
275  //the header is already concatenated by construction
276  eformat::write::node_t* last = &m_node[9];
277  eformat::write::node_t* payload = last; //buffer for an instant...
278  if (m_node[10].size_word) last = last->next; //advance one node
279  last->next = 0; //potentially remove old checksum
280 
281  //iterate over the attached children
282  for (v40_write::ROBFragment* curr = m_child; curr; curr = curr->next()) {
283  last->next = curr->bind();
284  while (last->next) last = last->next; //advance until end
285  }
286 
287  //make sure the last page of the last attached children points to the first
288  //unchecked page, but only if we have unchecked ROB fragments appended
289  if (m_n_unchecked) {
290  last->next = m_unchecked;
291  last = &m_unchecked[m_n_unchecked-1];
292  last->next = 0; //potentially remove old checksum
293  }
294 
295  //calculate the checksum if it was requested and we have data
296  //in this part of the code "payload" points to 1 node before the begin
297  if (checksum_type() != eformat::NO_CHECKSUM) {
298  payload = payload->next; //position cursor at payload start
299  if (!payload) {
300  eformat::write::node_t null;
301  set(null, 0, 0, 0);
302  m_checksum = eformat::write::checksum(checksum_type(), &null);
303  }
304  else
305  m_checksum = eformat::write::checksum(checksum_type(), payload);
306  last->next = &m_node[11];
307  }
308 
309  return m_node;
310 }

◆ checksum_type() [1/2]

void offline_eformat::v40_write::FullEventFragment::checksum_type ( uint32_t  s)

Changes the check-sum type for this fragment.

This will actually not calculate the checksum for this fragment. You will have to call bind() in order to do that. If you change anything within the fragment after calling bind(), a re-bind() is required.

Parameters
sThe new value to set

Definition at line 312 of file v40_write_FullEventFragment.cxx.

313 {
314  if (m_node[2].base[0] == eformat::NO_CHECKSUM && s != eformat::NO_CHECKSUM) {
315  //Going from no checksum to having a checksum: update sizes
316  m_node[0].base[1] += 1;
317  }
318  else if (m_node[2].base[0] != eformat::NO_CHECKSUM &&
319  s == eformat::NO_CHECKSUM) {
320  //Going from having a checksum to no checksum: update sizes
321  m_node[0].base[1] -= 1;
322  }
323  m_node[2].base[0] = s;
324 }

◆ checksum_type() [2/2]

uint32_t offline_eformat::v40_write::FullEventFragment::checksum_type ( void  ) const
inline

Returns the check sum type of this fragment.

Definition at line 165 of file v40_write_FullEventFragment.h.

165 { return m_node[2].base[0]; }

◆ copy_header() [1/2]

void offline_eformat::v40_write::FullEventFragment::copy_header ( const FullEventFragment other)

Definition at line 148 of file v40_write_FullEventFragment.cxx.

150 {
151  minor_version(other.minor_version());
152  source_id(other.source_id());
153  bc_time_seconds(other.bc_time_seconds());
154  bc_time_nanoseconds(other.bc_time_nanoseconds());
155  global_id(other.global_id());
156  run_type(other.run_type());
157  run_no(other.run_no());
158  lumi_block(other.lumi_block());
159  lvl1_id(other.lvl1_id());
160  bc_id(other.bc_id());
161  lvl1_trigger_type(other.lvl1_trigger_type());
162  status(other.nstatus(), other.status());
163  lvl1_trigger_info(other.nlvl1_trigger_info(), other.lvl1_trigger_info());
164  lvl2_trigger_info(other.nlvl2_trigger_info(), other.lvl2_trigger_info());
165  event_filter_info(other.nevent_filter_info(), other.event_filter_info());
166  stream_tag(other.nstream_tag(), other.stream_tag());
167  checksum_type(other.checksum_type());
168 }

◆ copy_header() [2/2]

void offline_eformat::v40_write::FullEventFragment::copy_header ( const uint32_t *  other)

Copies the header (meta data information) from another existing FullEvent Fragment.

Please note that this will not copy any specificy payload related information belonging to the other fragment.

Also note that the variable length data (status, info words, stream tags) is copied in a shallow way, by pointing to the existing blocks of the copied fragment. This way, you either must reset or guarantee this data will be available during the lifetime of this fragment.

Parameters
otherThe other FullEventFragment from which I should copy the metadata from

Definition at line 118 of file v40_write_FullEventFragment.cxx.

119 {
121  read.check(); //this gives us a good start-up scenario
122  eformat::helper::Version fe_ver(read.version());
123  minor_version(fe_ver.minor_version());
124  source_id(read.source_id());
125  bc_time_seconds(read.bc_time_seconds());
126  bc_time_nanoseconds(read.bc_time_nanoseconds());
127  global_id(read.global_id());
128  run_type(read.run_type());
129  run_no(read.run_no());
130  lumi_block(read.lumi_block());
131  lvl1_id(read.lvl1_id());
132  bc_id(read.bc_id());
133  lvl1_trigger_type(read.lvl1_trigger_type());
134  const uint32_t* tmp;
135  read.status(tmp);
136  status(read.nstatus(), tmp);
137  read.lvl1_trigger_info(tmp);
138  lvl1_trigger_info(read.nlvl1_trigger_info(), tmp);
139  read.lvl2_trigger_info(tmp);
140  lvl2_trigger_info(read.nlvl2_trigger_info(), tmp);
141  read.event_filter_info(tmp);
142  event_filter_info(read.nevent_filter_info(), tmp);
143  read.stream_tag(tmp);
144  stream_tag(read.nstream_tag(), tmp);
145  checksum_type(read.checksum_type());
146 }

◆ event_filter_info() [1/2]

void offline_eformat::v40_write::FullEventFragment::event_filter_info ( uint32_t  n,
const uint32_t *  data 
)

Changes the EF trigger info words from the fragment.

Parameters
nHow many EF info words the underlying FullEventFragment fragment supposed to have.
dataA pointer to n pre-allocated words

Definition at line 212 of file v40_write_FullEventFragment.cxx.

214 {
215  m_node[0].base[1] -= nevent_filter_info(); //remove previous count
216  m_node[0].base[2] -= nevent_filter_info(); //remove previous count
217  m_node[7].size_word = m_node[6].base[0] = n; //set new values
218  m_node[0].base[1] += n; //fragment size
219  m_node[0].base[2] += n; //header size
220  // FIXME: I'm assuming that these are ok.
221  // Probably can't avoid this as long as we're using node_t from eformat.
222  uint32_t* data_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(data);
223  m_node[7].base = data_nc;
224 }

◆ event_filter_info() [2/2]

const uint32_t* offline_eformat::v40_write::FullEventFragment::event_filter_info ( void  ) const
inline

Returns a pointer to the first EF trigger info to be used by this fragment.

Definition at line 360 of file v40_write_FullEventFragment.h.

361  { return m_node[7].base; }

◆ first_child()

const v40_write::ROBFragment* offline_eformat::v40_write::FullEventFragment::first_child ( void  ) const
inline

This returns the first child of this fragment.

The system operates as a concatenated list of fragments. From this child you can get to the next.

Definition at line 458 of file v40_write_FullEventFragment.h.

459  { return m_child; }

◆ global_id() [1/2]

void offline_eformat::v40_write::FullEventFragment::global_id ( uint32_t  s)
inline

Changes the global identifier for this event.

Parameters
sThe new value to set

Definition at line 204 of file v40_write_FullEventFragment.h.

205  { m_node[2].base[3] = s; }

◆ global_id() [2/2]

uint32_t offline_eformat::v40_write::FullEventFragment::global_id ( void  ) const
inline

Returns the global identifier for this event.

Definition at line 210 of file v40_write_FullEventFragment.h.

211  { return m_node[2].base[3]; }

◆ initialize()

void offline_eformat::v40_write::FullEventFragment::initialize ( void  )
private

Initializes the internal fields of this ROB fragment with the standard values.

Definition at line 25 of file v40_write_FullEventFragment.cxx.

26 {
27  m_header[0] = eformat::FULL_EVENT; //marker
28  m_header[1] = 21; //this header size + status size
29  m_header[2] = 21; //this header size + status size
30  eformat::helper::Version version(0, eformat::MAJOR_V40_VERSION);
31  m_header[3] = version.code(); //format version
32  m_header[4] = 0; //source identifier
33  m_header[5] = 1; //number of status
34  m_header[6] = eformat::NO_CHECKSUM; //check sum
35  m_header[7] = 0; //bc time seconds
36  m_header[8] = 0; //bc time nanoseconds
37  m_header[9] = 0; //global identifier
38  m_header[10] = 0; //run type
39  m_header[11] = 0; //run number
40  m_header[12] = 0; //luminosity block number
41  m_header[13] = 0; //LVL1 identifiery
42  m_header[14] = 0; //bunch crossing identifier
43  m_header[15] = 0; //LVL1 trigger type
44  m_header[16] = 0; //number of LVL1 info words
45  m_header[17] = 0; //number of LVL2 info words
46  m_header[18] = 0; //number of EF info words
47  m_header[19] = 0; //number of Stream Tag words
48 
49  //now initialize pages
50  set(m_node[0], m_header, 6, &m_node[1]);
51  set(m_node[1], &eformat::DEFAULT_STATUS, 1, &m_node[2]);
52  set(m_node[2], &m_header[6], 11, &m_node[3]);
53  set(m_node[3], 0, 0, &m_node[4]); //no LVL1 info yet
54  set(m_node[4], &m_header[17], 1, &m_node[5]);
55  set(m_node[5], 0, 0, &m_node[6]); //no LVL2 info yet
56  set(m_node[6], &m_header[18], 1, &m_node[7]);
57  set(m_node[7], 0, 0, &m_node[8]); //no EF info yet
58  set(m_node[8], &m_header[19], 1, &m_node[9]);
59  set(m_node[9], 0, 0, 0); //no stream tag yet
60 
61  //optional extra payload
62  set(m_node[10], 0, 0, 0);
63 
64  //optional checksum stuff (trailer)
65  m_checksum = 0;
66  set(m_node[11], &m_checksum, 1, 0);
67 
68  //our unchecked data
69  m_n_unchecked = 0;
70  set(m_unchecked[0], 0, 0, 0);
71 
72  m_child = 0;
73  m_last = 0;
74 }

◆ lumi_block() [1/2]

void offline_eformat::v40_write::FullEventFragment::lumi_block ( uint16_t  s)
inline

Changes the luminosity block number.

Parameters
sThe new value to set

Definition at line 246 of file v40_write_FullEventFragment.h.

247  { m_node[2].base[6] = s; }

◆ lumi_block() [2/2]

uint16_t offline_eformat::v40_write::FullEventFragment::lumi_block ( void  ) const
inline

Returns the luminosity block number for this fragment.

Definition at line 252 of file v40_write_FullEventFragment.h.

253  { return m_node[2].base[6]; }

◆ lvl1_id() [1/2]

void offline_eformat::v40_write::FullEventFragment::lvl1_id ( uint32_t  s)
inline

Changes the lvl1 identifier in this fragment.

Parameters
sThe new value to set

Definition at line 260 of file v40_write_FullEventFragment.h.

261  { m_node[2].base[7] = s; }

◆ lvl1_id() [2/2]

uint32_t offline_eformat::v40_write::FullEventFragment::lvl1_id ( void  ) const
inline

Returns the lvl1 identifier for this fragment.

Definition at line 266 of file v40_write_FullEventFragment.h.

267  { return m_node[2].base[7]; }

◆ lvl1_trigger_info() [1/2]

void offline_eformat::v40_write::FullEventFragment::lvl1_trigger_info ( uint32_t  n,
const uint32_t *  data 
)

Changes the LVL1 trigger info words from the fragment.

Parameters
nHow many LVL1 info words the underlying FullEventFragment fragment supposed to have.
dataA pointer to n pre-allocated words

Definition at line 184 of file v40_write_FullEventFragment.cxx.

186 {
187  m_node[0].base[1] -= nlvl1_trigger_info(); //remove previous count
188  m_node[0].base[2] -= nlvl1_trigger_info(); //remove previous count
189  m_node[3].size_word = m_node[2].base[10] = n; //set new values
190  m_node[0].base[1] += n; //fragment size
191  m_node[0].base[2] += n; //header size
192  // FIXME: I'm assuming that these are ok.
193  // Probably can't avoid this as long as we're using node_t from eformat.
194  uint32_t* data_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(data);
195  m_node[3].base = data_nc;
196 }

◆ lvl1_trigger_info() [2/2]

const uint32_t* offline_eformat::v40_write::FullEventFragment::lvl1_trigger_info ( void  ) const
inline

Returns a pointer to the first LVL1 trigger info to be used by this fragment.

Definition at line 316 of file v40_write_FullEventFragment.h.

317  { return m_node[3].base; }

◆ lvl1_trigger_type() [1/2]

void offline_eformat::v40_write::FullEventFragment::lvl1_trigger_type ( uint8_t  s)
inline

Changes the lvl1 trigger type in this fragment.

Parameters
sThe new value to set

Definition at line 288 of file v40_write_FullEventFragment.h.

289  { m_node[2].base[9] = s; }

◆ lvl1_trigger_type() [2/2]

uint8_t offline_eformat::v40_write::FullEventFragment::lvl1_trigger_type ( void  ) const
inline

Returns the lvl1 trigger type for this fragment.

Definition at line 294 of file v40_write_FullEventFragment.h.

295  { return m_node[2].base[9]; }

◆ lvl2_trigger_info() [1/2]

void offline_eformat::v40_write::FullEventFragment::lvl2_trigger_info ( uint32_t  n,
const uint32_t *  data 
)

Changes the LVL2 trigger info words from the fragment.

Parameters
nHow many LVL2 info words the underlying FullEventFragment fragment supposed to have.
dataA pointer to n pre-allocated words

Definition at line 198 of file v40_write_FullEventFragment.cxx.

200 {
201  m_node[0].base[1] -= nlvl2_trigger_info(); //remove previous count
202  m_node[0].base[2] -= nlvl2_trigger_info(); //remove previous count
203  m_node[5].size_word = m_node[4].base[0] = n; //set new values
204  m_node[0].base[1] += n; //fragment size
205  m_node[0].base[2] += n; //header size
206  // FIXME: I'm assuming that these are ok.
207  // Probably can't avoid this as long as we're using node_t from eformat.
208  uint32_t* data_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(data);
209  m_node[5].base = data_nc;
210 }

◆ lvl2_trigger_info() [2/2]

const uint32_t* offline_eformat::v40_write::FullEventFragment::lvl2_trigger_info ( void  ) const
inline

Returns a pointer to the first LVL2 trigger info to be used by this fragment.

Definition at line 338 of file v40_write_FullEventFragment.h.

339  { return m_node[5].base; }

◆ meta_size_word()

uint32_t offline_eformat::v40_write::FullEventFragment::meta_size_word ( void  ) const
inline

Returns the size of this fragments header.

Definition at line 392 of file v40_write_FullEventFragment.h.

393  { return m_node[0].base[2] + (checksum_type()?1:0); }

◆ minor_version() [1/2]

void offline_eformat::v40_write::FullEventFragment::minor_version ( uint16_t  v)
inline

Changes the minor version number of the fragment.

Parameters
vThe new minor version for this header

Definition at line 127 of file v40_write_FullEventFragment.h.

127  {
128  eformat::helper::Version version(v, eformat::MAJOR_V40_VERSION);
129  m_node[0].base[3] = version.code();
130  }

◆ minor_version() [2/2]

uint16_t offline_eformat::v40_write::FullEventFragment::minor_version ( void  ) const
inline

Returns the minor version number of the fragment.

Definition at line 135 of file v40_write_FullEventFragment.h.

136  { return 0xffff & m_node[0].base[3]; }

◆ nevent_filter_info()

uint32_t offline_eformat::v40_write::FullEventFragment::nevent_filter_info ( void  ) const
inline

Returns the number of status wors in this fragment.

Definition at line 353 of file v40_write_FullEventFragment.h.

354  { return m_node[6].base[0]; }

◆ nlvl1_trigger_info()

uint32_t offline_eformat::v40_write::FullEventFragment::nlvl1_trigger_info ( void  ) const
inline

Returns the number of status wors in this fragment.

Definition at line 309 of file v40_write_FullEventFragment.h.

310  { return m_node[2].base[10]; }

◆ nlvl2_trigger_info()

uint32_t offline_eformat::v40_write::FullEventFragment::nlvl2_trigger_info ( void  ) const
inline

Returns the number of status wors in this fragment.

Definition at line 331 of file v40_write_FullEventFragment.h.

332  { return m_node[4].base[0]; }

◆ nstatus()

uint32_t offline_eformat::v40_write::FullEventFragment::nstatus ( void  ) const
inline

Returns the number of status wors in this fragment.

Definition at line 115 of file v40_write_FullEventFragment.h.

115 { return m_node[0].base[5]; }

◆ nstream_tag()

uint32_t offline_eformat::v40_write::FullEventFragment::nstream_tag ( void  ) const
inline

Returns the number of stream tag words in this fragment.

At this level of the API, a stream tag is defined to be a 32-bit null padded (standard) C string.

Definition at line 368 of file v40_write_FullEventFragment.h.

369  { return m_node[8].base[0]; }

◆ nunchecked_fragments()

uint32_t offline_eformat::v40_write::FullEventFragment::nunchecked_fragments ( void  ) const
inline

Returns the number of unchecked ROBs there are.

Definition at line 441 of file v40_write_FullEventFragment.h.

442  { return m_n_unchecked; }

◆ operator=()

FullEventFragment& offline_eformat::v40_write::FullEventFragment::operator= ( const FullEventFragment other)
delete

◆ page_count()

uint32_t offline_eformat::v40_write::FullEventFragment::page_count ( void  ) const

Returns the total number of (raw memory) pages this fragment is composed of.

Warning
This operation navigates at a potentially large list of child page nodes (for a full ATLAS event this should be bigger than 2,000 pages when built from scratch). If you don't do your bookkeeping, avoid calling this too often.

Definition at line 264 of file v40_write_FullEventFragment.cxx.

265 {
266  uint32_t retval = 10 + (m_node[9].next?1:0) + (checksum_type()?1:0);
267  for (const v40_write::ROBFragment* curr = m_child; curr; curr = curr->next())
268  retval += curr->page_count();
269  return retval+m_n_unchecked;
270 }

◆ run_no() [1/2]

void offline_eformat::v40_write::FullEventFragment::run_no ( uint32_t  s)
inline

Changes the run number.

Parameters
sThe new value to set

Definition at line 232 of file v40_write_FullEventFragment.h.

233  { m_node[2].base[5] = s; }

◆ run_no() [2/2]

uint32_t offline_eformat::v40_write::FullEventFragment::run_no ( void  ) const
inline

Returns the run number for this fragment.

Definition at line 238 of file v40_write_FullEventFragment.h.

239  { return m_node[2].base[5]; }

◆ run_type() [1/2]

void offline_eformat::v40_write::FullEventFragment::run_type ( uint32_t  s)
inline

Changes the run type.

Parameters
sThe new value to set

Definition at line 218 of file v40_write_FullEventFragment.h.

219  { m_node[2].base[4] = s; }

◆ run_type() [2/2]

uint32_t offline_eformat::v40_write::FullEventFragment::run_type ( void  ) const
inline

Returns the run type for this fragment.

Definition at line 224 of file v40_write_FullEventFragment.h.

225  { return m_node[2].base[4]; }

◆ size_change()

void offline_eformat::v40_write::FullEventFragment::size_change ( uint32_t  o,
uint32_t  n 
)
inline

This method is used by children of this fragment to notify fragment size changes.

Parameters
oThe old size, in 32-bit words
nThe new size, in 32-bit words

Definition at line 468 of file v40_write_FullEventFragment.h.

469  { m_node[0].base[1] -= o; m_node[0].base[1] += n; }

◆ size_word()

uint32_t offline_eformat::v40_write::FullEventFragment::size_word ( void  ) const
inline

Returns the total size for this fragment, in words.

Definition at line 398 of file v40_write_FullEventFragment.h.

399  { return m_node[0].base[1]; }

◆ source_id() [1/2]

void offline_eformat::v40_write::FullEventFragment::source_id ( uint32_t  s)
inline

Changes the source identifier for this fragment.

Parameters
sThe new value to set

Definition at line 143 of file v40_write_FullEventFragment.h.

144  { m_node[0].base[4] = s; }

◆ source_id() [2/2]

uint32_t offline_eformat::v40_write::FullEventFragment::source_id ( void  ) const
inline

Returns the source identifier of this fragment.

Definition at line 149 of file v40_write_FullEventFragment.h.

150  { return m_node[0].base[4]; }

◆ status() [1/2]

void offline_eformat::v40_write::FullEventFragment::status ( uint32_t  n,
const uint32_t *  status 
)

Changes the number of status words and the status words themselves from the fragment.

Parameters
nHow many status words the underlying FullEventFragment fragment supposed to have.
statusA pointer to n pre-allocated words

Definition at line 170 of file v40_write_FullEventFragment.cxx.

172 {
173  m_node[0].base[1] -= m_node[0].base[5]; //remove count from previous status
174  m_node[0].base[2] -= m_node[0].base[5]; //remove count from previous status
175  m_node[1].size_word = m_node[0].base[5] = n; //set new values
176  m_node[0].base[1] += n;
177  m_node[0].base[2] += n;
178  // FIXME: I'm assuming that these are ok.
179  // Probably can't avoid this as long as we're using node_t from eformat.
180  uint32_t* status_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(status);
181  m_node[1].base = status_nc;
182 }

◆ status() [2/2]

const uint32_t* offline_eformat::v40_write::FullEventFragment::status ( void  ) const
inline

Returns a pointer to the first status word to be used by this fragment.

Definition at line 120 of file v40_write_FullEventFragment.h.

120 { return m_node[1].base; }

◆ stream_tag() [1/2]

void offline_eformat::v40_write::FullEventFragment::stream_tag ( uint32_t  n,
const uint32_t *  data 
)

Changes the stream tag words from the fragment.

At this level of the API, a stream tag is defined to be a 32-bit null padded (standard) C string.

Parameters
nHow many stream tag words the underlying FullEventFragment fragment supposed to have.
dataA pointer to n pre-allocated words

Definition at line 226 of file v40_write_FullEventFragment.cxx.

228 {
229  m_node[0].base[1] -= nstream_tag(); //remove previous count
230  m_node[0].base[2] -= nstream_tag(); //remove previous count
231  m_node[9].size_word = m_node[8].base[0] = n; //set new values
232  m_node[0].base[1] += n; //fragment size
233  m_node[0].base[2] += n; //header size
234  // FIXME: I'm assuming that these are ok.
235  // Probably can't avoid this as long as we're using node_t from eformat.
236  uint32_t* data_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(data);
237  m_node[9].base = data_nc;
238 }

◆ stream_tag() [2/2]

const uint32_t* offline_eformat::v40_write::FullEventFragment::stream_tag ( void  ) const
inline

Returns a pointer to the first stream tag word to be used by this fragment.

At this level of the API, a stream tag is defined to be a 32-bit null padded (standard) C string.

Definition at line 387 of file v40_write_FullEventFragment.h.

387 { return m_node[9].base; }

◆ unchecked_fragment()

const uint32_t * offline_eformat::v40_write::FullEventFragment::unchecked_fragment ( uint32_t  n) const

Returns a particular unchecked ROB fragment.

Please not that this method will not perform bound-checking. You are supposed to make sure the existing range is not exceeded.

Parameters
nThe index of the unchecked fragment you want to retrieve.

Definition at line 326 of file v40_write_FullEventFragment.cxx.

328 {
329  return m_unchecked[n].base;
330 }

Member Data Documentation

◆ m_checksum

uint32_t offline_eformat::v40_write::FullEventFragment::m_checksum
private

My payload's checksum, if asked.

Definition at line 503 of file v40_write_FullEventFragment.h.

◆ m_child

v40_write::ROBFragment* offline_eformat::v40_write::FullEventFragment::m_child
private

my children

Definition at line 501 of file v40_write_FullEventFragment.h.

◆ m_header

uint32_t offline_eformat::v40_write::FullEventFragment::m_header[20]
private

The FullEvent Header.

Definition at line 499 of file v40_write_FullEventFragment.h.

◆ m_last

v40_write::ROBFragment* offline_eformat::v40_write::FullEventFragment::m_last
private

my last child

Definition at line 502 of file v40_write_FullEventFragment.h.

◆ m_n_unchecked

uint32_t offline_eformat::v40_write::FullEventFragment::m_n_unchecked
private

The number of unchecked nodes attached.

Definition at line 504 of file v40_write_FullEventFragment.h.

◆ m_node

eformat::write::node_t offline_eformat::v40_write::FullEventFragment::m_node[12]
private

Node representation.

Definition at line 500 of file v40_write_FullEventFragment.h.

◆ m_unchecked

eformat::write::node_t offline_eformat::v40_write::FullEventFragment::m_unchecked[MAX_UNCHECKED_FRAGMENTS]
private

Unchecked nodes.

Definition at line 505 of file v40_write_FullEventFragment.h.


The documentation for this class was generated from the following files:
read
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
Definition: openCoraCool.cxx:569
base
std::string base
Definition: hcg.cxx:78
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
offline_eformat::v40_write::FullEventFragment::lvl1_id
uint32_t lvl1_id(void) const
Returns the lvl1 identifier for this fragment.
Definition: v40_write_FullEventFragment.h:266
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
offline_eformat::v40_write::FullEventFragment::m_checksum
uint32_t m_checksum
My payload's checksum, if asked.
Definition: v40_write_FullEventFragment.h:503
offline_eformat::v40_write::FullEventFragment::m_unchecked
eformat::write::node_t m_unchecked[MAX_UNCHECKED_FRAGMENTS]
Unchecked nodes.
Definition: v40_write_FullEventFragment.h:505
offline_eformat::v40_write::ROBFragment::next
void next(ROBFragment *n)
Sets the next sibling.
Definition: v40_write_ROBFragment.h:507
offline_eformat::v40_write::FullEventFragment::bc_time_nanoseconds
uint32_t bc_time_nanoseconds(void) const
Returns the additional amount of nanoseconds, for this fragment's bunch crossing time.
Definition: v40_write_FullEventFragment.h:196
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
offline_eformat::v40_write::FullEventFragment::nlvl1_trigger_info
uint32_t nlvl1_trigger_info(void) const
Returns the number of status wors in this fragment.
Definition: v40_write_FullEventFragment.h:309
offline_eformat::v40_write::FullEventFragment::m_last
v40_write::ROBFragment * m_last
my last child
Definition: v40_write_FullEventFragment.h:502
offline_eformat::v40_write::FullEventFragment::m_header
uint32_t m_header[20]
The FullEvent Header.
Definition: v40_write_FullEventFragment.h:499
offline_eformat::v40_write::FullEventFragment::copy_header
void copy_header(const uint32_t *other)
Copies the header (meta data information) from another existing FullEvent Fragment.
Definition: v40_write_FullEventFragment.cxx:118
offline_eformat::v40_write::MAX_UNCHECKED_FRAGMENTS
const uint32_t MAX_UNCHECKED_FRAGMENTS
Maximum number of unchecked fragments a writeable FullEventFragment may have.
Definition: v40_write_FullEventFragment.h:33
offline_eformat::v40_write::FullEventFragment::stream_tag
const uint32_t * stream_tag(void) const
Returns a pointer to the first stream tag word to be used by this fragment.
Definition: v40_write_FullEventFragment.h:387
offline_eformat::v40_write::FullEventFragment::lvl1_trigger_type
uint8_t lvl1_trigger_type(void) const
Returns the lvl1 trigger type for this fragment.
Definition: v40_write_FullEventFragment.h:294
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment
eformat::FullEventFragment< PointerType > FullEventFragment
Definition: RawEvent.h:26
offline_eformat::v40_write::FullEventFragment::bc_id
uint16_t bc_id(void) const
Returns the bunch crossing identifier for this fragment.
Definition: v40_write_FullEventFragment.h:280
offline_eformat::v40_write::FullEventFragment::nlvl2_trigger_info
uint32_t nlvl2_trigger_info(void) const
Returns the number of status wors in this fragment.
Definition: v40_write_FullEventFragment.h:331
LArCellBinning_test.retval
def retval
Definition: LArCellBinning_test.py:112
offline_eformat::v40_write::FullEventFragment::nevent_filter_info
uint32_t nevent_filter_info(void) const
Returns the number of status wors in this fragment.
Definition: v40_write_FullEventFragment.h:353
offline_eformat::v40_write::FullEventFragment::checksum_type
uint32_t checksum_type(void) const
Returns the check sum type of this fragment.
Definition: v40_write_FullEventFragment.h:165
offline_eformat::v40_write::FullEventFragment::m_child
v40_write::ROBFragment * m_child
my children
Definition: v40_write_FullEventFragment.h:501
offline_eformat::v40_write::FullEventFragment::run_type
uint32_t run_type(void) const
Returns the run type for this fragment.
Definition: v40_write_FullEventFragment.h:224
beamspotman.n
n
Definition: beamspotman.py:731
offline_eformat::v40_write::FullEventFragment::initialize
void initialize(void)
Initializes the internal fields of this ROB fragment with the standard values.
Definition: v40_write_FullEventFragment.cxx:25
offline_eformat::v40_write::FullEventFragment::bc_time_seconds
uint32_t bc_time_seconds(void) const
Returns the time since the (unix) origin, in seconds, for this fragment.
Definition: v40_write_FullEventFragment.h:189
offline_eformat::v40_write::FullEventFragment::run_no
uint32_t run_no(void) const
Returns the run number for this fragment.
Definition: v40_write_FullEventFragment.h:238
offline_eformat::v40_write::FullEventFragment::source_id
uint32_t source_id(void) const
Returns the source identifier of this fragment.
Definition: v40_write_FullEventFragment.h:149
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
offline_eformat::v40_write::FullEventFragment::status
const uint32_t * status(void) const
Returns a pointer to the first status word to be used by this fragment.
Definition: v40_write_FullEventFragment.h:120
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment
eformat::ROBFragment< PointerType > ROBFragment
Definition: RawEvent.h:27
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
offline_eformat::v40_write::FullEventFragment::m_node
eformat::write::node_t m_node[12]
Node representation.
Definition: v40_write_FullEventFragment.h:500
python.PyAthena.v
v
Definition: PyAthena.py:157
get_generator_info.version
version
Definition: get_generator_info.py:33
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
offline_eformat::v40_write::FullEventFragment::m_n_unchecked
uint32_t m_n_unchecked
The number of unchecked nodes attached.
Definition: v40_write_FullEventFragment.h:504
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
offline_eformat::v40_write::FullEventFragment::global_id
uint32_t global_id(void) const
Returns the global identifier for this event.
Definition: v40_write_FullEventFragment.h:210
offline_eformat::v40_write::FullEventFragment::lvl2_trigger_info
const uint32_t * lvl2_trigger_info(void) const
Returns a pointer to the first LVL2 trigger info to be used by this fragment.
Definition: v40_write_FullEventFragment.h:338
offline_eformat::v40_write::FullEventFragment::nstream_tag
uint32_t nstream_tag(void) const
Returns the number of stream tag words in this fragment.
Definition: v40_write_FullEventFragment.h:368
offline_eformat::v40_write::FullEventFragment::minor_version
uint16_t minor_version(void) const
Returns the minor version number of the fragment.
Definition: v40_write_FullEventFragment.h:135
offline_eformat::v40_write::FullEventFragment::event_filter_info
const uint32_t * event_filter_info(void) const
Returns a pointer to the first EF trigger info to be used by this fragment.
Definition: v40_write_FullEventFragment.h:360
offline_eformat::v40_write::FullEventFragment::lumi_block
uint16_t lumi_block(void) const
Returns the luminosity block number for this fragment.
Definition: v40_write_FullEventFragment.h:252
offline_eformat::v40_write::FullEventFragment::lvl1_trigger_info
const uint32_t * lvl1_trigger_info(void) const
Returns a pointer to the first LVL1 trigger info to be used by this fragment.
Definition: v40_write_FullEventFragment.h:316
offline_eformat::v40_write::FullEventFragment::size_word
uint32_t size_word(void) const
Returns the total size for this fragment, in words.
Definition: v40_write_FullEventFragment.h:398