CbmRoot
CbmTrdModuleSimT.cxx
Go to the documentation of this file.
1 #include "CbmTrdModuleSimT.h"
2 
3 #include "CbmTrdAddress.h"
4 #include "CbmTrdDigi.h"
5 #include "CbmTrdDigitizer.h"
6 #include "CbmTrdFASP.h"
7 #include "CbmTrdParFasp.h"
8 #include "CbmTrdParModDigi.h"
9 #include "CbmTrdParModGain.h"
10 #include "CbmTrdParModGas.h"
11 #include "CbmTrdParSetAsic.h"
12 #include "CbmTrdPoint.h"
13 #include "CbmTrdRadiator.h"
14 #include "CbmTrdTrianglePRF.h"
15 
16 #include "CbmDigitizeBase.h"
17 #include "CbmMatch.h"
18 #include "CbmTimeSlice.h"
19 
20 #include <FairLogger.h>
21 #include <FairRootManager.h>
22 
23 #include <TGeoManager.h>
24 #include <TMath.h>
25 #include <TRandom.h>
26 #include <TVector3.h>
27 
28 #include <iomanip>
29 
30 #define VERBOSE 0
31 
32 using std::cout;
33 using std::endl;
34 using std::fabs;
35 using std::make_pair;
36 using std::max;
37 using std::pair;
38 using namespace std;
39 
40 //_________________________________________________________________________________
41 CbmTrdModuleSimT::CbmTrdModuleSimT(Int_t mod, Int_t ly, Int_t rot, Bool_t FASP)
42  : CbmTrdModuleSim(mod, ly, rot)
43  , fTriangleBinning(NULL)
44  , fFASP(NULL)
45  , fTimeSlice(NULL)
46  , fTimeOld(0) {
47  SetNameTitle(Form("TrdSimT%d", mod), "Simulator for triangular read-out.");
48  SetAsic(FASP);
49 }
50 
51 //_________________________________________________________________________________
54  if (fFASP) delete fFASP;
55 }
56 
57 //_________________________________________________________________________________
58 Bool_t
59 CbmTrdModuleSimT::MakeDigi(CbmTrdPoint* point, Double_t time, Bool_t TR) {
68  if (VERBOSE) {
69  printf("CbmTrdModuleSimT::MakeDigi @ T[ns] = ev[%10.2f]+hit[%5.2f] ...\n",
70  time,
71  point->GetTime());
72  point->Print("");
73  }
74  Double_t gin[3] = {point->GetXIn(), point->GetYIn(), point->GetZIn()},
75  gout[3] = {point->GetXOut(), point->GetYOut(), point->GetZOut()},
76  lin[3], // entrace point coordinates in local module cs
77  lout[3], // exit point coordinates in local module cs
78  ain[3], // entrace anode wire position
79  aout[3], // exit anode wire position
80  dd[3]; // vec(lout)-vec(lin)
81  gGeoManager->cd(GetPath());
82  gGeoManager->MasterToLocal(gin, lin);
83  gGeoManager->MasterToLocal(gout, lout);
84  SetPositionMC(lout);
85  if (VERBOSE)
86  printf(" ModPos : in[%7.4f %7.4f %7.4f] out[%7.4f %7.4f %7.4f]\n",
87  lin[0],
88  lin[1],
89  lin[2],
90  lout[0],
91  lout[1],
92  lout[2]);
93 
94  // General processing on the MC point
95  Double_t ELossTR(0.), ELossdEdX(point->GetEnergyLoss());
96  if (fRadiator && TR) {
97  // nofElectrons++;
98  if (
100  point)) { // electron has passed lattice grid (or frame material) befor reaching the gas volume -> TR-photons have been absorbed by the lattice grid
101  // nofLatticeHits++;
102  } else if (gout[2] >= gin[2]) { //electron has passed the radiator
103  TVector3 mom;
104  point->Momentum(mom);
105  ELossTR = fRadiator->GetTR(mom);
106  }
107  }
108  //ELossTR=5.895; // 55Fe, Ka (89%)
109  //ELossTR=6.492; // 55Fe, Kb (11%)
110  //ELossdEdX = gRandom->Gaus(ELossdEdX, );
111 
112  // compute track length in the gas volume
113  Double_t trackLength(0.), txy(0.);
114  for (Int_t i = 0; i < 3; i++) {
115  dd[i] = (lout[i] - lin[i]);
116  if (i == 2) txy = trackLength;
117  trackLength += dd[i] * dd[i];
118  }
119  if (trackLength > 0.)
120  trackLength = TMath::Sqrt(trackLength);
121  else {
122  LOG(warn) << GetName()
123  << "::MakeDigi: NULL track length for"
124  " dEdx("
125  << std::setprecision(5) << ELossdEdX * 1e6 << ") keV ";
126  return kFALSE;
127  }
128  if (txy > 0.)
129  txy = TMath::Sqrt(txy);
130  else {
131  LOG(warn) << GetName()
132  << "::MakeDigi: NULL xy track length projection for"
133  " dEdx("
134  << std::setprecision(5) << ELossdEdX * 1e6 << ") keV ";
135  return kFALSE;
136  }
137  // compute yz direction
138  Double_t dzdy = dd[2] / dd[1];
139  if (VERBOSE) printf(" dzdy[%f]\n", dzdy);
140 
141  // get anode wire for the entrance point
142  memcpy(ain, lin, 3 * sizeof(Double_t));
144  // get anode wire for the exit point
145  memcpy(aout, lout, 3 * sizeof(Double_t));
147 
148  // estimate no of anode wires hit by the track
149  Double_t dw(fDigiPar->GetAnodeWireSpacing());
150  Int_t ncls = TMath::Nint(TMath::Abs(aout[1] - ain[1]) / dw + 1.);
151  if (VERBOSE) {
152  printf(" WireHit(s): %d\n", ncls);
153  printf(" AnodePos : win[%7.4f / %7.4f] wout[%7.4f / %7.4f]\n",
154  ain[1],
155  lin[1],
156  aout[1],
157  lout[1]);
158  }
159 
160  // calculate track segmentation on the amplification cells distribution
161  Int_t sgnx(1), sgny(1);
162  if (lout[0] < lin[0]) sgnx = -1;
163  if (lout[1] < lin[1]) sgny = -1;
164  Double_t dy[] = {TMath::Min((ain[1] + 0.5 * sgny * dw - lin[1]) * sgny,
165  (lout[1] - lin[1]) * sgny),
166  TMath::Min((lout[1] - (aout[1] - 0.5 * sgny * dw)) * sgny,
167  (lout[1] - lin[1]) * sgny)},
168  dxw(TMath::Abs(dd[0] * dw / dd[1])),
169  dx[] = {TMath::Abs(dy[0] * dd[0] / dd[1]),
170  TMath::Abs(dy[1] * dd[0] / dd[1])};
171  // check partition
172  Double_t DX(dx[0]), DY(dy[0]);
173  for (Int_t ic(1); ic < ncls - 1; ic++) {
174  DX += dxw;
175  DY += dw;
176  }
177  if (ncls > 1) {
178  DX += dx[1];
179  DY += dy[1];
180  }
181  if (VERBOSE) {
182  printf(" DX[%7.4f] = dx0[%7.4f] + dx1[%7.4f] dwx[%7.4f] checkDX[%7.4f]\n"
183  " DY[%7.4f] = dy0[%7.4f] + dy1[%7.4f] dwy[%7.4f] checkDY[%7.4f]\n",
184  dd[0],
185  dx[0],
186  dx[1],
187  dxw,
188  sgnx * DX,
189  dd[1],
190  dy[0],
191  dy[1],
192  dw,
193  sgny * DY);
194  }
195 
196  Double_t pos[3] = {ain[0], ain[1], ain[2]}, ldx(0.), ldy(0.), dxy(0.),
197  e(0.), /*etr(0.),*/
198  tdrift, /*x0=lin[0],*/ y0 = lin[1] - ain[1], z0 = lin[2];
199  for (Int_t icl(0); icl < ncls; icl++) {
200  if (!icl) {
201  ldx = dx[0];
202  ldy = dy[0];
203  } else if (icl == ncls - 1) {
204  ldx = dx[1];
205  ldy = dy[1];
206  } else {
207  ldx = dxw;
208  ldy = dw;
209  }
210 
211  dxy = ldx * ldx + ldy * ldy;
212  if (dxy <= 0) {
213  LOG(error) << GetName()
214  << "::MakeDigi: NULL projected track length in cluster " << icl
215  << " for track length[cm] (" << std::setprecision(5) << ldx
216  << ", " << std::setprecision(2) << ldy
217  << ")."
218  " dEdx("
219  << std::setprecision(5) << ELossdEdX * 1e6 << ") keV ";
220  continue;
221  }
222  dxy = TMath::Sqrt(dxy);
223  if (VERBOSE)
224  printf(" %d ldx[%7.4f] ldy[%7.4f] xy[%7.4f] frac=%7.2f%%\n",
225  icl,
226  ldx,
227  ldy,
228  dxy,
229  1.e2 * dxy / txy);
230 
231  Double_t dEdx(dxy / txy),
232  cELoss(ELossdEdX * dEdx); // continuos energy deposit
233  e += cELoss;
234 
235  if (VERBOSE)
236  printf(" y0[%7.4f] z0[%7.4f] y1[%7.4f] z1[%7.4f]\n",
237  y0,
238  z0,
239  y0 + ldy * sgny,
240  z0 + dzdy * ldy * sgny);
241  tdrift = fChmbPar->ScanDriftTime(y0, z0, dzdy, ldy * sgny);
242  y0 += ldy * sgny;
243  z0 += dzdy * ldy * sgny;
244  pos[0] += 0.5 * ldx * sgnx;
245  if (VERBOSE)
246  printf(" time_hit[ns]=%10.2f time_drift[ns]=%6.2f\n",
247  time + point->GetTime(),
248  tdrift);
249  // apply GAS GAIN
250  // convert Edep [keV] to collected charge [fC]
251  cELoss = fChmbPar->EkevFC(1e6 * cELoss);
252  ScanPadPlane(pos, ldx, cELoss, time + point->GetTime() + tdrift);
253  pos[0] += 0.5 * ldx * sgnx;
254  pos[1] += dw * sgny;
255  }
256  if (TMath::Abs(lout[0] - pos[0]) > 1.e-3) {
257  LOG(warn) << GetName() << "::MakeDigi: Along wire coordinate error : x_sim="
258  << std::setprecision(5) << lout[0]
259  << " x_calc=" << std::setprecision(5) << pos[0];
260  }
261  if (TMath::Abs(ELossdEdX - e) > 1.e-3) {
262  LOG(warn) << GetName()
263  << "::MakeDigi: dEdx partition to anode wires error : E[keV] = "
264  << std::setprecision(5) << ELossdEdX * 1e6
265  << " Sum(Ei)[keV]=" << std::setprecision(5) << e * 1e6;
266  }
267 
268  // simulate TR
269  if (ELossTR > 0) {
270  Double_t lambda(0.3), diffx(0.1);
271  Double_t dist = gRandom->Exp(lambda);
272  if (VERBOSE)
273  printf(" %d PE effect @ %7.4fcm trackLength=%7.4fcm\n",
274  ncls,
275  dist,
276  trackLength);
277  if (dist > trackLength) return kTRUE;
278 
279  // propgate to PE position
280  lin[0] += dd[0] * dist / trackLength;
281  lin[1] += dd[1] * dist / trackLength;
282  lin[2] += dd[2] * dist / trackLength;
283  // get anode wire for the PE point
284  memcpy(ain, lin, 3 * sizeof(Double_t));
286 
287  y0 = lin[1] - ain[1];
288  tdrift = fChmbPar->GetDriftTime(y0, ain[2]);
289  Char_t peShell = fChmbPar->GetPEshell(ELossTR);
290  if (peShell) {
291  // compute loss by non-ionizing effects
292  // 1. escape peak
293  if (gRandom->Uniform() < fChmbPar->GetNonIonizingBR(peShell)) {
294  ELossTR -= fChmbPar->GetBindingEnergy(peShell, 0);
295  if (VERBOSE)
296  printf(" yM[%7.4f] zM[%7.4f] -> yA[%7.4f] y0[%7.4f] "
297  "tDrift[ns]=%3d PE=%c EscPeak Edep=%5.3f [keV]\n",
298  lin[1],
299  lin[2],
300  ain[1],
301  y0,
302  Int_t(tdrift),
303  peShell,
304  ELossTR);
305  // 2. main peak
306  } else {
307  ELossTR -= 2 * fChmbPar->GetBindingEnergy(peShell, 1);
308  if (VERBOSE)
309  printf(" yM[%7.4f] zM[%7.4f] -> yA[%7.4f] y0[%7.4f] "
310  "tDrift[ns]=%3d PE=%c MainPeak Edep=%5.3f [keV]\n",
311  lin[1],
312  lin[2],
313  ain[1],
314  y0,
315  Int_t(tdrift),
316  peShell,
317  ELossTR);
318  }
319  } else if (VERBOSE)
320  printf(" yM[%7.4f] zM[%7.4f] -> yA[%7.4f] y0[%7.4f] tDrift[ns]=%3d "
321  "PE=%c\n",
322  lin[1],
323  lin[2],
324  ain[1],
325  y0,
326  Int_t(tdrift),
327  peShell);
328  //ELossTR = gRandom->Gaus(ELossTR, ); // account for gain uncertainty
329  ELossTR =
330  fChmbPar->EkevFC(ELossTR); // convert Edep [keV] to collected charge [fC]
331 
332  ScanPadPlane(
333  ain, tdrift * diffx, ELossTR, time + point->GetTime() + tdrift);
334  }
335  return kTRUE;
336 }
337 
338 //_________________________________________________________________________________
339 Bool_t CbmTrdModuleSimT::ScanPadPlane(const Double_t* point,
340  Double_t DX,
341  Double_t ELoss,
342  Double_t toff) {
352  if (VERBOSE)
353  printf(" WirePlane : xy[%7.4f %7.4f] D[%7.4f] S[fC]=%7.4f "
354  "time[ns]=%10.2f\n",
355  point[0],
356  point[1],
357  DX,
358  ELoss,
359  toff);
360 
361  Int_t sec(-1), col(-1), row(-1);
362  fDigiPar->GetPadInfo(point, sec, col, row);
363  if (sec < 0 || col < 0 || row < 0) {
364  LOG(error)
365  << "CbmTrdModuleSimT::ScanPadPlane: Hit to pad matching failed for ["
366  << std::setprecision(5) << point[0] << ", " << std::setprecision(5)
367  << point[1] << ", " << std::setprecision(5) << point[2] << "].";
368  return kFALSE;
369  }
370  for (Int_t is(0); is < sec; is++)
371  row += fDigiPar->GetNofRowsInSector(is);
372 
373  Double_t dx, dy;
374  fDigiPar->TransformToLocalPad(point, dx, dy);
375  if (VERBOSE)
376  printf(" PadPlane : col[%d] row[%d] x[%7.4f] y[%7.4f]\n",
377  col,
378  row,
379  dx,
380  dy);
381 
382  // build binning if called for the first time. Don't care about sector information as Bucharest has only 1 type of pads
383  if (!fTriangleBinning)
386  if (!fTriangleBinning->SetOrigin(dx, dy)) {
387  LOG(warn)
388  << "CbmTrdModuleSimT::ScanPadPlane: Hit outside integration limits ["
389  << std::setprecision(5) << dx << ", " << std::setprecision(5) << dy
390  << "].";
391  return kFALSE;
392  }
393 
394  // set minimum threshold for all channels [keV]
395  // TODO should be stored/computed in CbmTrdModule via triangular/FASP digi param
396  //Double_t epsilon=1.e-4;
397 
398  // local storage for digits on a maximum area of 5x3 columns for up[1]/down[0] pads
399  const Int_t nc = 2 * CbmTrdTrianglePRF::NC + 1;
400  const Int_t nr = 2 * CbmTrdTrianglePRF::NR + 1;
401  Double_t array[nc][nr][2] = {{{0.}}}, prf(0.);
402  Int_t colOff, rowOff, up /* bx, by*/; // VF not used
403 
404  // look right
405  do {
406  // check if there is any contribution on this bin column
407  //if(fTriangleBinning->GetChargeFraction()<=epsilon) break;
408 
409  // look up
410  do {
412  fTriangleBinning->GetCurrentPad(colOff, rowOff, up);
413  if (colOff < 0 || colOff >= nc || rowOff < 0 || rowOff >= nr) {
414  printf("CbmTrdModuleSimT::ScanPadPlane: Bin outside mapped array : "
415  "col[%d] row[%d]\n",
416  colOff,
417  rowOff);
418  break;
419  }
420  //fTriangleBinning->GetCurrentBin(bx, by);
421  //printf(" {ru} bin[%2d %2d] c[%d] r[%d] u[%2d] PRF[%f]\n", bx, by, colOff, rowOff, up, prf);
422  if (up)
423  array[colOff][rowOff][(up > 0 ? 0 : 1)] += prf;
424  else {
425  array[colOff][rowOff][0] += 0.5 * prf;
426  array[colOff][rowOff][1] += 0.5 * prf;
427  }
428  } while (fTriangleBinning->NextBinY() /* && prf>=epsilon*/);
430  //printf("\n");
431 
432  // skip bin @ y0 which was calculated before
433  if (!fTriangleBinning->PrevBinY()) continue;
434 
435  // look down
436  do {
438  fTriangleBinning->GetCurrentPad(colOff, rowOff, up);
439  if (colOff < 0 || colOff >= nc || rowOff < 0 || rowOff >= nr) {
440  printf("CbmTrdModuleSimT::ScanPadPlaneTriangleAB: Bin outside mapped "
441  "array : col[%d] row[%d]\n",
442  colOff,
443  rowOff);
444  break;
445  }
446  //fTriangleBinning->GetCurrentBin(bx, by);
447  //printf(" {rd} bin[%2d %2d] c[%d] r[%d] u[%2d] PRF[%f]\n", bx, by, colOff, rowOff, up, prf);
448  if (up)
449  array[colOff][rowOff][(up > 0 ? 0 : 1)] += prf;
450  else {
451  array[colOff][rowOff][0] += 0.5 * prf;
452  array[colOff][rowOff][1] += 0.5 * prf;
453  }
454  } while (fTriangleBinning->PrevBinY() /* && prf>=epsilon*/);
456  //printf("\n");
457 
458  } while (fTriangleBinning->NextBinX());
460 
461 
462  if (fTriangleBinning
463  ->PrevBinX()) { // skip bin @ x0 which was calculated before
464  // look left
465  do {
466  // check if there is any contribution on this bin column
467  //if(fTriangleBinning->GetChargeFraction()<=epsilon) break;
468 
469  // look up
470  do {
472  fTriangleBinning->GetCurrentPad(colOff, rowOff, up);
473  if (colOff < 0 || colOff >= nc || rowOff < 0 || rowOff >= nr) {
474  printf("CbmTrdModuleSimT::ScanPadPlane: Bin outside mapped array : "
475  "col[%d] row[%d]\n",
476  colOff,
477  rowOff);
478  break;
479  }
480  //fTriangleBinning->GetCurrentBin(bx, by);
481  //printf(" {lu} bin[%2d %2d] c[%d] r[%d] u[%2d] PRF[%f]\n", bx, by, colOff, rowOff, up, prf);
482  if (up)
483  array[colOff][rowOff][(up > 0 ? 0 : 1)] += prf;
484  else {
485  array[colOff][rowOff][0] += 0.5 * prf;
486  array[colOff][rowOff][1] += 0.5 * prf;
487  }
488  } while (fTriangleBinning->NextBinY() /* && prf>=epsilon*/);
490 
491  // skip bin @ y0 which was calculated before
492  if (!fTriangleBinning->PrevBinY()) continue;
493 
494  // look down
495  do {
497  fTriangleBinning->GetCurrentPad(colOff, rowOff, up);
498  if (colOff < 0 || colOff >= nc || rowOff < 0 || rowOff >= nr) {
499  printf("CbmTrdModuleSimT::ScanPadPlane: Bin outside mapped array : "
500  "col[%d] row[%d]\n",
501  colOff,
502  rowOff);
503  break;
504  }
505  //fTriangleBinning->GetCurrentBin(bx, by);
506  //printf(" {ld} bin[%2d %2d] c[%d] r[%d] u[%2d] PRF[%f]\n", bx, by, colOff, rowOff, up, prf);
507  if (up)
508  array[colOff][rowOff][(up > 0 ? 0 : 1)] += prf;
509  else {
510  array[colOff][rowOff][0] += 0.5 * prf;
511  array[colOff][rowOff][1] += 0.5 * prf;
512  }
513  } while (fTriangleBinning->PrevBinY() /* && prf>=epsilon*/);
515  //printf("\n");
516 
517  } while (fTriangleBinning->PrevBinX());
518  }
520  //printf("\n");
521  if (VERBOSE) {
522  printf(" ");
523  for (Int_t ic(0); ic < nc; ic++)
524  printf("%7d[u/d] ", ic);
525  printf("\n");
526  for (Int_t ir(nr); ir--;) {
527  printf(" r[%d] ", ir);
528  for (Int_t ic(0); ic < nc; ic++)
529  printf(
530  "%6.4f/%6.4f ", 1.e2 * array[ic][ir][0], 1.e2 * array[ic][ir][1]);
531  printf("\n");
532  }
533  }
534 
535  // pair pads and convert to ADC
536  // calibration ADC -> keV based on 55Fe measurements as presented @
537  //https://indico.gsi.de/event/4760/session/6/contribution/58/material/slides/0.pdf on slide 14
538  // TODO should be stored/computed in CbmTrdParModGain
539  //const Float_t ECalib[]={-528./380., 1./380.}; VF / not used
540  Double_t Emeasure(0.);
541  for (Int_t ir(nr); ir--;) {
542  for (Int_t ic(nc); (--ic) >= 0;) {
543  for (Int_t iup(0); iup < 2; iup++) {
544  //if(array[ic][ir][iup]<=epsilon) continue;
545  array[ic][ir][iup] *= ELoss / fTriangleBinning->Norm();
546  Emeasure += array[ic][ir][iup];
547  // conversion from keV -> fC
548  //array[ic][ir][iup] = (array[ic][ir][iup]-ECalib[0])*380.;
549  }
550  // if(ic>0) array[ic-1][ir][0]+=array[ic][ir][1]; // add top pad to previous tilt pair
551  // array[ic][ir][1] += array[ic][ir][0]; // add bottom pad to current rect pair
552 
553  if (ic < nc - 1)
554  array[ic + 1][ir][0] +=
555  array[ic][ir][1]; // add bottom pad to next tilt pair
556  array[ic][ir][1] += array[ic][ir][0]; // add top pad to current rect pair
557  }
558  }
559  if (VERBOSE) {
560  printf(" Sth[fC]=%6.4f Sdigi[fC]=%6.4f\n", ELoss, Emeasure);
561  printf(" ");
562  for (Int_t ic(0); ic < nc; ic++)
563  printf("%7d[T/R] ", ic);
564  printf("\n");
565  for (Int_t ir(nr); ir--;) {
566  printf(" r[%d] ", ir);
567  for (Int_t ic(0); ic < nc; ic++)
568  printf("%6.2f/%6.2f ", array[ic][ir][0], array[ic][ir][1]);
569  printf("\n");
570  }
571  }
572  // register digitisation to container
573  Int_t address(0);
574  for (Int_t ir(0); ir < nr; ir++) {
575  for (Int_t ic(0); ic < nc; ic++) {
576  // check if column is inside pad-plane
577  Int_t wcol(col + ic - CbmTrdTrianglePRF::NC);
578  if (wcol < 0 || wcol >= fDigiPar->GetNofColumns()) continue;
579 
580  // check if row is inside pad-plane
581  Int_t wrow(row + ir - CbmTrdTrianglePRF::NR);
582  if (wrow < 0 || wrow >= fDigiPar->GetNofRows()) continue;
583 
584  // check if there are data available
585  Double_t dch[2] = {0.};
586  Bool_t kCOL(kFALSE);
587  for (Int_t iup(0); iup < 2; iup++) {
588  if (array[ic][ir][iup] < 0.1) continue;
589  dch[iup] = TMath::Nint(array[ic][ir][iup] * 10.);
590  kCOL = kTRUE;
591  }
592  if (!kCOL) continue;
593 
594  // compute global column address
595  address =
596  GetPadAddress(wrow, wcol); //CbmTrdAddress::GetAddress(fLayerId,
597 
598  // add physics (E[keV], t[ns], Etr[keV])
599  AddDigi(address, &dch[0], toff); //, ELossTR/ELoss);
600  }
601  }
602  return kTRUE;
603 }
604 
605 //_______________________________________________________________________________________________
606 void CbmTrdModuleSimT::AddDigi(Int_t address,
607  Double_t* charge,
608  Double_t time /*, Double_t fTR*/) {
614  // make digi
615  CbmTrdDigi *digi(NULL), *sdigi(NULL);
616  CbmMatch* digiMatch(NULL);
617  digi =
618  new CbmTrdDigi(address, charge[0], charge[1], ULong64_t(TMath::Ceil(time)));
619  digi->SetAddressModule(fModAddress); // may not be needed in the future
620  digiMatch = new CbmMatch();
621  Double_t weighting = 1;
622  digiMatch->AddLink(CbmLink(weighting, fPointId, fEventId, fInputId));
623  //digi->SetMatch(digiMatch);
624 
625  // get the link to saved digits
626  std::map<Int_t, std::vector<pair<CbmTrdDigi*, CbmMatch*>>>::iterator it =
627  fBuffer.find(address);
628 
629  // check for saved
630  if (it != fBuffer.end()) {
631  Bool_t kINSERT(kFALSE);
632  for (std::vector<pair<CbmTrdDigi*, CbmMatch*>>::iterator itv =
633  fBuffer[address].begin();
634  itv != fBuffer[address].end();
635  itv++) {
636  sdigi = itv->first;
637  if (sdigi->GetTime() <= digi->GetTime())
638  continue; // arrange digits in increasing order of time
639  fBuffer[address].insert(itv, make_pair(digi, digiMatch));
640  if (VERBOSE) cout << " => Save(I) " << digi->ToString();
641  kINSERT = kTRUE;
642  break;
643  }
644  if (!kINSERT) {
645  fBuffer[address].push_back(make_pair(digi, digiMatch));
646  if (VERBOSE) cout << " => Save(B) " << digi->ToString();
647  }
648  } else { // add address
649  if (VERBOSE) cout << " => Add " << digi->ToString();
650  fBuffer[address].push_back(make_pair(digi, digiMatch));
651  }
652 }
653 
654 //_______________________________________________________________________________________________
655 Int_t CbmTrdModuleSimT::FlushBuffer(ULong64_t time) {
661  if (!fFASP) { // Build & configure FASP simulator
662  fFASP = new CbmTrdFASP(1000);
664  fFASP->SetLGminLength(31);
665  }
666  if (!fTimeSlice) {
667  FairRootManager* ioman = FairRootManager::Instance();
668  fTimeSlice = (CbmTimeSlice*) ioman->GetObject("TimeSlice.");
669  }
670  Bool_t closeTS(kFALSE);
671  if (fTimeSlice) closeTS = (fTimeOld - fTimeSlice->GetEndTime() - 1000) > 0.;
672  fTimeOld = time;
673 
674  if (VERBOSE)
675  printf("CbmTrdModuleSimT::FlushBuffer(%llu) FASP start[%llu] end[%llu] "
676  "closeTS[%c]\n",
677  time,
678  fFASP->GetStartTime(),
679  fFASP->GetEndTime(),
680  (closeTS ? 'y' : 'n'));
681 
682  // ask FASP simulator if there is enough time elapsed from the last running of the simulator
683  if (time > 0 && !fFASP->Go(time) && !closeTS) return 0;
684  // configure FASP simulator time range for special cases
685  if (closeTS) fFASP->SetProcTime(TMath::Nint(fTimeSlice->GetEndTime()));
686 
687  if (VERBOSE) {
688  cout << "\nPHYS DIGITS : \n";
689  DumpBuffer();
690  }
691  Int_t /*n1(0),*/ rowOld(-1), asicId, asicOld(-1);
692  CbmTrdDigi* digi(NULL);
693  CbmMatch* digiMatch(NULL);
694  // CbmTrdParFasp *fasp(NULL); const CbmTrdParFaspChannel *chFasp[2]={NULL}; (VF) not used
695 
696  // write from saved buffer
697  Int_t localAddress(0), ndigi(0) /*, n2(0)*/;
698  std::map<Int_t, std::vector<std::pair<CbmTrdDigi*, CbmMatch*>>>::iterator it =
699  fBuffer.begin();
700  for (; it != fBuffer.end(); it++) {
701  localAddress = it->first;
702  ndigi = fBuffer[localAddress].size();
703  if (!ndigi) {
704  //printf("FOUND saved vector empty @ %d\n", localAddress);
705  continue;
706  }
707  // compute CBM address
708  Int_t col, row = GetPadRowCol(localAddress, col);
709 
710  // get ASIC channel calibration
711  Int_t asicAddress = fAsicPar->GetAsicAddress(localAddress << 1);
712  if (asicAddress < 0) {
713  LOG(warn) << GetName() << "::FlushBuffer: FASP Calibration for ro_ch "
714  << localAddress << " in module " << fModAddress << " missing.";
715  } else {
716  LOG(debug) << GetName() << "::FlushBuffer: Found FASP "
717  << asicAddress % 1000 << " for ro_ch " << localAddress
718  << " in module " << fModAddress;
719  // fasp = (CbmTrdParFasp*)fAsicPar->GetAsicPar(asicAddress); (VF) not used
720  //fasp->Print();
721  // chFasp[0] = fasp->GetChannel(localAddress, 0);
722  // chFasp[1] = fasp->GetChannel(localAddress, 1);
723  }
724 
725  if (rowOld < 0) { // first row
726  rowOld = row;
727  //printf("PROCESS FIRST ROW %d\n", row);
728  }
729  asicId = row * 9 + col / 8;
730  if (asicOld < 0) { // first row
731  asicOld = asicId;
732  //printf("PROCESS FIRST ASIC %d\n", asicId);
733  }
734  if (row != rowOld || asicId != asicOld) { // next row
735  //printf("PROCESS ASIC[%3d] ROW[%2d]\n", asicId, row);
736  rowOld = row;
737  asicOld = asicId;
738  }
739  fFASP->PhysToRaw(&(it->second), col, row);
740  }
741  if (fFASP) fFASP->Clear("draw"); // clear buffer
742 
743  if (VERBOSE) {
744  cout << "\nFEE DIGITS : \n";
745  DumpBuffer();
746  cout << "\nRAW DIGITS : \n";
747  }
748 
749  //save digitisation results
750  Int_t n(0), nDigiLeft(0);
751  Double_t timeMin(-1), timeMax(0);
752  ULong64_t newStartTime(0);
753  it = fBuffer.begin();
754  std::vector<std::pair<CbmTrdDigi*, CbmMatch*>>::iterator iv;
755  while (it != fBuffer.end()) {
756  localAddress = it->first;
757  if (!fBuffer[localAddress].size()) continue;
758 
759  digiMatch = NULL;
760  Int_t col(-1), row(-1), srow, sec;
761  iv = fBuffer[localAddress].begin();
762  while (iv != fBuffer[localAddress].end()) {
763  digi = iv->first;
764  if (!digi->IsMasked()) { // no more digi processed
765  if (newStartTime == 0 || digi->GetTimeDAQ() < newStartTime)
766  newStartTime = digi->GetTimeDAQ();
767  break;
768  }
769  if (digi->IsFlagged(
770  0)) { // phys digi didn't produce CS/FT update last digiMatch
771  delete digi;
772  if (digiMatch) {
773  digiMatch->AddLink(iv->second->GetLink(0));
774  if (VERBOSE) cout << "\t" << digiMatch->ToString();
775  }
776  iv = fBuffer[localAddress].erase(iv); // remove from saved buffer
777  continue;
778  }
779 
780  if (col < 0) {
781  row = GetPadRowCol(localAddress, col);
782  sec = fDigiPar->GetSector(row, srow);
783  if (VERBOSE)
784  printf("CbmTrdModuleSimT::FlushBuffer : request ly[%d] mod[%d] "
785  "sec[%d] srow[%d] col[%d]\n",
786  fLayerId,
788  sec,
789  srow,
790  col);
791  //address = CbmTrdAddress::GetAddress(fLayerId, CbmTrdAddress::GetModuleId(fModAddress), sec, srow, col);
792  }
793  if (timeMin < 0 || digi->GetTime() < timeMin) timeMin = digi->GetTime();
794  if (digi->GetTime() > timeMax) timeMax = digi->GetTime();
795 
796  if (VERBOSE) cout << "\t" << digi->ToString();
797  digiMatch = iv->second;
798  fDigitizer->SendData(digi, digiMatch);
799  n++;
800  iv = fBuffer[localAddress].erase(iv); // remove from saved buffer
801  }
802  // clear address if there are no more digits available
803  if (fBuffer[localAddress].size()) {
804  nDigiLeft += fBuffer[localAddress].size();
805  //printf("%d left-overs @ %d\n", fBuffer[localAddress].size(), localAddress);
806  it++;
807  } else
808  it = fBuffer.erase(it);
809  }
810  if (VERBOSE)
811  printf("CbmTrdModuleSimT::FlushBuffer : write %d digis from %duns to "
812  "%duns. Digits still in buffer %d\n",
813  n,
814  TMath::Nint(timeMin),
815  TMath::Nint(timeMax),
816  nDigiLeft);
817  fFASP->SetStartTime(newStartTime);
818  fFASP->SetProcTime();
819 
820  //iteratively process all digi at the end of run
821  if (time == 0 && nDigiLeft) n += FlushBuffer();
822  return n;
823 }
824 
825 //_______________________________________________________________________________________________
827  for (std::map<Int_t,
828  std::vector<std::pair<CbmTrdDigi*, CbmMatch*>>>::const_iterator
829  it = fBuffer.begin();
830  it != fBuffer.end();
831  it++) {
832  if (!it->second.size()) continue;
833  printf("address[%10d] n[%2d]\n", it->first, (Int_t) it->second.size());
834  for (std::vector<std::pair<CbmTrdDigi*, CbmMatch*>>::const_iterator iv =
835  it->second.cbegin();
836  iv != it->second.cend();
837  iv++) {
838  cout << "\t" << (iv->first->IsFlagged(0) ? 'P' : 'D') << "[" << iv->first
839  << "] " << iv->first->ToString();
840  cout << "\t" << iv->second->ToString();
841  }
842  }
843 }
844 
845 
846 //_______________________________________________________________________________
850  if (fAsicPar) {
851  LOG(warn) << GetName() << "::SetAsicPar : The list for module "
852  << fModAddress << " already initialized.";
853  return;
854  }
855  fAsicPar = p; //new CbmTrdParSetAsic();
856  //fAsicPar->Print();
857  return;
858  // if(!fDigiPar){
859  // LOG(warn) << GetName() << "::SetAsicPar : No Digi params for module "<< fModAddress <<". Try calling first CbmTrdModSim::SetDigiPar to get FASP position right.";
860  // return;
861  // }
862  //
863  // CbmTrdParAsic *asic(NULL);
864  //
865  // Int_t iFebGroup = 0;
866  // Int_t gRow[3] = { 1, 2, 4 }; // re-ordering on the feb -> same mapping for normal and super
867  // Int_t gCol[3] = { 8, 8, 4 }; // re-ordering on the feb -> same mapping for normal and super
868  // Double_t xAsic = 0; // x position of Asic
869  // Double_t yAsic = 0; // y position of Asic
870  //
871  // Int_t rowId(0), isecId(0), irowId(0), iAsic(0);
872  // for (Int_t s = 0, rg(0); s < fDigiPar->GetNofSectors(); s++) {
873  // for (Int_t r = 0; r < fDigiPar->GetNofRowsInSector(s); r++, rg++){
874  // for (Int_t c = 0; c < fDigiPar->GetNofColumnsInSector(s); c++){
875  // // ultimate density 6 rows, 5 pads
876  // // super density 4 rows, 8 pads
877  // // normal density 2 rows, 16 pads
878  // if ((rowId % gRow[iFebGroup]) == 0){
879  // if ((c % gCol[iFebGroup]) == 0){
880  // xAsic = c + gCol[iFebGroup] / 2.;
881  // yAsic = r + gRow[iFebGroup] / 2.;
882  //
883  // Double_t local_point[3];
884  // Double_t padsizex = fDigiPar->GetPadSizeX(s);
885  // Double_t padsizey = fDigiPar->GetPadSizeY(s);
886  //
887  // // calculate position in sector coordinate system
888  // // with the origin in the lower left corner (looking upstream)
889  // local_point[0] = ((Int_t)(xAsic + 0.5) * padsizex);
890  // local_point[1] = ((Int_t)(yAsic + 0.5) * padsizey);
891  //
892  // // calculate position in module coordinate system
893  // // with the origin in the lower left corner (looking upstream)
894  // local_point[0] += fDigiPar->GetSectorBeginX(s);
895  // local_point[1] += fDigiPar->GetSectorBeginY(s);
896  // if (local_point[0] > 2*fDx) LOG(error) << GetName() << "::SetAsicPar: asic position x=" << local_point[0] << " is out of bounds [0," << 2*fDx<< "]!";
897  // if (local_point[1] > 2*fDy) LOG(error) << GetName() << "::SetAsicPar: asic position y=" << local_point[1] << " is out of bounds [0," << 2*fDy<< "]!";
898  //
899  // // local_point[i] must be >= 0 at this point Double_t local_point[3];
900  // Int_t address=GetAsicAddress(iAsic);
901  // if(!(asic = fAsicPar->GetAsicPar(address))){
902  // LOG(warn) << GetName() << "::SetAsicPar : Couldn't find ASIC @ "<<local_point[0] - fDx<<", "<< local_point[1] - fDy<<" address "<<address;
903  // asic = new CbmTrdParFasp(address, iFebGroup, local_point[0] - fDx, local_point[1] - fDy);
904  // fAsicPar->SetAsicPar(address, asic);
905  // } else {
906  // //LOG(info) << GetName() << "::SetAsicPar : Found ASIC @ address "<<address;
907  // asic->SetPosition(local_point[0] - fDx, local_point[1] - fDy);
908  // asic->SetFebGrouping(iFebGroup);
909  // }
910  //
911  // // read-out channel to FASP channel mapping TODO more realistically
912  // for (Int_t ir = rowId; ir < rowId + gRow[iFebGroup]; ir++) {
913  // for (Int_t ic = c; ic < c + gCol[iFebGroup]; ic++) {
914  // if (ir >= fDigiPar->GetNofRows() ) LOG(error) << GetName() << "::SetAsicPar: ir " << ir << " is out of bounds!";
915  // if (ic >= fDigiPar->GetNofColumns() ) LOG(error) << GetName() << "::SetAsicPar: ic " << ic << " is out of bounds!";
916  // //isecId = fDigiPar->GetSector((Int_t)ir, irowId);
917  // asic->SetChannelAddress(GetPadAddress(rg, ic));
918  // //CbmTrdAddress::GetAddress(CbmTrdAddress::GetLayerId(fModAddress), CbmTrdAddress::GetModuleId(fModAddress), isecId, irowId, ic));
919  // if (false)
920  // printf(" M:%10i(%4i) s: %i irowId: %4i ic: %4i r: %4i c: %4i address:%10i\n",fModAddress,
921  // CbmTrdAddress::GetModuleId(fModAddress),
922  // isecId, irowId, ic, r, c,
923  // CbmTrdAddress::GetAddress(fLayerId, fModAddress, isecId, irowId, ic));
924  // }
925  // }
926  // iAsic++; // next Asic
927  // }
928  // }
929  // }
930  // rowId++;
931  // }
932  // }
933  //
934  // // Self Test
935  // // for (Int_t s = 0; s < fDigiPar->GetNofSectors(); s++){
936  // // const Int_t nRow = fDigiPar->GetNofRowsInSector(s);
937  // // const Int_t nCol = fDigiPar->GetNofColumnsInSector(s);
938  // for (Int_t r = 0; r < GetNrows(); r++){
939  // for (Int_t c = 0; c < GetNcols(); c++){
940  // Int_t channelAddress = GetPadAddress(r,c);
941  // //CbmTrdAddress::GetAddress(CbmTrdAddress::GetLayerId(fModAddress),CbmTrdAddress::GetModuleId(fModAddress), s, r, c);
942  // if (fAsicPar->GetAsicAddress(channelAddress) == -1)
943  // LOG(error) << GetName() << "::SetAsicPar: Channel address:" << channelAddress << " is not or multiple initialized in module " << fModAddress << "(ID:" << CbmTrdAddress::GetModuleId(fModAddress) << ")" << "(r:" << r << ", c:" << c << ")";
944  // }
945  // }
946  // // }
947  // //fAsicPar->Print();
948 }
949 
CbmDigitizeBase.h
CbmTrdParModDigi::GetPadSizeY
Double_t GetPadSizeY(Int_t i) const
Definition: CbmTrdParModDigi.h:37
CbmTrdDigi::GetTimeDAQ
ULong64_t GetTimeDAQ() const
Getter for global DAQ time [clk]. Differs for each ASIC. In FASP case DAQ time is already stored in f...
Definition: CbmTrdDigi.h:131
CbmTrdParModGas.h
CbmTrdParModDigi::ProjectPositionToNextAnodeWire
void ProjectPositionToNextAnodeWire(Double_t *local_point) const
Definition: CbmTrdParModDigi.cxx:190
CbmMatch
Definition: CbmMatch.h:22
CbmTrdPoint::GetYOut
Double_t GetYOut() const
Definition: CbmTrdPoint.h:67
CbmTrdTrianglePRF::PrevBinY
Bool_t PrevBinY()
Move current bin down.
Definition: CbmTrdTrianglePRF.cxx:239
CbmTrdParModGas::GetBindingEnergy
Float_t GetBindingEnergy(const Char_t shell='K', Bool_t main=kTRUE) const
Get binding energy for the working gas.
Definition: CbmTrdParModGas.cxx:143
CbmTrdPoint::GetZIn
Double_t GetZIn() const
Definition: CbmTrdPoint.h:65
CbmTrdModuleSimT::fTriangleBinning
CbmTrdTrianglePRF * fTriangleBinning
Integration of PRF on triangular pad-plane geometry.
Definition: CbmTrdModuleSimT.h:76
CbmTrdAddress.h
Helper class to convert unique channel ID back and forth.
CbmTrdModuleAbstract::fModAddress
UShort_t fModAddress
unique identifier for current module
Definition: CbmTrdModuleAbstract.h:78
CbmTrdDigi::IsFlagged
Bool_t IsFlagged(const Int_t iflag) const
Query flag status (generic)
Definition: CbmTrdDigi.cxx:165
CbmTrdFASP.h
CbmTrdModuleSim::fEventId
Int_t fEventId
MC event id being processed.
Definition: CbmTrdModuleSim.h:88
CbmTrdTrianglePRF::Norm
Double_t Norm() const
Definition: CbmTrdTrianglePRF.h:91
CbmTrdParModDigi::GetNofRowsInSector
Int_t GetNofRowsInSector(Int_t i) const
Definition: CbmTrdParModDigi.cxx:366
CbmTrdModuleSimT::fTimeOld
ULong64_t fTimeOld
time [ns] of the last event processed (check CbmDaq)
Definition: CbmTrdModuleSimT.h:79
CbmTrdParModGas::GetDriftTime
Double_t GetDriftTime(Double_t y0, Double_t z0) const
Definition: CbmTrdParModGas.cxx:189
CbmTrdParModDigi::GetNofRows
Int_t GetNofRows() const
Definition: CbmTrdParModDigi.cxx:340
CbmTrdModuleAbstract::fAsicPar
CbmTrdParSetAsic * fAsicPar
the set of ASIC operating on the module (owned)
Definition: CbmTrdModuleAbstract.h:87
CbmTrdTrianglePRF.h
CbmTrdModuleAbstract::GetPadAddress
virtual Int_t GetPadAddress(Int_t r, Int_t c) const
Addressing read-out pads on module based on (row,col)
Definition: CbmTrdModuleAbstract.h:57
CbmTrdDigitizer.h
TRD digitizer. Updated 24/04/2013 by Andrey Lebedev andrey.lebedev@gsi.de Updated 4/06/2018 by Alex B...
CbmTrdModuleAbstract::GetPath
virtual const Char_t * GetPath() const
Definition: CbmTrdModuleAbstract.h:66
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmTrdParSetAsic
Describe TRD module ASIC settings (electronic gain, delays, etc)
Definition: CbmTrdParSetAsic.h:18
CbmTrdModuleSimT::CbmTrdModuleSimT
CbmTrdModuleSimT(Int_t mod, Int_t ly, Int_t rot, Bool_t FASP=kTRUE)
Definition: CbmTrdModuleSimT.cxx:41
CbmTrdParSetAsic::GetAsicAddress
virtual Int_t GetAsicAddress(Int_t chAddress) const
Look for the ASIC which operates on a specific channel.
Definition: CbmTrdParSetAsic.cxx:209
CbmTrdPoint::GetXOut
Double_t GetXOut() const
Definition: CbmTrdPoint.h:66
CbmTrdAddress::GetModuleId
static UInt_t GetModuleId(UInt_t address)
Return module ID from address.
Definition: CbmTrdAddress.h:78
CbmTrdModuleSimT::MakeDigi
Bool_t MakeDigi(CbmTrdPoint *p, Double_t time, Bool_t TR)
Steer building of digits for triangular pad geometry.
Definition: CbmTrdModuleSimT.cxx:59
CbmTrdRadiator.h
CbmMatch.h
VERBOSE
#define VERBOSE
Definition: CbmTrdModuleSimT.cxx:30
CbmTrdFASP::SetStartTime
void SetStartTime(ULong64_t t)
Set buffer time offset [ns].
Definition: CbmTrdFASP.h:79
CbmTrdParModGas::GetNonIonizingBR
Float_t GetNonIonizingBR(const Char_t shell='K') const
Get branching ration for radiative process on the.
Definition: CbmTrdParModGas.cxx:165
CbmTimeSlice.h
CbmTrdPoint::Print
virtual void Print(const Option_t *opt) const
Definition: CbmTrdPoint.cxx:51
CbmTrdModuleSimT::SetAsicPar
void SetAsicPar(CbmTrdParSetAsic *p=NULL)
Definition: CbmTrdModuleSimT.cxx:847
CbmTrdModuleSimT.h
CbmTrdModuleSim
Abstract class for module wise digitization and raw format producing.
Definition: CbmTrdModuleSim.h:18
CbmTrdParSetAsic.h
CbmTrdRadiator::LatticeHit
Bool_t LatticeHit(const CbmTrdPoint *point)
Definition: CbmTrdRadiator.cxx:618
CbmTrdParModDigi::GetPadInfo
Bool_t GetPadInfo(const Double_t *local_point, Int_t &sectorId, Int_t &columnId, Int_t &rowId) const
Definition: CbmTrdParModDigi.cxx:436
CbmTrdParModGas::EkevFC
Float_t EkevFC(Float_t ekev) const
Convert Energy debposit in keV to pad-plane charge taking into account the gas gain.
Definition: CbmTrdParModGas.cxx:85
CbmTrdModuleSim::fInputId
Int_t fInputId
MC input file number.
Definition: CbmTrdModuleSim.h:89
CbmTrdModuleSim::fDigitizer
CbmTrdDigitizer * fDigitizer
Definition: CbmTrdModuleSim.h:91
CbmTrdParModGain.h
CbmTrdParModDigi::GetPadSizeX
Double_t GetPadSizeX(Int_t i) const
Definition: CbmTrdParModDigi.h:36
CbmTrdModuleSim::SetPositionMC
virtual void SetPositionMC(Double_t pos[3])
Definition: CbmTrdModuleSim.h:73
CbmTimeSlice::GetEndTime
Double_t GetEndTime() const
Definition: CbmTimeSlice.cxx:94
CbmTrdFASP::GetEndTime
virtual ULong64_t GetEndTime() const
Definition: CbmTrdFASP.h:35
CbmTrdDigi.h
CbmTrdTrianglePRF::NextBinX
Bool_t NextBinX()
Move current bin to the right.
Definition: CbmTrdTrianglePRF.cxx:198
CbmTrdTrianglePRF::PrevBinX
Bool_t PrevBinX()
Move current bin to the left.
Definition: CbmTrdTrianglePRF.cxx:229
CbmTrdParModDigi::GetSector
Int_t GetSector(Int_t npady, Int_t &rowId) const
Definition: CbmTrdParModDigi.cxx:274
CbmTrdModuleSimT::~CbmTrdModuleSimT
virtual ~CbmTrdModuleSimT()
Definition: CbmTrdModuleSimT.cxx:52
CbmTrdParModDigi::GetAnodeWireSpacing
Double_t GetAnodeWireSpacing() const
Definition: CbmTrdParModDigi.h:47
CbmTrdTrianglePRF::SetOrigin
Bool_t SetOrigin(Double_t x, Double_t y)
Set map offset @ point (x,y)
Definition: CbmTrdTrianglePRF.cxx:249
CbmTrdParFasp.h
CbmTrdTrianglePRF::GetCurrentPad
void GetCurrentPad(Int_t &col, Int_t &row, Int_t &u) const
Compute the pad corresponding to current bin.
Definition: CbmTrdTrianglePRF.cxx:162
CbmTrdModuleSim::fPointId
Int_t fPointId
MC point id being processed.
Definition: CbmTrdModuleSim.h:87
CbmTrdModuleSimT::fTimeSlice
CbmTimeSlice * fTimeSlice
link to CBM time slice
Definition: CbmTrdModuleSimT.h:78
CbmMatch::AddLink
void AddLink(const CbmLink &newLink)
Definition: CbmMatch.cxx:42
CbmTrdFASP::SetLGminLength
static void SetLGminLength(Int_t nclk)
Set linear-gate minimum length.
Definition: CbmTrdFASP.h:63
CbmTrdTrianglePRF::NR
@ NR
no. of neighbor rows (except the hit) to be considered in cluster definition
Definition: CbmTrdTrianglePRF.h:31
CbmTrdParModDigi.h
CbmTrdModuleSimT::FlushBuffer
Int_t FlushBuffer(ULong64_t time=0)
Flush local buffer of digits which can no longer interact with current event.
Definition: CbmTrdModuleSimT.cxx:655
CbmTrdFASP
FASP channel simulator.
Definition: CbmTrdFASP.h:24
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmTrdModuleSimT::DumpBuffer
void DumpBuffer() const
Print current buffer content.
Definition: CbmTrdModuleSimT.cxx:826
CbmTrdModuleAbstract::fChmbPar
const CbmTrdParModGas * fChmbPar
detection description (HV, drift) of module
Definition: CbmTrdModuleAbstract.h:85
CbmTrdPoint::GetZOut
Double_t GetZOut() const
Definition: CbmTrdPoint.h:68
CbmTrdModuleSim::fBuffer
std::map< Int_t, std::vector< std::pair< CbmTrdDigi *, CbmMatch * > > > fBuffer
Local digits buffer as function of time for each TRD channel in the module.
Definition: CbmTrdModuleSim.h:99
CbmTrdModuleAbstract::fDigiPar
const CbmTrdParModDigi * fDigiPar
read-out description of module
Definition: CbmTrdModuleAbstract.h:83
CbmTrdTrianglePRF::GoToOriginY
void GoToOriginY()
Move current biny to the origin biny0.
Definition: CbmTrdTrianglePRF.h:80
CbmTrdDigi::IsMasked
Bool_t IsMasked() const
Query digi mask (FASP only)
Definition: CbmTrdDigi.h:142
CbmTrdFASP::Clear
virtual void Clear(Option_t *opt="")
Finalize currently stored data.
Definition: CbmTrdFASP.cxx:97
CbmTrdPoint
Definition: CbmTrdPoint.h:23
CbmTrdTrianglePRF::GetChargeFraction
Double_t GetChargeFraction() const
Compute charge fraction on the current bin.
Definition: CbmTrdTrianglePRF.cxx:151
CbmTrdParModGas::GetPEshell
Char_t GetPEshell(Float_t Ex) const
Get first atomic shell which can be excited by PE effect.
Definition: CbmTrdParModGas.cxx:174
CbmDigitize::SendData
void SendData(Digi *digi, CbmMatch *match=nullptr)
Send a digi and the corresponding match object to the DAQ.
Definition: CbmDigitize.h:219
CbmTrdParModDigi::TransformToLocalPad
void TransformToLocalPad(const Double_t *local_point, Double_t &posX, Double_t &posY) const
Definition: CbmTrdParModDigi.cxx:634
CbmTrdModuleSim::fRadiator
CbmTrdRadiator * fRadiator
Pointer to digitizer.
Definition: CbmTrdModuleSim.h:94
CbmTrdModuleAbstract::GetPadRowCol
virtual Int_t GetPadRowCol(Int_t address, Int_t &c) const
Addressing read-out pads based on module address.
Definition: CbmTrdModuleAbstract.h:100
CbmTrdTrianglePRF::NC
@ NC
no. of neighbor columns (except the hit) to be considered in cluster definition
Definition: CbmTrdTrianglePRF.h:29
CbmTimeSlice
Bookkeeping of time-slice content.
Definition: CbmTimeSlice.h:29
CbmTrdPoint::GetXIn
Double_t GetXIn() const
Definition: CbmTrdPoint.h:63
CbmTrdModuleAbstract::fLayerId
Char_t fLayerId
layer identifier
Definition: CbmTrdModuleAbstract.h:79
CbmTrdParModGas::ScanDriftTime
Double_t ScanDriftTime(Double_t y0, Double_t z0, Double_t dzdy, Double_t dy) const
Get prompt signal for track segment in the y-z plane.
Definition: CbmTrdParModGas.cxx:210
CbmTrdFASP::Go
virtual Bool_t Go(ULong64_t time)
Check if there is enough time elapsed from fStartTime to run simulator.
Definition: CbmTrdFASP.cxx:206
CbmTrdRadiator::GetTR
Float_t GetTR(TVector3 mom)
Definition: CbmTrdRadiator.cxx:732
CbmTrdTrianglePRF::GoToOriginX
void GoToOriginX()
Move current binx to the origin binx0.
Definition: CbmTrdTrianglePRF.h:76
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:60
CbmTrdFASP::GetStartTime
virtual ULong64_t GetStartTime() const
Definition: CbmTrdFASP.h:36
CbmTrdTrianglePRF::NextBinY
Bool_t NextBinY()
Move current bin up.
Definition: CbmTrdTrianglePRF.cxx:208
CbmTrdPoint.h
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmTrdDigi
Definition: CbmTrdDigi.h:14
CbmTrdDigi::GetTime
Double_t GetTime() const
Getter for physical time [ns]. Accounts for clock representation of each ASIC. In SPADIC case physica...
Definition: CbmTrdDigi.h:127
CbmTrdModuleSimT::fFASP
CbmTrdFASP * fFASP
FASP simulator.
Definition: CbmTrdModuleSimT.h:77
CbmTrdModuleSimT::ScanPadPlane
Bool_t ScanPadPlane(const Double_t *point, Double_t dx, Double_t E, Double_t tdrift)
Build digits for the triangular pad geometry.
Definition: CbmTrdModuleSimT.cxx:339
CbmTrdFASP::PhysToRaw
virtual void PhysToRaw(std::vector< std::pair< CbmTrdDigi *, CbmMatch * >> *digi, Int_t col=0, Int_t row=0)
Convert physics information in digi to the raw format.
Definition: CbmTrdFASP.cxx:296
CbmTrdTrianglePRF
Utility for converting energy to signal over the triangular pad geometry (Bucharest prototype)
Definition: CbmTrdTrianglePRF.h:26
CbmTrdFASP::SetProcTime
void SetProcTime(ULong64_t t=0)
Set limit in time for processing digis.
Definition: CbmTrdFASP.cxx:798
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
CbmTrdModuleSimT::SetAsic
void SetAsic(Bool_t)
Definition: CbmTrdModuleSimT.h:41
CbmTrdPoint::GetYIn
Double_t GetYIn() const
Definition: CbmTrdPoint.h:64
CbmTrdModuleSimT::AddDigi
void AddDigi(Int_t address, Double_t *charge, Double_t time)
Adding triangular digits to time slice buffer.
Definition: CbmTrdModuleSimT.cxx:606
CbmTrdParModDigi::GetNofColumns
Int_t GetNofColumns() const
Definition: CbmTrdParModDigi.cxx:321
CbmTrdFASP::SetNeighbourTrigger
static void SetNeighbourTrigger(Bool_t nb=kTRUE)
Set FASP trigger mode.
Definition: CbmTrdFASP.h:67
CbmMatch::ToString
virtual std::string ToString() const
Return string representation of the object.
Definition: CbmMatch.cxx:21
CbmTrdModuleSimT
Simulation module implementation for triangular pad geometry.
Definition: CbmTrdModuleSimT.h:14
CbmTrdDigi::ToString
std::string ToString() const
String representation of a TRD digi. Account for digi type and specific information.
Definition: CbmTrdDigi.cxx:243