Belle II Software  release-05-01-25
TimeDigitizer.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <top/modules/TOPDigitizer/TimeDigitizer.h>
12 #include <top/geometry/TOPGeometryPar.h>
13 #include <mdst/dataobjects/MCParticle.h>
14 #include <framework/logging/Logger.h>
15 #include <TRandom.h>
16 
17 using namespace std;
18 
19 namespace Belle2 {
24  namespace TOP {
25 
26  unsigned TimeDigitizer::s_storageDepth = 0;
27  unsigned TimeDigitizer::s_readoutWindows = 0;
28  int TimeDigitizer::s_offsetWindows = 0;
29  unsigned TimeDigitizer::s_window = 0;
30  bool TimeDigitizer::s_maskSamples = false;
31  DBObjPtr<TOPCalTimeWalk>* TimeDigitizer::s_timeWalk = 0;
32 
33  TimeDigitizer::TimeDigitizer(int moduleID, int pixelID, double timeOffset,
34  double calErrorsSq, int shift, double rmsNoise,
35  const TOPSampleTimes& sampleTimes):
36  m_moduleID(moduleID), m_pixelID(pixelID), m_timeOffset(timeOffset),
37  m_calErrorsSq(calErrorsSq), m_rmsNoise(rmsNoise), m_sampleTimes(&sampleTimes),
38  m_windowShift(shift)
39  {
40  const auto& channelMapper = TOPGeometryPar::Instance()->getChannelMapper();
41  m_channel = channelMapper.getChannel(pixelID);
42  if (!channelMapper.isChannelValid(m_channel)) {
43  B2ERROR("TimeDigitizer::TimeDigitizer: invalid channel");
44  return;
45  }
46 
47  unsigned bs = 0;
48  channelMapper.splitChannelNumber(m_channel, bs, m_carrier, m_asic, m_chan);
49 
50  const auto& frontEndMapper = TOPGeometryPar::Instance()->getFrontEndMapper();
51  const auto* map = frontEndMapper.getMap(m_moduleID, bs);
52  if (!map) {
53  B2ERROR("TimeDigitizer::TimeDigitizer: no valid frontend map found");
54  return;
55  }
56 
57  m_scrodID = map->getScrodID();
58  m_valid = true;
59 
60  }
61 
62  void TimeDigitizer::addTimeOfHit(double t, double pulseHeight, EType type,
63  const TOPSimHit* simHit)
64  {
65  Hit hit;
66  hit.pulseHeight = pulseHeight;
67  hit.type = type;
68  hit.simHit = simHit;
69  switch (type) {
70  case static_cast<int>(c_Hit):
72  break;
73  case static_cast<int>(c_ChargeShare):
75  break;
76  case static_cast<int>(c_CrossTalk):
77  hit.shape = 0;
78  B2ERROR("TOP::TimeDigitizer: waveform shape of cross-talk not yet available");
79  break;
80  case static_cast<int>(c_CalPulse):
82  break;
83  default:
84  hit.shape = 0;
85  }
86  m_times.insert(std::pair<double, const Hit>(t, hit));
87  }
88 
89  //-------- simplified pile-up and double-hit-resolution model ------- //
90  // this function will probably be removed in the future, therefore I don't
91  // care about some hard-coded values
92 
93  typedef std::multimap<double, const TimeDigitizer::Hit>::const_iterator Iterator;
94 
96  StoreArray<TOPDigit>& digits,
97  int threshold,
98  int thresholdCount,
99  double timeJitter) const
100  {
101 
102  if (m_times.empty()) return;
103 
104  // get parameters of the model
105  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
106  const auto& tdc = geo->getNominalTDC();
107  double hitResolveTime = tdc.getDoubleHitResolution();
108  double pileupTime = tdc.getPileupTime();
109 
110  // split time pattern into multiple hits (according to double-hit resolution)
111  std::vector<Iterator> ranges;
112  ranges.push_back(m_times.begin());
113  double prevTime = m_times.begin()->first;
114  for (Iterator it = m_times.begin(); it != m_times.end(); ++it) {
115  if (it->first - prevTime > hitResolveTime) ranges.push_back(it);
116  prevTime = it->first;
117  }
118  ranges.push_back(m_times.end());
119 
120  // loop over splitted regions
121  for (unsigned k = 0; k < ranges.size() - 1; k++) {
122 
123  // temporary containers
124  std::vector<double> times;
125  std::vector<double> weights;
126  std::vector<const TOPSimHit*> simHits;
127 
128  // take only hits within pileup time and discard others
129  prevTime = ranges[k]->first;
130  for (Iterator it = ranges[k]; it != ranges[k + 1]; ++it) {
131  if (it->first - prevTime > pileupTime) break;
132  times.push_back(it->first);
133  double pulseHeight = gRandom->Gaus(it->second.pulseHeight, m_rmsNoise);
134  weights.push_back(pulseHeight);
135  simHits.push_back(it->second.simHit);
136  prevTime = it->first;
137  }
138 
139  // determine pulse height
140  double height = 0;
141  for (const auto& weight : weights) height += weight;
142 
143  // set weights
144  for (auto& weight : weights) weight /= height;
145 
146  // generate pulse width
147  double width = gRandom->Gaus(2.3, 0.4);
148  if (width < 0.5) width = 0.5;
149 
150  // determine detection time
151  double time = 0;
152  for (unsigned j = 0; j < times.size(); j++) time += times[j] * weights[j];
153 
154  // add additional time jitter
155  if (timeJitter > 0) time += gRandom->Gaus(0., timeJitter);
156 
157  // emulate feature extraction data
158 
159  double mean = time + width / 2;
160  double sigma = width / 2.35482;
161 
162  int samplePeak = tdc.getSample(mean);
163  if (mean - tdc.getSampleTime(samplePeak) > tdc.getSampleWidth() / 2) samplePeak++;
164  short vPeak = height * gauss(tdc.getSampleTime(samplePeak), mean, sigma);
165  if (vPeak < threshold) continue;
166  if (vPeak > 3000) vPeak = 3000; // saturation - roughly (e.g. 4096 - pedestal)
167 
168  double halfWid = sigma * sqrt(-2 * log(0.5 * vPeak / height));
169  int sampleRise = tdc.getSample(mean - halfWid);
170  if (!tdc.isSampleValid(sampleRise)) continue;
171  short vRise0 = height * gauss(tdc.getSampleTime(sampleRise), mean, sigma);
172  short vRise1 = height * gauss(tdc.getSampleTime(sampleRise + 1), mean, sigma);
173 
174  int sampleFall = tdc.getSample(mean + halfWid);
175  if (!tdc.isSampleValid(sampleFall + 1)) continue;
176  short vFall0 = height * gauss(tdc.getSampleTime(sampleFall), mean, sigma);
177  short vFall1 = height * gauss(tdc.getSampleTime(sampleFall + 1), mean, sigma);
178 
179  if (threshold > 0) {
180  double halfDt = sigma * sqrt(-2 * log(threshold / height));
181  int overThr = tdc.getSample(mean + halfDt) - tdc.getSample(mean - halfDt);
182  if (overThr < thresholdCount) continue;
183  }
184 
185  // determine integral
186  int numSamples = (sampleFall - sampleRise) * 4; // according to topcaf
187  double sigmaIntegral = 0;
188  if (numSamples > 1) sigmaIntegral = m_rmsNoise * sqrt(numSamples - 1);
189  double integral = gRandom->Gaus(height * 7.0, sigmaIntegral);
190 
191  // append new raw digit
192  auto* rawDigit = rawDigits.appendNew(m_scrodID, TOPRawDigit::c_MC);
193  rawDigit->setCarrierNumber(m_carrier);
194  rawDigit->setASICNumber(m_asic);
195  rawDigit->setASICChannel(m_chan);
196  rawDigit->setASICWindow(s_window);
197  rawDigit->setSampleRise(sampleRise);
198  rawDigit->setDeltaSamplePeak(samplePeak - sampleRise);
199  rawDigit->setDeltaSampleFall(sampleFall - sampleRise);
200  rawDigit->setValueRise0(vRise0);
201  rawDigit->setValueRise1(vRise1);
202  rawDigit->setValueFall0(vFall0);
203  rawDigit->setValueFall1(vFall1);
204  rawDigit->setValuePeak(vPeak);
205  rawDigit->setIntegral(integral);
206 
207  double rawTime = rawDigit->getCFDLeadingTime();
208  double cfdTime = rawTime * tdc.getSampleWidth() - tdc.getOffset();
209  double cfdWidth = rawDigit->getFWHM() * tdc.getSampleWidth();
210  int sampleDivisions = 0x1 << tdc.getSubBits();
211  int tfine = int(rawTime * sampleDivisions) % sampleDivisions;
212  if (tfine < 0) tfine += sampleDivisions;
213  rawDigit->setTFine(tfine);
214 
215  // append new digit
216 
217  auto* digit = digits.appendNew(m_moduleID, m_pixelID, rawTime);
218  digit->setTime(cfdTime);
219  digit->setTimeError(timeJitter);
220  digit->setPulseHeight(rawDigit->getValuePeak());
221  digit->setIntegral(rawDigit->getIntegral());
222  digit->setPulseWidth(cfdWidth);
223  digit->setChannel(m_channel);
224  digit->setFirstWindow(rawDigit->getASICWindow());
225  digit->setStatus(TOPDigit::c_OffsetSubtracted);
226  digit->addRelationTo(rawDigit);
227 
228  // set relations to simulated hits and MC particles
229 
230  for (unsigned j = 0; j < simHits.size(); j++) {
231  const auto* simHit = simHits[j];
232  const double& weight = weights[j];
233  if (simHit) {
234  digit->addRelationTo(simHit, weight);
235  RelationVector<MCParticle> particles = simHit->getRelationsFrom<MCParticle>();
236  for (unsigned i = 0; i < particles.size(); ++i) {
237  digit->addRelationTo(particles[i], particles.weight(i) * weight);
238  }
239  }
240  }
241 
242  } // end loop over splitted regions
243  }
244 
245 
246  // -------- full waveform digitization ------- //
247 
249  StoreArray<TOPRawDigit>& rawDigits,
250  StoreArray<TOPDigit>& digits,
251  int threshold,
252  int hysteresis,
253  int thresholdCount) const
254  {
255 
256  // get parameters of the model
257 
258  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
259  const auto& tdc = geo->getNominalTDC();
260 
261  // generate waveform
262 
263  std::vector<unsigned short> windowNumbers;
264  int offsetWindows = s_offsetWindows + m_windowShift;
265  int winnum = s_window + offsetWindows;
266  if (winnum < 0) winnum += s_storageDepth;
267  windowNumbers.push_back(winnum);
268  for (unsigned i = 1; i < s_readoutWindows; i++) {
269  windowNumbers.push_back((windowNumbers.back() + 1) % s_storageDepth);
270  }
271  std::vector<double> baselines(windowNumbers.size(), 0);
272  std::vector<double> rmsNoises(windowNumbers.size(), m_rmsNoise);
273  double averagePedestal = tdc.getAveragePedestal();
274  std::vector<double> pedestals(windowNumbers.size(), averagePedestal);
275  int adcRange = tdc.getADCRange();
276 
277  int startSample = -offsetWindows * TOPRawWaveform::c_WindowSize;
278  auto wfData = generateWaveform(startSample, baselines, rmsNoises, pedestals,
279  adcRange);
280 
281  // store waveform
282 
283  auto* waveform = waveforms.appendNew(m_moduleID, m_pixelID, m_channel, m_scrodID,
284  windowNumbers[0], 0, wfData);
285  waveform->setStorageWindows(windowNumbers);
286  waveform->setPedestalSubtractedFlag(true);
287 
288  // do feature extraction
289 
290  waveform->featureExtraction(threshold, hysteresis, thresholdCount);
291 
292  // digits
293 
294  for (const auto& feature : waveform->getFeatureExtractionData()) {
295  int sampleRise = feature.sampleRise;
296  if (sampleRise < 0) continue;
297  unsigned iwin = sampleRise / TOPRawWaveform::c_WindowSize;
298  if (iwin >= windowNumbers.size()) continue;
299  sampleRise -= iwin * TOPRawWaveform::c_WindowSize; // should fit raw data bits
300  if (s_maskSamples and (sampleRise % 64) > 55) continue;
301 
302  unsigned DsamplePeak = feature.samplePeak - feature.sampleRise;
303  if ((DsamplePeak & 0x0F) != DsamplePeak) continue; // does not fit raw data bits
304 
305  unsigned DsampleFall = feature.sampleFall - feature.sampleRise;
306  if ((DsampleFall & 0x0F) != DsampleFall) continue; // does not fit raw data bits
307 
308  std::vector<unsigned short> winNumbers;
309  for (unsigned i = iwin; i < windowNumbers.size(); i++) {
310  winNumbers.push_back(windowNumbers[i]);
311  }
312 
313  // append new raw digit and set it
314  auto* rawDigit = rawDigits.appendNew(m_scrodID, TOPRawDigit::c_ProductionDebug);
315  rawDigit->setCarrierNumber(m_carrier);
316  rawDigit->setASICNumber(m_asic);
317  rawDigit->setASICChannel(m_chan);
318  rawDigit->setASICWindow(windowNumbers[iwin]);
319  rawDigit->setStorageWindows(winNumbers);
320  rawDigit->setSampleRise(sampleRise);
321  rawDigit->setDeltaSamplePeak(DsamplePeak);
322  rawDigit->setDeltaSampleFall(DsampleFall);
323  rawDigit->setValueRise0(feature.vRise0);
324  rawDigit->setValueRise1(feature.vRise1);
325  rawDigit->setValueFall0(feature.vFall0);
326  rawDigit->setValueFall1(feature.vFall1);
327  rawDigit->setValuePeak(feature.vPeak);
328  rawDigit->setIntegral(feature.integral);
329  double rawTimeLeading = rawDigit->getCFDLeadingTime(); // time in [samples]
330  int sampleDivisions = 0x1 << tdc.getSubBits();
331  int tfine = int(rawTimeLeading * sampleDivisions) % sampleDivisions;
332  if (tfine < 0) tfine += sampleDivisions;
333  rawDigit->setTFine(tfine);
334  rawDigit->addRelationTo(waveform);
335 
336  double rawTimeFalling = rawDigit->getCFDFallingTime(); // time in [samples]
337  double rawTimeErr = rawDigit->getCFDLeadingTimeError(m_rmsNoise); // in [samples]
338 
339  // convert to [ns] using time base calibration
340  int nwin = iwin + offsetWindows;
341  rawTimeLeading += nwin * TOPRawDigit::c_WindowSize;
342  rawTimeFalling += nwin * TOPRawDigit::c_WindowSize;
343 
344  double cfdTime = m_sampleTimes->getTime(s_window, rawTimeLeading) - m_timeOffset;
345  double width = m_sampleTimes->getDeltaTime(s_window,
346  rawTimeFalling,
347  rawTimeLeading);
348  int sample = static_cast<int>(rawTimeLeading);
349  if (rawTimeLeading < 0) sample--;
350  double timeError = rawTimeErr * m_sampleTimes->getTimeBin(s_window, sample);
351  double timeErrorSq = timeError * timeError + m_calErrorsSq;
352  int pulseHeight = rawDigit->getValuePeak();
353 
354  if (s_timeWalk) {
355  cfdTime -= (*s_timeWalk)->getTimeWalk(pulseHeight);
356  timeErrorSq += (*s_timeWalk)->getSigmaSq(pulseHeight);
357  }
358 
359  // append new digit and set it
360  auto* digit = digits.appendNew(m_moduleID, m_pixelID, rawTimeLeading);
361  digit->setTime(cfdTime);
362  digit->setTimeError(sqrt(timeErrorSq));
363  digit->setPulseHeight(pulseHeight);
364  digit->setIntegral(rawDigit->getIntegral());
365  digit->setPulseWidth(width);
366  digit->setChannel(m_channel);
367  digit->setFirstWindow(s_window);
368  if (m_sampleTimes->isCalibrated()) {
369  digit->addStatus(TOPDigit::c_TimeBaseCalibrated);
370  }
371  digit->addRelationTo(rawDigit);
372 
373  // check validity of feature extraction
374 
375  if (!rawDigit->isFEValid() or rawDigit->isPedestalJump()) {
376  digit->setHitQuality(TOPDigit::c_Junk);
377  }
378 
379  // set relations to simulated hits and MC particles, largest weight first
380 
381  std::multimap<double, const Hit*, std::greater<double>> weights;
382  for (const auto& hit : m_times) {
383  double hitTime = hit.first;
384  double weight = 0;
385  const auto* pulseShape = hit.second.shape;
386  if (pulseShape) {
387  weight = fabs(pulseShape->getValue(cfdTime - hitTime));
388  }
389  if (weight > 0.01) {
390  weight *= hit.second.pulseHeight;
391  weights.insert(std::pair<double, const Hit*>(weight, &hit.second));
392  }
393  }
394  double sum = 0;
395  for (const auto& w : weights) sum += w.first;
396  if (sum == 0) continue; // noisy hit
397  for (const auto& w : weights) {
398  auto weight = w.first / sum;
399  const auto* simHit = w.second->simHit;
400  if (simHit and weight > 0) {
401  digit->addRelationTo(simHit, weight);
402  RelationVector<MCParticle> particles = simHit->getRelationsFrom<MCParticle>();
403  for (unsigned i = 0; i < particles.size(); ++i) {
404  digit->addRelationTo(particles[i], particles.weight(i) * weight);
405  }
406  } else if (w.second->type == c_CalPulse and weight > 0.90) {
407  digit->setHitQuality(TOPDigit::c_CalPulse);
408  }
409  }
410  }
411 
412  }
413 
414 
415  vector<short> TimeDigitizer::generateWaveform(int startSample,
416  const vector<double>& baselines,
417  const vector<double>& rmsNoises,
418  const vector<double>& pedestals,
419  int adcRange) const
420  {
421 
422  if (baselines.empty() or baselines.size() != rmsNoises.size() or
423  baselines.size() != pedestals.size())
424  B2FATAL("TOP::TimeDigitizer: inconsistent vector sizes");
425 
426  // model parameters
427 
428  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
429  const auto& tdc = geo->getNominalTDC();
430  const auto& signalShape = geo->getSignalShape();
431 
432  double dt = tdc.getSampleWidth();
433  double fmax = 1 / (2 * dt); // Nyquist frequency
434  double tau1 = 1 / (2 * M_PI * signalShape.getPole1());
435  double tau2 = 1 / (2 * M_PI * signalShape.getPole2());
436  double bw1 = 1 / (4 * tau1); // bandwidth of first order filter
437  double bw2 = 1 / (4 * (tau1 + tau2)); // bandwidth of second order filter
438 
439  // construct waveform vector containing white noise
440 
441  vector<double> waveform;
442  for (auto rms : rmsNoises) {
443  double rms0 = rms * sqrt(fmax / bw2);
444  for (unsigned i = 0; i < TOPRawWaveform::c_WindowSize; i++) {
445  waveform.push_back(gRandom->Gaus(0, rms0));
446  }
447  }
448 
449  // noise smoothing according to second order low pass filter
450 
451  double a1 = exp(-dt / tau1);
452  double v0 = gRandom->Gaus(0, rmsNoises[0] * sqrt(bw1 / bw2));
453  double prevValue = v0;
454  for (auto& value : waveform) { // first order filter (pole1)
455  value = a1 * prevValue + (1 - a1) * value;
456  prevValue = value;
457  }
458  double a2 = exp(-dt / tau2);
459  prevValue = v0;
460  for (auto& value : waveform) { // first order filter again (pole2)
461  value = a2 * prevValue + (1 - a2) * value;
462  prevValue = value;
463  }
464 
465  // add possible baseline shifts
466 
467  int k = 0;
468  for (auto baseline : baselines) {
469  for (unsigned i = 0; i < TOPRawWaveform::c_WindowSize; i++) {
470  waveform[k] += baseline;
471  k++;
472  }
473  }
474 
475  // add signal
476 
477  for (const auto& hit : m_times) {
478  double hitTime = hit.first;
479  double pulseHeight = hit.second.pulseHeight;
480  const auto* pulseShape = hit.second.shape;
481  if (not pulseShape) continue;
482  double timeWalk = 0;
483  if (s_timeWalk) {
484  double t = (*s_timeWalk)->getTimeWalk(pulseHeight);
485  double sig = (*s_timeWalk)->getSigma(pulseHeight);
486  timeWalk = gRandom->Gaus(t, sig);
487  }
488  int size = waveform.size();
489  for (int sample = 0; sample < size; sample++) {
490  double t = m_sampleTimes->getTime(s_window, sample - startSample) - m_timeOffset;
491  waveform[sample] += pulseHeight * pulseShape->getValue(t - timeWalk - hitTime);
492  }
493  }
494 
495  // model saturation effects and convert to short
496  // (exact modelling would require pedestals for each sample)
497 
498  vector<short> wf;
499  k = 0;
500  for (auto pedestal : pedestals) {
501  for (unsigned i = 0; i < TOPRawWaveform::c_WindowSize; i++) {
502  int adc = waveform[k] + pedestal;
503  if (adc < 0) adc = 0;
504  if (adc > adcRange) adc = adcRange;
505  adc -= pedestal;
506  wf.push_back(adc);
507  k++;
508  }
509  }
510 
511  return wf;
512  }
513 
514 
515 
516  } // TOP namespace
518 } // Belle2 namespace
Belle2::TOPRawDigit::c_ProductionDebug
@ c_ProductionDebug
from production debugging format
Definition: TOPRawDigit.h:56
Belle2::StoreArray::appendNew
T * appendNew()
Construct a new T object at the end of the array.
Definition: StoreArray.h:256
Belle2::TOP::TimeDigitizer::s_maskSamples
static bool s_maskSamples
mask samples at window boundary (phase-2)
Definition: TimeDigitizer.h:278
Belle2::TOP::TimeDigitizer::s_storageDepth
static unsigned s_storageDepth
ASIC analog storage depth.
Definition: TimeDigitizer.h:274
Belle2::TOP::TimeDigitizer::s_readoutWindows
static unsigned s_readoutWindows
number of readout windows
Definition: TimeDigitizer.h:275
Belle2::TOPSimHit
Class to store simulated hits of Cherenkov photons on PMT's input for digitization module (TOPDigitiz...
Definition: TOPSimHit.h:37
Belle2::TOP::TimeDigitizer::m_calErrorsSq
double m_calErrorsSq
calibration uncertainties squared
Definition: TimeDigitizer.h:284
Belle2::TOPRawDigit::c_WindowSize
@ c_WindowSize
number of samples per window
Definition: TOPRawDigit.h:64
Belle2::TOPSampleTimes::getTime
double getTime(int window, double sample) const
Returns time w.r.t SSTin that corresponds to the window number.
Definition: TOPSampleTimes.h:152
Belle2::TOPGeometry::getCalPulseShape
const TOPSignalShape & getCalPulseShape() const
Returns calibration pulse shape.
Definition: TOPGeometry.h:240
Belle2::RelationsInterface::addRelationTo
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
Definition: RelationsObject.h:144
Belle2::TOPGeometry::getSignalShape
const TOPSignalShape & getSignalShape() const
Returns single photon signal shape.
Definition: TOPGeometry.h:234
Belle2::TOPRawWaveform::c_WindowSize
@ c_WindowSize
number of samples per ASIC window
Definition: TOPRawWaveform.h:40
Belle2::TOP::TimeDigitizer::digitize
void digitize(StoreArray< TOPRawDigit > &rawDigits, StoreArray< TOPDigit > &digits, int threshold=0, int thresholdCount=0, double timeJitter=0) const
Do time digitization using simplified pile-up and double-hit-resolution model.
Definition: TimeDigitizer.cc:95
Belle2::TOP::TimeDigitizer::m_times
std::multimap< double, const Hit > m_times
hits sorted by time
Definition: TimeDigitizer.h:296
Belle2::TOP::TimeDigitizer::s_window
static unsigned s_window
first window number
Definition: TimeDigitizer.h:277
Belle2::Iterator
map< unsigned, const TOPSampleTimes * >::const_iterator Iterator
Iteratior for m_map.
Definition: TOPCalTimebase.cc:25
Belle2::TOPGeometry::getNominalTDC
const TOPNominalTDC & getNominalTDC() const
Returns nominal time-to-digit conversion parameters.
Definition: TOPGeometry.h:228
Belle2::TOPRawDigit::c_MC
@ c_MC
from MC digitization
Definition: TOPRawDigit.h:53
Belle2::TOP::FrontEndMapper::getMap
const TOPFrontEndMap * getMap(int moduleID, int bs) const
Return map from TOP module side.
Definition: FrontEndMapper.h:84
Belle2::TOP::TimeDigitizer::s_timeWalk
static DBObjPtr< TOPCalTimeWalk > * s_timeWalk
pointer to DB object
Definition: TimeDigitizer.h:279
Belle2::TOP::TimeDigitizer::m_channel
unsigned m_channel
hardware channel number (0-based)
Definition: TimeDigitizer.h:289
Belle2::TOP::TOPGeometryPar::Instance
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
Definition: TOPGeometryPar.cc:45
Belle2::TOP::TimeDigitizer::m_carrier
unsigned m_carrier
carrier board number
Definition: TimeDigitizer.h:291
Belle2::RelationVector
Class for type safe access to objects that are referred to in relations.
Definition: DataStore.h:38
Belle2::TOPSampleTimes
Calibration constants of a singe ASIC channel: time axis (sample times)
Definition: TOPSampleTimes.h:34
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPNominalTDC::getDoubleHitResolution
double getDoubleHitResolution() const
Returns double hit resolution time.
Definition: TOPNominalTDC.h:177
Belle2::TOP::TimeDigitizer::Hit
hit data other than time
Definition: TimeDigitizer.h:60
Belle2::TOP::TimeDigitizer::m_sampleTimes
const TOPSampleTimes * m_sampleTimes
sample times
Definition: TimeDigitizer.h:286
Belle2::TOPSampleTimes::isCalibrated
bool isCalibrated() const
Returns calibration status.
Definition: TOPSampleTimes.h:197
Belle2::TOP::TimeDigitizer::gauss
double gauss(double x, double mean, double sigma) const
Gauss function (pulse shape approximation)
Definition: TimeDigitizer.h:251
Belle2::TOP::TimeDigitizer::addTimeOfHit
void addTimeOfHit(double t, double pulseHeight, EType type, const TOPSimHit *simHit=0)
Add time of simulated hit.
Definition: TimeDigitizer.cc:62
Belle2::TOP::TimeDigitizer::m_rmsNoise
double m_rmsNoise
r.m.s of noise [ADC counts]
Definition: TimeDigitizer.h:285
Belle2::TOP::TimeDigitizer::m_pixelID
int m_pixelID
pixel (e.g.
Definition: TimeDigitizer.h:282
Belle2::TOP::TimeDigitizer::m_timeOffset
double m_timeOffset
time offset [ns]
Definition: TimeDigitizer.h:283
Belle2::TOPSampleTimes::getDeltaTime
double getDeltaTime(int window, double sample2, double sample1) const
Returns time difference between sample2 and sample1.
Definition: TOPSampleTimes.h:167
Belle2::TOP::TimeDigitizer::m_valid
bool m_valid
true, if module/pixel is mapped to hardware
Definition: TimeDigitizer.h:294
Belle2::TOP::TimeDigitizer::m_scrodID
unsigned m_scrodID
SCROD ID.
Definition: TimeDigitizer.h:290
Belle2::TOP::TimeDigitizer::m_windowShift
int m_windowShift
additional wf window shift due to asic mis-alignment
Definition: TimeDigitizer.h:287
Belle2::TOP::TimeDigitizer::m_asic
unsigned m_asic
ASIC number.
Definition: TimeDigitizer.h:292
Belle2::TOP::TimeDigitizer::m_moduleID
int m_moduleID
module ID (1-based)
Definition: TimeDigitizer.h:281
Belle2::TOP::TOPGeometryPar::getGeometry
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using Basf2 units.
Definition: TOPGeometryPar.cc:167
Belle2::MCParticle
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:43
Belle2::TOP::TimeDigitizer::m_chan
unsigned m_chan
ASIC channel number.
Definition: TimeDigitizer.h:293
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TOP::TimeDigitizer::generateWaveform
std::vector< short > generateWaveform(int startSample, const std::vector< double > &baselines, const std::vector< double > &rmsNoises, const std::vector< double > &pedestals, int ADCRange) const
Generate waveform.
Definition: TimeDigitizer.cc:415
Belle2::TOP::TimeDigitizer::s_offsetWindows
static int s_offsetWindows
number of windows before first wf window
Definition: TimeDigitizer.h:276
Belle2::TOPSampleTimes::getTimeBin
double getTimeBin(int window, int sampleNumber) const
Returns time bin of a given sample number and window (e.g.
Definition: TOPSampleTimes.cc:106
Belle2::TOP::TOPGeometryPar::getChannelMapper
const ChannelMapper & getChannelMapper() const
Returns default channel mapper (mapping of channels to pixels)
Definition: TOPGeometryPar.h:95
Belle2::TOP::TimeDigitizer::EType
EType
hit type enumerators
Definition: TimeDigitizer.h:50
Belle2::TOP::TOPGeometryPar::getFrontEndMapper
const FrontEndMapper & getFrontEndMapper() const
Returns front-end mapper (mapping of SCROD's to positions within TOP modules)
Definition: TOPGeometryPar.h:89