Belle II Software  release-05-01-25
TrgEclDigitizer.cc
1 //---------------------------------------------------------------
2 // $Id$
3 //---------------------------------------------------------------
4 // Filename : TrgEclDigitizer.cc
5 // Section : TRG ECL
6 // Owner : InSoo Lee/Yuuji Unno
7 // Email : islee@hep.hanyang.ac.kr / yunno@post.kek.jp
8 //---------------------------------------------------------------
9 // Description : A class to represent TRG ECL
10 //---------------------------------------------------------------
11 // $Log$
12 // 2017-02-16 : v01
13 //---------------------------------------------------------------
14 #include <framework/datastore/StoreArray.h>
15 #include <framework/gearbox/Unit.h>
16 
17 #include <ecl/geometry/ECLGeometryPar.h>
18 #include <ecl/dataobjects/ECLSimHit.h>
19 #include <ecl/dataobjects/ECLHit.h>
20 
21 #include "trg/ecl/TrgEclDigitizer.h"
22 
23 
24 #include "trg//ecl/dataobjects/TRGECLDigi0.h"
25 #include "trg/ecl/dataobjects/TRGECLWaveform.h" // by shebalin
26 
27 #include <iostream>
28 #include <math.h>
29 #include <TRandom.h>
30 
31 using namespace std;
32 using namespace Belle2;
33 //using namespace TRG;
34 //
35 //
36 //
37 TrgEclDigitizer::TrgEclDigitizer(): TimeRange(0), _waveform(0), _FADC(1), _BeambkgTag(0)
38 {
39 
40  MatrixParallel.clear();
41  MatrixSerial.clear();
42 
43  _TCMap = new TrgEclMapping();
44  _DataBase = new TrgEclDataBase();
45 
46 
47  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
48  TCEnergy_tot[iTCIdm] = 0;
49  TCTiming_tot[iTCIdm] = 0;
50  for (int iTime = 0; iTime < 80; iTime++) {
51  TCEnergy[iTCIdm][iTime] = 0;
52  TCTiming[iTCIdm][iTime] = 0;
53  TCBkgContribution[iTCIdm][iTime] = 0;
54  TCSigContribution[iTCIdm][iTime] = 0;
55  TCBeambkgTag[iTCIdm][iTime] = 0;
56 
57  }
58 
59  for (int iii = 0; iii < 60 ; iii++) {
60  TCRawEnergy[iTCIdm][iii] = 0;
61  TCRawTiming[iTCIdm][iii] = 0;
62  TCRawBkgTag[iTCIdm][iii] = 0;
63  }
64  for (int iii = 0; iii < 64 ; iii++) {
65  WaveForm[iTCIdm][iii] = 0;
66  }
67  }
68 
69 
70 
71 }
72 //
73 //
74 //
76 {
77 
78  delete _TCMap;
79  delete _DataBase;
80 
81 }
82 //
83 //
84 //
85 
86 void
88 {
89  // prepare Matrix for Noise generation
90  //
91  _DataBase-> readNoiseLMatrix(MatrixParallel, MatrixSerial);
92  //
93  int TableFlag = 1;//1: ECLHit ,2: ECLSimHit
94  // initialize parameters
95  getTCHit(TableFlag);
96  //
97  //
98  //
99  return;
100 }
101 //
102 //
103 //
104 void
106 {
107 
108  std::vector< std::vector<float> > E_cell(8736, std::vector<float>(80, 0.0));
109  std::vector< std::vector<float> > T_ave(8736, std::vector<float>(80, 0.0));
110  std::vector< std::vector<float> > Tof_ave(8736, std::vector<float>(80, 0.0));
111  std::vector< std::vector<float> > beambkg_tag(8736, std::vector<float>(80, 0.0));
112 
113  int nBinTime = 80;
114  TimeRange = 4000; // -4us ~ 4us
116  // read Xtal data
117  //---------------------------------------------------------------------
118  if (TableFlag == 1) { // read ECLHit table
119  StoreArray<ECLHit> eclHitArray("ECLHits");
120  int nHits_hit = eclHitArray.getEntries() - 1;
121  //
122  for (int iHits = 0; iHits < nHits_hit; iHits++) {
123  // Get a hit
124  ECLHit* aECLHit = eclHitArray[iHits];
125  int beambkg = aECLHit->getBackgroundTag();
126 
127  // Hit geom. info
128  int hitCellId = aECLHit->getCellId() - 1;
129  float hitE = aECLHit->getEnergyDep() / Unit::GeV;
130  float aveT = aECLHit->getTimeAve(); // ns :time from IP to PD
131  if (aveT < - TimeRange || aveT > TimeRange) {continue;} //Choose - TimeRange ~ TimeTange
132  int TimeIndex = (int)((aveT + TimeRange) / 100); //Binning : -4000 = 1st bin ~ 4000 80th bin.
133 
134  int iTCIdm = _TCMap->getTCIdFromXtalId(hitCellId + 1) - 1;
135  TCEnergy[iTCIdm][TimeIndex] += hitE;
136  TCTiming[iTCIdm][TimeIndex] += hitE * aveT;
137  if (beambkg > 0) {TCBkgContribution[iTCIdm][TimeIndex] += hitE ;}
138  else if (beambkg == 0) {TCSigContribution[iTCIdm][TimeIndex] += hitE;}
139 
140  }
141  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
142  for (int iTime = 0; iTime < nBinTime; iTime++) {
143  if (TCEnergy[iTCIdm][iTime] < 1e-9) {continue;}// 0.01MeV cut
144  /* cppcheck-suppress variableScope */
145  double maxbkgE = 0;
146  /* cppcheck-suppress variableScope */
147  int maxbkgtag = 0;
148  TCTiming[iTCIdm][iTime] /= TCEnergy[iTCIdm][iTime];
149  if (_BeambkgTag == 1) {
150  if (TCBkgContribution[iTCIdm][iTime] < TCSigContribution[iTCIdm][iTime]) {
151  TCBeambkgTag[iTCIdm][iTime] = 0; //signal Tag : 0
152  } else {
153  for (int iXtalIdm = 0; iXtalIdm < 8736; iXtalIdm++) {
154  int iTCId = _TCMap->getTCIdFromXtalId(iXtalIdm + 1) - 1;
155  if (iTCIdm != iTCId) {continue;}
156  if (maxbkgE < E_cell[iXtalIdm][iTime]) {
157  maxbkgE = E_cell[iXtalIdm][iTime];
158  maxbkgtag = beambkg_tag[iXtalIdm][iTime];
159  }
160  }
161  TCBeambkgTag[iTCIdm][iTime] = maxbkgtag;
162  }
163  }
164  }
165  }
166  }
167 
168 
169  if (TableFlag == 2) { // read ECLSimHit
171  //=====================
172  // Loop over all hits of steps
173  //=====================
174  StoreArray<ECLSimHit> eclArray("ECLSimHits");
175  int nHits = eclArray.getEntries();
176  //
177  for (int iHits = 0; iHits < nHits; iHits++) {
178  // Get a hit
179  ECLSimHit* aECLSimHit = eclArray[iHits];
180 
181  int hitCellId = aECLSimHit->getCellId() - 1;
182  float hitE = aECLSimHit->getEnergyDep() / Unit::GeV;
183  float hitTOF = aECLSimHit->getFlightTime() / Unit::ns;
184 
185  G4ThreeVector t = aECLSimHit->getPosIn(); // [cm], Hit position in Xtal (based on from IP)
186  TVector3 HitInPos(t.x(), t.y(), t.z()); // = aECLSimHit->getPosIn(); // [cm], Hit position in Xtal (based on from IP)
187  TVector3 PosCell = eclp->GetCrystalPos(hitCellId);// [cm], Xtal position (based on from IP)
188  TVector3 VecCell = eclp->GetCrystalVec(hitCellId);
189  float local_pos_r = (15.0 - (HitInPos - PosCell) * VecCell);
190  if (hitTOF < - TimeRange || hitTOF > TimeRange) {continue;}
191  int TimeIndex = (int)((hitTOF + TimeRange) / 100);
192  E_cell[hitCellId][TimeIndex] = E_cell[hitCellId][TimeIndex] + hitE;
193  T_ave[hitCellId][TimeIndex] = T_ave[hitCellId][TimeIndex] + hitE * local_pos_r;
194  Tof_ave[hitCellId][TimeIndex] = Tof_ave[hitCellId][TimeIndex] + hitE * hitTOF;
195  }
196  //
197  //
198  //
199  //===============
200  // Xtal energy and timing (0-8us, 0.2us interval, 40 bins)
201  //===============
202  for (int iECLCell = 0; iECLCell < 8736; iECLCell++) {
203  for (int TimeIndex = 0; TimeIndex < nBinTime; TimeIndex++) {
204 
205  if (E_cell[iECLCell][TimeIndex] < 1e-9) {continue;} // 0.01MeV cut
206 
207  T_ave[iECLCell][TimeIndex] = T_ave[iECLCell][TimeIndex] / E_cell[iECLCell][TimeIndex];
208  T_ave[iECLCell][TimeIndex] =
209  6.05 +
210  0.0749 * T_ave[iECLCell][TimeIndex] -
211  0.00112 * T_ave[iECLCell][TimeIndex] * T_ave[iECLCell][TimeIndex];
212  Tof_ave[iECLCell][TimeIndex] = Tof_ave[iECLCell][TimeIndex] / E_cell[iECLCell][TimeIndex];
213 
214  } // 40bins, Time interval = 200ns
215  }
216  //
217  //
218  //
219 
220  for (int iXtalIdm = 0; iXtalIdm < 8736; iXtalIdm++) {
221  int iTCIdm = _TCMap->getTCIdFromXtalId(iXtalIdm + 1) - 1;
222  for (int iTime = 0; iTime < nBinTime; iTime++) {
223  if (E_cell[iXtalIdm][iTime] < 1e-9) {continue;} // 0.01MeV cut
224  TCEnergy[iTCIdm][iTime] += E_cell[iXtalIdm][iTime];
225  TCTiming[iTCIdm][iTime] += E_cell[iXtalIdm][iTime] * (T_ave[iXtalIdm][iTime]);
226  if (beambkg_tag[iXtalIdm][iTime] > 0) {TCBkgContribution[iTCIdm][iTime] += E_cell[iXtalIdm][iTime];}
227  if (beambkg_tag[iXtalIdm][iTime] == 0) {TCSigContribution[iTCIdm][iTime] += E_cell[iXtalIdm][iTime];}
228 
229  }
230  }
231  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
232  for (int iTime = 0; iTime < nBinTime; iTime++) {
233  /* cppcheck-suppress variableScope */
234  double maxbkgE = 0;
235  /* cppcheck-suppress variableScope */
236  int maxbkgtag = 0;
237  if (TCEnergy[iTCIdm][iTime] < 1e-9) {continue;} // 0.01MeV cut
238  TCTiming[iTCIdm][iTime] /= TCEnergy[iTCIdm][iTime];
239  if (_BeambkgTag == 1) {
240  if (TCBkgContribution[iTCIdm][iTime] < TCSigContribution[iTCIdm][iTime]) {
241  TCBeambkgTag[iTCIdm][iTime] = 0; //signal Tag : 0
242  } else {
243  for (int iXtalIdm = 0; iXtalIdm < 8736; iXtalIdm++) {
244  int iTCId = _TCMap->getTCIdFromXtalId(iXtalIdm + 1) - 1;
245  if (iTCIdm != iTCId) {continue;}
246  if (maxbkgE < E_cell[iXtalIdm][iTime]) {
247  maxbkgE = E_cell[iXtalIdm][iTime];
248  maxbkgtag = beambkg_tag[iXtalIdm][iTime];
249  }
250  }
251  TCBeambkgTag[iTCIdm][iTime] = maxbkgtag;
252  }
253  }
254  }
255 
256  }
257 
258  }
259 
260 
261 
262  //--------------------------
263  // TC energy and timing in t=0-1us as true values.
264  //--------------------------
265  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
266  for (int iTime = 40; iTime < 50; iTime++) {
267  TCEnergy_tot[iTCIdm] += TCEnergy[iTCIdm][iTime];
268  TCTiming_tot[iTCIdm] += TCTiming[iTCIdm][iTime] * TCEnergy[iTCIdm][iTime];
269  }
270  TCTiming_tot[iTCIdm] /= TCEnergy_tot[iTCIdm];
271 
272  }
273 
274 
275  return;
276 }
277 //
278 //
279 //
280 void
281 TrgEclDigitizer::digitization01(std::vector<std::vector<double>>& TCDigiE, std::vector<std::vector<double>>& TCDigiT)
282 {
283  TCDigiE.clear();
284  TCDigiE.resize(576, vector<double>(64 , 0));
285  TCDigiT.clear();
286  TCDigiT.resize(576, vector<double>(64 , 0));
287 
288  //
289  double cut_energy_tot = 0.03; // [GeV]
290  int nbin_pedestal = 4; // = nbin_pedestal*fam_sampling_interval [ns] in total
291  double fam_sampling_interval = 125; // [ns]
292  int NSampling = 64; // # of sampling array
293 
294 
295  std::vector< std::vector<float> > noise_pileup(576, std::vector<float>(64, 0.0)); // [GeV]
296  std::vector< std::vector<float> > noise_parallel(576, std::vector<float>(64, 0.0)); // [GeV]
297  std::vector< std::vector<float> > noise_serial(576, std::vector<float>(64, 0.0)); // [GeV]
298  std::vector<float> X_pr(64, 0.0);
299  std::vector<float> X_sr(64, 0.0);
300 
301 
302  // (Make sampling time random between FAM sampling intervals)
303  double random_sampling_correction = 0; // [ns]
304  random_sampling_correction = gRandom->Rndm() * fam_sampling_interval;
305  //==================
306  // (01)Signal digitization
307  //==================
308  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
309  if (TCEnergy_tot[iTCIdm] < cut_energy_tot) {continue;} // TC energy_tot cut
310  for (int iTimeBin = 0; iTimeBin < 80; iTimeBin++) {
311  if (TCEnergy[iTCIdm][iTimeBin] < 0.0001) {continue;} // 0.1MeV cut on TC bin_energy
312  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
313  // inputTiming is in [us] <-- Be careful, here is NOT [ns]
314  double inputTiming
315  = (-TCTiming[iTCIdm][iTimeBin] - TimeRange + (-nbin_pedestal + iSampling) * fam_sampling_interval) * 0.001;
316  inputTiming += random_sampling_correction * 0.001;
317  if (inputTiming < 0 || inputTiming > 2.0) {continue;} // Shaping in t0 ~t0+ 2.0 us
318  if (_FADC == 1) {
319 
320  TCDigiE[iTCIdm][iSampling] += interFADC(inputTiming) * TCEnergy[iTCIdm][iTimeBin];
321  } else {
322  TCDigiE[iTCIdm][iSampling] += SimplifiedFADC(0, inputTiming) * TCEnergy[iTCIdm][iTimeBin];
323  }
324  }
325 
326  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
327  TCDigiT[iTCIdm][iSampling] = (-nbin_pedestal + iSampling - TimeRange / fam_sampling_interval) * fam_sampling_interval;
328  TCDigiT[iTCIdm][iSampling] += random_sampling_correction;
329  }
330  }
331  }
332  //
333  //
334  //
335  if (0) {
336  FILE* f_out_dat = fopen("ztsim.no_noise.dat", "w");
337  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
338  if (TCEnergy_tot[iTCIdm] < cut_energy_tot) { continue; } // TC energy_tot cut
339  fprintf(f_out_dat, "%5i %8.5f %8.5f %8.1f ",
340  iTCIdm + 1, TCEnergy_tot[iTCIdm], TCEnergy[iTCIdm][0], TCDigiT[iTCIdm][0]);
341  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
342  fprintf(f_out_dat, "%7.4f ", TCDigiE[iTCIdm][iSampling]);
343  }
344  fprintf(f_out_dat, "\n");
345  }
346  fclose(f_out_dat);
347  }
348  //==================
349  // (01)noise embedding
350  //==================
351  double tmin_noise = -4; // orignal
352  double tgen = 10.3; // orignal
353  int bkg_level = 1030;
354  double ttt0 = 0; // [us]
355  /* cppcheck-suppress variableScope */
356  double ttt1 = 0; // [us]
357  /* cppcheck-suppress variableScope */
358  double ttt2 = 0; // [us]
359  //
360  double frac_pileup = 0.035; // pileup noise fraction?
361  double frac_parallel = 0.023; // parralel noise fraction?
362  double frac_serial = 0.055; // serial noise fraction?
363  double times_pileup = 1; // noise scale based on Belle noise.
364  double times_parallel = 3.15; // noise scale
365  double times_serial = 3.15; // noise scale
366 
367  double corr_pileup = times_pileup * frac_pileup * sqrt(fam_sampling_interval * 0.001);
368  double corr_parallel = times_parallel * frac_parallel * sqrt(fam_sampling_interval * 0.001);
369  double corr_serial = times_serial * frac_serial * sqrt(fam_sampling_interval * 0.001);
370 
371 
372  if (0) {
373  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
374  if (TCEnergy_tot[iTCIdm] < cut_energy_tot) { continue; } // TC energy_tot cut
375  for (int jjj = 0; jjj < bkg_level; jjj++) {
376  ttt0 = -(tmin_noise + tgen * gRandom->Rndm()); // [us]
377  ttt1 = -(tmin_noise + tgen * gRandom->Rndm()); // [us]
378  ttt2 = -(tmin_noise + tgen * gRandom->Rndm()); // [us]
379  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
380  // (pile-up noise)
381  if (ttt0 > 0) { TCDigiE[iTCIdm][iSampling] += SimplifiedFADC(0, ttt0) * corr_pileup * 0.001; }
382  // (parallel noise)
383  if (ttt1 > 0) { TCDigiE[iTCIdm][iSampling] += SimplifiedFADC(1, ttt1) * corr_parallel; }
384  // (serial noise)
385  if (ttt2 > 0) { TCDigiE[iTCIdm][iSampling] += SimplifiedFADC(2, ttt2) * corr_serial; }
386  ttt0 += fam_sampling_interval * 0.001;
387  ttt1 += fam_sampling_interval * 0.001;
388  ttt2 += fam_sampling_interval * 0.001;
389  }
390  }
391  }
392  }
393  if (1) { //use L Matrix
394  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
395 
396  if (TCEnergy_tot[iTCIdm] < cut_energy_tot) { continue; } // TC energy_tot cut
397 
398  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
399  X_pr[iSampling] = gRandom ->Gaus(0, 1);
400  X_sr[iSampling] = gRandom ->Gaus(0, 1);
401  }
402 
403  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
404  for (int jSampling = 0; jSampling < NSampling; jSampling++) {
405  noise_parallel[iTCIdm][iSampling] += 10 * corr_parallel * MatrixParallel[iSampling][jSampling] * X_pr[jSampling];
406  noise_serial[iTCIdm][iSampling] += 10 * corr_serial * MatrixSerial[iSampling][jSampling] * X_sr[jSampling];
407  }
408  }
409 
410  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
411 
412  TCDigiE[iTCIdm][iSampling] += noise_pileup[iTCIdm][iSampling] + noise_parallel[iTCIdm][iSampling] +
413  noise_serial[iTCIdm][iSampling];
414  }
415  }
416  if (0) {
417  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) { //Only Pile-up noise use old method.
418  if (TCEnergy_tot[iTCIdm] < cut_energy_tot) { continue; } // TC energy_tot cut
419  for (int jjj = 0; jjj < bkg_level; jjj++) {
420  ttt0 = -(tmin_noise + tgen * gRandom->Rndm()); // [us]
421  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
422  // (pile-up noise)
423  if (ttt0 > 0) { TCDigiE[iTCIdm][iSampling] += SimplifiedFADC(0, ttt0) * corr_pileup * 0.001; }
424  ttt0 += fam_sampling_interval * 0.001;
425  }
426  }
427  }
428  }
429  }
430 
431  if (_waveform == 1) {
432 
433  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
434  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
435  WaveForm[iTCIdm][iSampling] = TCDigiE[iTCIdm][iSampling];
436  }
437 
438  }
439  }
440 
441 }
442 void
443 TrgEclDigitizer::digitization02(std::vector<std::vector<double>>& TCDigiE, std::vector<std::vector<double>>& TCDigiT)
444 {
445  //===============
446  // (03)Signal digitization (w/ 12ns interval for method-0)
447  //===============
448  TCDigiE.clear();
449  TCDigiE.resize(576, vector<double>(666 , 0));
450  TCDigiT.clear();
451  TCDigiT.resize(576, vector<double>(666 , 0));
452  double cut_energy_tot = 0.03; // [GeV]
453  int nbin_pedestal = 100;
454  float fam_sampling_interval = 12; // [ns]
455 
456  std::vector< std::vector<float> > TCDigiEnergy(576, std::vector<float>(666, 0.0)); // [GeV]
457  std::vector< std::vector<float> > TCDigiTiming(576, std::vector<float>(666, 0.0)); // [ns]
458  int NSampling = 666;
459 
460  // Make sampling time random between FAM sampling intervals
461  float random_sampling_correction = 0; // [ns]
462  random_sampling_correction = gRandom->Rndm() * fam_sampling_interval;
463  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
464  if (TCEnergy_tot[iTCIdm] < cut_energy_tot) {continue;} // TC energy_tot cut
465  for (int iTimeBin = 0; iTimeBin < 80; iTimeBin++) {
466  if (TCEnergy[iTCIdm][iTimeBin] < 0.0001) { continue; } // 0.1 MeV cut on TC bin_energy
467  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
468  // inputTiming is in [us] <-- Be careful, here is NOT [ns]
469  float inputTiming
470  = (-TCTiming[iTCIdm][iTimeBin] - TimeRange + (-nbin_pedestal + iSampling) * fam_sampling_interval) * 0.001;
471 
472  inputTiming += random_sampling_correction * 0.001;
473  if (inputTiming < 0 || inputTiming > 2.0) {continue;} // Shaping in t0 ~t0+ 2.0 us
474 
475  TCDigiEnergy[iTCIdm][iSampling] += FADC(0, inputTiming) * TCEnergy[iTCIdm][iTimeBin];
476  }
477  }
478  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
479  TCDigiTiming[iTCIdm][iSampling] = (-nbin_pedestal + iSampling - TimeRange / fam_sampling_interval) * fam_sampling_interval;
480  TCDigiTiming[iTCIdm][iSampling] += random_sampling_correction;
481  }
482  }
483  //==================
484  // (03)noise embedding
485  //==================
486 
487  double tmin_noise = -4; // orignal
488  double tgen = 10.3; //
489  int bkg_level = 1030;
490  double ttt0 = 0; // [us]
491  double ttt1 = 0; // [us]
492  double ttt2 = 0; // [us]
493  double frac_pileup = 0.035; // pileup noise fraction?
494  double frac_parallel = 0.023; // parralel noise fraction?
495  double frac_serial = 0.055; // serial noise fraction?
496  double times_pileup = 1; // noise scale based on Belle noise.
497  double times_parallel = 1; // noise scale
498  double times_serial = 1; // noise scale
499  double corr_pileup = times_pileup * frac_pileup * sqrt(fam_sampling_interval * 0.001);
500  double corr_parallel = times_parallel * frac_parallel * sqrt(fam_sampling_interval * 0.001);
501  double corr_serial = times_serial * frac_serial * sqrt(fam_sampling_interval * 0.001);
502  corr_pileup = 0.011068;
503  corr_parallel = 0.00727324;
504  corr_serial = 0.0173925;
505 
506 
507  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
508  if (TCEnergy_tot[iTCIdm] < cut_energy_tot) { continue; } // 1 MeV TC energy cut
509  for (int jjj = 0; jjj < bkg_level; jjj++) {
510  ttt0 = -(tmin_noise + tgen * gRandom->Rndm()); // [us]
511  ttt1 = -(tmin_noise + tgen * gRandom->Rndm()); // [us]
512  ttt2 = -(tmin_noise + tgen * gRandom->Rndm()); // [us]
513  for (int iSampling = 0; iSampling < NSampling; iSampling++) {
514  // (pile-up noise)
515  if (ttt0 > 0) { TCDigiEnergy[iTCIdm][iSampling] += FADC(0, ttt0) * corr_pileup * 0.001; }
516  // (parallel noise)
517  if (ttt1 > 0) { TCDigiEnergy[iTCIdm][iSampling] += FADC(1, ttt1) * corr_parallel; }
518  // (serial noise)
519  if (ttt2 > 0) { TCDigiEnergy[iTCIdm][iSampling] += FADC(2, ttt2) * corr_serial; }
520  ttt0 += fam_sampling_interval * 0.001;
521  ttt1 += fam_sampling_interval * 0.001;
522  ttt2 += fam_sampling_interval * 0.001;
523  }
524  }
525  }
526 
527 }
528 //
529 //
530 //
531 void
533 {
534  //---------------
535  // Root Output
536  //---------------
537  int m_hitNum = 0;
538  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
539  for (int iBinTime = 0; iBinTime < 80; iBinTime++) {
540  if (TCEnergy[iTCIdm][iBinTime] < 0.001) {continue;}
541  StoreArray<TRGECLDigi0> TCDigiArray;
542  TCDigiArray.appendNew();
543  m_hitNum = TCDigiArray.getEntries() - 1;
544 
545  TCDigiArray[m_hitNum]->setEventId(m_nEvent);
546  TCDigiArray[m_hitNum]->setTCId(iTCIdm + 1);
547  TCDigiArray[m_hitNum]->setiBinTime(iBinTime);
548  TCDigiArray[m_hitNum]->setRawEnergy(TCEnergy[iTCIdm][iBinTime]);
549  TCDigiArray[m_hitNum]->setRawTiming(TCTiming[iTCIdm][iBinTime]);
550 
551  TCDigiArray[m_hitNum]->setBeamBkgTag(TCBeambkgTag[iTCIdm][iBinTime]);
552 
553  }
554  }
555 
556  if (_waveform == 1) {
557  StoreArray<TRGECLWaveform> TCWaveformArray;
558  for (int iTCIdm = 0; iTCIdm < 576; iTCIdm++) {
559  if (iTCIdm == 80) iTCIdm = 512; // skip barrel
560  int tc_phi_id = _TCMap->getTCPhiIdFromTCId(iTCIdm + 1);
561  int tc_theta_id = _TCMap->getTCThetaIdFromTCId(iTCIdm + 1);
562  TRGECLWaveform* newWf = TCWaveformArray.appendNew(iTCIdm + 1, WaveForm[iTCIdm]);
563  newWf->setThetaPhiIDs(tc_theta_id, tc_phi_id);
564  }
565 
566  }
567 
568 
569  return;
570 }
571 double
573 {
574 
575  std::vector<double> SignalAmp;
576  std::vector<double> SignalTime;
577 
578  SignalAmp.clear();
579  SignalTime.clear();
580 
581  timing = timing * 1000;
582  int startbin = (int)(timing) / 12;
583  int endbin = startbin + 1;
584 
585 
586  SignalAmp = { 0, 3.47505e-06, 0.000133173, 0.000939532, 0.00337321, 0.00845977, 0.0170396, 0.0296601, 0.0465713, 0.0677693, 0.0930545, 0.122086, 0.154429, 0.189595, 0.227068, 0.266331, 0.306882, 0.348243, 0.389971, 0.431664, 0.472959, 0.513539, 0.553127, 0.59149, 0.628431, 0.663791, 0.697445, 0.729297, 0.759281, 0.787354, 0.813494, 0.837698, 0.859982, 0.880372, 0.898908, 0.915639, 0.930622, 0.943919, 0.955598, 0.965731, 0.97439, 0.98165, 0.987587, 0.992275, 0.995788, 0.9982, 0.999581, 1, 0.999525, 0.998219, 0.996143, 0.993356, 0.989846, 0.985364, 0.979439, 0.971558, 0.961304, 0.948421, 0.932809, 0.914509, 0.893664, 0.870494, 0.845267, 0.818279, 0.789837, 0.76025, 0.729815, 0.698815, 0.667511, 0.636141, 0.604919, 0.574035, 0.543654, 0.513915, 0.484939, 0.456822, 0.429643, 0.403462, 0.378324, 0.354259, 0.331286, 0.309412, 0.288633, 0.26894, 0.250316, 0.232736, 0.216174, 0.200597, 0.185972, 0.172262, 0.159428, 0.147431, 0.136232, 0.12579, 0.116067, 0.107022, 0.0986191, 0.0908193, 0.0835871, 0.0768874, 0.0706867, 0.0649528, 0.0596551, 0.0547641, 0.0502523, 0.0460932, 0.042262, 0.0387353, 0.0354909, 0.0325082, 0.0297677, 0.0272511, 0.0249416, 0.0228232, 0.020881, 0.0191014, 0.0174714, 0.0159792, 0.0146138, 0.0133649, 0.012223, 0.0111793, 0.0102258, 0.00935504, 0.00856, 0.00783438, 0.00717232, 0.00656842, 0.00601773, 0.00551567, 0.00505807, 0.00464106, 0.00426114, 0.00391506, 0.00359985, 0.0033128, 0.00305143, 0.00281346, 0.00259681, 0.00239957, 0.00222002, 0.00205655, 0.00190773, 0.00177223, 0.00164885, 0.00153648, 0.00143413, 0.00134087, 0.00125589, 0.00117842, 0.00110777, 0.00104332, 0.000984488, 0.000930766, 0.000881678, 0.000836798, 0.000795734, 0.000758134, 0.000723677, 0.00069207, 0.000663051, 0.000636377, 0.000611832, 0.000589219, 0.000568358, 0.000549086, 0.000531258, 0.000514738, 0.000499407, 0.000485156, 0.000471884, 0.000459502, 0.00044793, 0.000437092, 0.000426923, 0.000417363, 0.000408356, 0.000399853, 0.000391811, 0.000384187, 0.000376946, 0.000370055, 0.000363483, 0.000357203, 0.000351192, 0.000345426, 0.000339886, 0.000334554, 0.000329413, 0.000324448, 0.000319645, 0.000314993, 0.000310481, 0.000306098, 0.000301836, 0.000297686, 0.00029364, 0.000289693, 0.000285837, 0.000282068, 0.00027838, 0.000274768, 0.000271229, 0.000267759, 0.000264354, 0.000261011, 0.000257727, 0.000254499, 0.000251326, 0.000248204, 0.000245132, 0.000242108, 0.000239131, 0.000236198, 0.000233308, 0.00023046, 0.000227653, 0.000224885, 0.000222155, 0.000219463, 0.000216807, 0.000214187, 0.000211602, 0.00020905, 0.000206532, 0.000204046, 0.000201593, 0.00019917, 0.000196779, 0.000194417, 0.000192085, 0.000189782, 0.000187508, 0.000185262, 0.000183044, 0.000180853, 0.000178689, 0.000176552, 0.000174441, 0.000172355, 0.000170295, 0.00016826, 0.000166249, 0.000164263, 0.000162301, };
587 
588  SignalTime = { 0, 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156, 168, 180, 192, 204, 216, 228, 240, 252, 264, 276, 288, 300, 312, 324, 336, 348, 360, 372, 384, 396, 408, 420, 432, 444, 456, 468, 480, 492, 504, 516, 528, 540, 552, 564, 576, 588, 600, 612, 624, 636, 648, 660, 672, 684, 696, 708, 720, 732, 744, 756, 768, 780, 792, 804, 816, 828, 840, 852, 864, 876, 888, 900, 912, 924, 936, 948, 960, 972, 984, 996, 1008, 1020, 1032, 1044, 1056, 1068, 1080, 1092, 1104, 1116, 1128, 1140, 1152, 1164, 1176, 1188, 1200, 1212, 1224, 1236, 1248, 1260, 1272, 1284, 1296, 1308, 1320, 1332, 1344, 1356, 1368, 1380, 1392, 1404, 1416, 1428, 1440, 1452, 1464, 1476, 1488, 1500, 1512, 1524, 1536, 1548, 1560, 1572, 1584, 1596, 1608, 1620, 1632, 1644, 1656, 1668, 1680, 1692, 1704, 1716, 1728, 1740, 1752, 1764, 1776, 1788, 1800, 1812, 1824, 1836, 1848, 1860, 1872, 1884, 1896, 1908, 1920, 1932, 1944, 1956, 1968, 1980, 1992, 2004, 2016, 2028, 2040, 2052, 2064, 2076, 2088, 2100, 2112, 2124, 2136, 2148, 2160, 2172, 2184, 2196, 2208, 2220, 2232, 2244, 2256, 2268, 2280, 2292, 2304, 2316, 2328, 2340, 2352, 2364, 2376, 2388, 2400, 2412, 2424, 2436, 2448, 2460, 2472, 2484, 2496, 2508, 2520, 2532, 2544, 2556, 2568, 2580, 2592, 2604, 2616, 2628, 2640, 2652, 2664, 2676, 2688, 2700, 2712, 2724, 2736, 2748, 2760, 2772, 2784, 2796, 2808, 2820, 2832, 2844, 2856, 2868, 2880, 2892, 2904, 2916, 2928, };
589 
590 
591  double E_out = 0;
592  if (timing < 0 || timing > 2928) {return E_out;}
593 
594  if (timing > SignalTime[startbin] && timing < SignalTime[endbin]) {
595  E_out = (((SignalAmp[endbin] - SignalAmp[startbin])) / (SignalTime[endbin] - SignalTime[startbin])) *
596  (timing - SignalTime[startbin]) + SignalAmp[startbin];
597  return E_out;
598  } else {
599  E_out = 0;
600  }
601 
602 
603  return E_out;
604 
605 }
606 //
607 //
608 //
609 double
611  double timing)
612 {
613 
614  //--------------------------------------
615  //
616  // o "timing" unit is [us]
617  // o flag_gen = 0(=signal), 1(=parallel), 2(=serial)
618  // o return value(PDF) is [GeV]
619  //
620  //--------------------------------------
621  double tsh, dd;
622  static double tc, tc2, tsc, tris, b1, b2;
623  static double amp, dft, as;
624  /* cppcheck-suppress variableScope */
625  static double td;
626  /* cppcheck-suppress variableScope */
627  static double t1;
628  /* cppcheck-suppress variableScope */
629  static double t2;
630 
631  static int ifir = 0;
632 
633  if (ifir == 0) {
634 
635  td = 0.10; // diff time ( 0.10)
636  t1 = 0.10; // integ1 real ( 0.10)
637  b1 = 30.90; // integ1 imag ( 30.90)
638  t2 = 0.01; // integ2 real ( 0.01)
639  b2 = 30.01; // integ2 imag ( 30.01)
640  double ts = 1.00; // scint decay ( 1.00)
641  dft = 0.600; // diff delay ( 0.600)
642  as = 0.548; // diff frac ( 0.548)
643  //
644  amp = 1.0;
645  tris = 0.01;
646  tsc = ts;
647  //
648  int im = 0;
649  int ij = 0;
650  int fm = 0;
651  tc = 0;
652  double tt = u_max(u_max(td, t1), u_max(t2, ts)) * 2;
653  int flag_once = 0;
654  while (flag_once == 0) {
655  double dt = tt / 1000;
656  double tm = 0;
657  for (int j = 1; j <= 1000; j++) {
658  tc2 = tc - dft;
659  double fff =
660  (ShapeF(tc, t1, b1, t2, b2, td, tsc) -
661  ShapeF(tc, t1, b1, t2, b2, td, tris) * 0.01) -
662  (ShapeF(tc2, t1, b1, t2, b2, td, tsc) -
663  ShapeF(tc2, t1, b1, t2, b2, td, tris) * 0.01) * as;
664  if (fff > fm) {
665  fm = fff;
666  tm = tc;
667  im = j;
668  }
669  tc = tc + dt;
670  }
671  if (im >= 1000) {
672  tt = 2 * tt;
673  flag_once = 0;
674  continue;
675  }
676  if (ij == 0) {
677  ij = 1;
678  tc = 0.99 * tm;
679  dt = tm * 0.02 / 1000;
680  flag_once = 0;
681  continue;
682  }
683  flag_once = 1;
684  }
685  amp = 1.0 / fm;
686  ifir = 1;
687  }
688  //
689  //
690  double pdf = 0;
691  if (flag_gen == 0) {
692  //-----<signal>
693  tc2 = timing - dft;
694  pdf = amp * (
695  (ShapeF(timing, t1, b1, t2, b2, td, tsc) -
696  ShapeF(timing, t1, b1, t2, b2, td, tris) * 0.01) -
697  (ShapeF(tc2, t1, b1, t2, b2, td, tsc) -
698  ShapeF(tc2, t1, b1, t2, b2, td, tris) * 0.01) * as);
699  } else if (flag_gen == 1) {
700  //-----<parallel>
701  tc2 = timing - dft;
702  tsh = 0.001;
703  pdf = amp * (
704  ShapeF(timing, t1, b1, t2, b2, td, tsh) -
705  ShapeF(tc2, t1, b1, t2, b2, td, tsh) * as);
706  pdf = pdf * 0.001; // GeV
707  } else {
708  //-----<serial>
709  tc2 = timing - dft;
710  tsh = 0.001;
711  pdf = amp * (
712  ShapeF(timing, t1, b1, t2, b2, td, tsh) -
713  ShapeF(tc2, t1, b1, t2, b2, td, tsh) * as);
714  //
715  tc = timing - 0.01;
716  if (tc < 0) { tc = 0; }
717  dd = timing - tc;
718  tc2 = tc - dft;
719  pdf = (amp * (
720  ShapeF(tc, t1, b1, t2, b2, td, tsh) -
721  ShapeF(tc2, t1, b1, t2, b2, td, tsh) * as) - pdf) / dd;
722  pdf = pdf * 0.001; // GeV
723  }
724 
725  return pdf;
726 }
727 //
728 //
729 //
730 double
732  double t01,
733  double tb1,
734  double t02,
735  double tb2,
736  double td1,
737  double ts1)
738 {
739  double dr;
740  double dzna;
741  double das1, das0, dac0;
742  double dcs0s, dsn0s, dcs0d, dsn0d;
743  double dcs1s, dsn1s, dcs1d, dsn1d;
744 
745  double sv123 = 0.0;
746  if (t00 < 0) return 0;
747 
748  dr = (ts1 - td1) / td1;
749  if (fabs(dr) <= 1.0e-5) {
750  if (ts1 > td1) { ts1 = td1 * 1.00001; }
751  else { ts1 = td1 * 0.99999; }
752  }
753  //
754  dr = (pow((t01 - t02), 2) + pow((tb1 - tb2), 2)) / (pow((t01), 2) + pow((tb1), 2));
755  if (dr <= 1.e-10) {
756  if (t01 < t02) { t01 = t02 / 1.00001; }
757  else { t01 = t02 / 0.99999; }
758  }
759  if (t00 <= 0.0) return 0;
760  //
761  //
762  //
763  double a1 = 1 / t01;
764  double a2 = 1 / tb1;
765  double b1 = 1 / t02;
766  double b2 = 1 / tb2;
767  double c1 = 1 / td1;
768  double c2 = 1 / ts1;
769 
770  das0 = b2 * (pow((b1 - a1), 2) + (b2 + a2) * (b2 - a2));
771  dac0 = -2 * (b1 - a1) * a2 * b2;
772  das1 = a2 * (pow((b1 - a1), 2) - (b2 + a2) * (b2 - a2));
773 
774  dsn0s = ((c2 - a1) * das0 - (-a2) * dac0) / (pow(a2, 2) + pow((c2 - a1), 2));
775  dcs0s = ((-a2) * das0 + (c2 - a1) * dac0) / (pow(a2, 2) + pow((c2 - a1), 2));
776 
777  dsn1s = ((c2 - b1) * das1 - (-b2) * (-dac0)) / (pow(b2, 2) + pow((c2 - b1), 2));
778  dcs1s = ((-b2) * das1 + (c2 - b1) * (-dac0)) / (pow(b2, 2) + pow((c2 - b1), 2));
779 
780  dsn0d = ((c1 - a1) * das0 - (-a2) * dac0) / (pow(a2, 2) + pow((c1 - a1), 2));
781  dcs0d = ((-a2) * das0 + (c1 - a1) * dac0) / (pow(a2, 2) + pow((c1 - a1), 2));
782 
783  dsn1d = ((c1 - b1) * das1 - (-b2) * (-dac0)) / (pow(b2, 2) + pow((c1 - b1), 2));
784  dcs1d = ((-b2) * das1 + (c1 - b1) * (-dac0)) / (pow(b2, 2) + pow((c1 - b1), 2));
785  //
786  //
787  //
788  dzna = (pow((b1 - a1), 2) + pow((b2 - a2), 2)) * (pow((b1 - a1), 2) + pow((a2 + b2), 2));
789 
790  sv123 = (
791  (dcs0s + dcs1s) * exp(-c2 * t00) * (-1) +
792  (dcs0d + dcs1d) * exp(-c1 * t00) +
793  ((dsn0s - dsn0d) * sin(a2 * t00) + (dcs0s - dcs0d) * cos(a2 * t00)) * exp(-a1 * t00) +
794  ((dsn1s - dsn1d) * sin(b2 * t00) + (dcs1s - dcs1d) * cos(b2 * t00)) * exp(-b1 * t00)
795  )
796  / dzna / (1 / c2 - 1 / c1);
797 
798  return sv123;
799 }
800 
801 //
802 //
803 //
804 
805 
806 double
808  double timing)
809 {
810 
811  //--------------------------------------
812  //
813  // o "timing" unit is [us]
814  // o flag_gen = 0(=signal), 1(=parallel), 2(=serial)
815  // o return value(PDF) is [GeV]
816  // o Generate signal shape using a simplified function.
817  //
818  //
819  //--------------------------------------
820  double tsh, dd;
821  static double tc, tc2, tsc, tris;
822  static double amp, td, t1, t2, dft, as;
823 
824 
825  // int im, ij;
826 
827  static int ifir = 0;
828 
829  if (ifir == 0) {
830 
831  td = 0.10; // diff time ( 0.10)
832  t1 = 0.10; // integ1 real ( 0.10)
833  // b1 = 30.90; // integ1 imag ( 30.90)
834  t2 = 0.01; // integ2 real ( 0.01)
835  // b2 = 30.01; // integ2 imag ( 30.01)
836  double ts = 1.00; // scint decay ( 1.00)
837  dft = 0.600; // diff delay ( 0.600)
838  as = 0.548; // diff frac ( 0.548)
839  //
840  amp = 1.0;
841  tris = 0.01;
842  // ts0 = 0.0;
843  tsc = ts;
844  double fm = 0;
845  //
846  int im = 0;
847  int ij = 0;
848  tc = 0;
849  double tt = u_max(u_max(td, t1), u_max(t2, ts)) * 2;
850  int flag_once = 0;
851  while (flag_once == 0) {
852  double dt = tt / 1000;
853 
854  double tm = 0;
855  for (int j = 1; j <= 1000; j++) {
856  tc2 = tc - dft;
857  double fff =
858  (ShapeF(tc, tsc) -
859  ShapeF(tc, tris) * 0.01) -
860  (ShapeF(tc2, tsc) -
861  ShapeF(tc2, tris) * 0.01) * as;
862  if (fff > fm) {
863  fm = fff;
864  tm = tc;
865  im = j;
866  }
867  tc = tc + dt;
868  }
869  if (im >= 1000) {
870  tt = 2 * tt;
871  flag_once = 0;
872  continue;
873  }
874  if (ij == 0) {
875  ij = 1;
876  tc = 0.99 * tm;
877  dt = tm * 0.02 / 1000;
878  flag_once = 0;
879  continue;
880  }
881  flag_once = 1;
882  }
883  amp = 1.0 / fm;
884  ifir = 1;
885  }
886  //
887  //
888  double pdf = 0;
889  if (flag_gen == 0) {
890  //-----<signal>
891  tc2 = timing - dft;
892  pdf = amp * (
893  (ShapeF(timing, tsc) -
894  ShapeF(timing, tris) * 0.01) -
895  (ShapeF(tc2, tsc) -
896  ShapeF(tc2, tris) * 0.01) * as);
897  } else if (flag_gen == 1) {
898  //-----<parallel>
899  tc2 = timing - dft;
900  tsh = 0.001;
901  pdf = amp * (
902  ShapeF(timing, tsh) -
903  ShapeF(tc2, tsh) * as);
904  pdf = pdf * 0.001; // GeV
905  } else {
906  //-----<serial>
907  tc2 = timing - dft;
908  tsh = 0.001;
909  pdf = amp * (
910  ShapeF(timing, tsh) -
911  ShapeF(tc2, tsh) * as);
912  //
913  tc = timing - 0.01;
914  if (tc < 0) { tc = 0; }
915  dd = timing - tc;
916  tc2 = tc - dft;
917  pdf = (amp * (
918  ShapeF(tc, tsh) -
919  ShapeF(tc2, tsh) * as) - pdf) / dd;
920  pdf = pdf * 0.001; // GeV
921  }
922 
923  return pdf;
924 }
925 
926 
927 double TrgEclDigitizer::ShapeF(double t00, double ts1)
928 {
929 
930  double dzna;
931  // double das1,das0,dac0;
932  double dcs0s, dsn0s, dcs0d, dsn0d;
933  double dcs1s, dsn1s, dcs1d, dsn1d;
934  double a1, a2, b1, b2, c1, c2;
935  double sv123 = 0.0;
936 
937  if (t00 <= 0.0) return 0;
938 
939 
940 
941  a1 = 10 ;
942  a2 = 0.0323625 ;
943  b1 = 100;
944  b2 = 0.0333222;
945  c1 = 10;
946 
947  if (ts1 == 1) {
948  c2 = 1;
949  dsn0s = -29.9897;
950  dcs0s = -0.08627;
951 
952  dsn1s = -2.64784;
953  dcs1s = -0.00285194;
954  }
955  if (ts1 == 0.01) {
956  c2 = 100;
957  dsn0s = 2.999 ;
958  dcs0s = -0.00323517;
959 
960  dsn1s = 5.82524;
961  dcs1s = -7866.7;
962  }
963  if (ts1 == 0.001) {
964  c2 = 1000;
965  dsn0s = 0.272636;
966  dcs0s = -0.000204983;
967 
968  dsn1s = 0.291262;
969  dcs1s = 0.000204894;
970  }
971 
972  dsn0d = -5.998;
973  dcs0d = -8340.22;
974 
975  dsn1d = -2.91262;
976  dcs1d = -0.00323517;
977  //
978  //
979  //
980  dzna = 6.561e+07;
981 
982 
983 
984 
985 
986 
987 
988 
989  sv123 = (
990  (dcs0s + dcs1s) * exp(-c2 * t00) * (-1) +
991  (dcs0d + dcs1d) * exp(-c1 * t00) +
992  ((dsn0s - dsn0d) * sin(a2 * t00) + (dcs0s - dcs0d) * cos(a2 * t00)) * exp(-a1 * t00) +
993  ((dsn1s - dsn1d) * sin(b2 * t00) + (dcs1s - dcs1d) * cos(b2 * t00)) * exp(-b1 * t00)
994  )
995  / dzna / (1 / c2 - 1 / c1);
996 
997 
998  return sv123;
999 }
1000 
1001 
1002 
1003 //
1004 //
1005 //
1006 double
1007 TrgEclDigitizer::u_max(double aaa, double bbb)
1008 {
1009 
1010  if (aaa > bbb) { return aaa; }
1011  else { return bbb; }
1012 }
1013 //
1014 //
1015 
Belle2::StoreArray::appendNew
T * appendNew()
Construct a new T object at the end of the array.
Definition: StoreArray.h:256
Belle2::ECL::ECLGeometryPar::GetCrystalVec
TVector3 GetCrystalVec(int cid)
The direction of crystal.
Definition: ECLGeometryPar.h:110
Belle2::TrgEclDigitizer::digitization01
void digitization01(std::vector< std::vector< double >> &, std::vector< std::vector< double >> &)
fit method, digi with 125ns interval
Definition: TrgEclDigitizer.cc:281
Belle2::TrgEclDigitizer::ShapeF
double ShapeF(double, double, double, double, double, double, double)
return shape using FADC function
Definition: TrgEclDigitizer.cc:731
Belle2::Unit::ns
static const double ns
Standard of [time].
Definition: Unit.h:58
Belle2::TrgEclDigitizer::getTCHit
void getTCHit(int)
get TC Hits from Xtal hits
Definition: TrgEclDigitizer.cc:105
Belle2::TrgEclDigitizer::WaveForm
double WaveForm[576][64]
TC Energy converted from Xtarl Energy [GeV].
Definition: TrgEclDigitizer.h:107
Belle2::TrgEclDigitizer::TCBkgContribution
double TCBkgContribution[576][80]
Beambackground contribution.
Definition: TrgEclDigitizer.h:99
Belle2::TrgEclDigitizer::_waveform
int _waveform
Flag of waveform table.
Definition: TrgEclDigitizer.h:105
Belle2::ECLHit::getCellId
int getCellId() const
Get Cell ID.
Definition: ECLHit.h:76
Belle2::ECLSimHit
ClassECLSimHit - Geant4 simulated hit for the ECL.
Definition: ECLSimHit.h:42
Belle2::TrgEclDigitizer::_DataBase
TrgEclDataBase * _DataBase
Object of DataBase.
Definition: TrgEclDigitizer.h:89
Belle2::TRGECLWaveform
Digitize result.
Definition: TRGECLWaveform.h:19
Belle2::TrgEclDigitizer::SimplifiedFADC
double SimplifiedFADC(int, double)
FADC.
Definition: TrgEclDigitizer.cc:807
Belle2::TrgEclDigitizer::TCTiming_tot
double TCTiming_tot[576]
TC Timing converted from Xtarl Timing [GeV].
Definition: TrgEclDigitizer.h:76
Belle2::ECLHit::getEnergyDep
double getEnergyDep() const
Get deposit energy.
Definition: ECLHit.h:81
Belle2::TrgEclDigitizer::_TCMap
TrgEclMapping * _TCMap
Object of TC Mapping.
Definition: TrgEclDigitizer.h:87
Belle2::TrgEclMapping::getTCPhiIdFromTCId
int getTCPhiIdFromTCId(int)
get [TC Phi ID] from [TC ID]
Definition: TrgEclMapping.cc:227
Belle2::TrgEclDigitizer::u_max
double u_max(double, double)
Find max value between 2 vals;.
Definition: TrgEclDigitizer.cc:1007
Belle2::TrgEclDataBase
class TrgEclDataBase;
Definition: TrgEclDataBase.h:24
Belle2::TrgEclDigitizer::TCRawBkgTag
double TCRawBkgTag[576][60]
Input Beambackgroun tag
Definition: TrgEclDigitizer.h:84
Belle2::TrgEclMapping
A class of TC Mapping.
Definition: TrgEclMapping.h:31
Belle2::ECLSimHit::getCellId
int getCellId() const
Get Cell ID.
Definition: ECLSimHit.h:99
Belle2::TrgEclDigitizer::TCEnergy
double TCEnergy[576][80]
TC Energy converted from Xtarl Energy [GeV].
Definition: TrgEclDigitizer.h:70
Belle2::ECLSimHit::getPosIn
G4ThreeVector getPosIn() const
Get Position.
Definition: ECLSimHit.h:134
Belle2::ECL::ECLGeometryPar::Instance
static ECLGeometryPar * Instance()
Static method to get a reference to the ECLGeometryPar instance.
Definition: ECLGeometryPar.cc:151
Belle2::TrgEclDigitizer::_FADC
int _FADC
Flag of choosing the method of waveform generation function 0: use simplifiedFADC,...
Definition: TrgEclDigitizer.h:109
Belle2::TrgEclDigitizer::TCRawTiming
double TCRawTiming[576][60]
Input TC timing[ns]
Definition: TrgEclDigitizer.h:82
Belle2::TrgEclDigitizer::save
void save(int)
save fitting result into tables
Definition: TrgEclDigitizer.cc:532
Belle2::TrgEclDigitizer::MatrixParallel
std::vector< std::vector< double > > MatrixParallel
Noise Matrix of Parallel and Serial Noise.
Definition: TrgEclDigitizer.h:95
Belle2::TrgEclDigitizer::TimeRange
double TimeRange
time range(defult : -4000 ~ 4000 ns )
Definition: TrgEclDigitizer.h:68
Belle2::TrgEclDigitizer::TCBeambkgTag
int TCBeambkgTag[576][80]
Beambackground tag.
Definition: TrgEclDigitizer.h:103
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrgEclDigitizer::TCEnergy_tot
double TCEnergy_tot[576]
TC Energy converted from Xtarl Energy [GeV].
Definition: TrgEclDigitizer.h:74
Belle2::TrgEclDigitizer::TCSigContribution
double TCSigContribution[576][80]
Signal contribution.
Definition: TrgEclDigitizer.h:101
Belle2::ECLSimHit::getFlightTime
double getFlightTime() const
Get Flight time from IP.
Definition: ECLSimHit.h:114
Belle2::TrgEclDigitizer::MatrixSerial
std::vector< std::vector< double > > MatrixSerial
Noise Low triangle Matrix of Serial noise
Definition: TrgEclDigitizer.h:97
Belle2::TRGECLWaveform::setThetaPhiIDs
void setThetaPhiIDs(int thid, int phid)
Set Theta and Phi Id of TC.
Definition: TRGECLWaveform.h:73
Belle2::TrgEclDigitizer::interFADC
double interFADC(double)
Faster FADC using interpolation.
Definition: TrgEclDigitizer.cc:572
Belle2::ECL::ECLGeometryPar::GetCrystalPos
TVector3 GetCrystalPos(int cid)
The Position of crystal.
Definition: ECLGeometryPar.h:102
Belle2::ECLSimHit::getEnergyDep
double getEnergyDep() const
Get Deposit energy.
Definition: ECLSimHit.h:119
Belle2::TrgEclDigitizer::TCRawEnergy
double TCRawEnergy[576][60]
Input TC energy[GeV].
Definition: TrgEclDigitizer.h:80
Belle2::ECLHit
Class to store simulated hits which equate to average of ECLSImHit on crystals input for digitization...
Definition: ECLHit.h:36
Belle2::SimHitBase::getBackgroundTag
virtual unsigned short getBackgroundTag() const
Get background tag.
Definition: SimHitBase.h:56
Belle2::TrgEclMapping::getTCThetaIdFromTCId
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
Definition: TrgEclMapping.cc:200
Belle2::ECL::ECLGeometryPar
The Class for ECL Geometry Parameters.
Definition: ECLGeometryPar.h:45
Belle2::TrgEclDigitizer::FADC
double FADC(int, double)
FADC
Definition: TrgEclDigitizer.cc:610
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TrgEclMapping::getTCIdFromXtalId
int getTCIdFromXtalId(int)
get [TC ID] from [Xtal ID]
Definition: TrgEclMapping.cc:36
Belle2::ECLHit::getTimeAve
double getTimeAve() const
Get average time.
Definition: ECLHit.h:86
Belle2::Unit::GeV
static const double GeV
Standard of [energy, momentum, mass].
Definition: Unit.h:61
Belle2::TrgEclDigitizer::digitization02
void digitization02(std::vector< std::vector< double >> &, std::vector< std::vector< double >> &)
orignal no fit method, digi with 12ns interval
Definition: TrgEclDigitizer.cc:443
Belle2::TrgEclDigitizer::_BeambkgTag
int _BeambkgTag
Flag of saving beam background tag or not.
Definition: TrgEclDigitizer.h:111
Belle2::StoreArray::getEntries
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:226
Belle2::TrgEclDigitizer::setup
void setup()
setup fam module
Definition: TrgEclDigitizer.cc:87
Belle2::TrgEclDigitizer::~TrgEclDigitizer
virtual ~TrgEclDigitizer()
Destructor.
Definition: TrgEclDigitizer.cc:75
Belle2::TrgEclDigitizer::TCTiming
double TCTiming[576][80]
TC Timing converted from Xtarl Timing [GeV].
Definition: TrgEclDigitizer.h:72