CbmRoot
CbmMuchDigitizeGem.cxx
Go to the documentation of this file.
1 
24 // Includes from MUCH
25 #include "CbmMuchDigitizeGem.h"
26 #include "CbmMuchDigi.h"
27 #include "CbmMuchModuleGem.h"
28 #include "CbmMuchModuleGemRadial.h"
30 #include "CbmMuchPad.h"
31 #include "CbmMuchPadRadial.h"
32 #include "CbmMuchPadRectangular.h"
33 #include "CbmMuchPoint.h"
34 #include "CbmMuchReadoutBuffer.h"
35 #include "CbmMuchRecoDefs.h"
36 #include "CbmMuchSector.h"
37 #include "CbmMuchSectorRadial.h"
39 #include "CbmMuchStation.h"
40 
41 // Includes from base
42 #include "FairEventHeader.h"
43 #include "FairLogger.h"
44 #include "FairMCEventHeader.h"
45 #include "FairMCPoint.h"
46 #include "FairRootManager.h"
47 #include "FairRunAna.h"
48 #include "FairRunSim.h"
49 
50 // Includes from Cbm
51 #include "CbmMCTrack.h"
52 #include "TChain.h"
53 #include "TDatabasePDG.h"
54 #include "TFile.h"
55 #include "TH1D.h"
56 #include "TObjArray.h"
57 #include "TRandom.h"
58 #include <TGeoManager.h>
59 
60 #include "TCanvas.h"
61 #include <cassert>
62 #include <cstring>
63 #include <iomanip>
64 #include <iostream>
65 #include <sstream>
66 #include <vector>
67 
68 using std::cout;
69 using std::endl;
70 using std::fixed;
71 using std::map;
72 using std::right;
73 using std::setprecision;
74 using std::setw;
75 using std::string;
76 
77 
78 // ----- Default constructor -------------------------------------------
80  : CbmDigitize<CbmMuchDigi>("MuchDigitizeGem")
81  ,
82  //fgDeltaResponse(),
83  fAlgorithm(1)
84  , fGeoScheme(CbmMuchGeoScheme::Instance())
85  , fDigiFile()
86  , fPoints(NULL)
87  , fMCTracks(NULL)
88  ,
89  //fDigis(NULL),
90  //fDigiMatches(NULL),
91  fNFailed(0)
92  , fNOutside(0)
93  , fNMulti(0)
94  , fFlag(0)
95  , fNADCChannels(-1)
96  , fQMax(-1)
97  , fQThreshold(-1)
98  , fMeanNoise(1500)
99  , fSpotRadius(-1)
100  , fMeanGasGain(-1)
101  , fDTime(-1)
102  , fDeadPadsFrac(-1)
103  , fTimer()
104  , fMcChain(NULL)
105  , fDeadTime(400)
106  , fDriftVelocity(-1)
107  ,
108  //fPeakingTime(20),
109  //fRemainderTime(40),
110  fTimeBinWidth(1)
111  , fNTimeBins(200)
112  , fTOT(0)
113  , fTotalDriftTime(-1)
114  ,
115  // fTotalDriftTime(0.3/fDriftVelocity*10000), // 40 ns
116  fSigma()
117  , fMPV()
118  , fIsLight(1)
119  , // fIsLight = 1 (default) Store Light CbmMuchDigiMatch in output branch, fIsLight = 0 Create Heavy CbmMuchDigiMatch with fSignalShape info.
120  fTimePointLast(-1)
121  , fTimeDigiFirst(-1)
122  , fTimeDigiLast(-1)
123  , fNofPoints(0)
124  , fNofSignals(0)
125  , fNofDigis(0)
126  , fNofEvents(0)
127  , fNofPointsTot(0.)
128  , fNofSignalsTot(0.)
129  , fNofDigisTot(0.)
130  , fTimeTot()
131  ,
132  // hPriElAfterDriftpath(NULL),
133  fPerPadNoiseRate(10e-9)
134  , fGenerateElectronicsNoise(kFALSE)
135  , fNoiseCharge(nullptr)
136  , fAddressCharge() {
137  fSigma[0] = new TF1("sigma_e", "pol6", -5, 10);
138  fSigma[0]->SetParameters(sigma_e);
139 
140  fSigma[1] = new TF1("sigma_mu", "pol6", -5, 10);
141  fSigma[1]->SetParameters(sigma_mu);
142 
143  fSigma[2] = new TF1("sigma_p", "pol6", -5, 10);
144  fSigma[2]->SetParameters(sigma_p);
145 
146  fMPV[0] = new TF1("mpv_e", "pol6", -5, 10);
147  fMPV[0]->SetParameters(mpv_e);
148 
149  fMPV[1] = new TF1("mpv_mu", "pol6", -5, 10);
150  fMPV[1]->SetParameters(mpv_mu);
151 
152  fMPV[2] = new TF1("mpv_p", "pol6", -5, 10);
153  fMPV[2]->SetParameters(mpv_p);
154  Reset();
155  fNoiseCharge = new TF1(
156  "Noise Charge",
157  "TMath::Gaus(x, [0], [1])",
158  fQThreshold,
159  fQMax
160  / 10); //noise function to calculate charge for noise hit. mean=fQThreashold(10000),fQMax=500000
161 }
162 // -------------------------------------------------------------------------
163 
164 
165 // -------------------------------------------------------------------------
166 CbmMuchDigitizeGem::CbmMuchDigitizeGem(const char* digiFileName, Int_t flag)
167  : CbmDigitize<CbmMuchDigi>("MuchDigitizeGem")
168  ,
169  //fgDeltaResponse(),
170  fAlgorithm(1)
171  , fGeoScheme(CbmMuchGeoScheme::Instance())
172  , fDigiFile(digiFileName)
173  , fPoints(NULL)
174  , fMCTracks(NULL)
175  ,
176  //fDigis(NULL),
177  //fDigiMatches(NULL),
178  fNFailed(0)
179  , fNOutside(0)
180  , fNMulti(0)
181  , fFlag(flag)
182  , fNADCChannels(-1)
183  , fQMax(-1)
184  , fQThreshold(-1)
185  , fMeanNoise(1500)
186  , fSpotRadius(-1)
187  , fMeanGasGain(-1)
188  , fDTime(-1)
189  , fDeadPadsFrac(-1)
190  , fTimer()
191  , fMcChain(NULL)
192  , fDeadTime(400)
193  , fDriftVelocity(-1)
194  ,
195  //fPeakingTime(20),
196  //fRemainderTime(40),
197  fTimeBinWidth(1)
198  , fNTimeBins(200)
199  , fTOT(0)
200  , fTotalDriftTime(-1)
201  ,
202  // fTotalDriftTime(0.3/fDriftVelocity*10000), // 40 ns
203  fSigma()
204  , fMPV()
205  , fIsLight(1)
206  , // fIsLight = 1 (default) Store Light CbmMuchDigiMatch in output branch, fIsLight = 0 Create Heavy CbmMuchDigiMatch with fSignalShape info.
207  fTimePointLast(-1)
208  , fTimeDigiFirst(-1)
209  , fTimeDigiLast(-1)
210  , fNofPoints(0)
211  , fNofSignals(0)
212  , fNofDigis(0)
213  , fNofEvents(0)
214  , fNofPointsTot(0.)
215  , fNofSignalsTot(0.)
216  , fNofDigisTot(0.)
217  ,
218  // hPriElAfterDriftpath(NULL),
219  fTimeTot()
220  , fPerPadNoiseRate(10e-9)
221  , fGenerateElectronicsNoise(kFALSE)
222  , fNoiseCharge(nullptr)
223  , fAddressCharge() {
224  fSigma[0] = new TF1("sigma_e", "pol6", -5, 10);
225  fSigma[0]->SetParameters(sigma_e);
226 
227  fSigma[1] = new TF1("sigma_mu", "pol6", -5, 10);
228  fSigma[1]->SetParameters(sigma_mu);
229 
230  fSigma[2] = new TF1("sigma_p", "pol6", -5, 10);
231  fSigma[2]->SetParameters(sigma_p);
232 
233  fMPV[0] = new TF1("mpv_e", "pol6", -5, 10);
234  fMPV[0]->SetParameters(mpv_e);
235 
236  fMPV[1] = new TF1("mpv_mu", "pol6", -5, 10);
237  fMPV[1]->SetParameters(mpv_mu);
238 
239  fMPV[2] = new TF1("mpv_p", "pol6", -5, 10);
240  fMPV[2]->SetParameters(mpv_p);
241  Reset();
242  fNoiseCharge = new TF1(
243  "Noise Charge",
244  "TMath::Gaus(x, [0], [1])",
245  fQThreshold,
246  fQMax
247  / 10); //noise function to calculate charge for noise hit. mean=fQThreashold(10000),fQMax=500000
248 }
249 // -------------------------------------------------------------------------
250 
251 
252 // ----- Destructor ----------------------------------------------------
254 
255  delete fSigma[0];
256  delete fSigma[1];
257  delete fSigma[2];
258  delete fMPV[0];
259  delete fMPV[1];
260  delete fMPV[2];
261 }
262 // -------------------------------------------------------------------------
263 
264 
265 // ----- Private method Reset -------------------------------------------
269 }
270 // -------------------------------------------------------------------------
271 
272 // ----- Setting Detector related parameters -------------------------------------------
274  Int_t DetectorType = module->GetDetectorType();
275  // cout<<" dec type "<<DetectorType<<endl;
276  switch (DetectorType) {
277  case 3: // For GEM
278  {
279  fNADCChannels = 32; // Total ADC Channels
280  fQMax = 500000; // Maximum charge = 80 fC for GEM
281  fQThreshold = 12500; // Minimum charge threshold = 2fC for GEM
282  fMeanNoise = 1500; // mean noise
283  fSpotRadius = 0.05; // Spot radius = 500 um for GEM
284  fMeanGasGain = 5000; // Mean gas gain = 5000 for GEM
285  fDTime = 3;
286  fDeadPadsFrac = 0;
287  fDriftVelocity = 100; // Drift Velocity = 100 um/ns
288  auto DriftVolumeWidth = module->GetSize().Z(); // Drift gap
290  DriftVolumeWidth / fDriftVelocity * 10000; // Drift time (ns)
291  } break;
292  case 4: { //For RPC
293  fNADCChannels = 32; // Total ADC Channels
294  fQMax = 812500; // Maximum charge = 130 fC for RPC
295  fQThreshold = 187500; // Minimum charge threshold = 30 fC for RPC
296  fMeanNoise = 1500; // mean noise
297  fSpotRadius = 0.2; // Spot radius = 2 mm for RPC
298  fMeanGasGain = 3e4; // Mean gas gain = 3e4 for RPC
299  fDTime = 3;
300  fDeadPadsFrac = 0;
301  fDriftVelocity = 120; // Drift velocity = 120 um/ns
302  auto DriftVolumeWidth = module->GetSize().Z(); // Drift gap
304  DriftVolumeWidth / fDriftVelocity * 10000; // Drift time (ns)
305 
306  } break;
307  }
308  // set parameters for GEM
309 }
310 // -------------------------------------------------------------------------
311 
312 
313 // ----- Private method Init -------------------------------------------
315 
316 
317  // Screen output
318  std::cout << std::endl;
319  LOG(info) << "==========================================================";
320  LOG(info) << GetName() << ": Initialisation\n";
321 
322  FairRootManager* ioman = FairRootManager::Instance();
323  if (!ioman) Fatal("Init", "No FairRootManager");
324 
325  if (fEventMode) { LOG(info) << fName << ": Using event-by-event mode"; }
326 
327  // hPriElAfterDriftpathgem = new TH1D("hPriElAfterDriftpathgem"," GEM:primary electron ",300,0,300);
328  // hPriElAfterDriftpathrpc = new TH1D("hPriElAfterDriftpathrpc"," RPC:primary electron ",300,0,300);
329  // hadcGEM = new TH1F("hadcGEM","GEM:ADC",70,-0.5,69.5);
330  // hadcRPC = new TH1F("hadcRPC","RPC:ADC",70,-0.5,69.5);
331 
332  // hdrifttimegem = new TH1D("hdrifttimegem"," GEM ",100,0,50);
333  // hdrifttimerpc = new TH1D("hdrifttimerpc"," RPC ",100,0,50);
334 
335  // Get geometry version tag
336  gGeoManager->CdTop();
337  TGeoNode* cave = gGeoManager->GetCurrentNode(); // cave
338  TString geoTag;
339  for (Int_t iNode = 0; iNode < cave->GetNdaughters(); iNode++) {
340  TString name = cave->GetDaughter(iNode)->GetVolume()->GetName();
341  if (name.Contains("much", TString::kIgnoreCase)) {
342  if (name.Contains("mcbm", TString::kIgnoreCase)) {
343  geoTag = TString(name(5, name.Length()));
344  } else {
345  geoTag = TString(name(5, name.Length() - 5));
346  }
347  // geoTag = "v17b"; // modified ekata
348  cout << " geo tag " << geoTag << endl;
349  LOG(info) << fName << ": MUCH geometry tag is " << geoTag;
350  break;
351  } //? node is MUCH
352  } //# top level nodes
353 
354 
355  // Set the parameter file and the flag, if not done in constructor
356  if (fDigiFile.IsNull()) {
357  if (geoTag.IsNull())
358  LOG(fatal)
359  << fName
360  << ": no parameter file specified and no MUCH node found in geometry!";
361  fDigiFile = gSystem->Getenv("VMCWORKDIR");
362  // TODO: (VF) A better naming convention for the geometry tag and the
363  // corresponding parameter file is surely desirable.
364  if (geoTag.Contains("mcbm", TString::kIgnoreCase)) {
365  fDigiFile += "/parameters/much/much_" + geoTag + "_digi_sector.root";
366  } else {
367  fDigiFile +=
368  "/parameters/much/much_" + geoTag(0, 4) + "_digi_sector.root";
369  }
370  // fDigiFile ="/home/ekata/CbmRoot/AUG18/parameters/much/much_v17b_digi_sector.root";
371 
372  LOG(info) << fName << ": Using parameter file " << fDigiFile;
373 
374  fFlag = (geoTag.Contains("mcbm", TString::kIgnoreCase) ? 1 : 0);
375  LOG(info) << fName << ": Using flag " << fFlag
376  << (fFlag ? " (mcbm) " : "(standard)");
377  }
378 
379 
380  // Initialize GeoScheme
381  TFile* oldfile = gFile;
382  TFile* file = new TFile(fDigiFile);
383  if (!file->IsOpen())
384  LOG(fatal) << fName << ": parameter file " << fDigiFile
385  << " does not exist!";
386  TObjArray* stations = (TObjArray*) file->Get("stations");
387  file->Close();
388  file->Delete();
389  gFile = oldfile;
390  fGeoScheme->Init(stations, fFlag);
391 
392 
393  // Determine drift volume width
394  // Double_t driftVolumeWidth = 0.4; // cm - default and will over written by Detector Parameters function.
395 
396  // Double_t DriftVolumeWidth;
397  for (Int_t i = 0; i < fGeoScheme->GetNStations(); i++) {
398  CbmMuchStation* station = fGeoScheme->GetStation(i);
399  //CbmMuchStation* station = fGeoScheme->GetStation(3);
400  if (station->GetNLayers() <= 0) continue;
401  CbmMuchLayerSide* side = station->GetLayer(0)->GetSide(0);
402  if (side->GetNModules() <= 0) continue;
403  CbmMuchModule* module = side->GetModule(0);
404  // if (module->GetDetectorType()!=4)continue;
405  if (module->GetDetectorType() != 3 && module->GetDetectorType() != 4)
406  continue;
407  DetectorParameters(module);
408  //cout<<" dec type "<<module->GetDetectorType()<<" drift width "<<DriftVolumeWidth<<endl;
409  }
410 
411  // cout<<" dec type "<<module->GetDetectorType()<<" drift width "<<driftVolumeWidth<<endl;
412  /*
413  driftVolumeWidth = module->GetSize().Z();
414  cout<<"driftVolumeWidth "<<driftVolumeWidth<<endl;
415  break;
416 
417  }
418  fTotalDriftTime = driftVolumeWidth/fDriftVelocity*10000; // [ns];
419 */
420 
421  //Reading MC point as Event by event for time based digi generation also.
422  // Get input array of MuchPoints
423  fPoints = (TClonesArray*) ioman->GetObject("MuchPoint");
424  assert(fPoints);
425 
426  // Get input array of MC tracks
427  fMCTracks = (TClonesArray*) ioman->GetObject("MCTrack");
428  assert(fMCTracks);
429 
430  // Register output arrays in vector
431  /*
432  fDigis = new std::vector<CbmMuchDigi>();
433  ioman->RegisterAny("MuchDigi",fDigis, IsOutputBranchPersistent("MuchDigi"));
434  if ( fCreateMatches ) {
435  fDigiMatches = new std::vector<CbmMatch>();
436  ioman->RegisterAny("MuchDigiMatch",fDigiMatches, IsOutputBranchPersistent("MuchDigiMatch"));
437  }
438  */
439  RegisterOutput();
440 
441  // Register output arrays in TClonesArray which is replaced with vector
442  /*fDigis = new TClonesArray("CbmMuchDigi", 1000);
443  ioman->Register("MuchDigi", "Digital response in MUCH", fDigis, kTRUE);
444  if ( fCreateMatches ) {
445  fDigiMatches = new TClonesArray("CbmMatch", 1000);
446  ioman->Register("MuchDigiMatch", "Digi Match in MUCH", fDigiMatches, kTRUE);
447  }*/
448  //fgDeltaResponse is used in the CbmMuchSignal for analysing the Signal Shape,
449  //it is generated once in the digitizer and then be used by each CbmMuchSignal.
450  //For reducing the time therefore generated once in the CbmMuchDigitize Gem and
451  //not generated in the CbmMuchSignal
452  // Set response on delta function
453 
454  // Not using fSignalShape as consuming memory. Commening all the field related.
455 
456  //Int_t nShapeTimeBins=Int_t(gkResponsePeriod/gkResponseBin);
457  //fgDeltaResponse.Set(nShapeTimeBins);
458  //for (Int_t i=0;i<fgDeltaResponse.GetSize();i++){
459  // Double_t time = i*gkResponseBin;
460  // if (time<=fPeakingTime) fgDeltaResponse[i]=time/fPeakingTime;
461  // else fgDeltaResponse[i] = exp(-(time-fPeakingTime)/fRemainderTime);
462  //}
463 
464  // --- Enable histogram if want to enalyze Noise spectrum.
465  //noise = new TH1D("noise", "Noise Generated per Event NoiseRate 10e-8", 100 , 0 , 200);
466  LOG(info) << GetName() << ": Initialisation successful";
467  LOG(info) << "==========================================================";
468  std::cout << std::endl;
469 
470  return kSUCCESS;
471 }
472 // -------------------------------------------------------------------------
473 
474 
475 // ----- Public method Exec --------------------------------------------
476 void CbmMuchDigitizeGem::Exec(Option_t*) {
477 
478  // --- Start timer and reset counters
479  fTimer.Start();
480  Reset();
481 
482  // --- Event number and time
483  GetEventInfo();
484  LOG(debug) << GetName() << ": Processing event " << fCurrentEvent
485  << " from input " << fCurrentInput
486  << " at t = " << fCurrentEventTime << " ns with "
487  << fPoints->GetEntriesFast() << " MuchPoints ";
488 
489  //ReadAndRegister(fCurrentEventTime);
490 
491  for (Int_t iPoint = 0; iPoint < fPoints->GetEntriesFast(); iPoint++) {
492  const CbmMuchPoint* point = (const CbmMuchPoint*) fPoints->At(iPoint);
493  LOG(debug1) << GetName() << ": Processing MCPoint " << iPoint;
494  assert(point);
495  ExecPoint(point, iPoint);
496  fNofPoints++;
497  } // MuchPoint loop
498 
499  // --------------------NOISE Generated before ReadAndRegister---------------------- //
503  fNofNoiseTot += nNoise;
504  //noise->Fill(nNoise);
505  LOG(info) << "+ " << setw(20) << GetName() << ": Generated " << nNoise
506  << " noise signals from t = " << fPreviousEventTime << " ns to "
507  << fCurrentEventTime << " ns and " << fNofNoiseTot
508  << " total noise generated till now.";
509  LOG(debug3) << "+ " << setw(20) << GetName() << ": Generated "
511  << " noise signals for this time slice from t = "
512  << fPreviousEventTime << " ns to " << fCurrentEventTime << "ns";
514  }
515 
516 
517  if (fEventMode)
518  ReadAndRegister(-1);
519  else
521 
522  // --- Event log
523  LOG(info) << "+ " << setw(15) << GetName() << ": Event " << setw(6) << right
524  << fCurrentEvent << " at " << fixed << setprecision(3)
525  << fCurrentEventTime << " ns, points: " << fNofPoints
526  << ", signals: " << fNofSignals << ", digis: " << fNofDigis
527  << ". Exec time " << setprecision(6) << fTimer.RealTime() << " s.";
528 
529 
530  fTimer.Stop();
531  fNofEvents++;
535  fTimeTot += fTimer.RealTime();
536 
537 } // -----------------------------------------------------------------------------------------
538 
539 
540 //================================Generte Noise==============================================//
541 Int_t CbmMuchDigitizeGem::GenerateNoise(Double_t t1, Double_t t2) {
542  LOG(debug) << "+ " << setw(20) << GetName() << ": Previous event time " << t1
543  << " Current event time " << t2 << " ns.";
544  if (t1 > t2) {
545  LOG(debug) << "+ "
546  << ": Previous event time " << t1
547  << " is greater than Current event time " << t2
548  << ". No electronics noise signal generated for "
549  << fCurrentEvent << " event.";
550  return 0;
551  };
552  Int_t numberofstations = fGeoScheme->GetNStations();
553  auto StationNoise = 0;
554  for (Int_t i = 0; i < numberofstations; i++) {
555  CbmMuchStation* station = fGeoScheme->GetStation(i);
556  auto numberoflayers = station->GetNLayers();
557  if (numberoflayers <= 0) continue;
558 
559  auto LayerNoise = 0;
560  for (Int_t j = 0; j < numberoflayers; j++) {
561  CbmMuchLayerSide* side = station->GetLayer(j)->GetSide(0);
562  auto numberofmodules = side->GetNModules();
563  if (numberofmodules <= 0) continue;
564 
565  auto FrontModuleNoise = 0;
566  for (auto k = 0; k < numberofmodules; k++) {
567  CbmMuchModuleGem* module = (CbmMuchModuleGem*) (side->GetModule(k));
568  if (module->GetDetectorType() != 4 && module->GetDetectorType() != 3)
569  continue;
570  FrontModuleNoise += GenerateNoisePerModule(module, t1, t2);
571  }
572  side = station->GetLayer(j)->GetSide(1);
573  numberofmodules = side->GetNModules();
574  if (numberofmodules <= 0) continue;
575  auto BackModuleNoise = 0;
576  for (auto k = 0; k < numberofmodules; k++) {
577  CbmMuchModuleGem* module = (CbmMuchModuleGem*) side->GetModule(k);
578  if (module->GetDetectorType() != 4 && module->GetDetectorType() != 3)
579  continue;
580  BackModuleNoise += GenerateNoisePerModule(module, t1, t2);
581  }
582  LayerNoise += FrontModuleNoise + BackModuleNoise;
583  }
584  LOG(debug1) << "+ " << setw(20) << GetName() << ": Generated "
585  << LayerNoise << " noise signals in station " << i
586  << " from t = " << fPreviousEventTime << " ns to "
587  << fCurrentEventTime << " ns";
588  StationNoise += LayerNoise;
589  }
590  return StationNoise;
591 }
592 
593 //================================Generte Noise==============================================//
594 
596  Double_t t1,
597  Double_t t2) {
598  auto NumberOfPad = module->GetNPads();
599  Double_t nNoiseMean = fPerPadNoiseRate * NumberOfPad * (t2 - t1);
600  Int_t nNoise = gRandom->Poisson(nNoiseMean);
601  LOG(debug) << "+ " << setw(20) << GetName()
602  << ": Number of noise signals : " << nNoise << " in one module. ";
603  for (Int_t iNoise = 0; iNoise <= nNoise; iNoise++) {
604  Int_t padnumber = Int_t(gRandom->Uniform(Double_t(NumberOfPad)));
605  CbmMuchPad* pad = module->GetPad(padnumber);
606  Double_t NoiseTime = gRandom->Uniform(t1, t2);
607  Double_t charge = fNoiseCharge->GetRandom();
608  while (charge < 0)
609  charge = fNoiseCharge->GetRandom();
610  AddNoiseSignal(pad, NoiseTime, charge);
611  }
612  //noise->Fill(nNoise);
613  return nNoise;
614 }
615 
616 //=================Add a signal to the buffer=====================//
617 
619  Double_t time,
620  Double_t charge) {
621  assert(pad);
622  LOG(debug3) << GetName() << ": Receiving signal " << charge << " in channel "
623  << pad->GetAddress() << " at time " << time << "ns";
624  // LOG(debug) << GetName() << ": discarding signal in dead channel "
625  // << channel;
626  // return;
627  CbmMuchSignal* signal = new CbmMuchSignal(pad->GetAddress(), time);
628  //signal->SetTimeStart(time);
629  //signal->SetTimeStop(time+fDeadTime);
630  signal->SetCharge((UInt_t) charge);
631  UInt_t address = pad->GetAddress();
632  CbmMuchReadoutBuffer::Instance()->Fill(address, signal);
634  LOG(debug3) << "+ " << setw(20) << GetName()
635  << ": Registered a Noise CbmMuchSignal into the "
636  "CbmMuchReadoutBuffer. Number of Noise Signal generated "
637  << fNofNoiseSignals;
638 }
639 //====================End of Noise part=================//
640 
641 // -------------------------------------------------------------------------
642 //Read all the Signal from CbmMuchReadoutBuffer, convert the analog signal into the digital response and register Output according to event by event mode and Time based mode.
643 void CbmMuchDigitizeGem::ReadAndRegister(Long_t eventTime) {
644  std::vector<CbmMuchSignal*> SignalList;
645  //Event Time should be passed with the Call
646  /*Double_t eventTime = -1.;
647  if(fDaq){
648  eventTime = FairRun::Instance()->GetEventHeader()->GetEventTime();
649  }*/
650 
651  Int_t ReadOutSignal =
652  CbmMuchReadoutBuffer::Instance()->ReadOutData(eventTime, SignalList);
653  LOG(debug) << GetName() << ": Number of Signals read out from Buffer "
654  << ReadOutSignal << " and SignalList contain " << SignalList.size()
655  << " entries.";
656 
657  for (std::vector<CbmMuchSignal*>::iterator LoopOver = SignalList.begin();
658  LoopOver != SignalList.end();
659  LoopOver++) {
660  CbmMuchDigi* digi = ConvertSignalToDigi(*LoopOver);
661  CbmMatch* digiMatch =
662  new CbmMatch(*(*LoopOver)->GetMatch()); // must be copied from signal
663  //assert(digi);
664  if (!digi) {
665  LOG(debug2) << GetName()
666  << ": Digi not created as signal is below threshold.";
667  } else {
668  LOG(debug2) << GetName() << ": New digi: sector = "
670  << " channel= "
672 
673  SendData(digi, digiMatch);
674  fNofDigis++;
675  }
676  }
677 
678  LOG(debug) << GetName() << ": " << fNofDigis
679  << (fNofDigis == 1 ? " digi " : " digis ")
680  << "created and sent to DAQ ";
681  if (fNofDigis)
682  LOG(debug) << "( from " << fixed << setprecision(3) << fTimeDigiFirst
683  << " ns to " << fTimeDigiLast << " ns )";
684  LOG(debug);
685 
686  // After digis are created from signals the signals have to be removed
687  // Otherwise there is a huge memeory leak
688  for (auto signal : SignalList) {
689  delete (signal);
690  }
691 
692 } //----ReadAndRegister -------
693 
694 //Convert Signal into the Digi with appropriate methods.
695 
697 
698  //Setting Parameters for RPC or GEM (10 lines)
699  auto address = signal->GetAddress();
700  auto StationIndex = CbmMuchAddress::GetStationIndex(address);
701  CbmMuchStation* station = fGeoScheme->GetStation(StationIndex);
702  auto LayerIndex = CbmMuchAddress::GetLayerIndex(address);
703  auto SideIndex = CbmMuchAddress::GetLayerSideIndex(address);
704  CbmMuchLayerSide* side = station->GetLayer(LayerIndex)->GetSide(SideIndex);
705  auto ModuleIndex = CbmMuchAddress::GetLayerSideIndex(address);
706  CbmMuchModule* module = side->GetModule(ModuleIndex);
707  assert(module);
708  DetectorParameters(module);
709 
710  // cout<<"Det Type: "<<module->GetDetectorType()<<" fQThreshold "<<fQThreshold<<" fqmax "<<fQMax<<" drift time "<<fTotalDriftTime<<" drift vel "<<fDriftVelocity<<" spot radius "<<fSpotRadius<<endl;
711  //cout<<"fQThreshold "<<fQThreshold<<" fqmax "<<fQMax<<endl;
712  //signal below threshold should be discarded.
713  if (signal->GetCharge() < 0)
714  return (
715  NULL); //Before type casting signed int into unsigned int need to check for -ve value otherwise after casing -ve int value will become a large +ve value.
716  else if ((unsigned int) signal->GetCharge() < fQThreshold)
717  return (NULL);
718 
719  Long64_t TimeStamp = signal->GetTimeStamp();
720  // Int_t TimeStamp = signal->GetTimeStamp(fQThreshold);
721  // if (TimeStamp < 0) return (NULL);//entire signal is below threshold, no digi generation.
722 
723  CbmMuchDigi* digi = new CbmMuchDigi();
724  digi->SetAddress(signal->GetAddress());
725  //Charge in number of electrons, need to be converted in ADC value
726  // digi->SetAdc((signal->GetCharge())*fNADCChannels/fQMax);//Charge should be computed as per Electronics Response.
727  Float_t adcValue;
728  adcValue = ((signal->GetCharge() - fQThreshold) * fNADCChannels)
729  / (fQMax - fQThreshold);
730  digi->SetAdc(
731  adcValue
732  + 1); //Charge should be computed as per Electronics Response. *** modified by Ekata Nandy***
733  // ADC channels number is 32.GEM & RPC has different charge threshold value and dynamic range, so SetAdc has been changed accordingly. ADC value starts from 1 to 32. ADC 0 has been excluded as it gives wrong x,y,t in Hit finder.@modified by Ekata Nandy
734 
735  // cout<<" dynamic range "<<(fQMax -fQThreshold)<<" adc "<<digi->GetAdc()<<" channels "<<fNADCChannels<< "charge "<<signal->GetCharge()<<endl;
736  /* if(module->GetDetectorType()==3)
737  {hadcGEM->Fill(digi->GetAdc());}
738  if(module->GetDetectorType()==4)
739  {hadcRPC->Fill(digi->GetAdc());}
740  */
741  digi->SetTime(TimeStamp);
742 
743 
744  // Update times of first and last digi
746  fNofDigis ? TMath::Min(fTimeDigiFirst, Double_t(TimeStamp)) : TimeStamp;
747  fTimeDigiLast = TMath::Max(fTimeDigiLast, Double_t(TimeStamp));
748 
749  // digi->SetPileUp();
750  // digi->SetDiffEvent();
751  return (digi);
752 }
753 
754 
755 // -------------------------------------------------------------------------
757 
758 
759  // --- In event-by-event mode, the analogue buffer should be empty.
760  if (fEventMode) {
761  if (CbmMuchReadoutBuffer::Instance()->GetNData()) {
762  LOG(info) << fName << ": " << CbmMuchReadoutBuffer::Instance()->GetNData()
763  << " signals in readout buffer";
764  LOG(fatal) << fName << ": Readout buffer is not empty at end of run "
765  << "in event-by-event mode!";
766  } //? non-empty buffer
767  } //? event-by-event mode
768 
769  else { // time-based mode
770  fTimer.Start();
771  std::cout << std::endl;
772  LOG(info) << GetName() << ": Finish run";
773  Reset();
774  LOG(info) << fName << ": " << CbmMuchReadoutBuffer::Instance()->GetNData()
775  << " signals in readout buffer";
776  ReadAndRegister(-1.); // -1 means process all data
777  LOG(info) << setw(15) << GetName() << ": Finish, points " << fNofPoints
778  << ", signals: " << fNofSignals << ", digis: " << fNofDigis
779  << ". Exec time " << setprecision(6) << fTimer.RealTime()
780  << " s.";
781  LOG(info) << fName << ": " << CbmMuchReadoutBuffer::Instance()->GetNData()
782  << " signals in readout buffer";
783  fTimer.Stop();
787  fTimeTot += fTimer.RealTime();
788  } //? time-based mode
789  //noise->Draw();
790  std::cout << std::endl;
791  LOG(info) << "=====================================";
792  LOG(info) << GetName() << ": Run summary";
793  LOG(info) << "Events processed : " << fNofEvents;
794  LOG(info) << "MuchPoint / event : " << setprecision(1)
795  << fNofPointsTot / Double_t(fNofEvents);
796  LOG(info) << "MuchSignal / event : "
797  << fNofSignalsTot / Double_t(fNofEvents);
798  //<< " / " << fNofSignalsBTot / Double_t(fNofEvents)
799  LOG(info) << "MuchDigi / event : " << fNofDigisTot / Double_t(fNofEvents);
800  LOG(info) << "Digis per point : " << setprecision(6)
802  LOG(info) << "Digis per signal : " << fNofDigisTot / fNofSignalsTot;
803  LOG(info) << "Noise digis / event : " << fNofNoiseTot / Double_t(fNofEvents);
804  LOG(info) << "Noise fraction : " << fNofNoiseTot / fNofDigisTot;
805 
806  LOG(info) << "Real time per event : " << fTimeTot / Double_t(fNofEvents)
807  << " s";
808  LOG(info) << "=====================================";
809 
810  /*
811  TFile *f1 =new TFile ("pri_el_info.root","RECREATE");
812  hPriElAfterDriftpathgem->Write();
813  hPriElAfterDriftpathrpc->Write();
814  hadcGEM->Write();
815  hadcRPC->Write();
816  */
817  //if (fDaq) ReadAndRegister(-1.);
818 }
819 // -------------------------------------------------------------------------
820 
821 
822 // ------- Private method ExecAdvanced -------------------------------------
823 Bool_t CbmMuchDigitizeGem::ExecPoint(const CbmMuchPoint* point, Int_t iPoint) {
824 
825  //std::cout<<" start execution "<<iPoint<<std::endl;
826  TVector3 v1, v2, dv;
827  point->PositionIn(v1);
828  point->PositionOut(v2);
829  dv = v2 - v1;
830 
831  Bool_t Status;
832  Int_t detectorId = point->GetDetectorID();
833  CbmMuchModule* module = fGeoScheme->GetModuleByDetId(detectorId);
834  DetectorParameters(module);
835 
836  int detectortype = module->GetDetectorType();
837  //cout<<" dec type === "<<detectortype<<endl;
838  if (fAlgorithm == 0) { // Simple digitization
839  TVector3 v = 0.5 * (v1 + v2);
840  CbmMuchPad* pad = 0;
841  if (module->GetDetectorType() == 1) {
842  CbmMuchModuleGemRectangular* module1 =
843  (CbmMuchModuleGemRectangular*) module;
844  pad = module1->GetPad(v[0], v[1]);
845  if (pad) printf("x0=%f,y0=%f\n", pad->GetX(), pad->GetY());
846  } else if (module->GetDetectorType() == 3
847  || module->GetDetectorType() == 4) {
848  CbmMuchModuleGemRadial* module3 = (CbmMuchModuleGemRadial*) module;
849  pad = module3->GetPad(v[0], v[1]);
850  }
851  if (!pad) return kFALSE;
852  AddCharge(pad, fQMax, iPoint, point->GetTime(), 0);
853  return kTRUE;
854  }
855 
856  // Start of advanced digitization
857  Int_t nElectrons =
858  Int_t(GetNPrimaryElectronsPerCm(point, detectortype) * dv.Mag());
859  if (nElectrons < 0) return kFALSE;
860  //cout<<" nElectrons "<<nElectrons<<endl;
861  /*
862 if(detectortype==3)
863 {//cout<<" nElectrons "<<nElectrons<<endl;
864 hPriElAfterDriftpathgem->Fill(nElectrons);}
865 
866 if(detectortype==4)
867 {//cout<<" nElectrons "<<nElectrons<<endl;
868 hPriElAfterDriftpathrpc->Fill(nElectrons);}
869 */
870 
871  Double_t time = point->GetTime();
872 
873  if (module->GetDetectorType() == 1) {
874  CbmMuchModuleGemRectangular* module1 =
875  (CbmMuchModuleGemRectangular*) module;
876  map<CbmMuchSector*, Int_t> firedSectors;
877  for (Int_t i = 0; i < nElectrons; i++) {
878  Double_t aL = gRandom->Rndm();
879  Double_t driftTime = (1 - aL) * fTotalDriftTime;
880  TVector3 ve = v1 + dv * aL;
881  UInt_t ne = GasGain();
882  Double_t x = ve.X();
883  Double_t y = ve.Y();
884  Double_t x1 = x - fSpotRadius;
885  Double_t x2 = x + fSpotRadius;
886  Double_t y1 = y - fSpotRadius;
887  Double_t y2 = y + fSpotRadius;
888  Double_t s = 4 * fSpotRadius * fSpotRadius;
889  firedSectors[module1->GetSector(x1, y1)] = 0;
890  firedSectors[module1->GetSector(x1, y2)] = 0;
891  firedSectors[module1->GetSector(x2, y1)] = 0;
892  firedSectors[module1->GetSector(x2, y2)] = 0;
893  for (map<CbmMuchSector*, Int_t>::iterator it = firedSectors.begin();
894  it != firedSectors.end();
895  it++) {
896  CbmMuchSector* sector = (*it).first;
897  if (!sector) continue;
898  for (Int_t iPad = 0; iPad < sector->GetNChannels(); iPad++) {
899  CbmMuchPad* pad = sector->GetPadByChannelIndex(iPad);
900  Double_t xp0 = pad->GetX();
901  Double_t xpd = pad->GetDx() / 2.;
902  Double_t xp1 = xp0 - xpd;
903  Double_t xp2 = xp0 + xpd;
904  if (x1 > xp2 || x2 < xp1) continue;
905  Double_t yp0 = pad->GetY();
906  Double_t ypd = pad->GetDy() / 2.;
907  Double_t yp1 = yp0 - ypd;
908  Double_t yp2 = yp0 + ypd;
909  if (y1 > yp2 || y2 < yp1) continue;
910  Double_t lx = x1 > xp1 ? (x2 < xp2 ? x2 - x1 : xp2 - x1) : x2 - xp1;
911  Double_t ly = y1 > yp1 ? (y2 < yp2 ? y2 - y1 : yp2 - y1) : y2 - yp1;
912  AddCharge(pad, UInt_t(ne * lx * ly / s), iPoint, time, driftTime);
913  }
914  } // loop fired sectors
915  firedSectors.clear();
916  }
917  }
918 
919  if (module->GetDetectorType() == 3 || module->GetDetectorType() == 4) {
920  fAddressCharge.clear();
921  CbmMuchModuleGemRadial* module3 = (CbmMuchModuleGemRadial*) module;
922  if (!module3) {
923  LOG(debug) << GetName() << ": Not Processing MCPoint " << iPoint
924  << " because it is not on any GEM module.";
925  return 1;
926  }
927  CbmMuchSectorRadial* sFirst =
928  (CbmMuchSectorRadial*) module3->GetSectorByIndex(0); //First sector
929  if (!sFirst) {
930  LOG(debug) << GetName() << ": Not Processing MCPoint " << iPoint
931  << " because it is on the module " << module3
932  << " but not the first sector. " << sFirst;
933  return 1;
934  }
935  CbmMuchSectorRadial* sLast =
936  (CbmMuchSectorRadial*) module3->GetSectorByIndex(module3->GetNSectors()
937  - 1); //Last sector
938 
939  if (!sLast) {
940  LOG(debug) << GetName() << ": Not Processing MCPoint " << iPoint
941  << " because it is not the last sector of module." << module3;
942  return 1;
943  }
944  Double_t rMin = sFirst->GetR1(); //Mimimum radius of the Sector//5
945  Double_t rMax = sLast->GetR2(); //Maximum radius of the Sector//35
946 
947  //cout<<rMin<<" Yeah "<<rMax<<endl;
948  // std::cout<<"min Rad "<<rMin<<" max Rad "<<rMax<<std::endl;
949  //Calculating drifttime once for one track or one MCPoint, not for all the Primary Electrons generated during DriftGap.
950 
951  Double_t driftTime = -1;
952  while (driftTime < 0) {
953 
954  Double_t aL = gRandom->Gaus(
955  0.5, 0.133); //Generting random number for calculating Drift Time.
956  // cout<<"Det Type "<<detectortype<<"fTotalDriftTime "<<fTotalDriftTime<<endl;
957  driftTime = (1 - aL) * fTotalDriftTime;
958  }
959 
960  for (Int_t i = 0; i < nElectrons;
961  i++) { //Looping over all the primary electrons
962  Double_t RandomNumberForPrimaryElectronPosition = gRandom->Rndm();
963  TVector3 ve = v1 + dv * RandomNumberForPrimaryElectronPosition;
964 
965  //------------------------Added by O. Singh 11.12.2017 for mCbm-------------------------
966  Double_t r = 0.0, phi = 0.0;
967  if (fFlag == 1) { //mCbm
968  TVector3 nVe;
969  Double_t XX = ve.X();
970  Double_t YY = ve.Y();
971  Double_t ZZ = ve.Z();
972 
973  //Transfotamation of MuChpoints to pads position
974  Double_t tX =
975  18.5; // Ajit + OS + Apar -> For miniMUCH setup in March 2019
976  Double_t tY =
977  80.0; // Ajit + OS + Apar -> For miniMUCH setup in March 2019
978  Double_t nXX = XX - tX;
979  Double_t nYY = YY - tY;
980 
981  Double_t nZZ = ZZ;
982 
983  nVe.SetX(nXX);
984  nVe.SetY(nYY);
985  nVe.SetZ(nZZ);
986  r = nVe.Perp();
987  phi = nVe.Phi();
988  } else { //Cbm
989 
990  r = ve.Perp();
991  phi = ve.Phi();
992  }
993  //--------------------------------------------------------------------------
994  UInt_t ne = GasGain(); //Number of secondary electrons
995  Double_t r1 = r - fSpotRadius;
996  Double_t r2 = r + fSpotRadius;
997  Double_t phi1 = phi - fSpotRadius / r;
998  Double_t phi2 = phi + fSpotRadius / r;
999  // cout<<" fSpotRadius "<<fSpotRadius<<endl;
1000  if (r1 < rMin
1001  && r2 > rMin) { //Adding charge to the pad which is on Lower Boundary
1002  Status = AddCharge(sFirst,
1003  UInt_t(ne * (r2 - rMin) / (r2 - r1)),
1004  iPoint,
1005  time,
1006  driftTime,
1007  phi1,
1008  phi2);
1009  if (!Status)
1010  LOG(debug) << GetName() << ": Processing MCPoint " << iPoint
1011  << " in which Primary Electron : " << i
1012  << " not contributed charge. ";
1013  continue;
1014  }
1015  if (r1 < rMax
1016  && r2 > rMax) { //Adding charge to the pad which is on Upper Boundary
1017  Status = AddCharge(sLast,
1018  UInt_t(ne * (rMax - r1) / (r2 - r1)),
1019  iPoint,
1020  time,
1021  driftTime,
1022  phi1,
1023  phi2);
1024  if (!Status)
1025  LOG(debug) << GetName() << ": Processing MCPoint " << iPoint
1026  << " in which Primary Electron : " << i
1027  << " not contributed charge. ";
1028  continue;
1029  }
1030  if (r1 < rMin && r2 < rMin) continue;
1031  if (r1 > rMax && r2 > rMax) continue;
1032 
1033  CbmMuchSectorRadial* s1 = module3->GetSectorByRadius(r1);
1034  CbmMuchSectorRadial* s2 = module3->GetSectorByRadius(r2);
1035 
1036 
1037  if (s1 == s2) {
1038  Status = AddCharge(s1, ne, iPoint, time, driftTime, phi1, phi2);
1039  if (!Status)
1040  LOG(debug3) << GetName() << ": Processing MCPoint " << iPoint
1041  << " in which Primary Electron : " << i
1042  << " not contributed charge. ";
1043  } else { //Adding praportionate charge to both the pad
1044  Status = AddCharge(s1,
1045  UInt_t(ne * (s1->GetR2() - r1) / (r2 - r1)),
1046  iPoint,
1047  time,
1048  driftTime,
1049  phi1,
1050  phi2);
1051  if (!Status)
1052  LOG(debug3) << GetName() << ": Processing MCPoint " << iPoint
1053  << " in which Primary Electron : " << i
1054  << " not contributed charge. ";
1055  Status = AddCharge(s2,
1056  UInt_t(ne * (r2 - s2->GetR1()) / (r2 - r1)),
1057  iPoint,
1058  time,
1059  driftTime,
1060  phi1,
1061  phi2);
1062  if (!Status)
1063  LOG(debug3) << GetName() << ": Processing MCPoint " << iPoint
1064  << " in which Primary Electron : " << i
1065  << " not contributed charge. ";
1066  }
1067  }
1068 
1069  //Generate CbmMuchSignal for each entry of fAddressCharge and store in the CbmMuchReadoutBuffer
1070  if (!BufferSignals(iPoint, time, driftTime))
1071  LOG(debug3) << GetName() << ": Processing MCPoint " << iPoint
1072  << " nothing is buffered. ";
1073  fAddressCharge.clear();
1074  LOG(debug1) << GetName() << ": fAddressCharge size is "
1075  << fAddressCharge.size() << " Cleared fAddressCharge. ";
1076  }
1077  // std::cout<<" Execution completed for point # "<<iPoint<<std::endl;
1078  return kTRUE;
1079 }
1080 // -------------------------------------------------------------------------
1081 
1082 // -------------------------------------------------------------------------
1084  //cout<<" mean gain "<<fMeanGasGain<<endl;
1085  Double_t gasGain = -fMeanGasGain * TMath::Log(1 - gRandom->Rndm());
1086  if (gasGain < 0.) gasGain = 1e6;
1087  return (Int_t) gasGain;
1088 }
1089 // -------------------------------------------------------------------------
1090 
1091 // -------------------------------------------------------------------------
1092 Double_t CbmMuchDigitizeGem::Sigma_n_e(Double_t Tkin, Double_t mass) {
1093  Double_t logT;
1094  if (mass < 0.1) {
1095  logT = log(Tkin * 0.511 / mass);
1096  if (logT > 9.21034) logT = 9.21034;
1097  if (logT < min_logT_e) logT = min_logT_e;
1098  return fSigma[0]->Eval(logT);
1099  } else if (mass >= 0.1 && mass < 0.2) {
1100  logT = log(Tkin * 105.658 / mass);
1101  if (logT > 9.21034) logT = 9.21034;
1102  if (logT < min_logT_mu) logT = min_logT_mu;
1103  return fSigma[1]->Eval(logT);
1104  } else {
1105  logT = log(Tkin * 938.272 / mass);
1106  if (logT > 9.21034) logT = 9.21034;
1107  if (logT < min_logT_p) logT = min_logT_p;
1108  return fSigma[2]->Eval(logT);
1109  }
1110 }
1111 // -------------------------------------------------------------------------
1112 
1113 // -------------------------------------------------------------------------
1114 Double_t CbmMuchDigitizeGem::MPV_n_e(Double_t Tkin, Double_t mass) {
1115  Double_t logT;
1116  if (mass < 0.1) {
1117  logT = log(Tkin * 0.511 / mass);
1118  if (logT > 9.21034) logT = 9.21034;
1119  if (logT < min_logT_e) logT = min_logT_e;
1120  return fMPV[0]->Eval(logT);
1121  } else if (mass >= 0.1 && mass < 0.2) {
1122  logT = log(Tkin * 105.658 / mass);
1123  if (logT > 9.21034) logT = 9.21034;
1124  if (logT < min_logT_mu) logT = min_logT_mu;
1125  return fMPV[1]->Eval(logT);
1126  } else {
1127  logT = log(Tkin * 938.272 / mass);
1128  if (logT > 9.21034) logT = 9.21034;
1129  if (logT < min_logT_p) logT = min_logT_p;
1130  return fMPV[2]->Eval(logT);
1131  }
1132 }
1133 // -------------------------------------------------------------------------
1134 
1135 
1136 // -------------------------------------------------------------------------
1137 Double_t
1139  int detectortype) {
1140  Int_t trackId = point->GetTrackID();
1141  // Int_t eventId = point->GetEventID();
1142  if (trackId < 0) return -1;
1143  /* Commented out on request of A. Senger from 22.01.2014
1144  if (fDaq && eventId!=FairRootManager::Instance()->GetInTree()->GetBranch("MCTrack")->GetReadEntry())
1145  FairRootManager::Instance()->GetInTree()->GetBranch("MCTrack")->GetEntry(eventId);
1146  */
1147  CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTracks->At(trackId);
1148 
1149  if (!mcTrack) return -1;
1150  Int_t pdgCode = mcTrack->GetPdgCode();
1151 
1152  TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(pdgCode);
1153  // Assign proton hypothesis for unknown particles
1154  if (!particle) particle = TDatabasePDG::Instance()->GetParticle(2212);
1155  if (TMath::Abs(particle->Charge()) < 0.1) return -1;
1156 
1157  Double_t m = particle->Mass();
1158  TLorentzVector p;
1159  p.SetXYZM(point->GetPx(), point->GetPy(), point->GetPz(), m);
1160  Double_t Tkin = p.E() - m; // kinetic energy of the particle
1161  Double_t sigma =
1162  CbmMuchDigitizeGem::Sigma_n_e(Tkin, m); // sigma for Landau distribution
1163  Double_t mpv = CbmMuchDigitizeGem::MPV_n_e(
1164  Tkin, m); // most probable value for Landau distr.
1165  Double_t n;
1166  Double_t mpvRpc =
1167  50.0; // For RPC MPV and sigma is taken to produce final landau in accordance with experimental value
1168  Double_t sigmaRpc = 12.0;
1169  //cout<<" dec type function "<<detectortype<<endl;
1170  if (detectortype == 3)
1171  {
1172  n = gRandom->Landau(mpv, sigma);
1173  while (n > 5e4)
1174  n = gRandom->Landau(
1175  mpv, sigma); // restrict Landau tail to increase performance
1176  return m < 0.1 ? n / l_e : n / l_not_e;
1177  }
1178  if (detectortype == 4)
1179  {
1180  n = gRandom->Landau(mpvRpc, sigmaRpc);
1181  while (n > 5e4)
1182  n = gRandom->Landau(
1183  mpvRpc, sigmaRpc); // restrict Landau tail to increase performance
1184  return n;
1185  }
1186  // for all other cases will return -1.
1187  return -1;
1188 }
1189 // -------------------------------------------------------------------------
1190 // -------------------------------------------------------------------------
1192  UInt_t ne,
1193  Int_t /*iPoint*/,
1194  Double_t /*time*/,
1195  Double_t /*driftTime*/,
1196  Double_t phi1,
1197  Double_t phi2) {
1198  CbmMuchPadRadial* pad1 = s->GetPadByPhi(phi1);
1199  if (!pad1) return kFALSE;
1200  //assert(pad1); has to check if any pad address is NULL
1201  CbmMuchPadRadial* pad2 = s->GetPadByPhi(phi2);
1202  if (!pad2) return kFALSE;
1203  //assert(pad2); has to check if any pad address is NULL
1204  if (pad1 == pad2) {
1205  UInt_t address = pad1->GetAddress();
1206  //Finding that if for the same address if already charge stored then add the charge.
1207  std::map<UInt_t, UInt_t>::iterator it = fAddressCharge.find(address);
1208  if (it != fAddressCharge.end())
1209  it->second = it->second + ne;
1210  else
1211  fAddressCharge.insert(std::pair<UInt_t, UInt_t>(address, ne));
1212  // AddChargePerMC(pad1,ne,iPoint,time,driftTime);
1213  } else {
1214  Double_t phi = pad1 ? pad1->GetPhi2() : pad2 ? pad2->GetPhi1() : 0;
1215  UInt_t pad1_ne = UInt_t(ne * (phi - phi1) / (phi2 - phi1));
1216 
1217  UInt_t address = pad1->GetAddress();
1218  //Finding that if for the same address if already charge stored then add the charge.
1219  std::map<UInt_t, UInt_t>::iterator it = fAddressCharge.find(address);
1220  if (it != fAddressCharge.end())
1221  it->second = it->second + pad1_ne;
1222  else
1223  fAddressCharge.insert(std::pair<UInt_t, UInt_t>(address, pad1_ne));
1224  // AddChargePerMC(pad1,pad1_ne ,iPoint,time,driftTime);
1225 
1226 
1227  // Getting some segmentation fault a
1228  address = pad2->GetAddress();
1229  //Finding that if for the same address if already charge stored then add the charge.
1230  it = fAddressCharge.find(address);
1231  if (it != fAddressCharge.end())
1232  it->second = it->second + ne - pad1_ne;
1233  else
1234  fAddressCharge.insert(std::pair<UInt_t, UInt_t>(address, ne - pad1_ne));
1235  // AddChargePerMC(pad2,ne-pad1_ne,iPoint,time,driftTime);
1236  }
1237  return kTRUE;
1238 }
1239 // -------------------------------------------------------------------------
1240 
1241 
1242 // -------------------------------------------------------------------------
1243 //Will remove this AddCharge, only used for simple and Rectangular Geometry.
1245  UInt_t charge,
1246  Int_t iPoint,
1247  Double_t time,
1248  Double_t driftTime) {
1249  if (!pad) return;
1250 
1251  Long_t AbsTime = fCurrentEventTime + time + driftTime;
1252 
1253  //Creating a new Signal, it will be deleted by CbmReadoutBuffer()
1254  CbmMuchSignal* signal = new CbmMuchSignal(pad->GetAddress(), AbsTime);
1255  //signal->SetTimeStart(AbsTime);
1256  //signal->SetTimeStop(AbsTime+fDeadTime);
1257  signal->SetCharge(charge);
1258  //signal->MakeSignalShape(charge,fgDeltaResponse);
1259  signal->AddNoise(fMeanNoise);
1260  UInt_t address = pad->GetAddress();
1261  //match->AddCharge(iPoint,charge,time+driftTime,fgDeltaResponse,time,eventNr,inputNr);
1262  CbmLink link(charge, iPoint, fCurrentMCEntry, fCurrentInput);
1263  //std::cout<<"Before AddLink"<< endl;
1264  (signal->GetMatch())->AddLink(link);
1265  //std::cout<<"After AddLink"<< endl;
1266  //Adding all these temporary signal into the CbmMuchReadoutBuffer
1267  CbmMuchReadoutBuffer::Instance()->Fill(address, signal);
1268  //Increasing number of signal by one.
1269  fNofSignals++;
1270  LOG(debug4) << " Registered the CbmMuchSignal into the CbmMuchReadoutBuffer ";
1271 
1272 } //end of AddCharge
1273 
1274 
1275 //----------------------------------------------------------
1277  Double_t time,
1278  Double_t driftTime) {
1279 
1280  if (!fAddressCharge.size()) {
1281  LOG(debug2) << "Buffering MC Point " << iPoint
1282  << " but fAddressCharge size is " << fAddressCharge.size()
1283  << "so nothing to Buffer for this MCPoint.";
1284  return kFALSE;
1285  }
1286  UInt_t AbsTime = fCurrentEventTime + time + driftTime;
1287  LOG(debug2) << GetName() << ": Processing event " << fCurrentEvent
1288  << " from input " << fCurrentInput
1289  << " at t = " << fCurrentEventTime << " ns with "
1290  << fPoints->GetEntriesFast() << " MuchPoints "
1291  << " and Number of pad hit is " << fAddressCharge.size() << ".";
1292  //Loop on the fAddressCharge to store all the Signals into the CbmReadoutBuffer()
1293  //Generate one by one CbmMuchSignal from the fAddressCharge and store them into the CbmMuchReadoutBuffer.
1294  for (auto it = fAddressCharge.begin(); it != fAddressCharge.end(); ++it) {
1295  UInt_t address = it->first;
1296  //Creating a new Signal, it will be deleted by CbmReadoutBuffer()
1297  CbmMuchSignal* signal = new CbmMuchSignal(address, AbsTime);
1298  //signal->SetTimeStart(AbsTime);
1299  //signal->SetTimeStop(AbsTime+fDeadTime);
1300  //signal->MakeSignalShape(it->second,fgDeltaResponse);
1301  signal->SetCharge(it->second);
1302  signal->AddNoise(fMeanNoise);
1303  CbmLink link(signal->GetCharge(), iPoint, fCurrentMCEntry, fCurrentInput);
1304  (signal->GetMatch())->AddLink(link);
1305  //Adding all these temporary signal into the CbmMuchReadoutBuffer
1306  CbmMuchReadoutBuffer::Instance()->Fill(address, signal);
1307  //Increasing number of signal by one.
1308  fNofSignals++;
1309  LOG(debug3)
1310  << " Registered the CbmMuchSignal into the CbmMuchReadoutBuffer ";
1311  }
1312 
1313  LOG(debug2) << GetName() << ": For MC Point " << iPoint << " buffered "
1314  << fAddressCharge.size()
1315  << " CbmMuchSignal into the CbmReadoutBuffer.";
1316  return kTRUE;
1317 } //end of BufferSignals
1318 // -------------------------------------------------------------------------
1319 
1320 
CbmMuchDigitizeGem::AddCharge
Bool_t AddCharge(CbmMuchSectorRadial *s, UInt_t ne, Int_t iPoint, Double_t time, Double_t driftTime, Double_t phi1, Double_t phi2)
Definition: CbmMuchDigitizeGem.cxx:1191
CbmMatch
Definition: CbmMatch.h:22
CbmMuchSignal::GetTimeStamp
Long64_t GetTimeStamp()
Definition: CbmMuchSignal.h:115
CbmMuchDigitizeGem::Finish
virtual void Finish()
Definition: CbmMuchDigitizeGem.cxx:756
CbmMuchDigitizeGem::fPoints
TClonesArray * fPoints
Definition: CbmMuchDigitizeGem.h:181
CbmMuchDigi.h
CbmMuchGeoScheme
Definition: CbmMuchGeoScheme.h:43
CbmMuchPoint
Definition: CbmMuchPoint.h:21
CbmMuchStation::GetLayer
CbmMuchLayer * GetLayer(Int_t iLayer) const
Definition: CbmMuchStation.h:58
CbmMuchSectorRadial
Definition: CbmMuchSectorRadial.h:19
CbmMuchStation
Definition: CbmMuchStation.h:22
CbmMuchDigitizeGem::fTimeTot
Double_t fTimeTot
Total execution time.
Definition: CbmMuchDigitizeGem.h:243
CbmMuchDigitizeGem::fNofDigisTot
Double_t fNofDigisTot
Total number of digis created.
Definition: CbmMuchDigitizeGem.h:242
CbmDigitizeBase::GetEventInfo
void GetEventInfo()
Get event information.
Definition: CbmDigitizeBase.cxx:48
fDeadTime
static const Int_t fDeadTime
Definition: CbmMuchSignal.h:29
CbmMuchDigitizeGem::CbmMuchDigitizeGem
CbmMuchDigitizeGem()
Definition: CbmMuchDigitizeGem.cxx:79
CbmMuchDigitizeGem::Init
virtual InitStatus Init()
Definition: CbmMuchDigitizeGem.cxx:314
CbmMuchDigitizeGem::fPerPadNoiseRate
Double_t fPerPadNoiseRate
Definition: CbmMuchDigitizeGem.h:246
CbmReadoutBuffer::Fill
void Fill(UInt_t address, Data *data)
Definition: CbmReadoutBuffer.h:163
CbmMuchDigitizeGem::DetectorParameters
void DetectorParameters(CbmMuchModule *module)
Definition: CbmMuchDigitizeGem.cxx:273
CbmMuchDigitizeGem::GetNPrimaryElectronsPerCm
Double_t GetNPrimaryElectronsPerCm(const CbmMuchPoint *point, int detectortype)
Definition: CbmMuchDigitizeGem.cxx:1138
sigma_e
constexpr double sigma_e[]
Definition: CbmMuchRecoDefs.h:12
CbmMuchDigitizeGem::ExecPoint
Bool_t ExecPoint(const CbmMuchPoint *point, Int_t)
Definition: CbmMuchDigitizeGem.cxx:823
CbmMuchPadRadial::GetPhi2
Double_t GetPhi2() const
Definition: CbmMuchPadRadial.h:36
CbmMuchDigitizeGem::fNofSignalsTot
Double_t fNofSignalsTot
Total Number of signals.
Definition: CbmMuchDigitizeGem.h:241
CbmMuchDigitizeGem::fQThreshold
UInt_t fQThreshold
Definition: CbmMuchDigitizeGem.h:202
CbmMuchPad::GetY
Double_t GetY() const
Definition: CbmMuchPad.h:29
CbmMuchSector
Definition: CbmMuchSector.h:22
CbmMuchDigitizeGem::fNoiseCharge
TF1 * fNoiseCharge
Definition: CbmMuchDigitizeGem.h:253
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
CbmMuchDigitizeGem::Exec
virtual void Exec(Option_t *opt)
Definition: CbmMuchDigitizeGem.cxx:476
CbmMuchDigitizeGem::fNofPointsTot
Double_t fNofPointsTot
Total number of points processed.
Definition: CbmMuchDigitizeGem.h:240
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
mpv_p
constexpr double mpv_p[]
Definition: CbmMuchRecoDefs.h:27
CbmMuchDigitizeGem::fDeadPadsFrac
Double_t fDeadPadsFrac
Definition: CbmMuchDigitizeGem.h:208
CbmMuchSectorRadial::GetR1
Double_t GetR1() const
Definition: CbmMuchSectorRadial.h:31
CbmDigitizeBase::fCurrentMCEntry
Int_t fCurrentMCEntry
Number of current MC event.
Definition: CbmDigitizeBase.h:164
l_not_e
constexpr double l_not_e
Definition: CbmMuchRecoDefs.h:33
CbmMuchPad::GetDy
Double_t GetDy() const
Definition: CbmMuchPad.h:31
l_e
constexpr double l_e
Definition: CbmMuchRecoDefs.h:32
DetectorType
DetectorType
Definition: CbmMuchDigitizeGem.h:51
CbmMuchSector::GetNChannels
Int_t GetNChannels() const
Definition: CbmMuchSector.h:31
CbmMuchGeoScheme::Init
void Init(TObjArray *stations, Int_t flag)
Definition: CbmMuchGeoScheme.cxx:121
CbmMuchDigitizeGem::fMeanNoise
UInt_t fMeanNoise
Definition: CbmMuchDigitizeGem.h:204
CbmMuchSignal::GetAddress
Int_t GetAddress() const
Definition: CbmMuchSignal.h:96
CbmMuchReadoutBuffer::Instance
static CbmMuchReadoutBuffer * Instance()
Definition: CbmMuchReadoutBuffer.cxx:82
CbmMuchDigitizeGem::fNofNoiseTot
Int_t fNofNoiseTot
Set this boolean variable to True if want to generated Elecronics Noise.
Definition: CbmMuchDigitizeGem.h:251
CbmMuchDigitizeGem::fMeanGasGain
Double_t fMeanGasGain
Definition: CbmMuchDigitizeGem.h:206
CbmMuchDigitizeGem::GenerateNoise
Int_t GenerateNoise(Double_t, Double_t)
Definition: CbmMuchDigitizeGem.cxx:541
CbmMuchLayer::GetSide
CbmMuchLayerSide * GetSide(Bool_t side)
Definition: CbmMuchLayer.h:49
CbmMuchDigitizeGem::MPV_n_e
Double_t MPV_n_e(Double_t Tkin, Double_t mass)
Definition: CbmMuchDigitizeGem.cxx:1114
CbmMuchPad::GetDx
Double_t GetDx() const
Definition: CbmMuchPad.h:30
CbmMuchDigitizeGem::fDTime
Double_t fDTime
Definition: CbmMuchDigitizeGem.h:207
CbmMuchDigitizeGem::fTimer
TStopwatch fTimer
Definition: CbmMuchDigitizeGem.h:209
CbmMuchModuleGemRadial.h
CbmMuchDigi::SetAddress
void SetAddress(Int_t address)
Definition: CbmMuchDigi.h:84
CbmMuchModuleGemRadial::GetSectorByRadius
CbmMuchSectorRadial * GetSectorByRadius(Double_t r)
Definition: CbmMuchModuleGemRadial.cxx:60
CbmMuchDigitizeGem::Reset
void Reset()
Definition: CbmMuchDigitizeGem.cxx:266
CbmMuchSignal::GetCharge
UInt_t GetCharge() const
Definition: CbmMuchSignal.h:91
CbmMuchPadRadial
Definition: CbmMuchPadRadial.h:17
CbmMuchModuleGemRectangular
Definition: CbmMuchModuleGemRectangular.h:20
sigma_p
constexpr double sigma_p[]
Definition: CbmMuchRecoDefs.h:21
CbmMuchModule::GetSize
TVector3 GetSize() const
Definition: CbmMuchModule.h:50
min_logT_p
constexpr double min_logT_p
Definition: CbmMuchRecoDefs.h:31
CbmMuchRecoDefs.h
CbmMuchSignal::GetMatch
CbmMatch * GetMatch() const
Definition: CbmMuchSignal.h:95
CbmMuchSectorRectangular.h
CbmMuchModuleGemRectangular.h
CbmMuchGeoScheme::GetNStations
Int_t GetNStations() const
Definition: CbmMuchGeoScheme.h:79
CbmMuchReadoutBuffer.h
CbmMuchModuleGemRadial
Definition: CbmMuchModuleGemRadial.h:21
CbmMuchDigitizeGem::fDigiFile
TString fDigiFile
Definition: CbmMuchDigitizeGem.h:180
CbmMuchDigitizeGem::fAddressCharge
std::map< UInt_t, UInt_t > fAddressCharge
Function to sample the noise charge.
Definition: CbmMuchDigitizeGem.h:257
CbmMuchPoint.h
CbmMuchSectorRadial::GetPadByPhi
CbmMuchPadRadial * GetPadByPhi(Double_t phi)
Definition: CbmMuchSectorRadial.cxx:58
min_logT_mu
constexpr double min_logT_mu
Definition: CbmMuchRecoDefs.h:30
CbmMuchModuleGem::GetNPads
Int_t GetNPads()
Definition: CbmMuchModuleGem.cxx:58
CbmMuchDigitizeGem::fNofDigis
Int_t fNofDigis
Number of created digis in Exec.
Definition: CbmMuchDigitizeGem.h:236
CbmMuchSignal
Data class for an analog signal in the MUCH Simple data class used in the digitisation process of the...
Definition: CbmMuchSignal.h:31
CbmMuchDigitizeGem::AddNoiseSignal
void AddNoiseSignal(CbmMuchPad *, Double_t, Double_t)
Definition: CbmMuchDigitizeGem.cxx:618
CbmMuchModuleGemRectangular::GetPad
CbmMuchPadRectangular * GetPad(Double_t x, Double_t y)
Definition: CbmMuchModuleGemRectangular.cxx:102
CbmMuchPoint::PositionIn
void PositionIn(TVector3 &pos) const
Definition: CbmMuchPoint.h:79
CbmMuchDigitizeGem::fNADCChannels
UInt_t fNADCChannels
Definition: CbmMuchDigitizeGem.h:200
CbmMuchDigitizeGem::ConvertSignalToDigi
CbmMuchDigi * ConvertSignalToDigi(CbmMuchSignal *)
Definition: CbmMuchDigitizeGem.cxx:696
CbmDigitize
Base class template for CBM digitisation tasks.
Definition: CbmDigitize.h:39
CbmMuchPadRadial::GetPhi1
Double_t GetPhi1() const
Definition: CbmMuchPadRadial.h:35
CbmMuchLayerSide::GetModule
CbmMuchModule * GetModule(Int_t iModule) const
Definition: CbmMuchLayerSide.h:52
CbmMuchDigitizeGem::fNofNoiseSignals
Int_t fNofNoiseSignals
Definition: CbmMuchDigitizeGem.h:252
CbmDigitizeBase::fEventMode
Bool_t fEventMode
Definition: CbmDigitizeBase.h:159
CbmMuchPad::GetAddress
Int_t GetAddress() const
Definition: CbmMuchPad.h:27
min_logT_e
constexpr double min_logT_e
Definition: CbmMuchRecoDefs.h:29
CbmMuchDigitizeGem::Sigma_n_e
Double_t Sigma_n_e(Double_t Tkin, Double_t mass)
Definition: CbmMuchDigitizeGem.cxx:1092
CbmDigitizeBase::fCurrentEvent
Int_t fCurrentEvent
Number of current input.
Definition: CbmDigitizeBase.h:163
log
friend F32vec4 log(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:135
CbmMuchModuleGem
Definition: CbmMuchModuleGem.h:24
CbmMuchDigitizeGem::fPreviousEventTime
Double_t fPreviousEventTime
Definition: CbmMuchDigitizeGem.h:247
CbmMuchDigitizeGem::fTimeDigiFirst
Double_t fTimeDigiFirst
Time of first digi sent to DAQ.
Definition: CbmMuchDigitizeGem.h:231
CbmMuchDigitizeGem::fAlgorithm
Int_t fAlgorithm
Definition: CbmMuchDigitizeGem.h:178
CbmMuchDigitizeGem::GenerateNoisePerModule
Int_t GenerateNoisePerModule(CbmMuchModuleGem *, Double_t, Double_t)
Definition: CbmMuchDigitizeGem.cxx:595
CbmMuchDigitizeGem::fNofPoints
Int_t fNofPoints
Number of points processed in Exec.
Definition: CbmMuchDigitizeGem.h:234
CbmMuchSector::GetPadByChannelIndex
CbmMuchPad * GetPadByChannelIndex(Int_t iChannel) const
Definition: CbmMuchSector.cxx:22
CbmMuchSector.h
CbmMuchDigitizeGem::fGenerateElectronicsNoise
Bool_t fGenerateElectronicsNoise
Previous Event Time.
Definition: CbmMuchDigitizeGem.h:250
CbmMuchDigitizeGem::fGeoScheme
CbmMuchGeoScheme * fGeoScheme
Definition: CbmMuchDigitizeGem.h:179
CbmMuchDigitizeGem::fQMax
UInt_t fQMax
Definition: CbmMuchDigitizeGem.h:201
CbmMuchLayerSide
Definition: CbmMuchLayerSide.h:22
CbmMuchPoint::PositionOut
void PositionOut(TVector3 &pos) const
Definition: CbmMuchPoint.h:80
CbmMuchDigi::GetAddress
virtual Int_t GetAddress() const
Definition: CbmMuchDigi.h:77
CbmDigitizeBase::fCurrentInput
Int_t fCurrentInput
Flag for creation of links to MC.
Definition: CbmDigitizeBase.h:162
CbmMuchDigitizeGem::GasGain
Int_t GasGain()
Definition: CbmMuchDigitizeGem.cxx:1083
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmReadoutBuffer::ReadOutData
Int_t ReadOutData(Double_t time, std::vector< Data * > &dataList)
Definition: CbmReadoutBuffer.h:318
CbmDigitizeBase::fCurrentEventTime
Double_t fCurrentEventTime
Number of current MC entry.
Definition: CbmDigitizeBase.h:165
mpv_e
constexpr double mpv_e[]
Definition: CbmMuchRecoDefs.h:23
CbmMuchModuleGemRectangular::GetSector
CbmMuchSectorRectangular * GetSector(Double_t x, Double_t y)
Definition: CbmMuchModuleGemRectangular.cxx:75
CbmMuchDigitizeGem
Definition: CbmMuchDigitizeGem.h:56
CbmMuchDigitizeGem::fNofSignals
Int_t fNofSignals
Number of signals.
Definition: CbmMuchDigitizeGem.h:235
CbmMuchModule
Definition: CbmMuchModule.h:24
CbmMuchSectorRadial.h
CbmMuchAddress::GetLayerIndex
static Int_t GetLayerIndex(Int_t address)
Definition: CbmMuchAddress.h:106
CbmMuchAddress::GetStationIndex
static Int_t GetStationIndex(Int_t address)
Definition: CbmMuchAddress.h:103
CbmMuchDigitizeGem::fTotalDriftTime
Double_t fTotalDriftTime
Definition: CbmMuchDigitizeGem.h:221
CbmMuchDigitizeGem::fDriftVelocity
Double_t fDriftVelocity
Definition: CbmMuchDigitizeGem.h:212
CbmMuchDigitizeGem::fMPV
TF1 * fMPV[3]
Definition: CbmMuchDigitizeGem.h:224
CbmDigitize< CbmMuchDigi >::SendData
void SendData(CbmMuchDigi *digi, CbmMatch *match=nullptr)
Send a digi and the corresponding match object to the DAQ.
Definition: CbmDigitize.h:219
CbmMuchSignal::SetCharge
void SetCharge(UInt_t charge)
Definition: CbmMuchSignal.h:104
CbmMuchPad.h
CbmMuchDigi
Definition: CbmMuchDigi.h:31
CbmMuchModule::GetDetectorType
Int_t GetDetectorType() const
Definition: CbmMuchModule.h:52
CbmMuchDigitizeGem::BufferSignals
Bool_t BufferSignals(Int_t, Double_t, Double_t)
Definition: CbmMuchDigitizeGem.cxx:1276
CbmMuchPad
Definition: CbmMuchPad.h:21
CbmMuchDigitizeGem::fTimeDigiLast
Double_t fTimeDigiLast
Time of last digi sent to DAQ.
Definition: CbmMuchDigitizeGem.h:232
CbmMuchDigitizeGem::fSigma
TF1 * fSigma[3]
Definition: CbmMuchDigitizeGem.h:223
CbmMuchDigitizeGem.h
mpv_mu
constexpr double mpv_mu[]
Definition: CbmMuchRecoDefs.h:25
CbmMuchPadRectangular.h
CbmMCTrack.h
v
__m128 v
Definition: L1/vectors/P4_F32vec4.h:1
sigma_mu
constexpr double sigma_mu[]
Definition: CbmMuchRecoDefs.h:19
CbmMuchPadRadial.h
CbmMCTrack
Definition: CbmMCTrack.h:34
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
m
__m128 m
Definition: L1/vectors/P4_F32vec4.h:26
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmMuchPad::GetX
Double_t GetX() const
Definition: CbmMuchPad.h:28
CbmMuchDigitizeGem::fNofEvents
Int_t fNofEvents
Total number of events processed.
Definition: CbmMuchDigitizeGem.h:239
CbmMuchGeoScheme::GetStation
CbmMuchStation * GetStation(Int_t iStation) const
Definition: CbmMuchGeoScheme.cxx:209
CbmMuchStation::GetNLayers
Int_t GetNLayers() const
Definition: CbmMuchStation.h:50
CbmDigitize< CbmMuchDigi >::RegisterOutput
void RegisterOutput()
Register the output arrays.
Definition: CbmDigitize.h:175
CbmMuchDigitizeGem::fFlag
Int_t fFlag
Definition: CbmMuchDigitizeGem.h:190
CbmMuchGeoScheme::GetModuleByDetId
CbmMuchModule * GetModuleByDetId(Int_t detId) const
Definition: CbmMuchGeoScheme.cxx:278
CbmMuchDigitizeGem::~CbmMuchDigitizeGem
virtual ~CbmMuchDigitizeGem()
Definition: CbmMuchDigitizeGem.cxx:253
CbmMuchDigitizeGem::fMCTracks
TClonesArray * fMCTracks
Definition: CbmMuchDigitizeGem.h:182
CbmMuchStation.h
CbmMuchModuleGem::GetPad
CbmMuchPad * GetPad(Int_t address)
Definition: CbmMuchModuleGem.cxx:79
CbmMuchModuleGem::GetSectorByIndex
CbmMuchSector * GetSectorByIndex(Int_t iSector)
Definition: CbmMuchModuleGem.h:54
CbmMuchModuleGem::GetNSectors
Int_t GetNSectors() const
Definition: CbmMuchModuleGem.h:57
CbmMuchModuleGemRadial::GetPad
CbmMuchPadRadial * GetPad(Double_t x, Double_t y)
Definition: CbmMuchModuleGemRadial.cxx:72
CbmMuchDigitizeGem::fSpotRadius
Double_t fSpotRadius
Definition: CbmMuchDigitizeGem.h:205
CbmMuchDigitizeGem::ReadAndRegister
void ReadAndRegister(Long_t)
Definition: CbmMuchDigitizeGem.cxx:643
CbmMuchModuleGem.h
CbmMuchAddress::GetLayerSideIndex
static Int_t GetLayerSideIndex(Int_t address)
Definition: CbmMuchAddress.h:109
CbmMuchAddress::GetChannelIndex
static Int_t GetChannelIndex(Int_t address)
Definition: CbmMuchAddress.h:118
CbmMuchDigi::SetTime
void SetTime(ULong64_t time)
Definition: CbmMuchDigi.cxx:58
CbmMuchSignal::AddNoise
void AddNoise(UInt_t)
Definition: CbmMuchSignal.cxx:131
CbmMuchDigi::SetAdc
void SetAdc(Int_t adc)
Definition: CbmMuchDigi.cxx:34
CbmMuchAddress::GetSectorIndex
static Int_t GetSectorIndex(Int_t address)
Definition: CbmMuchAddress.h:115
CbmReadoutBuffer::GetNData
virtual Int_t GetNData()
Definition: CbmReadoutBuffer.h:266
CbmMuchLayerSide::GetNModules
Int_t GetNModules() const
Definition: CbmMuchLayerSide.h:47
CbmMuchSectorRadial::GetR2
Double_t GetR2() const
Definition: CbmMuchSectorRadial.h:32