GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TTdrEvent.h
Go to the documentation of this file.
1#ifndef TTDREVENT_H
2#define TTDREVENT_H
3
4/** \addtogroup Sorting
5 * @{
6 */
7
8#include "Globals.h"
9
10#include "TRawEvent.h"
11
12/////////////////////////////////////////////////////////////////
13///
14/// \class TTdrEvent
15///
16/// C++ class representing one tdr file.
17///
18/////////////////////////////////////////////////////////////////
19
20/// TDR event
21
23 uint32_t fSequence; ///< within the file
24 uint16_t fStream; ///< data acquisition stream number (1-4)
25 uint16_t fTape; ///< =1
26 uint16_t fHeaderEndian; ///< written as native 1 by tape server
27 uint16_t fDataEndian; ///< written as native 1 in the hardware structure of the data following
28 uint32_t fDataLength; ///< length of data following in bytes
29};
30
31class TTdrEvent : public TRawEvent {
32public:
33 // houskeeping functions
34 TTdrEvent(); ///< default constructor
35 TTdrEvent(const TTdrEvent&); ///< copy constructor
36 ~TTdrEvent() override; ///< destructor
37 TTdrEvent& operator=(const TTdrEvent&); ///< assignement operator
38 void Clear(Option_t* opt = "") override; ///< clear event for reuse
39 void Copy(TObject&) const override; ///< copy helper
40 void Print(const char* option = "") const override; ///< show all event information
41
42 // get event information
43
44 uint32_t GetDataSize() const override; ///< return the event size
45
46 // helpers for event creation
47
48 TTdrEventHeader& GetHeader() { return fHeader; } ///< return pointer to the data buffer
49 char* GetData() override; ///< return pointer to the data buffer
50
51 void SetHeader(const char* buffer); ///< set an externally allocated header buffer
52 void SetData(const std::vector<char>& buffer); ///< set an externally allocated data buffer
53
54 int SwapBytes(bool) override; ///< convert event data between little-endian (Linux-x86) and big endian (MacOS-PPC)
55
56protected:
57 TTdrEventHeader fHeader; ///< event header
58 std::vector<char> fData; ///< event data buffer
59
60 /// \cond CLASSIMP
61 ClassDefOverride(TTdrEvent, 0) // All of the data contained in a Midas Event
62 /// \endcond
63};
64/*! @} */
65#endif // TTdrEvent.h
RAW event.
Definition TRawEvent.h:23
void Copy(TObject &) const override
copy helper
Definition TTdrEvent.cxx:25
void SetHeader(const char *buffer)
set an externally allocated header buffer
Definition TTdrEvent.cxx:58
void Clear(Option_t *opt="") override
clear event for reuse
Definition TTdrEvent.cxx:52
TTdrEventHeader fHeader
event header
Definition TTdrEvent.h:57
TTdrEvent & operator=(const TTdrEvent &)
assignement operator
Definition TTdrEvent.cxx:42
std::vector< char > fData
event data buffer
Definition TTdrEvent.h:58
uint32_t GetDataSize() const override
return the event size
Definition TTdrEvent.cxx:86
TTdrEvent()
default constructor
Definition TTdrEvent.cxx:19
void Print(const char *option="") const override
show all event information
Definition TTdrEvent.cxx:97
TTdrEventHeader & GetHeader()
return pointer to the data buffer
Definition TTdrEvent.h:48
void SetData(const std::vector< char > &buffer)
set an externally allocated data buffer
Definition TTdrEvent.cxx:78
int SwapBytes(bool) override
convert event data between little-endian (Linux-x86) and big endian (MacOS-PPC)
char * GetData() override
return pointer to the data buffer
Definition TTdrEvent.cxx:91
~TTdrEvent() override
destructor
Definition TTdrEvent.cxx:37
TDR event.
Definition TTdrEvent.h:22
uint16_t fTape
=1
Definition TTdrEvent.h:25
uint32_t fDataLength
length of data following in bytes
Definition TTdrEvent.h:28
uint16_t fHeaderEndian
written as native 1 by tape server
Definition TTdrEvent.h:26
uint32_t fSequence
within the file
Definition TTdrEvent.h:23
uint16_t fDataEndian
written as native 1 in the hardware structure of the data following
Definition TTdrEvent.h:27
uint16_t fStream
data acquisition stream number (1-4)
Definition TTdrEvent.h:24