ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
WriteEvent Class Reference
Collaboration diagram for WriteEvent:

Public Types

enum  Status { Status::OK =0, Status::NOT_OK =1 }
 

Public Member Functions

 WriteEvent (const Event &readEvent)
 
Status status () const
 
const std::unique_ptr< uint32_t[]> & blob () const
 
const eformat::write::FullEventFragment & frag () const
 
uint32_t size () const
 

Private Attributes

Status m_status {Status::NOT_OK}
 
std::unique_ptr< uint32_t[]> m_blob
 
eformat::write::FullEventFragment m_frag
 
std::vector< eformat::write::ROBFragment > m_robs
 
std::vector< std::unique_ptr< uint32_t[]> > m_robBlobs
 
uint32_t m_size {0}
 

Detailed Description

Definition at line 50 of file trigbs_orderedMerge.cxx.

Member Enumeration Documentation

◆ Status

enum WriteEvent::Status
strong
Enumerator
OK 
NOT_OK 

Definition at line 52 of file trigbs_orderedMerge.cxx.

52 {OK=0, NOT_OK=1};

Constructor & Destructor Documentation

◆ WriteEvent()

WriteEvent::WriteEvent ( const Event readEvent)
inlineexplicit

Definition at line 63 of file trigbs_orderedMerge.cxx.

63  {
64  m_frag.status(readEvent.frag.nstatus(), readEvent.frag.status());
65  m_frag.run_type(readEvent.frag.run_type());
66  m_frag.run_no(readEvent.frag.run_no());
67  m_frag.global_id(readEvent.frag.global_id());
68  m_frag.lumi_block(readEvent.frag.lumi_block());
69  m_frag.bc_id(readEvent.frag.bc_id());
70  m_frag.bc_time_seconds(readEvent.frag.bc_time_seconds());
71  m_frag.bc_time_nanoseconds(readEvent.frag.bc_time_nanoseconds());
72  m_frag.lvl1_id(readEvent.frag.lvl1_id());
73  m_frag.lvl1_trigger_type(readEvent.frag.lvl1_trigger_type());
74  m_frag.lvl1_trigger_info(readEvent.frag.nlvl1_trigger_info(), readEvent.frag.lvl1_trigger_info());
75  m_frag.hlt_info(readEvent.frag.nhlt_info(), readEvent.frag.hlt_info());
76  m_frag.stream_tag(readEvent.frag.nstream_tag(), readEvent.frag.stream_tag());
77  m_frag.compression_type(eformat::Compression::UNCOMPRESSED);
78  m_frag.compression_level(0);
79  std::vector<eformat::read::ROBFragment> readRobs;
80  readEvent.frag.robs(readRobs);
81  m_robs.reserve(readRobs.size());
82  for (const eformat::read::ROBFragment& rob : readRobs) {
83  m_robs.emplace_back(rob.start());
84  const eformat::write::node_t* top = m_robs.back().bind();
85  const uint32_t writeSize = m_robs.back().size_word();
86  m_robBlobs.push_back(std::make_unique<uint32_t[]>(writeSize));
87  const uint32_t writtenSize = eformat::write::copy(*top, m_robBlobs.back().get(), writeSize);
88  if (writtenSize != writeSize) {
89  std::cerr << "Error in ROB serialisation, copied " << writtenSize << " instead of " << writeSize
90  << " words, skipping ROB" << std::endl;
92  continue;
93  }
94  m_frag.append_unchecked(m_robBlobs.back().get());
95  }
96 
97  const eformat::write::node_t* top = m_frag.bind();
98  m_size = m_frag.size_word();
99  m_blob = std::make_unique<uint32_t[]>(m_size);
100  const uint32_t writtenSize = eformat::write::copy(*top, m_blob.get(), m_size);
101  if (writtenSize != m_size) {
102  std::cerr << "Error in event serialisation, copied " << writtenSize << " instead of " << m_size << " words" << std::endl;
104  }
105 
107  }

Member Function Documentation

◆ blob()

const std::unique_ptr<uint32_t[]>& WriteEvent::blob ( ) const
inline

Definition at line 109 of file trigbs_orderedMerge.cxx.

109 {return m_blob;}

◆ frag()

const eformat::write::FullEventFragment& WriteEvent::frag ( ) const
inline

Definition at line 110 of file trigbs_orderedMerge.cxx.

110 {return m_frag;}

◆ size()

uint32_t WriteEvent::size ( ) const
inline

Definition at line 111 of file trigbs_orderedMerge.cxx.

111 {return m_size;}

◆ status()

Status WriteEvent::status ( ) const
inline

Definition at line 108 of file trigbs_orderedMerge.cxx.

108 {return m_status;}

Member Data Documentation

◆ m_blob

std::unique_ptr<uint32_t[]> WriteEvent::m_blob
private

Definition at line 56 of file trigbs_orderedMerge.cxx.

◆ m_frag

eformat::write::FullEventFragment WriteEvent::m_frag
private

Definition at line 57 of file trigbs_orderedMerge.cxx.

◆ m_robBlobs

std::vector<std::unique_ptr<uint32_t[]> > WriteEvent::m_robBlobs
private

Definition at line 59 of file trigbs_orderedMerge.cxx.

◆ m_robs

std::vector<eformat::write::ROBFragment> WriteEvent::m_robs
private

Definition at line 58 of file trigbs_orderedMerge.cxx.

◆ m_size

uint32_t WriteEvent::m_size {0}
private

Definition at line 60 of file trigbs_orderedMerge.cxx.

◆ m_status

Status WriteEvent::m_status {Status::NOT_OK}
private

Definition at line 55 of file trigbs_orderedMerge.cxx.


The documentation for this class was generated from the following file:
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
WriteEvent::Status::OK
@ OK
WriteEvent::Status::NOT_OK
@ NOT_OK
trigbs_truncateEvents.readEvent
def readEvent(file)
Definition: trigbs_truncateEvents.py:10
WriteEvent::m_size
uint32_t m_size
Definition: trigbs_orderedMerge.cxx:60
WriteEvent::m_robs
std::vector< eformat::write::ROBFragment > m_robs
Definition: trigbs_orderedMerge.cxx:58
WriteEvent::m_frag
eformat::write::FullEventFragment m_frag
Definition: trigbs_orderedMerge.cxx:57
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment
eformat::ROBFragment< PointerType > ROBFragment
Definition: RawEvent.h:27
WriteEvent::m_blob
std::unique_ptr< uint32_t[]> m_blob
Definition: trigbs_orderedMerge.cxx:56
WriteEvent::m_status
Status m_status
Definition: trigbs_orderedMerge.cxx:55
WriteEvent::m_robBlobs
std::vector< std::unique_ptr< uint32_t[]> > m_robBlobs
Definition: trigbs_orderedMerge.cxx:59
top
@ top
Definition: TruthClasses.h:64
calibdata.copy
bool copy
Definition: calibdata.py:27