R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BUnpackReader.cxx
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3
* Copyright (C) 2019-2025 Members of R3B Collaboration *
4
* *
5
* This software is distributed under the terms of the *
6
* GNU General Public Licence (GPL) version 3, *
7
* copied verbatim in the file "LICENSE". *
8
* *
9
* In applying this license GSI does not waive the privileges and immunities *
10
* granted to it by virtue of its status as an Intergovernmental Organization *
11
* or submit itself to any jurisdiction. *
12
******************************************************************************/
13
14
#include "FairRootManager.h"
15
#include "
R3BLogger.h
"
16
17
#include "
R3BEventHeader.h
"
18
#include "
R3BUnpackReader.h
"
19
20
extern
"C"
21
{
22
#include "ext_data_client.h"
23
#include "ext_h101_unpack.h"
24
}
25
#include <iostream>
26
27
R3BUnpackReader::R3BUnpackReader
(
EXT_STR_h101_unpack
* data,
size_t
offset)
28
:
R3BReader
(
"R3BUnpackReader"
)
29
,
fNEvent
(0)
30
,
fData
(data)
31
,
fOffset
(offset)
32
,
fHeader
(NULL)
33
{
34
}
35
36
Bool_t
R3BUnpackReader::Init
(ext_data_struct_info* a_struct_info)
37
{
38
Int_t ok;
39
R3BLOG
(info,
""
);
40
EXT_STR_h101_unpack_ITEMS_INFO(ok, *a_struct_info,
fOffset
,
EXT_STR_h101_unpack
, 0);
41
if
(!ok)
42
{
43
R3BLOG
(error,
"Failed to setup structure information."
);
44
return
kFALSE;
45
}
46
47
// Look for the R3BEventHeader
48
auto
frm = FairRootManager::Instance();
49
fHeader
=
dynamic_cast<
R3BEventHeader
*
>
(frm->GetObject(
"EventHeader."
));
50
if
(!
fHeader
)
51
{
52
R3BLOG
(warn,
"EventHeader. not found"
);
53
}
54
else
55
R3BLOG
(info,
"EventHeader. found"
);
56
57
return
kTRUE;
58
}
59
60
Bool_t
R3BUnpackReader::R3BRead
()
61
{
62
/* Display data */
63
// LOG(info) << " Event data:";
64
// char strMessage[1000];
65
// sprintf(strMessage, " %10d (d%10d): %2d\n",
66
// fData->EVENTNO,
67
// fData->EVENTNO - fNEvent,
68
// fData->TRIGGER);
69
// LOG(info) << strMessage;
70
71
// fNEvent = fData->EVENTNO;
72
73
if
(0 == (
fNEvent
% 1000))
74
{
75
R3BLOG
(debug1,
"event : "
<<
fNEvent
<<
", trigger : "
<<
fData
->TRIGGER);
76
}
77
78
if
(
fHeader
)
79
{
80
fHeader
->
SetTrigger
(
fData
->TRIGGER);
81
fHeader
->
SetEventno
(
fNEvent
++);
82
}
83
84
return
kTRUE;
85
}
86
87
void
R3BUnpackReader::Reset
() {}
88
89
ClassImp
(
R3BUnpackReader
)
R3BEventHeader.h
R3BLogger.h
R3BLOG
#define R3BLOG(severity, x)
Definition
R3BLogger.h:33
ClassImp
ClassImp(R3B::Neuland::Cal2HitPar)
R3BUnpackReader.h
EXT_STR_h101_unpack
struct EXT_STR_h101_unpack_t EXT_STR_h101_unpack
Definition
R3BUnpackReader.h:20
R3BEventHeader
Definition
R3BEventHeader.h:23
R3BEventHeader::SetTrigger
void SetTrigger(const int trigger)
Definition
R3BEventHeader.h:31
R3BEventHeader::SetEventno
void SetEventno(const uint64_t eventno)
Definition
R3BEventHeader.h:30
R3BReader::R3BReader
R3BReader(TString const &)
Definition
R3BReader.cxx:16
R3BUnpackReader
Definition
R3BUnpackReader.h:26
R3BUnpackReader::fOffset
size_t fOffset
Definition
R3BUnpackReader.h:45
R3BUnpackReader::fNEvent
uint64_t fNEvent
Definition
R3BUnpackReader.h:41
R3BUnpackReader::R3BRead
virtual Bool_t R3BRead() override
Definition
R3BUnpackReader.cxx:60
R3BUnpackReader::fHeader
R3BEventHeader * fHeader
Definition
R3BUnpackReader.h:47
R3BUnpackReader::fData
EXT_STR_h101_unpack * fData
Definition
R3BUnpackReader.h:43
R3BUnpackReader::R3BUnpackReader
R3BUnpackReader(EXT_STR_h101_unpack *, size_t)
Definition
R3BUnpackReader.cxx:27
R3BUnpackReader::Reset
virtual void Reset() override
Definition
R3BUnpackReader.cxx:87
R3BUnpackReader::Init
virtual Bool_t Init(ext_data_struct_info *) override
Definition
R3BUnpackReader.cxx:36
r3bsource
base
R3BUnpackReader.cxx
Generated by
1.18.0