Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
MicromegasRawDataEvaluation.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file MicromegasRawDataEvaluation.h
1
#ifndef MICROMEGAS_MicromegasRawDataEvaluation_H
2
#define MICROMEGAS_MicromegasRawDataEvaluation_H
3
9
#include "
MicromegasCalibrationData.h
"
10
#include "
MicromegasMapping.h
"
11
12
#include <
fun4all/SubsysReco.h
>
13
#include <
phool/PHObject.h
>
14
15
#include <TTree.h>
16
17
#include <map>
18
#include <memory>
19
#include <string>
20
#include <utility>
21
22
class
PHCompositeNode
;
23
class
TFile;
24
class
TH1;
25
class
TH2;
26
class
TProfile;
27
29
class
MicromegasRawDataEvaluation
:
public
SubsysReco
30
{
31
public
:
32
34
MicromegasRawDataEvaluation
(
const
std::string
&
name
=
"MicromegasRawDataEvaluation"
);
35
37
int
Init
(
PHCompositeNode
*)
override
;
38
40
int
InitRun
(
PHCompositeNode
*)
override
;
41
43
int
process_event
(
PHCompositeNode
*)
override
;
44
46
int
End
(
PHCompositeNode
*)
override
;
47
49
void
set_calibration_file
(
const
std::string
&
value
) {
m_calibration_filename
=
value
; }
50
52
void
set_n_sigma
(
double
value
) {
m_n_sigma
=
value
; }
53
55
56
void
set_min_adc
(
double
value
) {
m_min_adc
=
value
; }
57
59
void
set_sample_min
(
int
value
) {
m_sample_min
=
value
; }
60
62
void
set_sample_max
(
int
value
) {
m_sample_max
=
value
; }
63
65
void
set_evaluation_outputfile
(
const
std::string
&outputfile) {
m_evaluation_filename
= outputfile;}
66
67
class
Sample
68
{
69
public
:
71
unsigned
int
packet_id
= 0;
72
74
uint64_t
lvl1_bco
= 0;
75
77
unsigned
int
fee_bco
= 0;
78
80
unsigned
int
checksum
= 0;
81
unsigned
int
checksum_error
= 0;
82
84
unsigned
short
fee_id
= 0;
85
unsigned
short
layer
= 0;
86
unsigned
short
tile
= 0;
87
89
unsigned
short
sampa_address
= 0;
90
unsigned
short
sampa_channel
= 0;
91
93
unsigned
short
channel
= 0;
94
96
unsigned
short
strip
= 0;
97
98
unsigned
short
sample
= 0;
99
unsigned
short
adc
= 0;
100
101
double
pedestal
= 0;
102
double
rms
= 0;
103
104
using
List
= std::vector<Sample>;
105
};
106
111
class
Waveform
112
{
113
public
:
115
unsigned
int
packet_id
= 0;
116
118
uint64_t
lvl1_bco
= 0;
119
121
unsigned
int
fee_bco
= 0;
122
124
unsigned
int
checksum
= 0;
125
unsigned
int
checksum_error
= 0;
126
128
unsigned
short
fee_id
= 0;
129
unsigned
short
layer
= 0;
130
unsigned
short
tile
= 0;
131
133
unsigned
short
sampa_address
= 0;
134
unsigned
short
sampa_channel
= 0;
135
137
unsigned
short
channel
= 0;
138
140
unsigned
short
strip
= 0;
141
142
unsigned
short
sample_max
= 0;
143
unsigned
short
adc_max
= 0;
144
145
double
pedestal
= 0;
146
double
rms
= 0;
147
148
bool
is_signal
=
false
;
149
151
Waveform
() =
default
;
152
154
Waveform
(
const
Sample
& sample )
155
{
copy_from
( sample ); }
156
158
void
copy_from
(
const
Sample
& );
159
160
using
List
= std::vector<Waveform>;
161
};
162
163
164
class
Container
:
public
PHObject
165
{
166
public
:
167
void
Reset
();
168
169
// number of taggers for each packet
170
std::vector<int>
n_tagger
;
171
172
// number of waveform for each packet
173
std::vector<int>
n_waveform
;
174
175
Waveform::List
waveforms
;
176
Sample::List
samples
;
177
178
// bco for this event
179
std::vector<uint64_t>
lvl1_bco_list
;
180
181
// lvl1 count for this event
182
std::vector<uint32_t>
lvl1_count_list
;
183
184
ClassDef(
Container
,1)
185
};
186
187
private
:
188
190
std::string
m_calibration_filename
=
"TPOT_Pedestal_000.root"
;
191
193
MicromegasCalibrationData
m_calibration_data
;
194
196
MicromegasMapping
m_mapping
;
197
199
double
m_n_sigma
= 5;
200
202
/* This removes faulty channels for which calibration has failed */
203
double
m_min_adc
= 50;
204
206
int
m_sample_min
= 0;
207
209
int
m_sample_max
= 100;
210
212
std::string
m_evaluation_filename
=
"MicromegasRawDataEvaluation.root"
;
213
std::unique_ptr<TFile>
m_evaluation_file
;
214
216
TTree*
m_evaluation_tree
=
nullptr
;
217
219
Container
*
m_container
=
nullptr
;
220
222
using
bco_matching_pair_t
= std::pair<unsigned int, uint64_t>;
223
225
using
fee_bco_matching_map_t
= std::map<unsigned short, bco_matching_pair_t>;
226
fee_bco_matching_map_t
m_fee_bco_matching_map
;
227
229
230
using
bco_map_t
= std::map<uint64_t,unsigned int>;
231
bco_map_t
m_bco_map
;
232
233
};
234
235
#endif
coresoftware
blob
master
offline
packages
micromegas
MicromegasRawDataEvaluation.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:07
using
1.8.2 with
sPHENIX GitHub integration