CbmRoot
CbmMvdSensorDigitizerTBTask.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmMvdSensorDigitizerTBTask source file -----
3 // ----- Created 02.02.2012 by M. Deveaux -----
4 // -------------------------------------------------------------------------
20 
21 #include "TClonesArray.h"
22 #include "TObjArray.h"
23 
24 #include "CbmMvdPileupManager.h"
25 #include "CbmMvdPoint.h"
26 
27 #include "FairRuntimeDb.h"
28 
29 // Includes from FairRoot
30 #include "FairEventHeader.h"
31 #include "FairLogger.h"
32 #include "FairMCEventHeader.h"
33 #include "FairRunAna.h"
34 #include "FairRunSim.h"
35 
36 
37 // Includes from C++
38 #include <iomanip>
39 #include <iostream>
40 #include <map>
41 #include <vector>
42 
43 using std::cout;
44 using std::endl;
45 using std::fixed;
46 using std::ios_base;
47 using std::left;
48 using std::map;
49 using std::pair;
50 using std::right;
51 using std::setprecision;
52 using std::setw;
53 using std::vector;
54 
55 // ----- Standard constructor ------------------------------------------
58  , fEpiTh()
59  , fSegmentLength()
60  , fDiffusionCoefficient()
61  , fElectronsPerKeV()
62  , fWidthOfCluster()
63  , fPixelSizeX()
64  , fPixelSizeY()
65  , fCutOnDeltaRays()
66  , fChargeThreshold()
67  , fFanoSilicium()
68  , fEsum()
69  , fSegmentDepth()
70  , fCurrentTotalCharge()
71  , fCurrentParticleMass()
72  , fCurrentParticleMomentum()
73  , fCurrentParticlePdg()
74  , fLorentzY0()
75  , fLorentzXc()
76  , fLorentzW()
77  , fLorentzA()
78  , fLorentzNorm()
79  , fLandauMPV()
80  , fLandauSigma()
81  , fLandauGain()
82  , fLandauRandom(new TRandom3())
83  , fPixelSize()
84  , fPar0()
85  , fPar1()
86  , fPar2()
87  , fCompression()
88  , fResolutionHistoX()
89  , fResolutionHistoY()
90  , fNumberOfSegments()
91  , fCurrentLayer()
92  , fEvent()
93  , fVolumeId()
94  , fNPixelsX()
95  , fNPixelsY()
96  , fPixelCharge()
97  , fDigis()
98  , fDigiMatch()
99  , frand()
100  , fproduceNoise()
101  , fPixelChargeShort()
102  , fPixelScanAccelerator()
103  , fChargeMap()
104  , fChargeMapIt()
105  , fsensorDataSheet()
106  , fSigmaX()
107  , fSigmaY()
108  , fReadoutTime()
109  , fEfficiency()
110  , fMergeDist()
111  , fFakeRate()
112  , fInputPoints()
113  , fRandGen()
114  , fTimer()
115  , fNEvents()
116  , fNPoints()
117  , fNReal()
118  , fNBg()
119  , fNFake()
120  , fNLost()
121  , fNMerged()
122  , fTime()
123  , fReadoutLast()
124  , fReadoutCurrent()
125  , fReadoutNext()
126  , fSignalPoints() {
127  LOG(debug)
128  << "Starting CbmMvdSensorDigitizerTBTask::CbmMvdSensorDigitizerTBTask() ";
129 
130  fRandGen.SetSeed(2736);
131  fEvent = 0;
132  fTime = 0.;
133  fSigmaX = 0.0005;
134  fSigmaY = 0.0005;
135  fReadoutTime = 0.00005;
136 
137  fSegmentLength = 0.0001;
139  0.0055; // correspondes to the sigma of the gauss with the max drift length
140  fElectronsPerKeV = 276; //3.62 eV for e-h creation
141  fWidthOfCluster = 3.5; // in sigmas
142  fCutOnDeltaRays = 0.00169720; //MeV
143  fChargeThreshold = 100.; //electrons change 1 to 10
144  fFanoSilicium = 0.115;
145  fEsum = 0;
146  fSegmentDepth = 0;
151 
152  fPixelSize = 0.0025;
153 
154  fLorentzY0 = -6.1;
155  fLorentzXc = 0.;
156  fLorentzW = 1.03;
157  fLorentzA = 477.2;
158 
159  //fLorentzNorm=0.00013010281679422413;
160  fLorentzNorm = 1;
161 
162  frand = new TRandom3(0);
163  fproduceNoise = kFALSE;
164 
165  fReadoutLast = -1.;
166  fReadoutCurrent = 0.;
167 }
168 // -------------------------------------------------------------------------
169 
170 // ----- Destructor ----------------------------------------------------
172 
173  if (fInputPoints) {
174  fInputPoints->Delete();
175  delete fInputPoints;
176  }
177  if (fOutputBuffer) {
178  fOutputBuffer->Delete();
179  delete fOutputBuffer;
180  }
181 }
182 // ------------------------------------------------------------------------
183 
184 // ----- Virtual private method ReadSensorInformation ----------------
186 
187  CbmMvdSensorDataSheet* sensorData;
188  sensorData = fSensor->GetDataSheet();
189  if (!sensorData) { return kERROR; }
190 
191  fPixelSizeX = sensorData->GetPixelPitchX();
192  fPixelSizeY = sensorData->GetPixelPitchY();
193  fNPixelsX = sensorData->GetNPixelsX();
194  fNPixelsY = sensorData->GetNPixelsY();
195 
196  fChargeThreshold = sensorData->GetChargeThreshold();
197 
198  fPar0 = sensorData->GetLorentzPar0();
199  LOG(debug) << fPar0;
200  fPar1 = sensorData->GetLorentzPar1();
201  LOG(debug) << fPar1;
202  fPar2 = sensorData->GetLorentzPar2();
203  LOG(debug) << fPar2;
204 
205  fLandauMPV = sensorData->GetLandauMPV();
206  fLandauSigma = sensorData->GetLandauSigma();
207  fLandauGain = sensorData->GetLandauGain();
208  fEpiTh = sensorData->GetEpiThickness();
209 
210  return kSUCCESS;
211 }
212 // -----------------------------------------------------------------------------
213 
214 
215 // -----------------------------------------------------------------------------
216 void CbmMvdSensorDigitizerTBTask::SetInputArray(TClonesArray* inputStream) {
217 
218  Int_t i = 0;
219  Int_t nInputs = inputStream->GetEntriesFast();
220  while (nInputs > i) {
221  new ((*fInputPoints)[fInputPoints->GetEntriesFast()])
222  CbmMvdPoint(*((CbmMvdPoint*) inputStream->At(i)));
223  ++i;
224  }
225 }
226 // -----------------------------------------------------------------------------
227 
228 // -----------------------------------------------------------------------------
230 
231  new ((*fInputPoints)[fInputPoints->GetEntriesFast()])
232  CbmMvdPoint(*((CbmMvdPoint*) point));
233 }
234 // -----------------------------------------------------------------------------
235 
236 // -------------- public method ExecChain ------------------------------------
238 // -----------------------------------------------------------------------------
239 
240 // ----- Virtual public method Exec ------------------------------------
242 
243  if (fPreviousPlugin) {
244  fInputPoints->Delete();
245  fInputPoints->AbsorbObjects(fPreviousPlugin->GetOutputArray());
246  }
247  fOutputBuffer->Clear();
248  Int_t inputNr = 0;
249  Int_t eventNr = 0;
250  // Int_t nDigis = 0; (VF) not used
251  GetEventInfo(inputNr, eventNr, fTime);
252 
255  if (fInputPoints->GetEntriesFast() > 0) {
256 
257  for (Int_t iPoint = 0; iPoint < fInputPoints->GetEntriesFast(); iPoint++) {
258 
259  CbmMvdPoint* point = (CbmMvdPoint*) fInputPoints->At(iPoint);
260 
261  if (!point) {
262  cout << "-W-" << GetName() << ":: Exec:" << endl;
263  cout << " -received bad MC-Point. Ignored." << endl;
264  continue;
265  }
266  if (point->GetStationNr() != fSensor->GetSensorNr()) {
267  cout << "-W-" << GetName() << ":: Exec:" << endl;
268  cout << " -received bad MC-Point which doesn't belong here. Ignored."
269  << endl;
270  continue;
271  }
272  //The digitizer acts only on particles, which crossed the station.
273  //Particles generated in the sensor or being absorbed in this sensor are ignored
274  if (TMath::Abs(point->GetZOut() - point->GetZ()) < 0.9 * fEpiTh) {
275  LOG(debug) << "hit not on chip with thickness "
276  << 0.9 * 2 * fSensor->GetDZ();
277  LOG(debug) << "hit not on chip with length "
278  << TMath::Abs(point->GetZOut() - point->GetZ());
279  continue;
280  }
281  // Reject for the time being light nuclei (no digitization modell yet)
282  if (point->GetPdgCode() > 100000) { continue; }
284  ProducePixelCharge(point);
285  } //loop on MCpoints
286 
287  for (Int_t i = 0; i < fPixelCharge->GetEntriesFast(); ++i) {
289 
290  if (pixel->GetCharge() > fChargeThreshold
291  && pixel->GetTime() <= fReadoutLast) {
292  /* Not used
293  nDigis = fOutputBuffer->GetEntriesFast();
294 
295  CbmMvdDigi* digi = new ((*fOutputBuffer)[nDigis]) CbmMvdDigi (fSensor->GetSensorNr(),
296  pixel->GetX(), pixel->GetY(), pixel->GetCharge(),
297  fPixelSizeX, fPixelSizeY, pixel->GetTime(),
298  pixel->GetFrame());
299  */
300 
301 
302  CbmMatch* match = new CbmMatch();
303  for (Int_t iLink = 0; iLink < pixel->GetNContributors(); iLink++) {
304  if (pixel->GetTrackID()[iLink] > -1)
305  match->AddLink((Double_t) pixel->GetPointWeight()[iLink],
306  pixel->GetPointID()[iLink],
307  eventNr,
308  inputNr);
309  else
310  match->AddLink((Double_t) pixel->GetPointWeight()[iLink],
311  pixel->GetPointID()[iLink]);
312  }
313 
314  //digi->SetMatch(match);
315  std::pair<Int_t, Int_t> thispoint =
316  std::make_pair(pixel->GetX(), pixel->GetY());
317  std::pair<std::pair<Int_t, Int_t>, Double_t> thisTimePoint =
318  std::make_pair(thispoint, pixel->GetTime());
319 
320  fChargeMap.erase(thisTimePoint);
321  fPixelCharge->RemoveAt(i);
322 
323  } else {
324  ;
325  }
326  }
327  }
328 
329  else {
330  ;
331  }
332 
333  fPixelCharge->Compress();
334  fInputPoints->Delete();
335  fSignalPoints.clear();
336 
337 } // end of exec
338 // -------------------------------------------------------------------------
339 
340 // -------------------------------------------------------------------------
342  Int_t& eventNr,
343  Double_t& eventTime) {
344 
345  // --- The event number is taken from the FairRootManager
346  eventNr = FairRootManager::Instance()->GetEntryNr();
347 
348  // --- In a FairRunAna, take the information from FairEventHeader
349  if (FairRunAna::Instance()) {
350  FairEventHeader* event = FairRunAna::Instance()->GetEventHeader();
351  inputNr = event->GetInputFileId();
352  eventTime = event->GetEventTime();
353  }
354 
355  // --- In a FairRunSim, the input number and event time are always zero.
356  else {
357  if (!FairRunSim::Instance())
358  LOG(fatal) << GetName() << ": neither SIM nor ANA run.";
359  inputNr = 0;
360  eventTime = 0.;
361  }
362 }
363 // -------------------------------------------------------------------------
364 
365 // -------------------------------------------------------------------------
370  //Transform coordinates of the point into sensor frame
371 
372  Double_t globalPositionIn[3] = {point->GetX(), point->GetY(), point->GetZ()};
373  Double_t globalPositionOut[3] = {
374  point->GetXOut(), point->GetYOut(), point->GetZOut()};
375 
376  Double_t localPositionIn[3] = {0, 0, 0};
377 
378  Double_t localPositionOut[3] = {0, 0, 0};
379 
380  fSensor->TopToLocal(globalPositionIn, localPositionIn);
381  fSensor->TopToLocal(globalPositionOut, localPositionOut);
382 
383  Int_t pixelX, pixelY;
384  fSensor->LocalToPixel(&localPositionIn[0], pixelX, pixelY);
385 
386  // Copy results into variables used by earlier versions
387 
388  Double_t entryX = localPositionIn[0];
389  Double_t exitX = localPositionOut[0];
390  Double_t entryY = localPositionIn[1];
391  Double_t exitY = localPositionOut[1];
392  Double_t entryZ = localPositionIn[2];
393  Double_t exitZ = localPositionOut[2];
394 
413  // entry and exit from the epi layer ( det ref frame ) :
414  Double_t entryZepi = -fEpiTh / 2;
415  Double_t exitZepi = fEpiTh / 2;
416 
417 
418  TVector3 a(entryX, entryY, entryZ); // entry in the detector
419  TVector3 b(exitX, exitY, exitZ); // exit from the detector
420  TVector3 c;
421 
422  c = b - a; // AB in schema
423 
424  TVector3 d;
425  TVector3 e;
426 
427  Double_t scale1 = (entryZepi - entryZ) / (exitZ - entryZ);
428  Double_t scale2 = (exitZepi - entryZ) / (exitZ - entryZ);
429 
430 
431  d = c * scale1;
432  e = c * scale2;
433 
434  TVector3 entryEpiCoord;
435  TVector3 exitEpiCoord;
436 
437  entryEpiCoord = d + a;
438  exitEpiCoord = e + a;
439 
440 
441  //Get x and y coordinates at the ENTRY of the epi layer
442  Double_t entryXepi = entryEpiCoord.X();
443  Double_t entryYepi = entryEpiCoord.Y();
444  entryZepi = entryEpiCoord.Z();
445 
446  //Get x and y coordinates at the EXIT of the epi layer
447  Double_t exitXepi = exitEpiCoord.X();
448  Double_t exitYepi = exitEpiCoord.Y();
449  exitZepi = exitEpiCoord.Z();
450 
451 
452  Double_t lx = -(entryXepi - exitXepi); //length of segment x-direction
453  Double_t ly = -(entryYepi - exitYepi);
454  Double_t lz = -(entryZepi - exitZepi);
455 
456 
457  //-----------------------------------------------------------
458 
459 
460  Double_t rawLength =
461  sqrt(lx * lx + ly * ly
462  + lz * lz); //length of the track inside the epi-layer, in cm
463  Double_t trackLength = 0;
464 
465  if (rawLength < 1.0e+3) {
466  trackLength = rawLength;
467  }
468 
469  else {
470  cout << "-W- " << GetName() << " : rawlength > 1.0e+3 : " << rawLength
471  << endl;
472  trackLength = 1.0e+3;
473  }
474 
475  //Smear the energy on each track segment
476  Double_t charge =
478 
479  if (charge > (12000 / fLandauMPV)) {
480  charge = 12000 / fLandauMPV;
481  } //limit Random generator behaviour
482  //Translate the charge to normalized energy
483 
484  // cout << endl << "charge after random generator " << charge << endl;
485  Double_t dEmean = charge / (fElectronsPerKeV * 1e6);
486  // cout << endl << "dEmean " << dEmean << endl;
487  fNumberOfSegments = int(trackLength / fSegmentLength) + 1;
488 
489  dEmean =
490  dEmean
491  * ((Double_t) trackLength / fEpiTh); //scale the energy to the track length
492 
493  dEmean =
494  dEmean
495  / ((Double_t)
496  fNumberOfSegments); // From this point dEmean corresponds to the E lost per segment.
497 
498 
500 
501  fEsum = 0.0;
502 
503  //Double_t segmentLength_update = trackLength/((Double_t)fNumberOfSegments);
504 
505  if (lz != 0) {
510  fSegmentDepth = fEpiTh / ((Double_t) fNumberOfSegments);
511  } else { //condition added 05/08/08
512  fSegmentDepth = 0;
513  cout << "-W- " << GetName()
514  << " Length of track in detector (z-direction) is 0!!!" << endl;
515  }
516 
517 
518  Double_t x = 0, y = 0, z = 0;
519 
520  Double_t xDebug = 0, yDebug = 0, zDebug = 0;
521  Float_t totalSegmentCharge = 0;
522 
523  for (int i = 0; i < fNumberOfSegments; ++i) {
524 
525  z = -fEpiTh / 2
526  + ((double) (i) + 0.5)
527  * fSegmentDepth; //middle position of the segment; zdirection
528  x =
529  entryXepi
530  + ((double) (i) + 0.5)
531  * (lx
532  / ((Double_t)
533  fNumberOfSegments)); //middle position of the segment; xdirection
534  y =
535  entryYepi
536  + ((double) (i) + 0.5)
537  * (ly
538  / ((Double_t)
539  fNumberOfSegments)); //middle position of the segment; ydirection
540 
541  if (fShowDebugHistos) {
542  xDebug = xDebug + x;
543  yDebug = yDebug + y;
544  zDebug = zDebug + z;
545  };
546 
547  SignalPoint* sPoint = &fSignalPoints[i];
548 
549  fEsum = fEsum + dEmean;
550  sPoint->eloss = dEmean;
551  sPoint->x =
552  x; //here the coordinates x,y,z are given in the sensor reference frame.
553  sPoint->y = y;
554  sPoint->z = z;
555  charge = 1.0e+6 * dEmean * fElectronsPerKeV;
556  //cout << endl << "charge " << charge << endl;
557  sPoint->sigmaX = fPixelSize;
558  sPoint->sigmaY = fPixelSize;
559  sPoint->charge = charge;
560  totalSegmentCharge = totalSegmentCharge + charge;
561  }
562 }
563 // -------------------------------------------------------------------------
564 
566 
567  fCurrentTotalCharge = 0.0;
568 
569  CbmMvdPixelCharge* pixel;
570 
571  pair<Int_t, Int_t> thispoint;
572  pair<pair<Int_t, Int_t>, Double_t> thisTimePoint;
573 
574  Double_t xCentre, yCentre, sigmaX, sigmaY, xLo, xUp, yLo, yUp;
575 
576  SignalPoint* sPoint;
577  sPoint = &fSignalPoints[0];
578 
579  xCentre = sPoint->x; //of segment
580  yCentre = sPoint->y;
581  sigmaX = sPoint->sigmaX;
582  sigmaY = sPoint->sigmaY;
583 
584  xLo = sPoint->x - fWidthOfCluster * sigmaX;
585  xUp = sPoint->x + fWidthOfCluster * sigmaX;
586  yLo = sPoint->y - fWidthOfCluster * sigmaY;
587  yUp = sPoint->y + fWidthOfCluster * sigmaY;
588 
589  if (fNumberOfSegments < 2) {
590  Fatal("-E- CbmMvdDigitizer: ",
591  "fNumberOfSegments < 2, this makes no sense, check parameters.");
592  }
593 
594  Int_t* lowerXArray = new Int_t[fNumberOfSegments];
595  Int_t* upperXArray = new Int_t[fNumberOfSegments];
596  Int_t* lowerYArray = new Int_t[fNumberOfSegments];
597  Int_t* upperYArray = new Int_t[fNumberOfSegments];
598 
599  Int_t ixLo, ixUp, iyLo, iyUp;
600 
601 
602  Double_t minCoord[] = {xLo, yLo};
603  Double_t maxCoord[] = {xUp, yUp};
604 
605 
606  fSensor->LocalToPixel(minCoord, lowerXArray[0], lowerYArray[0]);
607  fSensor->LocalToPixel(maxCoord, upperXArray[0], upperYArray[0]);
608 
609 
610  if (lowerXArray[0] < 0) lowerXArray[0] = 0;
611  if (lowerYArray[0] < 0) lowerYArray[0] = 0;
612  if (upperXArray[0] > fNPixelsX) upperXArray[0] = fNPixelsX;
613  if (upperYArray[0] > fNPixelsY) upperYArray[0] = fNPixelsY;
614 
615  ixLo = lowerXArray[0];
616  iyLo = lowerYArray[0];
617  ixUp = upperXArray[0];
618  iyUp = upperYArray[0];
619 
620 
621  for (Int_t i = 1; i < fNumberOfSegments; i++) {
622 
623  sPoint = &fSignalPoints[i];
624  sigmaX = sPoint->sigmaX;
625  sigmaY = sPoint->sigmaY;
626 
627  minCoord[0] = sPoint->x - fWidthOfCluster * sigmaX;
628  minCoord[1] = sPoint->y - fWidthOfCluster * sigmaY;
629  maxCoord[0] = sPoint->x + fWidthOfCluster * sigmaX;
630  maxCoord[1] = sPoint->y + fWidthOfCluster * sigmaY;
631 
632  fSensor->LocalToPixel(minCoord, lowerXArray[i], lowerYArray[i]);
633  fSensor->LocalToPixel(maxCoord, upperXArray[i], upperYArray[i]);
634 
635  if (lowerXArray[i] < 0) lowerXArray[i] = 0;
636  if (lowerYArray[i] < 0) lowerYArray[i] = 0;
637 
638  if (upperXArray[i] > fNPixelsX) upperXArray[i] = fNPixelsX;
639  if (upperYArray[i] > fNPixelsY) upperYArray[i] = fNPixelsY;
640 
641  if (ixLo > lowerXArray[i]) { ixLo = lowerXArray[i]; }
642  if (ixUp < upperXArray[i]) { ixUp = upperXArray[i]; }
643  if (iyLo > lowerYArray[i]) { iyLo = lowerYArray[i]; }
644  if (iyUp < upperYArray[i]) { iyUp = upperYArray[i]; }
645  }
646  // loop over all pads of interest.
647  fPixelChargeShort.clear();
648  Int_t ix, iy;
649  Double_t ROTime = fSensor->GetReadoutTime(fTime + point->GetTime());
650  for (ix = ixLo; ix < ixUp + 1; ix++) {
651  for (iy = iyLo; iy < iyUp + 1; iy++) {
652  Double_t Current[3];
653  fSensor->PixelToLocal(ix, iy, Current);
654  pixel = nullptr;
655  for (Int_t i = 0; i < fNumberOfSegments; ++i) {
656  if (ix < lowerXArray[i] || iy < lowerYArray[i] || ix > upperXArray[i]
657  || iy > upperYArray[i]) {
658  continue;
659  }
660 
661  sPoint = &fSignalPoints[i];
662  xCentre = sPoint->x; //of segment
663  yCentre = sPoint->y; // idem
664  sigmaX = sPoint->sigmaX;
665  sigmaY = sPoint->sigmaY;
666  fCurrentTotalCharge += sPoint->charge;
667 
668  //compute the charge distributed to this pixel by this segment
669  Float_t numerator =
670  sPoint->charge * fLorentzNorm * (0.5 * fPar0 * fPar1 / TMath::Pi());
671  Float_t maxCount =
672  TMath::Max(1.e-10,
673  (((Current[0] - xCentre) * (Current[0] - xCentre))
674  + ((Current[1] - yCentre) * (Current[1] - yCentre)))
676  + 0.25 * fPar1 * fPar1);
677 
678  Float_t totCharge = (numerator / maxCount + fPar2);
679 
680  if (totCharge < 1) { continue; }
681  if (!pixel) {
682  thispoint = std::make_pair(ix, iy);
683  thisTimePoint = std::make_pair(thispoint, ROTime);
684  fChargeMapIt = fChargeMap.find(thisTimePoint);
685  if (fChargeMapIt == fChargeMap.end()) {
686  pixel = new ((*fPixelCharge)[fPixelCharge->GetEntriesFast()])
687  CbmMvdPixelCharge(totCharge,
688  ix,
689  iy,
690  point->GetPointId(),
691  point->GetTrackID(),
692  (point->GetX() + point->GetXOut()) / 2,
693  (point->GetY() + point->GetXOut()) / 2,
694  ROTime);
695  fChargeMap[thisTimePoint] = pixel;
696  } else {
697  pixel = fChargeMapIt->second;
698  pixel->AddCharge(totCharge);
699  }
700  fPixelChargeShort.push_back(pixel);
701  } else {
702  pixel->AddCharge(totCharge);
703  }
704  } // end for (track segments)
705  } //for y
706  } // for x
707 
708  std::vector<CbmMvdPixelCharge*>::size_type vectorSize =
709  fPixelChargeShort.size();
710 
711  for (ULong64_t f = 0; f < vectorSize; f++) {
712  CbmMvdPixelCharge* pixelCharge = fPixelChargeShort.at(f);
713  if (pixelCharge) {
714  pixelCharge->DigestCharge(
715  ((float) (point->GetX() + point->GetXOut()) / 2),
716  ((float) (point->GetY() + point->GetYOut()) / 2),
717  point->GetPointId(),
718  point->GetTrackID());
719  } else {
720  cout << endl << "Warning working on broken pixel " << endl;
721  }
722  }
723 
724  delete[] lowerXArray;
725  delete[] upperXArray;
726  delete[] lowerYArray;
727  delete[] upperYArray;
728 }
729 // -------------------------------------------------------------------------
730 
731 // ----- Virtual private method Init ----------------------------------
733 
734  //Read information on the sensor von data base
735  fSensor = mySensor;
736 
737  // cout << "-I- " << GetName() << ": Initialisation of sensor " << fSensor->GetName() << endl;
738 
739  fDigis = new TClonesArray("CbmMvdDigi", 10000);
740  fDigiMatch = new TClonesArray("CbmMatch", 10000);
741 
742  fOutputBuffer = new TClonesArray("CbmMvdDigi", 10000);
743  fInputPoints = new TClonesArray("CbmMvdPoint", 10000);
744 
745  fPixelCharge = new TClonesArray("CbmMvdPixelCharge", 100000);
746 
747  if (!fSensor) {
748  Fatal(GetName(),
749  "Fatal error: Init(CbmMvdSensor*) called without valid pointer, "
750  "don't know how to proceed.");
751  };
752 
754 
755  fPreviousPlugin = NULL;
756  initialized = kTRUE;
757 }
758 // -------------------------------------------------------------------------
759 
760 // ----- Virtual public method Reinit ----------------------------------
762 
763  delete fOutputBuffer;
764 
765  InitTask(sensor);
766 }
767 // -------------------------------------------------------------------------
768 
769 // ----- Virtual method Finish -----------------------------------------
771 // -------------------------------------------------------------------------
772 
773 // ----- Private method Reset ------------------------------------------
775 // -------------------------------------------------------------------------
776 
777 // ----- Private method PrintParameters --------------------------------
779 // -------------------------------------------------------------------------
780 
CbmMvdSensorTask::fSensor
CbmMvdSensor * fSensor
Definition: CbmMvdSensorTask.h:59
CbmMvdSensorPlugin::GetOutputArray
virtual TClonesArray * GetOutputArray()
Definition: CbmMvdSensorPlugin.h:41
CbmMvdPixelCharge::GetPointID
Int_t * GetPointID()
Definition: CbmMvdPixelCharge.h:48
CbmMatch
Definition: CbmMatch.h:22
f
float f
Definition: L1/vectors/P4_F32vec4.h:24
CbmMvdSensorDigitizerTBTask::fDiffusionCoefficient
Double_t fDiffusionCoefficient
Definition: CbmMvdSensorDigitizerTBTask.h:101
CbmMvdSensorDigitizerTBTask::frand
TRandom3 * frand
Definition: CbmMvdSensorDigitizerTBTask.h:151
CbmMvdSensorDataSheet::GetPixelPitchY
virtual Double_t GetPixelPitchY()
Definition: CbmMvdSensorDataSheet.h:82
CbmMvdPoint::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMvdPoint.h:76
CbmMvdSensorDataSheet::GetLorentzPar0
virtual Double_t GetLorentzPar0()
Definition: CbmMvdSensorDataSheet.h:103
CbmMvdPixelCharge::GetY
Int_t GetY()
Definition: CbmMvdPixelCharge.h:43
CbmMvdSensorDigitizerTBTask::SignalPoint::y
double y
Definition: CbmMvdSensorDigitizerTBTask.h:196
CbmMvdSensorDigitizerTBTask::GetEventInfo
void GetEventInfo(Int_t &inputNr, Int_t &eventNr, Double_t &eventTime)
Definition: CbmMvdSensorDigitizerTBTask.cxx:341
CbmMvdSensorDigitizerTBTask::fSigmaX
Double_t fSigmaX
Definition: CbmMvdSensorDigitizerTBTask.h:166
CbmMvdPoint::GetStationNr
Int_t GetStationNr() const
Definition: CbmMvdPoint.h:78
CbmMvdSensor::GetReadoutTime
Double_t GetReadoutTime(Double_t absoluteTime) const
Definition: CbmMvdSensor.cxx:670
CbmMvdSensor::TopToLocal
void TopToLocal(Double_t *lab, Double_t *local)
Definition: CbmMvdSensor.cxx:573
CbmMvdSensorDigitizerTBTask::fDigis
TClonesArray * fDigis
Definition: CbmMvdSensorDigitizerTBTask.h:147
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
CbmMvdSensorDigitizerTBTask::SignalPoint::sigmaY
double sigmaY
Definition: CbmMvdSensorDigitizerTBTask.h:199
CbmMvdSensor::PixelToLocal
void PixelToLocal(Int_t pixelNumberX, Int_t pixelNumberY, Double_t *local)
Definition: CbmMvdSensor.cxx:603
CbmMvdSensorDigitizerTBTask::fPixelSizeX
Double_t fPixelSizeX
Definition: CbmMvdSensorDigitizerTBTask.h:104
CbmMvdSensorDigitizerTBTask::fFanoSilicium
Double_t fFanoSilicium
Definition: CbmMvdSensorDigitizerTBTask.h:108
CbmMvdSensorDigitizerTBTask::PrintParameters
void PrintParameters()
Definition: CbmMvdSensorDigitizerTBTask.cxx:778
CbmMvdSensorDigitizerTBTask::fCurrentParticleMass
Double_t fCurrentParticleMass
Definition: CbmMvdSensorDigitizerTBTask.h:113
CbmMvdSensorDigitizerTBTask::fSegmentDepth
Double_t fSegmentDepth
Definition: CbmMvdSensorDigitizerTBTask.h:111
CbmMvdSensorDigitizerTBTask::SignalPoint
Definition: CbmMvdSensorDigitizerTBTask.h:194
CbmMvdSensorDigitizerTBTask::fNumberOfSegments
Int_t fNumberOfSegments
Definition: CbmMvdSensorDigitizerTBTask.h:138
CbmMvdSensorDigitizerTBTask::Finish
virtual void Finish()
Definition: CbmMvdSensorDigitizerTBTask.cxx:770
CbmMvdSensorDigitizerTBTask::ProducePixelCharge
void ProducePixelCharge(CbmMvdPoint *point)
Definition: CbmMvdSensorDigitizerTBTask.cxx:565
CbmMvdSensorDataSheet::GetLandauGain
virtual Double_t GetLandauGain()
Definition: CbmMvdSensorDataSheet.h:100
CbmMvdSensorDigitizerTBTask::fElectronsPerKeV
Double_t fElectronsPerKeV
Definition: CbmMvdSensorDigitizerTBTask.h:102
CbmMvdSensorDigitizerTBTask::fLorentzW
Double_t fLorentzW
Definition: CbmMvdSensorDigitizerTBTask.h:119
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmMvdSensorDigitizerTBTask::fEsum
Double_t fEsum
Definition: CbmMvdSensorDigitizerTBTask.h:110
CbmMvdSensorPlugin::fShowDebugHistos
Bool_t fShowDebugHistos
Definition: CbmMvdSensorPlugin.h:72
CbmMvdSensorDigitizerTBTask::ReadSensorInformation
InitStatus ReadSensorInformation()
Definition: CbmMvdSensorDigitizerTBTask.cxx:185
CbmMvdSensorDigitizerTBTask::fLandauMPV
Double_t fLandauMPV
Definition: CbmMvdSensorDigitizerTBTask.h:123
CbmMvdSensorDigitizerTBTask::fChargeMapIt
std::map< std::pair< std::pair< Int_t, Int_t >, Double_t >, CbmMvdPixelCharge * >::iterator fChargeMapIt
Definition: CbmMvdSensorDigitizerTBTask.h:160
CbmMvdSensorDigitizerTBTask::SignalPoint::eloss
double eloss
Definition: CbmMvdSensorDigitizerTBTask.h:201
CbmMvdSensorPlugin::fPreviousPlugin
CbmMvdSensorPlugin * fPreviousPlugin
Definition: CbmMvdSensorPlugin.h:67
CbmMvdSensorDigitizerTBTask::fChargeMap
std::map< std::pair< std::pair< Int_t, Int_t >, Double_t >, CbmMvdPixelCharge * > fChargeMap
Definition: CbmMvdSensorDigitizerTBTask.h:158
CbmMvdSensorDataSheet::GetEpiThickness
virtual Double_t GetEpiThickness()
Definition: CbmMvdSensorDataSheet.h:90
CbmMvdSensorDigitizerTBTask::fLorentzY0
Double_t fLorentzY0
Definition: CbmMvdSensorDigitizerTBTask.h:117
CbmMvdSensorDataSheet::GetNPixelsX
virtual Int_t GetNPixelsX()
Definition: CbmMvdSensorDataSheet.h:83
CbmMvdSensorDigitizerTBTask::SetInputArray
void SetInputArray(TClonesArray *inputStream)
Definition: CbmMvdSensorDigitizerTBTask.cxx:216
CbmMvdSensorTask::fOutputBuffer
TClonesArray * fOutputBuffer
Definition: CbmMvdSensorTask.h:58
CbmMvdSensor::GetIntegrationtime
Double_t GetIntegrationtime() const
Definition: CbmMvdSensor.h:76
CbmMvdSensorDigitizerTBTask::fSegmentLength
Double_t fSegmentLength
Definition: CbmMvdSensorDigitizerTBTask.h:99
CbmMvdSensorDigitizerTBTask::fLandauGain
Double_t fLandauGain
Definition: CbmMvdSensorDigitizerTBTask.h:125
CbmMvdSensorDigitizerTBTask::fLorentzA
Double_t fLorentzA
Definition: CbmMvdSensorDigitizerTBTask.h:120
CbmMvdSensorDigitizerTBTask::Reset
void Reset()
Definition: CbmMvdSensorDigitizerTBTask.cxx:774
CbmMvdSensor::LocalToPixel
void LocalToPixel(Double_t *local, Int_t &pixelNumberX, Int_t &pixelNumberY)
Definition: CbmMvdSensor.cxx:582
CbmMvdSensorTask
Definition: CbmMvdSensorTask.h:26
CbmMvdPoint::GetPointId
Int_t GetPointId() const
Definition: CbmMvdPoint.h:79
CbmMvdSensorDigitizerTBTask::fReadoutTime
Double_t fReadoutTime
Definition: CbmMvdSensorDigitizerTBTask.h:167
CbmMvdSensorDigitizerTBTask::fLandauRandom
TRandom3 * fLandauRandom
Definition: CbmMvdSensorDigitizerTBTask.h:126
CbmMvdPixelCharge::GetNContributors
Short_t GetNContributors()
Definition: CbmMvdPixelCharge.h:45
CbmMvdSensorPlugin::initialized
Bool_t initialized
Definition: CbmMvdSensorPlugin.h:71
CbmMvdPixelCharge::GetTime
Float_t GetTime()
Definition: CbmMvdPixelCharge.h:52
CbmMvdPoint.h
CbmMvdSensorDigitizerTBTask::ExecChain
void ExecChain()
Definition: CbmMvdSensorDigitizerTBTask.cxx:237
CbmMvdSensorDigitizerTBTask::fPixelChargeShort
std::vector< CbmMvdPixelCharge * > fPixelChargeShort
Definition: CbmMvdSensorDigitizerTBTask.h:154
CbmMvdSensor
Definition: CbmMvdSensor.h:40
CbmMvdPixelCharge::GetPointWeight
Float_t * GetPointWeight()
Definition: CbmMvdPixelCharge.h:51
CbmMvdPoint
Definition: CbmMvdPoint.h:28
CbmMvdSensorDigitizerTBTask::SignalPoint::charge
double charge
Definition: CbmMvdSensorDigitizerTBTask.h:200
CbmMvdPixelCharge
Definition: CbmMvdPixelCharge.h:14
d
double d
Definition: P4_F64vec2.h:24
CbmMvdSensorDigitizerTBTask::fWidthOfCluster
Double_t fWidthOfCluster
Definition: CbmMvdSensorDigitizerTBTask.h:103
CbmMvdSensorDigitizerTBTask::Exec
void Exec()
Definition: CbmMvdSensorDigitizerTBTask.cxx:241
CbmMvdSensorDataSheet::GetChargeThreshold
virtual Double_t GetChargeThreshold()
Definition: CbmMvdSensorDataSheet.h:114
CbmMvdSensorDigitizerTBTask::fRandGen
TRandom3 fRandGen
Definition: CbmMvdSensorDigitizerTBTask.h:176
CbmMvdSensorDigitizerTBTask
Definition: CbmMvdSensorDigitizerTBTask.h:47
CbmMatch::AddLink
void AddLink(const CbmLink &newLink)
Definition: CbmMatch.cxx:42
CbmMvdSensorDigitizerTBTask::fSignalPoints
SignalPointVec fSignalPoints
Definition: CbmMvdSensorDigitizerTBTask.h:207
CbmMvdSensorDigitizerTBTask::SignalPoint::x
double x
Definition: CbmMvdSensorDigitizerTBTask.h:195
CbmMvdSensorDigitizerTBTask::fNPixelsX
Int_t fNPixelsX
Definition: CbmMvdSensorDigitizerTBTask.h:142
CbmMvdSensorPlugin::GetName
virtual const char * GetName() const
Definition: CbmMvdSensorPlugin.h:62
CbmMvdPixelCharge::GetX
Int_t GetX()
Definition: CbmMvdPixelCharge.h:42
CbmMvdPixelCharge::GetTrackID
Int_t * GetTrackID()
Definition: CbmMvdPixelCharge.h:47
CbmMvdSensorDataSheet::GetPixelPitchX
virtual Double_t GetPixelPitchX()
Definition: CbmMvdSensorDataSheet.h:81
CbmMvdPixelCharge::GetCharge
Float_t GetCharge()
Definition: CbmMvdPixelCharge.h:41
CbmMvdSensorDigitizerTBTask::fCutOnDeltaRays
Double_t fCutOnDeltaRays
Definition: CbmMvdSensorDigitizerTBTask.h:106
xMath::Pi
double Pi()
Definition: xMath.h:5
CbmMvdSensorDigitizerTBTask::SignalPoint::sigmaX
double sigmaX
Definition: CbmMvdSensorDigitizerTBTask.h:198
CbmMvdSensorDigitizerTBTask::fInputPoints
TClonesArray * fInputPoints
Definition: CbmMvdSensorDigitizerTBTask.h:173
CbmMvdSensorDigitizerTBTask::SetInput
virtual void SetInput(CbmMvdPoint *point)
Definition: CbmMvdSensorDigitizerTBTask.cxx:229
CbmMvdSensorDigitizerTBTask::CbmMvdSensorDigitizerTBTask
CbmMvdSensorDigitizerTBTask()
Definition: CbmMvdSensorDigitizerTBTask.cxx:56
CbmMvdSensor::GetDZ
Double_t GetDZ() const
Definition: CbmMvdSensor.h:68
CbmMvdPoint::GetZOut
Double_t GetZOut() const
Definition: CbmMvdPoint.h:72
CbmMvdSensorDigitizerTBTask::fPar1
Double_t fPar1
Definition: CbmMvdSensorDigitizerTBTask.h:130
CbmMvdSensorDigitizerTBTask::fLandauSigma
Double_t fLandauSigma
Definition: CbmMvdSensorDigitizerTBTask.h:124
CbmMvdSensorDataSheet::GetLandauMPV
virtual Double_t GetLandauMPV()
Definition: CbmMvdSensorDataSheet.h:94
CbmMvdSensorDigitizerTBTask::fReadoutCurrent
Double_t fReadoutCurrent
Definition: CbmMvdSensorDigitizerTBTask.h:189
CbmMvdSensor::GetDataSheet
CbmMvdSensorDataSheet * GetDataSheet()
Definition: CbmMvdSensor.h:83
CbmMvdSensorDigitizerTBTask::ProduceIonisationPoints
void ProduceIonisationPoints(CbmMvdPoint *point)
Definition: CbmMvdSensorDigitizerTBTask.cxx:366
CbmMvdSensorDigitizerTBTask::ReInit
virtual void ReInit(CbmMvdSensor *mySensor)
Definition: CbmMvdSensorDigitizerTBTask.cxx:761
CbmMvdSensorDigitizerTBTask::fNPixelsY
Int_t fNPixelsY
Definition: CbmMvdSensorDigitizerTBTask.h:143
CbmMvdSensorDigitizerTBTask::fEpiTh
Double_t fEpiTh
Definition: CbmMvdSensorDigitizerTBTask.h:98
CbmMvdSensorDigitizerTBTask::fReadoutLast
Double_t fReadoutLast
Definition: CbmMvdSensorDigitizerTBTask.h:188
CbmMvdSensorDigitizerTBTask::fPixelScanAccelerator
TObjArray * fPixelScanAccelerator
Definition: CbmMvdSensorDigitizerTBTask.h:156
CbmMvdSensorDigitizerTBTask::fPar2
Double_t fPar2
Definition: CbmMvdSensorDigitizerTBTask.h:131
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmMvdPoint::GetXOut
Double_t GetXOut() const
Definition: CbmMvdPoint.h:70
ClassImp
ClassImp(CbmMvdSensorDigitizerTBTask)
CbmMvdSensorDigitizerTBTask::fPixelSize
Double_t fPixelSize
Definition: CbmMvdSensorDigitizerTBTask.h:128
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmMvdSensorDigitizerTBTask::fPar0
Double_t fPar0
Definition: CbmMvdSensorDigitizerTBTask.h:129
CbmMvdSensorDigitizerTBTask::fLorentzNorm
Double_t fLorentzNorm
Definition: CbmMvdSensorDigitizerTBTask.h:121
CbmMvdPileupManager.h
CbmMvdPoint::GetYOut
Double_t GetYOut() const
Definition: CbmMvdPoint.h:71
CbmMvdSensorDigitizerTBTask::fPixelSizeY
Double_t fPixelSizeY
Definition: CbmMvdSensorDigitizerTBTask.h:105
CbmMvdPixelCharge::DigestCharge
void DigestCharge(Float_t pointX, Float_t pointY, Int_t PointId, Int_t trackId)
Definition: CbmMvdPixelCharge.cxx:101
CbmMvdSensor::GetSensorNr
Int_t GetSensorNr() const
Definition: CbmMvdSensor.h:64
CbmMvdSensorDigitizerTBTask::SignalPoint::z
double z
Definition: CbmMvdSensorDigitizerTBTask.h:197
CbmMvdSensorDigitizerTBTask::fproduceNoise
Bool_t fproduceNoise
Definition: CbmMvdSensorDigitizerTBTask.h:152
CbmMvdSensorDigitizerTBTask::fLorentzXc
Double_t fLorentzXc
Definition: CbmMvdSensorDigitizerTBTask.h:118
CbmMvdSensorDigitizerTBTask::fSigmaY
Double_t fSigmaY
Definition: CbmMvdSensorDigitizerTBTask.h:166
CbmMvdSensorDigitizerTBTask::fCurrentParticleMomentum
Double_t fCurrentParticleMomentum
Definition: CbmMvdSensorDigitizerTBTask.h:114
CbmMvdSensorDataSheet::GetNPixelsY
virtual Int_t GetNPixelsY()
Definition: CbmMvdSensorDataSheet.h:84
CbmMvdSensorDigitizerTBTask::InitTask
virtual void InitTask(CbmMvdSensor *mySensor)
Definition: CbmMvdSensorDigitizerTBTask.cxx:732
CbmMvdSensorDigitizerTBTask::fTime
Double_t fTime
Definition: CbmMvdSensorDigitizerTBTask.h:187
CbmMvdSensorDataSheet::GetLandauSigma
virtual Double_t GetLandauSigma()
Definition: CbmMvdSensorDataSheet.h:97
CbmMvdSensorDigitizerTBTask::~CbmMvdSensorDigitizerTBTask
virtual ~CbmMvdSensorDigitizerTBTask()
Definition: CbmMvdSensorDigitizerTBTask.cxx:171
CbmMvdSensorDigitizerTBTask::fCurrentTotalCharge
Double_t fCurrentTotalCharge
Definition: CbmMvdSensorDigitizerTBTask.h:112
CbmMvdSensorDigitizerTBTask::fEvent
Int_t fEvent
Definition: CbmMvdSensorDigitizerTBTask.h:140
CbmMvdSensorDigitizerTBTask::fDigiMatch
TClonesArray * fDigiMatch
Definition: CbmMvdSensorDigitizerTBTask.h:149
CbmMvdPixelCharge::AddCharge
void AddCharge(Float_t charge)
Definition: CbmMvdPixelCharge.h:38
CbmMvdSensorDigitizerTBTask::fChargeThreshold
Float_t fChargeThreshold
Definition: CbmMvdSensorDigitizerTBTask.h:107
CbmMvdSensorDigitizerTBTask::fPixelCharge
TClonesArray * fPixelCharge
Definition: CbmMvdSensorDigitizerTBTask.h:145
CbmMvdSensorDataSheet
Definition: CbmMvdSensorDataSheet.h:22
CbmMvdSensorDigitizerTBTask.h
CbmMvdSensorDataSheet::GetLorentzPar1
virtual Double_t GetLorentzPar1()
Definition: CbmMvdSensorDataSheet.h:106
CbmMvdSensorDataSheet::GetLorentzPar2
virtual Double_t GetLorentzPar2()
Definition: CbmMvdSensorDataSheet.h:109