FairRoot/PandaRoot
PndSdsHybridHitProducer.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndSdsHybridHitProducer source file -----
3 // -------------------------------------------------------------------------
4 
5 
6 #include "TClonesArray.h"
7 #include "TArrayD.h"
8 #include "TGeoManager.h"
9 
10 #include "FairRootManager.h"
12 #include "PndSdsMCPoint.h"
13 #include "FairRun.h"
14 #include "FairRuntimeDb.h"
15 #include "FairGeoNode.h"
16 #include "FairGeoNode.h"
17 #include "FairGeoVector.h"
18 #include "FairRunAna.h"
19 #include "FairEventHeader.h"
20 
21 #include "PndStringSeparator.h"
22 #include "PndSdsCalcPixel.h"
23 #include "PndSdsCalcPixelDif.h"
24 #include "PndSdsCalcFePixel.h"
25 #include "PndSdsDigiPixel.h"
26 #include "PndSdsDigiPixelMCInfo.h"
27 
28 #include "PndSdsFEAmpModelSimple.h"
29 
30 #if (ROOT_VERSION_CODE >= ROOT_VERSION(5,34,10))
31  #include "FairMultiLinkedData_Interface.h"
32 #endif
33 
34 #include "PndDetectorList.h"
35 
36 // ----- Default constructor -------------------------------------------
38  PndSdsTask("SDS Hybrid Hit Producer"),
39  fDigiPixelMCInfo(kFALSE),
40  fPointArray(NULL),
41  fPixelArray(NULL),
42  fPixelMCArray(NULL),
43  fDigiPar(NULL),
44  fTotDigiPar(NULL),
45  fChargeConverter(NULL),
46  fMCEventHeader(NULL),
47  fDataBuffer(NULL),
48  flx(0.),
49  fly(0.),
50  fthreshold(0.),
51  fnoise(0.),
52  fqsigma(0.),
53  fcols(0),
54  frows(0),
55  fPixelHits(0),
56  fGeoH(NULL),
57  fEventNr(0),
58  fOverwriteParams(kFALSE),
59  fTimeOrderedDigi(kFALSE),
60  fPixelList()
61 {
62  if(fVerbose>0) Info("PndSdsHybridHitProducer","SDS Hybrid Digi Producer created, Parameters will be taken from RTDB");
63  SetPersistency(kTRUE);
64 }
65 // -------------------------------------------------------------------------
66 
68 PndSdsTask(name),
69  fDigiPixelMCInfo(kFALSE),
70  fPointArray(NULL),
71  fPixelArray(NULL),
72  fPixelMCArray(NULL),
73  fDigiPar(NULL),
74  fTotDigiPar(NULL),
75  fChargeConverter(NULL),
76  fMCEventHeader(NULL),
77  fDataBuffer(NULL),
78  flx(0.),
79  fly(0.),
80  fthreshold(0.),
81  fnoise(0.),
82  fqsigma(0.),
83  fcols(0),
84  frows(0),
85  fPixelHits(0),
86  fGeoH(NULL),
87  fEventNr(0),
88  fOverwriteParams(kFALSE),
89  fTimeOrderedDigi(kFALSE),
90  fPixelList()
91 {
92  if(fVerbose>0) Info("PndSdsHybridHitProducer","%s created, Parameters will be taken from RTDB",name);
93  SetPersistency(kTRUE);
94 }
95 // -------------------------------------------------------------------------
96 
98 PndSdsTask("SDS Hybrid Digi Producer (PndSdsHybridHitProducer)"),
99  fDigiPixelMCInfo(kFALSE),
100  fPointArray(NULL),
101  fPixelArray(NULL),
102  fPixelMCArray(NULL),
103  fDigiPar(NULL),
104  fTotDigiPar(NULL),
105  fChargeConverter(NULL),
106  fMCEventHeader(NULL),
107  fDataBuffer(NULL),
108  flx(lx),
109  fly(ly),
110  fthreshold(threshold),
111  fnoise(noise),
112  fqsigma(0.),
113  fcols(104),
114  frows(104),
115  fPixelHits(0),
116  fGeoH(NULL),
117  fEventNr(0),
118  fOverwriteParams(kTRUE),
119  fTimeOrderedDigi(kFALSE),
120  fPixelList()
121 {
122  fTimeOrderedDigi = kFALSE;
123  if(fVerbose>0) Info("PndSdsHybridHitProducer","SDS Hybrid Digi Producer created, Parameters will be overwritten in RTDB");
124  SetPersistency(kTRUE);
125 }
126 // -------------------------------------------------------------------------
127 
128 
129 // ----- Destructor ----------------------------------------------------
131 {
132  if (fChargeConverter!=0) delete fChargeConverter;
133  if (fDataBuffer!= 0) delete fDataBuffer;
134 }
135 // -------------------------------------------------------------------------
136 
137 // ----- Initialization of Parameter Containers -------------------------
139 {
140  if ( fGeoH == NULL )
142 
144  if( ! fDigiPar) Fatal("SetParContainers","No digitiztion parameters specified.");
145  if(fVerbose>1) Info("SetParContainers","done.");
146  return;
147 }
148 
150 {
152  return kSUCCESS;
153 }
154 
155 // ----- Public method Init --------------------------------------------
157 {
158  SetBranchNames();
159 
160  FairRun* ana = FairRun::Instance();
161  FairRootManager* ioman = FairRootManager::Instance();
162  if ( ! ioman )
163  {
164  std::cout << "-E- PndSdsHybridHitProducer::Init: "
165  << "RootManager not instantiated!" << std::endl;
166  return kFATAL;
167  }
168 
169 
170  fPointArray = (TClonesArray*) ioman->GetObject(fInBranchName);
171  if ( ! fPointArray )
172  {
173  std::cout << "-W- PndSdsHybridHitProducer::Init: "
174  << "No SDSPoint array!" << std::endl;
175  return kERROR;
176  }
177 
178 
179  // Create and register output array
180  // fPixelArray = new TClonesArray("PndSdsDigiPixel");
181  // if(fVerbose>1) Info("Init","Registering this branch: %s/%s",fFolderName.Data(),fOutBranchName.Data());
182  // ioman->Register(fOutBranchName, fFolderName, fPixelArray, fPersistance);
183  // fPixelArray = ioman->Register(fOutBranchName, "PndSdsDigiPixel", fFolderName, fPersistance);
184 
186  fDataBuffer = (PndSdsDigiPixelWriteoutBuffer*)ioman->RegisterWriteoutBuffer(fOutBranchName, fDataBuffer);
187  fDataBuffer->ActivateBuffering(fTimeOrderedDigi);
188 
189 
190  if(fOverwriteParams==kTRUE){
197  fDigiPar->setInputVersion(ana->GetRunId(),1);
198  fDigiPar->setChanged();
199  if(fVerbose>0) Info("Init","RTDB updated");
200  }
201 
202  if(fVerbose>2) fDigiPar->Print();
203 
204  flx = fDigiPar->GetXPitch();
205  fly = fDigiPar->GetYPitch();
207  fnoise = fDigiPar->GetNoise();
208  fcols = fDigiPar->GetFECols();
209  frows = fDigiPar->GetFERows();
211 
212  return kSUCCESS;
213 }
214 // -------------------------------------------------------------------------
215 
216 // ----- Public method Exec --------------------------------------------
218 {
219  if(fVerbose>3) Info("Exec","Start");
220  //
221  // if (fFEModel == 0)
222  // std::cout << "-E- PndSdsHybridHitProducer::Exec No front end model defined!" << std::endl;
223 
224 
225  Double_t EventTime = FairRootManager::Instance()->GetEventTime();
226 
227  if(fVerbose>0)
228  {
229  std::cout << std::endl;
230  std::cout << "-I- PndSdsHybridHitProducer::Exec EventTime: " << EventTime << " event: " << FairRootManager::Instance()->GetEntryNr() << std::endl;
231  }
232 
233  fPixelList.clear();
235  // Declare some variables
236  PndSdsMCPoint *point = NULL;
237 
238  if( ! fChargeConverter) Fatal("Exec","No charge converter specified");
239  // Int_t detID = 0; // Detector ID
240  fChargeConverter->StartExecute(); //here parameters that change every event are set
241 
242  // Loop over PndSdsMCPoints
243  Int_t nPoints = fPointArray->GetEntriesFast();
244  Int_t iFePixel = 0;
245  fPixelHits = 0;
246 
247  if(fVerbose>3) Info("Exec","Begin loop for %i points",nPoints);
248  for (Int_t iPoint = 0; iPoint < nPoints; iPoint++)
249  {
250  point = (PndSdsMCPoint*) fPointArray->At(iPoint);
251  if ( ! point){
252  std::cout<< "No Point!" << std::endl;
253  continue;
254  }
255  if (fVerbose > 1){
256  std::cout << "****Global Point: " << std::endl;
257  point->Print("");
258  }
259  FairGeoVector posInL, posOutL;
260  GetLocalHitPoints(point, posInL, posOutL);
261 
262  if (fVerbose > 1){
263  std::cout << "posOutL: " << std::endl;
264  std::cout << posInL.X() << " " << posInL.Y() << " " << posInL.Z() << std::endl;
265  std::cout << posOutL.X() << " " << posOutL.Y() << " " << posOutL.Z() << std::endl;
266  }
267 
268  if (fVerbose > 1){
269  FairGeoVector meanPosL = posInL + posOutL;
270  meanPosL /= 2;
271  meanPosL.Print();
272  std::cout << "Energy: " << point->GetEnergyLoss() << std::endl;
273  std::cout << point->GetSensorID() << std::endl;
274  std::cout << fGeoH->GetPath(point->GetSensorID()) << std::endl;
275  std::cout << "Time since Event started: " << point->GetTime() << std::endl;
276  }
277  std::vector<PndSdsPixel> myFePixels;
278  if ( fGeoH->GetPath(point->GetSensorID()).Contains("Pixel")
279  ||
280  ( fGeoH->GetPath(point->GetSensorID()).Contains("Sensor") &&
281  !fGeoH->GetPath(point->GetSensorID()).Contains("Strip") )
282  )
283  {
284  std::vector<PndSdsPixel> myPixels;
285  if(fqsigma>0){
286  // Define sensor by pixelsizes threshold and noise from macro outside
287  PndSdsCalcPixelDif PixelCalc(*fDigiPar);
288  // Calculate a cluster of Pixels fired (in sensor system)
289  myPixels = PixelCalc.GetPixels (posInL.getX(), posInL.getY(),
290  posOutL.getX(), posOutL.getY(),
291  point->GetEnergyLoss());
292  } else {
293  // Define sensor by pixelsizes threshold and noise from macro outside
294  PndSdsCalcPixel PixelCalc(flx, fly);
295  // Calculate a cluster of Pixels fired (in sensor system)
296  myPixels = PixelCalc.GetPixels (posInL.getX(), posInL.getY(),
297  posOutL.getX(), posOutL.getY(),
298  point->GetEnergyLoss());
299  }
300  if (myPixels.size() == 0){
301  if (fVerbose > 1) std::cout << "Deposited charge below threshold" << std::endl;
302  } else {
303  fPixelHits += myPixels.size();
304  if (fVerbose > 1) std::cout << "SensorPixels: " << std::endl;
305  for(UInt_t i = 0; i < myPixels.size(); i++)
306  {
307  myPixels[i].SetSensorID(point->GetSensorID());
308  if (fVerbose > 1) std::cout << myPixels[i] << std::endl;
309  }
310  // Calculate channel numbers
311  PndSdsCalcFePixel feCalc(*fDigiPar); //TODO: Why do we set 10 column Frontends per hand?
312  myFePixels = feCalc.CalcFEHits(myPixels);
313  if (fVerbose > 1){
314  std::cout << "FePixels: " << myFePixels.size() << std::endl;
315  for(UInt_t i = 0; i < myFePixels.size(); i++){
316  std::cout << myFePixels[i] << std::endl;
317  }
318  }
319  AddHits(&myFePixels, iPoint);
320  }//endif myPixels.size
321 
322  }//endif pixel
323  } // Loop over MCPoints
324 
325  // convert to digi data type after all charge is collected
326  // and apply gaussian noise
327 
328  Double_t charge=0;
329  for (unsigned int iPix = 0; iPix < fPixelList.size(); iPix++)
330  {
331  if(fVerbose>1) std::cout << "fPixelList.size()" << fPixelList.size() << std::endl;
332  point = (PndSdsMCPoint*) fPointArray->At(fPixelList[iPix].GetMCIndex()[0]);
333  charge=fPixelList[iPix].GetCharge();
334  //std::cout << fPixelList[iPix] << std::endl;
335 
336  if (fVerbose > 1) std::cout << fPixelList[iPix] << std::endl;
337 
338  // if (fFEModel > 0){
339  // double correctedTimeStamp = (fFEModel->GetTimeStamp(EventTime, 0, charge) - fFEModel->GetTimeWalkFromTot(fFEModel->GetTotFromCharge(charge)) - fFEModel->GetTimeStep()/2);
340  // std::cout << "FEModel-Test: " << point->GetEnergyLoss() << " " << charge << " " << fChargeConverter->ChargeToDigiValue(charge) << " " << fFEModel->GetTotFromCharge(charge) << " " << fFEModel->GetChargeFromTot(fFEModel->GetTotFromCharge(charge)) << std::endl
341  // << " Time: " << point->GetTimeStamp() << " " << fFEModel->GetTimeStamp(EventTime, point->GetTime(), charge) << " " << correctedTimeStamp << std::endl
342  // << " TimeDifference: " << point->GetTimeStamp() - correctedTimeStamp << std::endl;
343  // if ((point->GetTimeStamp() - correctedTimeStamp) > 10 || (point->GetTimeStamp() - correctedTimeStamp) < -10) {
344  // std::cout << "BigDifference!" << std::endl;
345  // }
346  // }
347 
348  Int_t smearedCharge = (Int_t)fChargeConverter->ChargeToDigiValue(charge);
349  Double_t smearedChargeInE = fChargeConverter->DigiValueToCharge(smearedCharge);
350  Int_t timeStamp = (Int_t)fChargeConverter->GetTimeStamp(point->GetTime(),smearedChargeInE, EventTime);
351 
352  if (smearedChargeInE < fthreshold)
353  smearedChargeInE = fthreshold;
354  Double_t timewalk = fChargeConverter->GetTimeWalk(smearedChargeInE);
355 
356  Double_t correctedTimeStamp = timeStamp - timewalk - fChargeConverter->GetTimeStep()/2;
357 
358  if (fVerbose > 2){
359  std::cout << "TimeStampCalc: EventTime: " << EventTime << " ToF " << point->GetTime() << " charge " << smearedChargeInE << " TW: " << timewalk << " CorrectedTS: " << correctedTimeStamp << std::endl;
360  std::cout << "Diff TimeStamp - EventTime " << correctedTimeStamp - EventTime << std::endl;
361  }
362  PndSdsDigiPixel *tempPixel = new PndSdsDigiPixel( fPixelList[iPix].GetMCIndex(), fInBranchId, fPixelList[iPix].GetSensorID() ,fPixelList[iPix].GetFE(),
363  fPixelList[iPix].GetCol(), fPixelList[iPix].GetRow(),
364  smearedCharge, correctedTimeStamp); //fChargeConverter->GetTimeStamp(point->GetTime(), charge,fEventHeader->GetEventTime()) );
365 
366  if (fTimeOrderedDigi){
367  tempPixel->ResetLinks();
368  std::vector<int> indices = fPixelList[iPix].GetMCIndex();
369  FairEventHeader* evtHeader = (FairEventHeader*)FairRootManager::Instance()->GetObject("EventHeader.");
370  for (int i = 0; i < (int)indices.size(); i++){
371  tempPixel->SetInsertHistory(true);
372  tempPixel->AddLink(FairLink(evtHeader->GetInputFileId(), evtHeader->GetMCEntryNumber(), fInBranchId, indices[i]));
373  PndSdsMCPoint* myPoint = (PndSdsMCPoint*)fPointArray->At(indices[i]);
374  tempPixel->AddLinks(*(myPoint->GetPointerToLinks()));
375  }
376  tempPixel->AddLink(FairLink(-1, fEventNr, "EventHeader.", -1));
377  }
378  fDataBuffer->FillNewData(tempPixel, fChargeConverter->ChargeToDigiValue(fPixelList[iPix].GetCharge())*6 + EventTime, point->GetTime()+EventTime);
379  if (fVerbose > 0){
380  std::cout << "PixelDigi: " << (tempPixel) << std::endl;
381 #if (ROOT_VERSION_CODE >= ROOT_VERSION(5,34,10))
382  std::cout << "Links in Digi: " << (FairMultiLinkedData_Interface*)(tempPixel) << std::endl;
383 #else
384  std::cout << "Links in Digi: " << (FairMultiLinkedData)(*tempPixel) << std::endl;
385 #endif
386  }
387  delete tempPixel;
388 
389 
390  }
391 
392 
393 
394 
396  // Event summary
397 
398  if (fVerbose > 1){
399  std::cout << "-I- PndSdsHybridHitProducer: " << nPoints << " PndSdsMCPoints, "
400  << fPixelHits << " Digi created." << " " << iFePixel
401  << " (event "<<fEventNr <<")"<< std::endl;
402 
403 
404  }
405  fEventNr++;
406  if(fVerbose>3) Info("Exec","Loop MC points");
407 }
408 
409 void PndSdsHybridHitProducer::GetLocalHitPoints(PndSdsMCPoint* myPoint, FairGeoVector& myHitIn, FairGeoVector& myHitOut)
410 {
411 
412  if (fVerbose > 1)
413  std::cout << "GetLocalHitPoints" << std::endl;
414  TGeoHMatrix trans = GetTransformation(myPoint->GetSensorID());
415 
416  Double_t posIn[3];
417  Double_t posOut[3];
418  Double_t posInLocal[3];
419  Double_t posOutLocal[3];
420 
421  posIn[0] = myPoint->GetX();
422  posIn[1] = myPoint->GetY();
423  posIn[2] = myPoint->GetZ();
424 
425  posOut[0] = myPoint->GetXOut();
426  posOut[1] = myPoint->GetYOut();
427  posOut[2] = myPoint->GetZOut();
428 
429  if (fVerbose > 1){
430  for (Int_t i = 0; i < 3; i++)
431  std::cout << "posIn "<< i << ": " << posIn[i] << std::endl;
432 
433  trans.Print("");
434  }
435 
436  trans.MasterToLocal(posIn, posInLocal);
437  trans.MasterToLocal(posOut, posOutLocal);
438 
439  if (fVerbose > 1) {
440  for (Int_t i = 0; i < 3; i++){
441  std::cout << "posInLocal "<< i << ": " << posInLocal[i] << std::endl;
442  std::cout << "posOutLocal "<< i << ": " << posOutLocal[i] << std::endl;
443  }
444  }
445 
446 
447  //posIn/OutLocal have the center of the coordinate system in the center of the shape
448  //typically sensors have their coordinate system centered at the lower left corner
449 
450  TVector3 offset = GetSensorDimensions(myPoint->GetSensorID());
451 
452  if (fVerbose > 1){
453  std::cout << "SensorDimension for: " << myPoint->GetSensorID() << std::endl;
454  std::cout << offset.X() << " " << offset.Y() << " " << offset.Z() << std::endl;
455  }
456 
457  posInLocal[0] += offset.x();
458  posInLocal[1] += offset.y();
459  //posInLocal[2] += offset.z();
460 
461  posOutLocal[0] += offset.x();
462  posOutLocal[1] += offset.y();
463  //posOutLocal[2] += offset.z();
464 
465 
466  myHitIn.setVector(posInLocal);
467  myHitOut.setVector(posOutLocal);
468 
469 }
470 
472 {
473  //PndGeoHandling GeoH(gGeoManager);
474  gGeoManager->cd(fGeoH->GetPath(sensorID));
475  TGeoHMatrix* transMat = gGeoManager->GetCurrentMatrix();
476  if (fVerbose > 1)
477  transMat->Print("");
478  return *transMat;
479 }
480 
482 {
483  //PndGeoHandling GeoH(gGeoManager);
484  gGeoManager->cd(fGeoH->GetPath(sensorID));
485  TGeoVolume* actVolume = gGeoManager->GetCurrentVolume();
486  TGeoBBox* actBox = (TGeoBBox*)(actVolume->GetShape());
487  TVector3 result;
488  result.SetX(actBox->GetDX());
489  result.SetY(actBox->GetDY());
490  result.SetZ(actBox->GetDZ());
491 
492  //result.Dump();
493 
494  return result;
495 }
496 
497 void PndSdsHybridHitProducer::AddHits(std::vector<PndSdsPixel>* hits, int mcIndex)
498 {
499  for (UInt_t i = 0; i < hits->size(); i++){
500  AddHit((*hits)[i], mcIndex);
501  }
502  if (fVerbose > 1) std::cout << "Size of fPixelList: " << fPixelList.size() << std::endl;
503 }
504 
506 {
507  bool found = false;
508  if(fVerbose > 1) std::cout << "Adding Hits to PixelList with mcIndex: " << mcIndex << std::endl;
509  // check if the channel fired already
510  for (UInt_t i = 0; i < fPixelList.size(); i++){
511  if ( fPixelList[i].GetSensorID() == hit.GetSensorID() &&
512  fPixelList[i].GetFE() == hit.GetFE() &&
513  fPixelList[i].GetCol() == hit.GetCol() &&
514  fPixelList[i].GetRow() == hit.GetRow() )
515  {
516  if (fVerbose > 1)
517  std::cout << "Pixel " << hit.GetSensorID()
518  << " FE/col/row " << hit.GetFE()
519  << "/" << hit.GetCol()
520  << "/" << hit.GetRow() << " already hit!"<< std::endl;
521  fPixelList[i].AddCharge(hit.GetCharge());
522  fPixelList[i].AddMCIndex(mcIndex);
523  return;
524  }
525  }
526  if (found == false){
527  hit.AddMCIndex(mcIndex);
528  fPixelList.push_back(hit);
529  }
530 }
531 
532 //______________________________________________________________________________
533 
534 // -------------------------------------------------------------------------
535 
537 {
538  // called after all Tasks did their Exex() and the data is copied to the file
539 
540  if(fDigiPixelMCInfo==kTRUE)
541  {
542  fPixelMCArray->Delete();
543  }
544  // fPixelArray->Delete();
545  FinishEvents();
546 }
547 // -------------------------------------------------------------------------
548 
550 {
551  // called after all Tasks did their Exex() and the data is copied to the file
552  // if (fTimeOrderedDigi){
553  // fDataBuffer->WriteOutAllData();
554  // }
555 
556 }
557 
Double_t GetXOut() const
Definition: PndSdsMCPoint.h:81
int fVerbose
Definition: poormantracks.C:24
std::vector< PndSdsPixel > GetPixels(Double_t inx, Double_t iny, Double_t outx, Double_t outy, Double_t energy)
Main function to calculate the vector of fired pixel.
Double_t GetXPitch() const
Int_t fInBranchId
Definition: PndSdsTask.h:43
PndSdsChargeConversion * fChargeConverter
TString fOutBranchName
Definition: PndSdsTask.h:40
Int_t i
Definition: run_full.C:25
PndGeoHandling * fGeoH
Definition: anasim.C:34
virtual Double_t GetTimeStep()
Double_t GetZOut() const
Definition: PndSdsMCPoint.h:83
Int_t GetSensorID() const
Definition: PndSdsPixel.h:44
virtual void SetParContainers()
void SetXPitch(Double_t x)
void SetPersistency(Bool_t val=kTRUE)
Int_t GetCol() const
Definition: PndSdsPixel.h:41
TVector3 offset(2, 0, 0)
virtual Double_t GetTimeStamp(Double_t tof, Double_t charge, Double_t MCEventTime)=0
absolute time stamp of a hit in ns (clock is taken into account)
TGeoManager * gGeoManager
Int_t GetSensorID() const
Definition: PndSdsMCPoint.h:89
Int_t GetFE() const
Definition: PndSdsPixel.h:45
Double_t GetQCloudSigma() const
TString GetPath(Int_t shortID)
for a given shortID the path is returned
Bool_t fTimeOrderedDigi
set to kTRUE to use the time ordering of the output data.
virtual Double_t DigiValueToCharge(Double_t digi)=0
Converts a given digitized charge into charge in electrons.
Double_t GetNoise() const
void SetThreshold(Double_t x)
void SetNoise(Double_t x)
TVector3 GetSensorDimensions(Int_t sensorID)
TGeoTranslation * trans
Int_t GetFERows() const
Int_t GetRow() const
Definition: PndSdsPixel.h:42
Int_t GetFECols() const
Double_t lx
virtual void Exec(Option_t *opt)
Double_t
TString fInBranchName
Definition: PndSdsTask.h:39
std::vector< PndSdsPixel > GetPixels(Double_t inx, Double_t iny, Double_t outx, Double_t outy, Double_t energy)
Main function to calculate the vector of fired pixel.
void AddHits(std::vector< PndSdsPixel > *hitList, int mcIndex)
virtual void SetBranchNames()=0
TClonesArray * point
Definition: anaLmdDigi.C:29
Double_t GetYPitch() const
void AddMCIndex(int i)
Definition: PndSdsPixel.h:55
TString fFolderName
Definition: PndSdsTask.h:41
void GetLocalHitPoints(PndSdsMCPoint *myPoint, FairGeoVector &myHitIn, FairGeoVector &myHitOut)
static PndGeoHandling * Instance()
TString name
double threshold
std::vector< PndSdsPixel > fPixelList
Double_t ly
void SetVerbose(Int_t v)
void AddHit(PndSdsPixel &hit, int mcIndex)
virtual Double_t ChargeToDigiValue(Double_t Charge)=0
Converts a given charge in electrons into the electronics answer e.g. ToT [ns].
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
Double_t GetYOut() const
Definition: PndSdsMCPoint.h:82
Double_t GetCharge() const
Definition: PndSdsPixel.h:43
virtual void Print(std::ostream &out=std::cout) const
PndSdsDigiPixelWriteoutBuffer * fDataBuffer
Calculates the pixels (digis) fired from a particle hitting the sensor.
Data class to store the digi output of a pixel module.
virtual Double_t GetTimeWalk(Double_t)
CbmHit * hits[nHits]
Definition: RiemannTest.C:19
void SetYPitch(Double_t x)
Class to calculate the position of digis on a front-end from the digis on a sensor.
ClassImp(PndSdsHybridHitProducer)
double noise
TGeoHMatrix GetTransformation(Int_t sensorID)
void SetFECols(Int_t x)
std::vector< PndSdsPixel > CalcFEHits(const std::vector< PndSdsPixel > &sensor_hits)
Main function to calculate front-end hits.
virtual void Print(const Option_t *opt=0) const
void SetFERows(Int_t x)
Double_t GetThreshold() const