Belle II Software  release-05-01-25
TOPDigitVariables.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributor: Jan Strube (jan.strube@desy.de) *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <top/variables/TOPDigitVariables.h>
11 
12 // // framework
13 #include <framework/gearbox/Const.h>
14 #include <framework/datastore/StoreObjPtr.h>
15 #include <framework/datastore/StoreArray.h>
16 
17 // // dataobjects
18 #include <tracking/dataobjects/ExtHit.h>
19 #include <mdst/dataobjects/Track.h>
20 #include <analysis/dataobjects/Particle.h>
21 #include <top/dataobjects/TOPDigit.h>
22 #include <top/geometry/TOPGeometryPar.h>
23 #include <top/dataobjects/TOPLikelihood.h>
24 #include <top/dataobjects/TOPRecBunch.h>
25 
26 #include <top/dataobjects/TOPBarHit.h>
27 #include <mdst/dataobjects/MCParticle.h>
28 
29 #include <algorithm> // for sort
30 using namespace std;
31 
32 namespace Belle2 {
37  // contains a couple of helper functions that are related to TOP variables
38  namespace Variable {
39  namespace TOPVariable {
40  // returns the TOP likelihood that is associated with a given particle
41  const TOPLikelihood* getTOPLikelihood(const Particle* particle)
42  {
43  if (not particle) return nullptr;
44  const auto* track = particle->getTrack();
45  return track ? track->getRelated<TOPLikelihood>() : nullptr;
46  }
47 
48  // returns the ExtHit that is associated with a given particle
49  const ExtHit* getExtHit(const Particle* particle)
50  {
51  const auto* topLikelihood = getTOPLikelihood(particle);
52  return topLikelihood ? topLikelihood->getRelated<ExtHit>() : nullptr;
53  }
54 
55  // returns the TOP slot ID of the particle
56  double getSlotID(const Particle* particle)
57  {
58  const auto* extHit = getExtHit(particle);
59  // zero is invalid slot ID, e.g. particle didn't hit the TOP
60  return extHit ? extHit->getCopyID() : 0;
61  }
62 
63  // returns the local coordinate of the particle's entry point to the TOP
64  TVector3 getLocalPosition(const Particle* particle)
65  {
66  const auto* extHit = getExtHit(particle);
67  if (not extHit) return TVector3(0, 0, 0);
68  int slotID = extHit->getCopyID();
69  const auto& position = extHit->getPosition(); // TVector3
70  const auto* geo = TOP::TOPGeometryPar::Instance()->getGeometry();
71  if (not geo or not geo->isModuleIDValid(slotID)) return TVector3(0, 0, 0);
72  const auto& module = geo->getModule(slotID);
73  return module.pointToLocal(position); // TVector3
74  }
75 
76  // returns the local coordinate of the MC particle's entry point to the TOP
77  TVector3 getLocalPositionMCMatch(const Particle* particle)
78  {
79  const MCParticle* mcparticle = particle->getRelatedTo<MCParticle>();
80  if (mcparticle == nullptr) {
81  return TVector3(0, 0, 0);
82  }
83  const auto* barHit = mcparticle->getRelated<TOPBarHit>();
84  if (!barHit) {
85  return TVector3(0, 0, 0);
86  }
87  int slotID = barHit->getModuleID();
88  const auto& position = barHit->getPosition(); // TVector3
89  const auto* geo = TOP::TOPGeometryPar::Instance()->getGeometry();
90  if (not geo or not geo->isModuleIDValid(slotID)) return TVector3(0, 0, 0);
91  const auto& module = geo->getModule(slotID);
92  return module.pointToLocal(position); // TVector3
93  }
94 
95  // returns the local coordinates of the particles momentum in the TOP
96  TVector3 getLocalMomentum(const Particle* particle)
97  {
98  const auto* extHit = getExtHit(particle);
99  if (not extHit) return TVector3(0, 0, 0);
100  int slotID = extHit->getCopyID();
101  const auto& momentum = extHit->getMomentum(); // TVector3
102  const auto* geo = TOP::TOPGeometryPar::Instance()->getGeometry();
103  if ((not geo) or (not geo->isModuleIDValid(slotID))) return TVector3(0, 0, 0);
104  const auto& module = geo->getModule(slotID);
105  return module.momentumToLocal(momentum); // TVector3
106  }
107 
108  // helper function to compute the TOF for an arbitrary hypothesis
109  double computeTOF(const Particle* particle, int pdg)
110  {
111  const auto* extHit = getExtHit(particle);
112  if (not extHit) return 0;
113  auto extPDGCode = abs(extHit->getPdgCode());
114  double pmom = particle->getMomentumMagnitude();
115  double massExtHit = Const::ChargedStable(extPDGCode).getMass();
116  double betaExtHit = pmom / sqrt(pmom * pmom + massExtHit * massExtHit);
117  double mass = pdg == 0 ? particle->getMass() : Const::ChargedStable(abs(pdg)).getMass();
118  double beta = pmom / sqrt(pmom * pmom + mass * mass);
119  return extHit->getTOF() * betaExtHit / beta;
120  }
121 
122  // returns the time of flight from the origin to the TOP
123  double getTOF(const Particle* particle)
124  {
125  return computeTOF(particle, 0);
126  }
127 
128  // returns the time of flight from the origin to the TOP under a given hypothesis
129  double getTOFExpert(const Particle* particle, const vector<double>& vars)
130  {
131  if (vars.size() != 1) {
132  B2FATAL("Need exactly one parameter (pdg id).");
133  }
134  int pdg = static_cast<int>(vars[0]);
135  return computeTOF(particle, pdg);
136  }
137 
138  // returns the average time of the first 5 (good) digits
139  double getAverageTimeOfFirst5(const Particle* particle)
140  {
141  int slotID = static_cast<int>(getSlotID(particle));
142  StoreArray<TOPDigit> digits;
143  vector<double> digitTimes;
144  for (const auto& digit : digits) {
145  if (digit.getModuleID() != slotID) continue;
146  // skip bad digits only when we want to clean
147  if (digit.getHitQuality() != TOPDigit::c_Good) continue;
148  digitTimes.push_back(digit.getTime());
149  }
150  if (digitTimes.empty()) return 0;
151  sort(digitTimes.begin(), digitTimes.end());
152  double T0 = 0;
153  size_t count = 0;
154  for (auto t : digitTimes) {
155  T0 += t;
156  count += 1;
157  if (count == 5) break;
158  }
159  return T0 / count;
160  }
161 
162  // counts the number of photons in the TOP in a given time frame
163  // if tmin < 0, count from the time of the first photon
164  int countHits(const Particle* particle, double tmin, double tmax, bool clean)
165  {
166  int slotID = static_cast<int>(getSlotID(particle));
167  StoreArray<TOPDigit> digits;
168  vector<double> digitTimes;
169  for (const auto& digit : digits) {
170  if (digit.getModuleID() != slotID) continue;
171  // skip bad digits only when we want to clean
172  if (clean && digit.getHitQuality() != TOPDigit::c_Good) continue;
173  digitTimes.push_back(digit.getTime());
174  }
175  if (digitTimes.empty()) return 0;
176  sort(digitTimes.begin(), digitTimes.end());
177  int count = 0;
178  if (tmin < 0) tmin = digitTimes[0];
179  for (auto t : digitTimes) {
180  if (t > tmax) break;
181  if (t >= tmin) ++count;
182  }
183  return count;
184  }
185 
186  // counts the number of photons regardless of hit quality
187  int countRawHits(const Particle* particle, double tmin, double tmax)
188  {
189  return countHits(particle, tmin, tmax, false);
190  }
191 
192  // returns the expected number of photons for a given hypothesis
193  double getExpectedPhotonCount(const Particle* particle, int pdg)
194  {
195  const auto* topLikelihood = getTOPLikelihood(particle);
196  if (not topLikelihood) return 0;
197  // if the user does select a hypothesis, use the particle's pdg code
198  pdg = pdg != 0 ? pdg : particle->getPDGCode();
199  const auto& chargedStable = Const::chargedStableSet.find(abs(pdg));
200  if (chargedStable == Const::invalidParticle) return 0; // PDG code not one of e, mu, pi, K, p, d
201  return topLikelihood->getEstPhot(chargedStable);
202  }
204  double topDigitCount(const Particle* particle)
205  {
206  auto trk = particle->getTrack();
207  if (not trk) {
208  return -1.0;
209  }
210  auto extHits = trk->getRelationsWith<ExtHit>();
211  int thisModuleID = static_cast<int>(getSlotID(particle));
212  if (thisModuleID == 0) return 0;
213  StoreArray<TOPDigit> topDigits;
214  int count = 0;
215  for (const auto& t : topDigits) {
216  if (t.getModuleID() != thisModuleID) continue; // catch the case where one of the module IDs is negative
217  if (t.getHitQuality() != TOPDigit::c_Good) continue;
218  count += 1;
219  }
220  return count;
221  }
222 
224  double topBackgroundDigitCount(const Particle* particle)
225  {
226  auto trk = particle->getTrack();
227  if (not trk) {
228  return -1.0;
229  }
230  auto extHits = trk->getRelationsWith<ExtHit>();
231  int thisModuleID = static_cast<int>(getSlotID(particle));
232  if (thisModuleID == 0) return 0;
233  StoreArray<TOPDigit> topDigits;
234  int count = 0;
235  for (const auto& t : topDigits) {
236  if (abs(t.getModuleID()) == abs(thisModuleID)) continue; // catch the case where one of the module IDs is negative
237  if (t.getHitQuality() != TOPDigit::c_Good) continue;
238  count += 1;
239  }
240  return count;
241  }
242 
244  double topBackgroundDigitCountRaw(const Particle* particle)
245  {
246  auto trk = particle->getTrack();
247  if (not trk) {
248  return -1.0;
249  }
250  auto extHits = trk->getRelationsWith<ExtHit>();
251  int thisModuleID = static_cast<int>(getSlotID(particle));
252  if (thisModuleID == 0) return 0;
253  StoreArray<TOPDigit> topDigits;
254  int count = 0;
255  for (const auto& t : topDigits) {
256  if (abs(t.getModuleID()) == abs(thisModuleID)) continue; // catch the case where one of the module IDs is negative
257  count += 1;
258  }
259  return count;
260  }
261 
263  double topRawDigitCount(const Particle* particle)
264  {
265  auto trk = particle->getTrack();
266  if (not trk) {
267  return -1.0;
268  }
269  auto extHits = trk->getRelationsWith<ExtHit>();
270  int thisModuleID = static_cast<int>(getSlotID(particle));
271  if (thisModuleID == 0) return 0;
272  StoreArray<TOPDigit> topDigits;
273  int count = 0;
274  for (const auto& t : topDigits) {
275  if (abs(t.getModuleID()) != abs(thisModuleID)) continue; // catch the case where one of the module IDs is negative
276  count += 1;
277  }
278  return count;
279  }
280 
282  double topDigitGapSize(const Particle* particle)
283  {
284  auto trk = particle->getTrack();
285  if (not trk) {
286  return -1.0;
287  }
288  auto extHits = trk->getRelationsWith<ExtHit>();
289  int thisModuleID = static_cast<int>(getSlotID(particle));
290  if (thisModuleID == 0) return 0;
291  StoreArray<TOPDigit> topDigits;
292  double maxGap = 0; // the largest time difference between two consecutive hits
293  vector<double> digitTimes; // all digits in the module that the track entered
294  for (const auto& t : topDigits) {
295  if (abs(t.getModuleID()) != abs(thisModuleID)) continue;
296  if (t.getHitQuality() != TOPDigit::c_Good) continue;
297  digitTimes.push_back(t.getTime());
298  }
299  if (digitTimes.empty()) {
300  return -1.0;
301  }
302  sort(digitTimes.begin(), digitTimes.end());
303  for (size_t i = 0; i < digitTimes.size() - 1; ++i) {
304  double gap = digitTimes[i + 1] - digitTimes[i];
305  if (gap > maxGap) {
306  maxGap = gap;
307  }
308  }
309  return maxGap;
310  }
311 
312  // The number of reflected digits is defined as the number of digits after the gap
313  // This method is a helper function to count the top digits after the largest gap
314  // between subsequent hits, under the constraints gap > minGap and gap < maxGap
315  double topCountPhotonsAfterLargesGapWithin(const Particle* particle, double minGap, double maxGap)
316  {
317  auto trk = particle->getTrack();
318  if (not trk) {
319  return -1.0;
320  }
321  auto extHits = trk->getRelationsWith<ExtHit>();
322  int thisModuleID = static_cast<int>(getSlotID(particle));
323  if (thisModuleID == 0) return 0;
324  StoreArray<TOPDigit> topDigits;
325  vector<double> digitTimes; // the times for all digits in the module that the track entered
326  for (const auto& t : topDigits) {
327  if (abs(t.getModuleID()) != abs(thisModuleID)) continue;
328  if (t.getHitQuality() != TOPDigit::c_Good) continue;
329  digitTimes.push_back(t.getTime());
330  }
331  if (digitTimes.empty()) {
332  return -1.0;
333  }
334 
335  double currentMaxGap = -1; // the largest time difference between two consecutive hits
336  size_t maxGapIndex = 0; // the index of the first hit *after* the gap
337  sort(digitTimes.begin(), digitTimes.end());
338  for (size_t i = 0; i < digitTimes.size() - 1; ++i) {
339  double gap = digitTimes[i + 1] - digitTimes[i];
340  if ((gap > minGap) and (gap < maxGap) and (gap > currentMaxGap)) {
341  currentMaxGap = gap;
342  maxGapIndex = i + 1;
343  }
344  }
345  return digitTimes.size() - maxGapIndex;
346  }
347 
349  double extrapTrackToTOPz(const Particle* particle)
350  {
351  auto trk = particle->getTrack();
352  if (not trk) {
353  return std::numeric_limits<double>::quiet_NaN();
354  }
355  auto trkfit = trk->getTrackFitResultWithClosestMass(Belle2::Const::ChargedStable(std::abs(particle->getPDGCode())));
356  auto top = trkfit->getHelix();
357  double arcLength = top.getArcLength2DAtCylindricalR(120);
358  const auto& result = top.getPositionAtArcLength2D(arcLength);
359  return result.z();
360  }
361 
363  double extrapTrackToTOPtheta(const Particle* particle)
364  {
365  auto trk = particle->getTrack();
366  if (not trk) {
367  return std::numeric_limits<double>::quiet_NaN();
368  }
369  auto trkfit = trk->getTrackFitResultWithClosestMass(Belle2::Const::ChargedStable(std::abs(particle->getPDGCode())));
370  auto top = trkfit->getHelix();
371  double arcLength = top.getArcLength2DAtCylindricalR(120);
372  const auto& result = top.getPositionAtArcLength2D(arcLength);
373  return result.Theta();
374  }
375 
377  double extrapTrackToTOPphi(const Particle* particle)
378  {
379  auto trk = particle->getTrack();
380  if (not trk) {
381  return std::numeric_limits<double>::quiet_NaN();
382  }
383  auto trkfit = trk->getTrackFitResultWithClosestMass(Belle2::Const::ChargedStable(std::abs(particle->getPDGCode())));
384  auto top = trkfit->getHelix();
385  double arcLength = top.getArcLength2DAtCylindricalR(120);
386  const auto& result = top.getPositionAtArcLength2D(arcLength);
387  return result.Phi();
388  }
389 
391  double topReflectedDigitCount(const Particle* particle)
392  {
393  return topCountPhotonsAfterLargesGapWithin(particle, 0, 10000);
394  }
395 
396  double topReflectedDigitCountExpert(const Particle* particle, const vector<double>& vars)
397  {
398  if (vars.size() != 2) {
399  B2FATAL("Need exactly two parameters (min, max)");
400  }
401  return topCountPhotonsAfterLargesGapWithin(particle, vars[0], vars[1]);
402  }
403 
405  double getTOPLocalX(const Particle* particle)
406  {
407  return TOPVariable::getLocalPosition(particle).X();
408  }
409 
411  double getTOPLocalY(const Particle* particle)
412  {
413  return TOPVariable::getLocalPosition(particle).Y();
414  }
415 
417  double getTOPLocalZ(const Particle* particle)
418  {
419  return TOPVariable::getLocalPosition(particle).Z();
420  }
421 
423  double getTOPLocalXMCMatch(const Particle* particle)
424  {
425  return TOPVariable::getLocalPositionMCMatch(particle).X();
426  }
427 
429  double getTOPLocalYMCMatch(const Particle* particle)
430  {
431  return TOPVariable::getLocalPositionMCMatch(particle).Y();
432  }
433 
435  double getTOPLocalZMCMatch(const Particle* particle)
436  {
437  return TOPVariable::getLocalPositionMCMatch(particle).Z();
438  }
439 
441  double getTOPLocalPhi(const Particle* particle)
442  {
443  return TOPVariable::getLocalMomentum(particle).Phi();
444  }
445 
447  double getTOPLocalTheta(const Particle* particle)
448  {
449  return TOPVariable::getLocalMomentum(particle).Theta();
450  }
451 
453  double getTOPPhotonCount(const Particle* particle)
454  {
455  const auto* topLikelihood = TOPVariable::getTOPLikelihood(particle);
456  return topLikelihood ? topLikelihood->getNphot() : 0;
457  }
458 
460  double getExpectedTOPPhotonCount(const Particle* particle, const vector<double>& vars)
461  {
462  if (vars.size() != 1) {
463  B2FATAL("Need exactly one parameter (pdg id).");
464  }
465  return TOPVariable::getExpectedPhotonCount(particle, static_cast<int>(vars[0]));
466  }
467 
469  double countTOPHitsInInterval(const Particle* particle, const vector<double>& vars)
470  {
471  if (vars.size() != 2) {
472  B2FATAL("Need exactly two parameters (tmin, tmax)");
473  }
474  return TOPVariable::countHits(particle, vars[0], vars[1]);
475  }
476 
478  double countTOPHitsInFirst20ns(const Particle* particle)
479  {
480  return TOPVariable::countHits(particle, -1.0, 20.0);
481  }
482 
484  double countRawTOPHitsInInterval([[maybe_unused]] const Particle* particle, const vector<double>& vars)
485  {
486  if (vars.size() != 2) {
487  B2FATAL("Need exactly two parameters (tmin, tmax)");
488  }
489  return TOPVariable::countRawHits(particle, vars[0], vars[1]);
490  }
491 
492  double getFlag(const Particle* particle)
493  {
494  const auto* topLikelihood = getTOPLikelihood(particle);
495  if (not topLikelihood) return 0;
496  return topLikelihood->getFlag();
497  }
498 
499  double getElectronLogL(const Particle* particle)
500  {
501  const auto* topLikelihood = getTOPLikelihood(particle);
502  if (not topLikelihood) return 0;
503  return topLikelihood->getLogL_e();
504  }
505 
506  double getMuonLogL(const Particle* particle)
507  {
508  const auto* topLikelihood = getTOPLikelihood(particle);
509  if (not topLikelihood) return 0;
510  return topLikelihood->getLogL_mu();
511  }
512 
513  double getPionLogL(const Particle* particle)
514  {
515  const auto* topLikelihood = getTOPLikelihood(particle);
516  if (not topLikelihood) return 0;
517  return topLikelihood->getLogL_pi();
518  }
519 
520  double getKaonLogL(const Particle* particle)
521  {
522  const auto* topLikelihood = getTOPLikelihood(particle);
523  if (not topLikelihood) return 0;
524  return topLikelihood->getLogL_K();
525  }
526 
527  double getProtonLogL(const Particle* particle)
528  {
529  const auto* topLikelihood = getTOPLikelihood(particle);
530  if (not topLikelihood) return 0;
531  return topLikelihood->getLogL_p();
532  }
533 
534  //---------------- TOPRecBunch related --------------------
535 
537  double isTOPRecBunchReconstructed([[maybe_unused]] const Particle* particle)
538  {
539  StoreObjPtr<TOPRecBunch> recBunch;
540  // Attention! 0.0 is false, everything else is true
541  // returning -1, like for the others will most likely lead to bugs
542  // if the caller is not careful about return values.
543  if (not recBunch.isValid()) return 0.0;
544  return recBunch->isReconstructed();
545  }
546 
548  double TOPRecBunchNumber([[maybe_unused]] const Particle* particle)
549  {
550  StoreObjPtr<TOPRecBunch> recBunch;
551  if (not recBunch.isValid()) return -9999.0;
552  return recBunch->getBunchNo();
553  }
554 
556  double TOPRecBunchCurrentOffset([[maybe_unused]] const Particle* particle)
557  {
558  StoreObjPtr<TOPRecBunch> recBunch;
559  if (not recBunch.isValid()) return -9999.0;
560  return recBunch->getCurrentOffset();
561  }
562 
564  double TOPRecBunchTrackCount([[maybe_unused]] const Particle* particle)
565  {
566  StoreObjPtr<TOPRecBunch> recBunch;
567  if (not recBunch.isValid()) return -9999.0;
568  return recBunch->getNumTracks();
569  }
570 
572  double TOPRecBunchUsedTrackCount([[maybe_unused]] const Particle* particle)
573  {
574  StoreObjPtr<TOPRecBunch> recBunch;
575  if (not recBunch.isValid()) return -9999.0;
576  return recBunch->getUsedTracks();
577  }
578  //-------------- Event based -----------------------------------
579 
581  double TOPRawPhotonsInSlot([[maybe_unused]] const Particle* particle, const vector<double>& vars)
582  {
583  if (vars.size() != 1) { B2FATAL("Need exactly one parameter (slot id).");}
584  StoreArray<TOPDigit> topDigits;
585  int thisModuleID = static_cast<int>(vars[0]);
586  size_t count = 0;
587  for (const auto& t : topDigits) {
588  if (abs(t.getModuleID()) != abs(thisModuleID)) continue;
589  count += 1;
590  }
591  return count;
592  }
593 
595  double TOPGoodPhotonsInSlot([[maybe_unused]] const Particle* particle, const vector<double>& vars)
596  {
597  if (vars.size() != 1) { B2FATAL("Need exactly one parameter (slot id).");}
598  StoreArray<TOPDigit> topDigits;
599  int thisModuleID = static_cast<int>(vars[0]);
600  size_t count = 0;
601  for (const auto& t : topDigits) {
602  if (abs(t.getModuleID()) != abs(thisModuleID)) continue;
603  if (t.getHitQuality() != TOPDigit::c_Good) continue;
604  count += 1;
605  }
606  return count;
607  }
608 
610  double TOPTracksInSlot([[maybe_unused]] const Particle* particle)
611  {
612  const auto* trk = particle->getTrack();
613  if (not trk) {
614  return -1.0;
615  }
616  int thisModuleID = static_cast<int>(getSlotID(particle));
617  if (thisModuleID == 0) return 0;
618  StoreArray<Track> tracks;
619  int nTracks = 0;
620  for (const auto& t : tracks) {
621  const auto* tl = t.getRelated<TOPLikelihood>();
622  if (not tl) continue;
623  const auto* te = tl->getRelated<ExtHit>();
624  if (not te) continue;
625  if (te->getCopyID() != thisModuleID) continue;
626  nTracks += 1;
627  }
628  return nTracks;
629  }
630 
631  } // TOPVariable
632 
633  VARIABLE_GROUP("TOP Calibration");
634  REGISTER_VARIABLE("extrapTrackToTOPimpactZ", TOPVariable::extrapTrackToTOPz,
635  "[calibration] z coordinate of the impact point of the track extrapolated to TOP using helix data from TrackFitResult");
636  REGISTER_VARIABLE("extrapTrackToTOPimpactTheta", TOPVariable::extrapTrackToTOPtheta,
637  "[calibration] theta coordinate of the impact point of the track extrapolated to TOP using helix data from TrackFitResult");
638  REGISTER_VARIABLE("extrapTrackToTOPimpactPhi", TOPVariable::extrapTrackToTOPphi,
639  "[calibration] phi coordinate of the impact point of the track extrapolated to TOP using helix data from TrackFitResult");
640  REGISTER_VARIABLE("topDigitCount", TOPVariable::topDigitCount,
641  "[calibration] The number of TOPDigits in the module to which the track was extrapolated");
642  REGISTER_VARIABLE("topBackgroundDigitCount", TOPVariable::topBackgroundDigitCount,
643  "[calibration] The number of TOPDigits in all modules except the one to which the track was extrapolated");
644  REGISTER_VARIABLE("topBackgroundDigitCountRaw", TOPVariable::topBackgroundDigitCountRaw,
645  "[calibration] The number of TOPDigits in all modules except the one to which the track was extrapolated");
646  REGISTER_VARIABLE("topDigitCountRaw", TOPVariable::topDigitCount,
647  "[calibration] The number of TOPDigits in the module to which the track was extrapolated, regardless of hit quality");
648  REGISTER_VARIABLE("topReflectedDigitCount", TOPVariable::topReflectedDigitCount,
649  "[calibration] The number of reflected photons in the same module");
650  REGISTER_VARIABLE("topReflectedDigitCountExpert(minGap, maxGap)", TOPVariable::topReflectedDigitCountExpert,
651  "[calibration] The number of photons after the largest gap between minGap and maxGap");
652  REGISTER_VARIABLE("topDigitGapSize", TOPVariable::topDigitGapSize,
653  "[calibration] The largest time difference between two consecutive hits in the same module");
654  REGISTER_VARIABLE("topLocalX", TOPVariable::getTOPLocalX,
655  "[calibration] The local x coordinate of the particle's entry point to the TOP module");
656  REGISTER_VARIABLE("topLocalY", TOPVariable::getTOPLocalY,
657  "[calibration] The local y coordinate of the particle's entry point to the TOP module");
658  REGISTER_VARIABLE("topLocalZ", TOPVariable::getTOPLocalZ,
659  "[calibration] The local z coordinate of the particle's entry point to the TOP module");
660  REGISTER_VARIABLE("topLocalXMCMatch", TOPVariable::getTOPLocalXMCMatch,
661  "[calibration] The local x coordinate of the MC particle's entry point to the TOP module");
662  REGISTER_VARIABLE("topLocalYMCMatch", TOPVariable::getTOPLocalYMCMatch,
663  "[calibration] The local y coordinate of the MC particle's entry point to the TOP module");
664  REGISTER_VARIABLE("topLocalZMCMatch", TOPVariable::getTOPLocalZMCMatch,
665  "[calibration] The local z coordinate of the MC particle's entry point to the TOP module");
666  REGISTER_VARIABLE("topLocalPhi", TOPVariable::getTOPLocalPhi,
667  "[calibration] The local phi coordinate of the particle's momentum in the TOP module");
668  REGISTER_VARIABLE("topLocalTheta", TOPVariable::getTOPLocalTheta,
669  "[calibration] The local phi coordinate of the particle's momentum in the TOP module");
670  REGISTER_VARIABLE("topTOF", TOPVariable::getTOF,
671  "[calibration] The time of flight from the origin to the TOP");
672  REGISTER_VARIABLE("topTOFExpert(pdg)", TOPVariable::getTOFExpert,
673  "[calibration] The time of flight from the origin to the TOP under the given hypothesis");
674  REGISTER_VARIABLE("topAverageTimeOfFirst5", TOPVariable::getAverageTimeOfFirst5,
675  "[calibration] The average time of the first (up to) 5 hits in the module with the track");
676  REGISTER_VARIABLE("topSlotID", TOPVariable::getSlotID,
677  "[calibration] The ID of the TOP slot that was hit by the particle");
678  REGISTER_VARIABLE("topExpectedPhotonCount(pdg)", TOPVariable::getExpectedTOPPhotonCount,
679  "[calibration] The expected number of photons in the TOP for the particle under the given hypothesis");
680  REGISTER_VARIABLE("topPhotonCount", TOPVariable::getTOPPhotonCount,
681  "[calibration] The number of (bg-subtracted) TOP photons in for the given particle");
682  REGISTER_VARIABLE("countTOPHitsInInterval(tmin, tmax)", TOPVariable::countTOPHitsInInterval,
683  "[calibration] The number of photons in the given interval");
684  REGISTER_VARIABLE("countTOPHitsInFirst20ns", TOPVariable::countTOPHitsInFirst20ns,
685  "[calibration] The number of photons in the first 20 ns after the first photon");
686  REGISTER_VARIABLE("countRawTOPHitsInInterval(tmin, tmax)", TOPVariable::countRawTOPHitsInInterval,
687  "[calibration] The number of photons in the given interval");
688  REGISTER_VARIABLE("topFlag", TOPVariable::getFlag,
689  "[calibration] reconstruction flag, log likelihoods are valid if flag==1");
690  REGISTER_VARIABLE("topElectronLogL", TOPVariable::getElectronLogL,
691  "[calibration] electron log likelihood");
692  REGISTER_VARIABLE("topMuonLogL", TOPVariable::getMuonLogL,
693  "[calibration] muon log likelihood");
694  REGISTER_VARIABLE("topPionLogL", TOPVariable::getPionLogL,
695  "[calibration] pion log likelihood");
696  REGISTER_VARIABLE("topKaonLogL", TOPVariable::getKaonLogL,
697  "[calibration] kaon log likelihood");
698  REGISTER_VARIABLE("topProtonLogL", TOPVariable::getProtonLogL,
699  "[calibration] proton log likelihood");
700  REGISTER_VARIABLE("topRecBunchUsedTrackCount", TOPVariable::TOPRecBunchUsedTrackCount,
701  "[calibration] The number of tracks used in the bunch reconstruction");
702  REGISTER_VARIABLE("topRecBunchTrackCount", TOPVariable::TOPRecBunchTrackCount,
703  "[calibration] The number of tracks in the TOP acceptance");
704  REGISTER_VARIABLE("topRecBunchCurrentOffset", TOPVariable::TOPRecBunchCurrentOffset,
705  "[calibration] The current offset");
706  REGISTER_VARIABLE("topRecBunchNumber", TOPVariable::TOPRecBunchNumber,
707  "[calibration] The number of the bunch relative to the interaction");
708  REGISTER_VARIABLE("isTopRecBunchReconstructed", TOPVariable::isTOPRecBunchReconstructed,
709  "[calibration] Flag to indicate whether the bunch was reconstructed");
710  REGISTER_VARIABLE("topRawPhotonsInSlot(id)", TOPVariable::TOPRawPhotonsInSlot,
711  "[calibration] The number of all photons in the given slot");
712  REGISTER_VARIABLE("topGoodPhotonsInSlot(id)", TOPVariable::TOPGoodPhotonsInSlot,
713  "[calibration] The number of good photons in the given slot");
714  REGISTER_VARIABLE("topTracksInSlot", TOPVariable::TOPTracksInSlot,
715  "[calibration] The number of tracks in the same slot as the particle");
716  } // Variable
718 } // Belle2
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Const::ChargedStable
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:465