R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BNeulandTacquilaReader.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 "
R3BNeulandTacquilaReader.h
"
15
#include "FairLogger.h"
16
#include "FairRootManager.h"
17
#include "
R3BNeulandTacquilaMappedData.h
"
18
#include "TClonesArray.h"
19
#include "ext_data_struct_info.hh"
20
21
extern
"C"
22
{
23
#include "ext_data_client.h"
24
#include "ext_h101_raw_nnp_tacquila.h"
25
}
26
27
R3BNeulandTacquilaReader::R3BNeulandTacquilaReader
(
EXT_STR_h101_raw_nnp_tacquila
* data, UInt_t offset)
28
:
R3BReader
(
"R3BNeulandTacquilaReader"
)
29
,
fNEvent
(0)
30
,
fData
(data)
31
,
fOffset
(offset)
32
,
fLogger
(FairLogger::GetLogger())
33
,
fArray
(new TClonesArray(
"R3BNeulandTacquilaMappedData"
))
34
{
35
}
36
37
R3BNeulandTacquilaReader::~R3BNeulandTacquilaReader
() {}
38
39
auto
R3BNeulandTacquilaReader::Init
(ext_data_struct_info* a_struct_info) ->
bool
40
{
41
// Initialize input UCESB structure
42
Int_t ok;
43
EXT_STR_h101_raw_nnp_tacquila_ITEMS_INFO(ok, *a_struct_info,
fOffset
,
EXT_STR_h101_raw_nnp_tacquila
, 1);
44
if
(!ok)
45
{
46
// Throw error
47
perror(
"ext_data_struct_info_item"
);
48
LOG(error) <<
"Failed to setup structure information."
;
49
return
kFALSE;
50
}
51
52
// Register output array in tree
53
FairRootManager::Instance()->Register(
"NeulandTacquilaMappedData"
,
"Neuland"
,
fArray
, kTRUE);
54
55
return
kTRUE;
56
}
57
58
Bool_t
R3BNeulandTacquilaReader::R3BRead
()
59
{
60
// Convert plain raw data to multi-dimensional array
61
auto
* data =
reinterpret_cast<
EXT_STR_h101_raw_nnp_tacquila_onion*
>
(
fData
);
62
63
// Loop over all planes, bars and PMT's
64
Int_t bar;
65
Int_t barId;
66
for
(Int_t p = 0; p < 8; p++)
67
{
68
for
(Int_t pmt = 0; pmt < 2; pmt++)
69
{
70
for
(Int_t k = 0; k < data->NNP[p]._[pmt]._; k++)
71
{
72
// Signal channel
73
UInt_t tdc1 = data->NNP[p]._[pmt].TAC[k];
74
UInt_t clock1 = data->NNP[p]._[pmt].CLK[k];
75
UInt_t qdc = data->NNP[p]._[pmt].ADC[k];
76
77
// Stop signal (17-th channel)
78
UInt_t tdc2 = data->NNP[p]._[pmt].T[k];
79
// UInt_t clock2 = data->NNP[p]._[pmt].S[k];
80
81
bar = data->NNP[p]._[pmt].I[k];
82
83
// Calculate global bar index
84
barId = p * 50 + bar;
85
86
// Store data in output
87
if
(tdc1 && tdc2)
88
{
89
new
((*fArray)[
fArray
->GetEntriesFast()])
90
R3BNeulandTacquilaMappedData
(63 - clock1, 4095 - tdc1, 4095 - tdc2, qdc, p + 1, bar, pmt + 1);
91
}
92
}
93
}
94
}
95
96
fNEvent
+= 1;
97
98
return
kTRUE;
99
}
100
101
void
R3BNeulandTacquilaReader::Reset
()
102
{
103
// Reset the output array
104
fArray
->Clear();
105
}
106
107
ClassImp
(
R3BNeulandTacquilaReader
)
ClassImp
ClassImp(R3B::Neuland::Cal2HitPar)
R3BNeulandTacquilaMappedData.h
R3BNeulandTacquilaReader.h
EXT_STR_h101_raw_nnp_tacquila
struct EXT_STR_h101_raw_nnp_tacquila_t EXT_STR_h101_raw_nnp_tacquila
Definition
R3BNeulandTacquilaReader.h:24
R3BNeulandTacquilaMappedData::R3BNeulandTacquilaMappedData
R3BNeulandTacquilaMappedData()=default
R3BNeulandTacquilaReader
A reader of NeuLAND Tacquila data with UCESB.
Definition
R3BNeulandTacquilaReader.h:35
R3BNeulandTacquilaReader::~R3BNeulandTacquilaReader
~R3BNeulandTacquilaReader()
Destructor.
Definition
R3BNeulandTacquilaReader.cxx:37
R3BNeulandTacquilaReader::fLogger
FairLogger * fLogger
FairLogger.
Definition
R3BNeulandTacquilaReader.h:74
R3BNeulandTacquilaReader::R3BNeulandTacquilaReader
R3BNeulandTacquilaReader(EXT_STR_h101_raw_nnp_tacquila *data, UInt_t)
Standard constructor.
Definition
R3BNeulandTacquilaReader.cxx:27
R3BNeulandTacquilaReader::fArray
TClonesArray * fArray
Output array.
Definition
R3BNeulandTacquilaReader.h:75
R3BNeulandTacquilaReader::Reset
void Reset() override
Method for clearing the output array.
Definition
R3BNeulandTacquilaReader.cxx:101
R3BNeulandTacquilaReader::fOffset
UInt_t fOffset
Definition
R3BNeulandTacquilaReader.h:73
R3BNeulandTacquilaReader::fData
EXT_STR_h101_raw_nnp_tacquila * fData
Reader specific data structure from ucesb.
Definition
R3BNeulandTacquilaReader.h:72
R3BNeulandTacquilaReader::Init
auto Init(ext_data_struct_info *info) -> bool override
Method for reader initialization.
Definition
R3BNeulandTacquilaReader.cxx:39
R3BNeulandTacquilaReader::fNEvent
UInt_t fNEvent
An event counter.
Definition
R3BNeulandTacquilaReader.h:71
R3BReader::R3BReader
R3BReader(TString const &)
Definition
R3BReader.cxx:16
R3BReader::R3BRead
virtual Bool_t R3BRead()=0
r3bsource
neuland
R3BNeulandTacquilaReader.cxx
Generated by
1.18.0