CbmRoot
Loading...
Searching...
No Matches
event_data_struct.h
Go to the documentation of this file.
1
/* Copyright (C) 2021 Institute for Nuclear Research, Moscow
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Nikolay Karpushkin [committer] */
4
5
#ifndef EVENT_DATA_STRUCT
6
#define EVENT_DATA_STRUCT
7
8
#include <TMath.h>
9
#include <TObject.h>
10
#include <TString.h>
11
#include <TTree.h>
12
13
#include <fstream>
14
15
16
//data processed from waveform
17
struct
event_data_struct
{
18
19
Float_t
EdepFPGA
;
20
Float_t
EdepWfm
;
21
Float_t
Ampl
;
22
Float_t
Minimum
;
23
Float_t
ZL
;
24
Float_t
Time
;
25
Int_t
TimeMax
;
26
Float_t
TimeHalf
;
27
Float_t
TimeInEvent
;
28
29
Float_t
FitEdep
;
30
Float_t
FitAmpl
;
31
Float_t
FitZL
;
32
Float_t
FitR2
;
33
Float_t
FitTimeMax
;
34
35
ULong64_t
EventTime
;
36
37
38
void
reset
()
39
{
40
EdepFPGA
= 0.;
41
EdepWfm
= 0.;
42
Ampl
= 0.;
43
Minimum
= 0.;
44
ZL
= 0.;
45
Time
= 0.;
46
TimeMax
= -1;
47
TimeHalf
= -1.;
48
TimeInEvent
= -1.;
49
50
FitEdep
= 0.;
51
FitAmpl
= 0.;
52
FitZL
= 0.;
53
FitR2
= 999.;
54
FitTimeMax
= -1.;
55
56
EventTime
= 0;
57
}
58
59
void
Print
()
60
{
61
printf(
"[EdepFPGA %.0f; EdepWfm %.0f; Ampl %.0f; Minumum %.0f; ZL %.2f; Time %.2f; TimeMax %i; TimeHalf %.2f; "
62
"TimeInEvent %.2f; FitEdep %.2f; FitAmpl %.2f; FitZL %.2f; FitR2 %.2f; FitTimeMax %.2f; EventTime %llu]"
,
63
EdepFPGA
,
EdepWfm
,
Ampl
,
Minimum
,
ZL
,
Time
,
TimeMax
,
TimeHalf
,
TimeInEvent
,
FitEdep
,
FitAmpl
,
FitZL
,
FitR2
,
64
FitTimeMax
,
EventTime
);
65
}
66
67
static
TString
GetChName
(Int_t channel_num) {
return
TString::Format(
"channel_%i"
, channel_num); }
68
69
TBranch*
CreateBranch
(TTree* tree, Int_t channel_num)
70
{
71
return
tree->Branch(
GetChName
(channel_num).Data(),
this
,
72
"EdepFPGA/F:EdepWfm/F:Ampl/F:Minimum/F:ZL/F:Time/F:TimeMax/I:TimeHalf/F:TimeInEvent/F:FitEdep/"
73
"F:FitAmpl/F:FitZL/F:FitR2/F:FitTimeMax/F:EventTime/l"
);
74
}
75
76
77
Int_t
SetBranch
(TTree* tree, Int_t channel_num)
78
{
79
return
tree->SetBranchAddress(
GetChName
(channel_num).Data(),
this
);
80
}
81
};
82
83
84
#endif
// EVENT_DATA_STRUCT
event_data_struct
Definition
event_data_struct.h:17
event_data_struct::EventTime
ULong64_t EventTime
Definition
event_data_struct.h:35
event_data_struct::GetChName
static TString GetChName(Int_t channel_num)
Definition
event_data_struct.h:67
event_data_struct::Ampl
Float_t Ampl
Definition
event_data_struct.h:21
event_data_struct::TimeInEvent
Float_t TimeInEvent
Definition
event_data_struct.h:27
event_data_struct::ZL
Float_t ZL
Definition
event_data_struct.h:23
event_data_struct::reset
void reset()
Definition
event_data_struct.h:38
event_data_struct::FitTimeMax
Float_t FitTimeMax
Definition
event_data_struct.h:33
event_data_struct::FitEdep
Float_t FitEdep
Definition
event_data_struct.h:29
event_data_struct::Print
void Print()
Definition
event_data_struct.h:59
event_data_struct::TimeMax
Int_t TimeMax
Definition
event_data_struct.h:25
event_data_struct::SetBranch
Int_t SetBranch(TTree *tree, Int_t channel_num)
Definition
event_data_struct.h:77
event_data_struct::EdepWfm
Float_t EdepWfm
Definition
event_data_struct.h:20
event_data_struct::FitAmpl
Float_t FitAmpl
Definition
event_data_struct.h:30
event_data_struct::TimeHalf
Float_t TimeHalf
Definition
event_data_struct.h:26
event_data_struct::Time
Float_t Time
Definition
event_data_struct.h:24
event_data_struct::Minimum
Float_t Minimum
Definition
event_data_struct.h:22
event_data_struct::FitR2
Float_t FitR2
Definition
event_data_struct.h:32
event_data_struct::EdepFPGA
Float_t EdepFPGA
Definition
event_data_struct.h:19
event_data_struct::CreateBranch
TBranch * CreateBranch(TTree *tree, Int_t channel_num)
Definition
event_data_struct.h:69
event_data_struct::FitZL
Float_t FitZL
Definition
event_data_struct.h:31
macro
psd
event_data_struct.h
Generated on Mon Feb 3 2025 23:03:53 for CbmRoot by
1.12.0