ATLAS Offline Software
Loading...
Searching...
No Matches
v40_write_FullEventFragment.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_FULLEVENTFRAGMENT_H
19#define OFFLINE_EFORMAT_V40_WRITE_FULLEVENTFRAGMENT_H
20
23#include <cstring>
24
25namespace offline_eformat {
26
27 namespace v40_write {
28
33 const uint32_t MAX_UNCHECKED_FRAGMENTS = 2048;
34
39 {
40 public:
41
59 FullEventFragment (uint32_t source_id, uint32_t bc_time_secs,
60 uint32_t bc_time_nsec, uint32_t global_id, uint32_t run_type,
61 uint32_t run_no, uint16_t lumi_block,
62 uint32_t lvl1_id, uint16_t bc_id, uint8_t lvl1_type);
63
70 FullEventFragment (const uint32_t* fe);
71
77
78 FullEventFragment (const FullEventFragment& other) = delete;
80
84 virtual ~FullEventFragment ();
85
99 void copy_header(const uint32_t* other);
100 void copy_header(const FullEventFragment& other);
101
110 void status (uint32_t n, const uint32_t* status);
111
115 inline uint32_t nstatus (void) const { return m_node[0].base[5]; }
116
120 inline const uint32_t* status (void) const { return m_node[1].base; }
121
127 inline void minor_version (uint16_t v) {
128 eformat::helper::Version version(v, eformat::MAJOR_V40_VERSION);
129 m_node[0].base[3] = version.code();
130 }
131
135 inline uint16_t minor_version (void) const
136 { return 0xffff & m_node[0].base[3]; }
137
143 inline void source_id (uint32_t s)
144 { m_node[0].base[4] = s; }
145
149 inline uint32_t source_id (void) const
150 { return m_node[0].base[4]; }
151
160 void checksum_type (uint32_t s);
161
165 inline uint32_t checksum_type (void) const { return m_node[2].base[0]; }
166
173 inline void bc_time_seconds (uint32_t s)
174 { m_node[2].base[1] = s; }
175
182 inline void bc_time_nanoseconds (uint32_t s)
183 { m_node[2].base[2] = s; }
184
189 inline uint32_t bc_time_seconds (void) const
190 { return m_node[2].base[1]; }
191
196 inline uint32_t bc_time_nanoseconds (void) const
197 { return m_node[2].base[2]; }
198
204 inline void global_id (uint32_t s)
205 { m_node[2].base[3] = s; }
206
210 inline uint32_t global_id (void) const
211 { return m_node[2].base[3]; }
212
218 inline void run_type (uint32_t s)
219 { m_node[2].base[4] = s; }
220
224 inline uint32_t run_type (void) const
225 { return m_node[2].base[4]; }
226
232 inline void run_no (uint32_t s)
233 { m_node[2].base[5] = s; }
234
238 inline uint32_t run_no (void) const
239 { return m_node[2].base[5]; }
240
246 inline void lumi_block (uint16_t s)
247 { m_node[2].base[6] = s; }
248
252 inline uint16_t lumi_block (void) const
253 { return m_node[2].base[6]; }
254
260 inline void lvl1_id (uint32_t s)
261 { m_node[2].base[7] = s; }
262
266 inline uint32_t lvl1_id (void) const
267 { return m_node[2].base[7]; }
268
274 inline void bc_id (uint16_t s)
275 { m_node[2].base[8] = s; }
276
280 inline uint16_t bc_id (void) const
281 { return m_node[2].base[8]; }
282
288 inline void lvl1_trigger_type (uint8_t s)
289 { m_node[2].base[9] = s; }
290
294 inline uint8_t lvl1_trigger_type (void) const
295 { return m_node[2].base[9]; }
296
304 void lvl1_trigger_info (uint32_t n, const uint32_t* data);
305
309 inline uint32_t nlvl1_trigger_info (void) const
310 { return m_node[2].base[10]; }
311
316 inline const uint32_t* lvl1_trigger_info (void) const
317 { return m_node[3].base; }
318
326 void lvl2_trigger_info (uint32_t n, const uint32_t* data);
327
331 inline uint32_t nlvl2_trigger_info (void) const
332 { return m_node[4].base[0]; }
333
338 inline const uint32_t* lvl2_trigger_info (void) const
339 { return m_node[5].base; }
340
348 void event_filter_info (uint32_t n, const uint32_t* data);
349
353 inline uint32_t nevent_filter_info (void) const
354 { return m_node[6].base[0]; }
355
360 inline const uint32_t* event_filter_info (void) const
361 { return m_node[7].base; }
362
368 inline uint32_t nstream_tag (void) const
369 { return m_node[8].base[0]; }
370
380 void stream_tag (uint32_t n, const uint32_t* data);
381
387 inline const uint32_t* stream_tag (void) const { return m_node[9].base; }
388
392 inline uint32_t meta_size_word (void) const
393 { return m_node[0].base[2] + (checksum_type()?1:0); }
394
398 inline uint32_t size_word (void) const
399 { return m_node[0].base[1]; }
400
414 void append (v40_write::ROBFragment* rob);
415
436 void append_unchecked (const uint32_t* rob);
437
441 inline uint32_t nunchecked_fragments (void) const
442 { return m_n_unchecked; }
443
451 const uint32_t* unchecked_fragment (uint32_t n) const;
452
458 inline const v40_write::ROBFragment* first_child (void) const
459 { return m_child; }
460
468 inline void size_change (uint32_t o, uint32_t n)
469 { m_node[0].base[1] -= o; m_node[0].base[1] += n; }
470
480 uint32_t page_count (void) const;
481
487 const eformat::write::node_t* bind (void);
488
489 private: //to make the code simpler
490
495 void initialize(void);
496
497 private: //representation
498
499 uint32_t m_header[20];
500 eformat::write::node_t m_node[12];
503 uint32_t m_checksum;
504 uint32_t m_n_unchecked;
505 eformat::write::node_t m_unchecked[MAX_UNCHECKED_FRAGMENTS];
506
507 };
508
509 }
510
511}
512
513#endif /* EFORMAT_WRITE_FULLEVENTFRAGMENT_H */
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Define macros for attributes used to control the static checker.
void minor_version(uint16_t v)
Changes the minor version number of the fragment.
uint32_t page_count(void) const
Returns the total number of (raw memory) pages this fragment is composed of.
const uint32_t * stream_tag(void) const
Returns a pointer to the first stream tag word to be used by this fragment.
FullEventFragment()
Builds a new empty FullEventFragment, otherwise invalid.
uint32_t source_id(void) const
Returns the source identifier of this fragment.
const eformat::write::node_t * bind(void)
Returns the first node of a list of nodes that represent the fragment you have constructed.
eformat::write::node_t m_node[12]
Node representation.
const uint32_t * lvl2_trigger_info(void) const
Returns a pointer to the first LVL2 trigger info to be used by this fragment.
uint32_t bc_time_nanoseconds(void) const
Returns the additional amount of nanoseconds, for this fragment's bunch crossing time.
uint32_t nlvl2_trigger_info(void) const
Returns the number of status wors in this fragment.
uint32_t nstream_tag(void) const
Returns the number of stream tag words in this fragment.
void append(v40_write::ROBFragment *rob)
Appends a new ROB fragment to this FullEvent fragment.
void copy_header(const uint32_t *other)
Copies the header (meta data information) from another existing FullEvent Fragment.
const v40_write::ROBFragment * first_child(void) const
This returns the first child of this fragment.
uint32_t checksum_type(void) const
Returns the check sum type of this fragment.
void global_id(uint32_t s)
Changes the global identifier for this event.
uint32_t nstatus(void) const
Returns the number of status wors in this fragment.
const uint32_t * status(void) const
Returns a pointer to the first status word to be used by this fragment.
uint32_t m_n_unchecked
The number of unchecked nodes attached.
uint32_t run_no(void) const
Returns the run number for this fragment.
uint16_t lumi_block(void) const
Returns the luminosity block number for this 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 run_type(void) const
Returns the run type for this fragment.
const uint32_t * unchecked_fragment(uint32_t n) const
Returns a particular unchecked ROB fragment.
void lvl1_id(uint32_t s)
Changes the lvl1 identifier in this fragment.
uint32_t bc_time_seconds(void) const
Returns the time since the (unix) origin, in seconds, for this fragment.
uint32_t meta_size_word(void) const
Returns the size of this fragments header.
void source_id(uint32_t s)
Changes the source identifier for this fragment.
void bc_id(uint16_t s)
Changes the bunch crossing identifier in this fragment.
FullEventFragment & operator=(const FullEventFragment &other)=delete
uint32_t m_checksum
My payload's checksum, if asked.
const uint32_t * event_filter_info(void) const
Returns a pointer to the first EF trigger info to be used by this fragment.
uint32_t nevent_filter_info(void) const
Returns the number of status wors in this fragment.
uint16_t bc_id(void) const
Returns the bunch crossing identifier for this fragment.
eformat::write::node_t m_unchecked[MAX_UNCHECKED_FRAGMENTS]
Unchecked nodes.
void bc_time_nanoseconds(uint32_t s)
Changes the bunch crossing time (the nanoseconds part) this fragment was produced at.
void lvl1_trigger_type(uint8_t s)
Changes the lvl1 trigger type in this fragment.
uint32_t nunchecked_fragments(void) const
Returns the number of unchecked ROBs there are.
void lumi_block(uint16_t s)
Changes the luminosity block number.
uint32_t global_id(void) const
Returns the global identifier for this event.
void initialize(void)
Initializes the internal fields of this ROB fragment with the standard values.
uint32_t nlvl1_trigger_info(void) const
Returns the number of status wors in this fragment.
FullEventFragment(const FullEventFragment &other)=delete
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.
void size_change(uint32_t o, uint32_t n)
This method is used by children of this fragment to notify fragment size changes.
uint32_t lvl1_id(void) const
Returns the lvl1 identifier for this fragment.
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.
const uint32_t * lvl1_trigger_info(void) const
Returns a pointer to the first LVL1 trigger info to be used by this fragment.
uint8_t lvl1_trigger_type(void) const
Returns the lvl1 trigger type for this fragment.
void append_unchecked(const uint32_t *rob)
Appends an unchecked (read-only) ROB fragment to the current FullEvent.
void bc_time_seconds(uint32_t s)
Changes the bunch crossing time (seconds) this fragment was produced at.
Defines a helper class to aid the creation of ROB fragments.
const uint32_t MAX_UNCHECKED_FRAGMENTS
Maximum number of unchecked fragments a writeable FullEventFragment may have.