BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnZDCRaw2Digit.h
Go to the documentation of this file.
1#ifndef BMNZDCRAW2DIGIT_H
2#define BMNZDCRAW2DIGIT_H
3
4#include "BmnADCDigit.h"
5#include "BmnSyncDigit.h"
6#include "BmnTDCDigit.h"
7#include "BmnZDCDigit.h"
8#include "Riostream.h"
9#include "TClonesArray.h"
10#include "TH1F.h"
11#include "TMinuit.h"
12#include "TProfile.h"
13#include "TString.h"
14
15#include <UniRun.h>
16#include <cstdlib>
17#include <iostream>
18
19#define MAX_EVENTS 10000
20#define MAX_CHANNELS 112
21#define MAX_LOG_CHANNELS 16
22
24
26{
27 public:
29 {
30 id = chan = adc_chan = size = x = y = -1;
31 used = 0;
32 };
33 void set(unsigned long v1,
34 unsigned char v2,
35 unsigned char v3,
36 unsigned char v4,
37 unsigned char v5,
38 unsigned char v6,
39 unsigned char v7,
40 float v8,
41 float v9)
42 {
43 id = v1;
44 chan = v2;
45 adc_chan = v3;
46 size = v4;
47 ix = v5;
48 iy = v6;
49 used = v7;
50 x = v8;
51 y = v9;
52 };
53 unsigned long id;
54 unsigned char chan;
55 unsigned char adc_chan;
56 unsigned char size;
57 unsigned char ix;
58 unsigned char iy;
59 unsigned char used;
60 float x;
61 float y;
62};
63
65{
66 public:
68 Int_t run,
69 TString mappingFile,
70 TString calibrationFile = "",
71 TString MaxPositionFile = "");
73
74 virtual ~BmnZDCRaw2Digit();
75
76 void print();
77
78 void setParStep(Float_t p) { pstep = p; };
79 Float_t getParStep() { return pstep; };
80
81 void setParStart(Float_t p) { pstart = p; };
82 Float_t getParStart() { return pstart; };
83
84 void setThreshold(Float_t t) { thres = t; };
85 Float_t getThreshold() { return thres; };
86
89
90 void setError(Float_t s) { sigma_amp = s; };
91 Float_t getError() { return sigma_amp; };
92
95
96 void setType(Int_t t) { wave2amp_flag = t; };
98
101
104
105 void setUseMeanXY(Int_t u) { use_meanxy = u; };
107
110
111 void FillEvent(TClonesArray* data, TClonesArray* zdcdigit);
112
113 void fillAmplitudes(TClonesArray* data);
114
115 int fillCalibrateCluster(TClonesArray* data, Float_t x, Float_t y, Float_t e, Int_t clsize);
116
118
120
121 void fillSampleProfiles(TClonesArray* data, Float_t x, Float_t y, Float_t e, Int_t clsize);
122
124
125 void calibrate();
126
127 void drawzdc(int nohist = 0);
128
129 void drawprof();
130
131 void drawtest();
132
133 float getAmp(int zch)
134 {
135 if (zch < MAX_CHANNELS)
136 return zdc_amp[zch];
137 else
138 return -1.;
139 };
140
141 float getLogAmp(int lch)
142 {
143 if (lch < MAX_LOG_CHANNELS)
144 return log_amp[lch];
145 else
146 return -1.;
147 };
148
149 int getLogId(int lch)
150 {
151 if (lch < MAX_LOG_CHANNELS)
152 return test_id[lch];
153 else
154 return -1;
155 };
156
157 int getLogChan(int lch)
158 {
159 if (lch < MAX_LOG_CHANNELS)
160 return test_chan[lch];
161 else
162 return -1;
163 };
164
165 // void fcn(Int_t& npar, Double_t *gin, Double_t& f, Double_t *par, Int_t iflag);
166
167 private:
168 int digiPar[6];
169 // char filname_base[256];
172 float cell_size[10];
173 int n_rec;
174 float thres;
184 float x_min, y_min;
185 float x_max, y_max;
186 float pstart, pstep;
188 // int use_log_function;
189 // static int nevents;
190
191 // static float amp_array[MAX_EVENTS][MAX_CHANNELS];
192 // static float profile_amp[MAX_EVENTS][MAX_CHANNELS];
193 // static float profile_err[MAX_EVENTS][MAX_CHANNELS];
204
205 void cellWeight(int ievent);
206 // static void fcn1(Int_t& npar, Double_t *gin, Double_t& f, Double_t *par, Int_t iflag);
207 double ch(double x, double r);
208 double sh(double x, double r);
209 double PP1(double x, double h);
210 double PP2(double x, double h);
211 double shower(double x, double h);
212 float wave2amp(UChar_t ns,
213 vector<Short_t>& scale,
214 Float_t* p,
215 Float_t* sigMin,
216 Float_t* sigMax,
217 Float_t* sigPed,
218 Float_t* sigInt);
219 float testwave2amp(UChar_t ns, vector<Short_t>& scale, Float_t* p);
225 int is_test[256];
233
235};
236#endif /* BMNZDCRAW2DIGIT_H */
__m128 m
Definition P4_F32vec4.h:27
int Int_t
unsigned char UChar_t
unsigned int UInt_t
float Float_t
#define ClassDef(name, id)
int index[MAX_CHANNELS]
int channel1[MAX_CHANNELS]
int fillCalibrateCluster(TClonesArray *data, Float_t x, Float_t y, Float_t e, Int_t clsize)
float wave2amp(UChar_t ns, vector< Short_t > &scale, Float_t *p, Float_t *sigMin, Float_t *sigMax, Float_t *sigPed, Float_t *sigInt)
void setEnergy(Float_t e)
float cale[MAX_CHANNELS]
TH1F * htest[MAX_LOG_CHANNELS]
Float_t getParStart()
void setThreshold(Float_t t)
void setPedSamples(Int_t p)
UInt_t test_id[MAX_LOG_CHANNELS]
BmnZDCRaw2Digit(Int_t period, Int_t run, TString mappingFile, TString calibrationFile="", TString MaxPositionFile="")
void setParStart(Float_t p)
float cal[MAX_CHANNELS]
double ch(double x, double r)
Float_t getThreshold()
float getLogAmp(int lch)
TProfile * TestProf[MAX_LOG_CHANNELS]
void FillEvent(TClonesArray *data, TClonesArray *zdcdigit)
void cellWeight(int ievent)
void drawzdc(int nohist=0)
float cal_out[MAX_CHANNELS]
double shower(double x, double h)
void setError(Float_t s)
int getLogChan(int lch)
Bmn_ZDC_map_element zdc_map_element[256]
void fillSampleProfilesAll(TClonesArray *data, Float_t x, Float_t y, Float_t e)
int number[MAX_CHANNELS]
int fillCalibrateAll(TClonesArray *data, Float_t x, Float_t y, Float_t e)
TProfile * SampleProf[MAX_CHANNELS]
double PP2(double x, double h)
void setMinSamples(Int_t m)
float testwave2amp(UChar_t ns, vector< Short_t > &scale, Float_t *p)
float getAmp(int zch)
double sh(double x, double r)
void setNorm(Float_t n)
float log_amp[MAX_LOG_CHANNELS]
void setParStep(Float_t p)
int test_chan[MAX_LOG_CHANNELS]
int fillCalibrateNumbers(TClonesArray *data, Float_t x, Float_t y, Float_t e, Int_t ncells, Int_t *numbers)
float cale_out[MAX_CHANNELS]
void setUseMeanXY(Int_t u)
int channel0[MAX_CHANNELS]
int getLogId(int lch)
void fillSampleProfiles(TClonesArray *data, Float_t x, Float_t y, Float_t e, Int_t clsize)
float zdc_amp[MAX_CHANNELS]
void fillAmplitudes(TClonesArray *data)
void setType(Int_t t)
void setLogFunction(Int_t u)
double PP1(double x, double h)
void set(unsigned long v1, unsigned char v2, unsigned char v3, unsigned char v4, unsigned char v5, unsigned char v6, unsigned char v7, float v8, float v9)
unsigned char adc_chan
static int use_log_function
static int use_log_function
#define MAX_LOG_CHANNELS
#define MAX_CHANNELS
*brief user defined string literal for JSON values *sa std::size_t n
Definition json.hpp:20362