Belle II Software  release-05-02-19
TOPreco.cc
1 //*****************************************************************************
2 //-----------------------------------------------------------------------------
3 // Fast simulation and reconstruction package for TOP counter (F77 core)
4 // M. Staric, April-2009, Sept-2011
5 //-----------------------------------------------------------------------------
6 //
7 // TOPreco.cc
8 // C++ interface to F77 functions: reconstruction
9 //-----------------------------------------------------------------------------
10 //*****************************************************************************
11 
12 #include <iostream>
13 #include <iomanip>
14 #include <top/reconstruction/TOPreco.h>
15 #include <top/reconstruction/TOPf77fun.h>
16 #include <top/geometry/TOPGeometryPar.h>
17 
18 #include <framework/gearbox/Const.h>
19 #include <framework/logging/Logger.h>
20 
21 extern "C" {
22  void set_beta_rq_(float*);
23  void set_time_window_(float*, float*);
24  void get_time_window_(float*, float*);
25  void set_pdf_opt_(int*, int*, int*);
26  void set_store_opt_(int*);
27  float get_logl_(float*, float*, float*, float*);
28  void get_logl_ch_(float*, float*, float*, float*, float*);
29  int data_getnum_();
30  void set_channel_mask_(int*, int*, int*);
31  void set_channel_off_(int*, int*);
32  void print_channel_mask_();
33  void set_channel_effi_(int*, int*, float*);
34  void redo_pdf_(float*, int*);
35  int get_num_peaks_(int*);
36  void get_peak_(int*, int*, float*, float*, float*);
37  float get_bgr_(int*);
38  int get_pik_typ_(int*, int*);
39  float get_pik_fic_(int*, int*);
40  float get_pik_e_(int*, int*);
41  float get_pik_sige_(int*, int*);
42  int get_pik_nx_(int*, int*);
43  int get_pik_ny_(int*, int*);
44  int get_pik_nxm_(int*, int*);
45  int get_pik_nym_(int*, int*);
46  int get_pik_nxe_(int*, int*);
47  int get_pik_nye_(int*, int*);
48  float get_pik_xd_(int*, int*);
49  float get_pik_yd_(int*, int*);
50  float get_pik_kxe_(int*, int*);
51  float get_pik_kye_(int*, int*);
52  float get_pik_kze_(int*, int*);
53  float get_pik_kxd_(int*, int*);
54  float get_pik_kyd_(int*, int*);
55  float get_pik_kzd_(int*, int*);
56 }
57 
58 namespace Belle2 {
63  namespace TOP {
64 
65  TOPreco::TOPreco(int Num, double Masses[], int pdgCodes[],
66  double BkgPerModule, double ScaleN0)
67  {
68  data_clear_();
69  rtra_clear_();
70 
71  std::vector<float> masses;
72  for (int i = 0; i < Num; i++) {
73  masses.push_back((float) Masses[i]);
74  }
75  rtra_set_hypo_(&Num, masses.data());
76  rtra_set_hypid_(&Num, pdgCodes);
77 
78  float b = (float) BkgPerModule;
79  float s = (float) ScaleN0;
80  set_top_par_(&b, &s);
81 
82  setPDFoption(c_Optimal); // default option
83  setTimeWindow(0.0, 0.0); // use default (TDC range)
84  setBeta(0); // use default: beta from momentum and mass
85  }
86 
87 
89  const TOPAsicMask& asicMask)
90  {
91  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
92  const auto& mapper = TOPGeometryPar::Instance()->getChannelMapper();
93  int numModules = geo->getNumModules();
94  for (int moduleID = 1; moduleID <= numModules; moduleID++) {
95  unsigned numPixels = geo->getModule(moduleID).getPMTArray().getNumPixels();
96  for (unsigned channel = 0; channel < numPixels; channel++) {
97  int mdn = moduleID - 1; // 0-based used in fortran
98  int ich = mapper.getPixelID(channel) - 1; // 0-base used in fortran
99  int flag = mask->isActive(moduleID, channel) and asicMask.isActive(moduleID, channel);
100  set_channel_mask_(&mdn, &ich, &flag);
101  }
102  }
103  B2INFO("TOPreco: new channel masks have been passed to reconstruction");
104  }
105 
106 
108  {
109  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
110  const auto& mapper = TOPGeometryPar::Instance()->getChannelMapper();
111  int numModules = geo->getNumModules();
112  for (int moduleID = 1; moduleID <= numModules; moduleID++) {
113  unsigned numPixels = geo->getModule(moduleID).getPMTArray().getNumPixels();
114  for (unsigned channel = 0; channel < numPixels; channel++) {
115  if (channelT0->isCalibrated(moduleID, channel)) continue;
116  int mdn = moduleID - 1; // 0-based used in fortran
117  int ich = mapper.getPixelID(channel) - 1; // 0-based used in fortran
118  set_channel_off_(&mdn, &ich);
119  }
120  }
121  B2INFO("TOPreco: channelT0-uncalibrated channels have been masked off");
122  }
123 
124 
126  {
127  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
128  const auto& ch_mapper = TOPGeometryPar::Instance()->getChannelMapper();
129  const auto& fe_mapper = TOPGeometryPar::Instance()->getFrontEndMapper();
130  int numModules = geo->getNumModules();
131  for (int moduleID = 1; moduleID <= numModules; moduleID++) {
132  unsigned numPixels = geo->getModule(moduleID).getPMTArray().getNumPixels();
133  for (unsigned channel = 0; channel < numPixels; channel++) {
134  const auto* fe = fe_mapper.getMap(moduleID, channel / 128);
135  if (not fe) {
136  B2ERROR("TOPreco::setUncalibratedChannelsOff no front-end map found");
137  continue;
138  }
139  auto scrodID = fe->getScrodID();
140  const auto* sampleTimes = timebase->getSampleTimes(scrodID, channel);
141  if (sampleTimes->isCalibrated()) continue;
142  int mdn = moduleID - 1; // 0-based used in fortran
143  int ich = ch_mapper.getPixelID(channel) - 1; // 0-based used in fortran
144  set_channel_off_(&mdn, &ich);
145  }
146  }
147  B2INFO("TOPreco: timebase-uncalibrated channels have been masked off");
148  }
149 
151  {
152  print_channel_mask_();
153  }
154 
156  {
157  const auto* topgp = TOPGeometryPar::Instance();
158  const auto* geo = topgp->getGeometry();
159  int numModules = geo->getNumModules();
160  for (int moduleID = 1; moduleID <= numModules; moduleID++) {
161  int numPixels = geo->getModule(moduleID).getPMTArray().getNumPixels();
162  for (int pixelID = 1; pixelID <= numPixels; pixelID++) {
163  int mdn = moduleID - 1; // 0-based used in fortran
164  int ich = pixelID - 1; // 0-based used in fortran
165  float effi = topgp->getRelativePixelEfficiency(moduleID, pixelID);
166  set_channel_effi_(&mdn, &ich, &effi);
167  }
168  }
169  B2INFO("TOPreco: new relative pixel efficiencies have been passed to reconstruction");
170  }
171 
172  void TOPreco::setMass(double Mass, int pdg)
173  {
174  int Num = 1;
175  float mass = (float) Mass;
176  rtra_set_hypo_(&Num, &mass);
177  rtra_set_hypid_(&Num, &pdg);
178  }
179 
180  void TOPreco::setTimeWindow(double Tmin, double Tmax)
181  {
182  float tmin = (float) Tmin;
183  float tmax = (float) Tmax;
184  set_time_window_(&tmin, &tmax);
185  }
186 
187  void TOPreco::getTimeWindow(double& Tmin, double& Tmax)
188  {
189  float tmin = 0;
190  float tmax = 0;
191  get_time_window_(&tmin, &tmax);
192  Tmin = tmin;
193  Tmax = tmax;
194  }
195 
196  void TOPreco::setPDFoption(PDFoption opt, int NP, int NC)
197  {
198  int iopt = opt;
199  set_pdf_opt_(&iopt, &NP, &NC);
200  }
201 
203  {
204  int iopt = opt;
205  set_store_opt_(&iopt);
206  }
207 
209  {
210  data_clear_();
211  rtra_clear_();
212  }
213 
214  int TOPreco::addData(int moduleID, int pixelID, double time, double timeError)
215  {
216  int status = 0;
217  moduleID--; // 0-based ID used in fortran
218  pixelID--; // 0-based ID used in fortran
219  float t = (float) time;
220  float terr = (float) timeError;
221  data_put_(&moduleID, &pixelID, &t, &terr, &status);
222  if (status > 0) return status;
223  switch (status) {
224  case 0:
225  B2WARNING("TOPReco::addData: no space available in /TOP_DATA/");
226  return status;
227  case -1:
228  B2ERROR("TOPReco::addData: invalid module ID."
229  << LogVar("moduleID", moduleID + 1));
230  return status;
231  case -2:
232  B2ERROR("TOPReco::addData: invalid pixel ID."
233  << LogVar("pixelID", pixelID + 1));
234  return status;
235  case -3:
236  B2DEBUG(100, "TOPReco::addData: digit should already be masked-out (different masks used?)");
237  return status;
238  default:
239  B2ERROR("TOPReco::addData: unknown return status."
240  << LogVar("status", status));
241  return status;
242  }
243  }
244 
246  {
247  return data_getnum_();
248  }
249 
250  void TOPreco::reconstruct(double X, double Y, double Z, double Tlen,
251  double Px, double Py, double Pz, int Q,
252  int HYP, int moduleID)
253  {
254  float x = (float) X;
255  float y = (float) Y;
256  float z = (float) Z;
257  float t = float(Tlen / Const::speedOfLight);
258  float px = (float) Px;
259  float py = (float) Py;
260  float pz = (float) Pz;
261  int REF = 0;
262  moduleID--; // 0-based ID used in fortran
263  rtra_clear_();
264  rtra_put_(&x, &y, &z, &t, &px, &py, &pz, &Q, &HYP, &REF, &moduleID);
265  top_reco_();
266  }
267 
268  void TOPreco::reconstruct(const TOPtrack& trk, int pdg)
269  {
270  m_hypID = abs(trk.getPDGcode());
271  if (pdg == 0) pdg = m_hypID;
272  int moduleID = trk.getModuleID();
273  reconstruct(trk.getX(), trk.getY(), trk.getZ(), trk.getTrackLength(),
274  trk.getPx(), trk.getPy(), trk.getPz(), trk.getCharge(),
275  pdg, moduleID);
276  }
277 
279  {
280  int K = 1;
281  return rtra_get_flag_(&K);
282  }
283 
285  {
286  int K = 1;
287  i++;
288  return rtra_get_sfot_(&K, &i);
289  }
290 
292  {
293  int K = 1;
294  return rtra_get_bfot_(&K);
295  }
296 
298  {
299  int K = 1;
300  return rtra_get_nfot_(&K);
301  }
302 
303  double TOPreco::getLogL(int i)
304  {
305  int K = 1;
306  i++;
307  return rtra_get_plkh_(&K, &i);
308  }
309 
310  void TOPreco::getLogL(int Size, double LogL[], double ExpNphot[], int& Nphot)
311  {
312  int K = 1;
313  std::vector<float> logl(Size), sfot(Size);
314  int Flag, MTRA, REF;
315  rtra_get_(&K, logl.data(), sfot.data(), &Size, &Nphot, &Flag, &MTRA, &REF);
316  for (int i = 0; i < Size; i++) {
317  LogL[i] = logl[i];
318  ExpNphot[i] = sfot[i];
319  }
320  }
321 
322  double TOPreco::getLogL(double timeShift, double timeMin, double timeMax,
323  double sigma)
324  {
325  float t0 = (float) timeShift;
326  float tmin = (float) timeMin;
327  float tmax = (float) timeMax;
328  float sigt = (float) sigma;
329  return get_logl_(&t0, &tmin, &tmax, &sigt);
330  }
331 
332  void TOPreco::getLogL(double timeShift, double timeMin, double timeMax, double sigma,
333  float* logL)
334  {
335  float t0 = (float) timeShift;
336  float tmin = (float) timeMin;
337  float tmax = (float) timeMax;
338  float sigt = (float) sigma;
339  get_logl_ch_(&t0, &tmin, &tmax, &sigt, logL);
340  }
341 
342  void TOPreco::getTrackHit(int LocGlob, double R[3], double Dir[3], double& Len,
343  double& Tlen, double& Mom, int& moduleID)
344  {
345  int K = 1;
346  float r[3], dir[3], len, tof, p;
347  rtra_gethit_(&K, &LocGlob, r, dir, &len, &tof, &p, &moduleID);
348  moduleID++;
349  for (int i = 0; i < 3; i++) {
350  R[i] = r[i];
351  Dir[i] = dir[i];
352  }
353  Len = len; Tlen = tof * Const::speedOfLight; Mom = p;
354  }
355 
356  void TOPreco::dumpLogL(int Size)
357  {
358  std::vector<double> logl(Size), sfot(Size);
359  std::vector<int> hypid(Size);
360  int Nphot;
361  getLogL(Size, logl.data(), sfot.data(), Nphot);
362  rtra_get_hypid_(&Size, hypid.data());
363 
364  int i_max = 0;
365  double logl_max = logl[0];
366  for (int i = 1; i < Size; i++) {
367  if (logl[i] > logl_max) {logl_max = logl[i]; i_max = i;}
368  }
369 
370  using namespace std;
371  cout << "TOPreco::dumpLogL: Flag=" << getFlag();
372  cout << " Detected Photons=" << Nphot << endl;
373  cout << " i HypID LogL ExpPhot" << endl;
374  cout << showpoint << fixed << right;
375  for (int i = 0; i < Size; i++) {
376  cout << setw(2) << i;
377  cout << setw(12) << hypid[i];
378  cout << setw(10) << setprecision(2) << logl[i];
379  cout << setw(8) << setprecision(2) << sfot[i];
380  if (i == i_max) cout << " <";
381  if (hypid[i] == m_hypID) cout << " <-- truth";
382  cout << endl;
383  }
384  }
385 
386  void TOPreco::dumpTrackHit(int LocGlob)
387  {
388  double r[3], dir[3], len, Tlen, p;
389  int moduleID;
390  getTrackHit(LocGlob, r, dir, len, Tlen, p, moduleID);
391 
392  using namespace std;
393  cout << showpoint << fixed << right;
394  cout << "TOPreco::dumpTrackHit: moduleID=" << moduleID;
395  cout << " Len=" << setprecision(2) << len;
396  cout << "cm Tlen=" << setprecision(1) << Tlen;
397  cout << "cm p=" << setprecision(2) << p << "GeV/c" << endl;
398  cout << "position [cm]: ";
399  for (int i = 0; i < 3; i++) {
400  cout << setw(10) << setprecision(2) << r[i];
401  }
402  if (LocGlob == c_Local) {cout << " (local)" << endl;}
403  else {cout << " (global)" << endl;}
404 
405  cout << "direction: ";
406  for (int i = 0; i < 3; i++) {
407  cout << setw(10) << setprecision(4) << dir[i];
408  }
409  if (LocGlob == c_Local) {cout << " (local)" << endl;}
410  else {cout << " (global)" << endl;}
411  }
412 
414  {
415  int n;
416  getnum_pulls_(&n);
417  return n;
418  }
419 
420  void TOPreco::getPull(int K, int& ich, float& t, float& t0, float& wid,
421  float& fic, float& wt)
422  {
423  K++;
424  get_pulls_(&K, &t, &t0, &wid, &fic, &wt, &ich);
425  ich++; // convert to 1-based
426  }
427 
428  double TOPreco::getPDF(int pixelID, double T, double Mass, int PDG, double Terr)
429  {
430  pixelID--; // 0-based ID used in fortran
431  float t = (float) T;
432  float terr = (float) Terr;
433  float mass = (float) Mass;
434  return get_pdf_(&pixelID, &t, &terr, &mass, &PDG);
435  }
436 
437  void TOPreco::setBeta(double beta)
438  {
439  m_beta = beta;
440  float bt = beta;
441  set_beta_rq_(&bt);
442  }
443 
444  void TOPreco::redoPDF(double mass, int PDG)
445  {
446  float m = mass;
447  redo_pdf_(&m, &PDG);
448  }
449 
450  int TOPreco::getNumofPDFPeaks(int pixelID) const
451  {
452  pixelID--; // 0-based is used in fortran
453  return get_num_peaks_(&pixelID);
454  }
455 
456  void TOPreco::getPDFPeak(int pixelID, int k,
457  float& position, float& width, float& numPhotons) const
458  {
459  pixelID--; // 0-based is used in fortran
460  k++; // counter starts with 1 in fortran
461  get_peak_(&pixelID, &k, &position, &width, &numPhotons);
462  }
463 
464  float TOPreco::getBkgLevel(int pixelID) const
465  {
466  pixelID--; // 0-based is used in fortran
467  return get_bgr_(&pixelID);
468  }
469 
470  int TOPreco::getPDFPeakType(int pixelID, int k) const
471  {
472  pixelID--; // 0-based is used in fortran
473  k++; // counter starts with 1 in fortran
474  return get_pik_typ_(&pixelID, &k);
475  }
476 
477  float TOPreco::getPDFPeakFic(int pixelID, int k) const
478  {
479  pixelID--; // 0-based is used in fortran
480  k++; // counter starts with 1 in fortran
481  return get_pik_fic_(&pixelID, &k);
482  }
483 
484  float TOPreco::getPDFPeakE(int pixelID, int k) const
485  {
486  pixelID--; // 0-based is used in fortran
487  k++; // counter starts with 1 in fortran
488  return get_pik_e_(&pixelID, &k);
489  }
490 
491  float TOPreco::getPDFPeakSigE(int pixelID, int k) const
492  {
493  pixelID--; // 0-based is used in fortran
494  k++; // counter starts with 1 in fortran
495  return get_pik_sige_(&pixelID, &k);
496  }
497 
498  int TOPreco::getPDFPeakNx(int pixelID, int k) const
499  {
500  pixelID--; // 0-based is used in fortran
501  k++; // counter starts with 1 in fortran
502  return abs(get_pik_nx_(&pixelID, &k));
503  }
504 
505  int TOPreco::getPDFPeakNy(int pixelID, int k) const
506  {
507  pixelID--; // 0-based is used in fortran
508  k++; // counter starts with 1 in fortran
509  return abs(get_pik_ny_(&pixelID, &k));
510  }
511 
512  int TOPreco::getPDFPeakNxm(int pixelID, int k) const
513  {
514  pixelID--; // 0-based is used in fortran
515  k++; // counter starts with 1 in fortran
516  return abs(get_pik_nxm_(&pixelID, &k));
517  }
518 
519  int TOPreco::getPDFPeakNym(int pixelID, int k) const
520  {
521  pixelID--; // 0-based is used in fortran
522  k++; // counter starts with 1 in fortran
523  return abs(get_pik_nym_(&pixelID, &k));
524  }
525 
526  int TOPreco::getPDFPeakNxe(int pixelID, int k) const
527  {
528  pixelID--; // 0-based is used in fortran
529  k++; // counter starts with 1 in fortran
530  return abs(get_pik_nxe_(&pixelID, &k));
531  }
532 
533  int TOPreco::getPDFPeakNye(int pixelID, int k) const
534  {
535  pixelID--; // 0-based is used in fortran
536  k++; // counter starts with 1 in fortran
537  return abs(get_pik_nye_(&pixelID, &k));
538  }
539 
540  float TOPreco::getPDFPeakXD(int pixelID, int k) const
541  {
542  pixelID--; // 0-based is used in fortran
543  k++; // counter starts with 1 in fortran
544  return get_pik_xd_(&pixelID, &k);
545  }
546 
547  float TOPreco::getPDFPeakYD(int pixelID, int k) const
548  {
549  pixelID--; // 0-based is used in fortran
550  k++; // counter starts with 1 in fortran
551  return get_pik_yd_(&pixelID, &k);
552  }
553 
554  float TOPreco::getPDFPeakKxe(int pixelID, int k) const
555  {
556  pixelID--; // 0-based is used in fortran
557  k++; // counter starts with 1 in fortran
558  return get_pik_kxe_(&pixelID, &k);
559  }
560 
561  float TOPreco::getPDFPeakKye(int pixelID, int k) const
562  {
563  pixelID--; // 0-based is used in fortran
564  k++; // counter starts with 1 in fortran
565  return get_pik_kye_(&pixelID, &k);
566  }
567 
568  float TOPreco::getPDFPeakKze(int pixelID, int k) const
569  {
570  pixelID--; // 0-based is used in fortran
571  k++; // counter starts with 1 in fortran
572  return get_pik_kze_(&pixelID, &k);
573  }
574 
575  float TOPreco::getPDFPeakKxd(int pixelID, int k) const
576  {
577  pixelID--; // 0-based is used in fortran
578  k++; // counter starts with 1 in fortran
579  return get_pik_kxd_(&pixelID, &k);
580  }
581 
582  float TOPreco::getPDFPeakKyd(int pixelID, int k) const
583  {
584  pixelID--; // 0-based is used in fortran
585  k++; // counter starts with 1 in fortran
586  return get_pik_kyd_(&pixelID, &k);
587  }
588 
589  float TOPreco::getPDFPeakKzd(int pixelID, int k) const
590  {
591  pixelID--; // 0-based is used in fortran
592  k++; // counter starts with 1 in fortran
593  return get_pik_kzd_(&pixelID, &k);
594  }
595 
596  } // end top namespace
598 } // end Belle2 namespace
599 
Belle2::TOP::TOPtrack::getPDGcode
int getPDGcode() const
Return PDG code.
Definition: TOPtrack.h:199
Belle2::TOP::TOPreco::getPDFPeakNy
int getPDFPeakNy(int pixelID, int k) const
Returns total number of reflections in y of PDF peak.
Definition: TOPreco.cc:505
Belle2::TOP::TOPreco::getFlag
int getFlag()
Return status.
Definition: TOPreco.cc:278
Belle2::TOP::TOPreco::setUncalibratedChannelsOff
static void setUncalibratedChannelsOff(const DBObjPtr< TOPCalChannelT0 > &channelT0)
Set uncalibrated channels off.
Definition: TOPreco.cc:107
Belle2::TOP::TOPreco::getNumOfPhotons
int getNumOfPhotons()
Return number of measured photons.
Definition: TOPreco.cc:297
Belle2::TOP::TOPreco::getExpectedPhotons
double getExpectedPhotons(int i=0)
Return expected number of photons (signal + background) for i-th mass hypothesis.
Definition: TOPreco.cc:284
Belle2::TOP::TOPreco::redoPDF
void redoPDF(double mass, int PDG)
Re-calculate PDF for a given particle mass using option c_Fine.
Definition: TOPreco.cc:444
Belle2::TOP::TOPreco::getTrackHit
void getTrackHit(int LocGlob, double R[3], double Dir[3], double &Len, double &Tlen, double &Mom, int &moduleID)
Return track hit at the bar in Local or Global frame.
Definition: TOPreco.cc:342
Belle2::TOP::TOPreco::reconstruct
void reconstruct(const TOPtrack &trk, int pdg=0)
Run reconstruction for a given track.
Definition: TOPreco.cc:268
Belle2::TOP::TOPreco::getPDFPeakNxe
int getPDFPeakNxe(int pixelID, int k) const
Returns number of reflections in x in prism.
Definition: TOPreco.cc:526
Belle2::TOP::TOPreco::getPDFPeakNxm
int getPDFPeakNxm(int pixelID, int k) const
Returns number of reflections in x before mirror.
Definition: TOPreco.cc:512
Belle2::TOP::TOPtrack
Class to hold reconstructed track, interface to fortran.
Definition: TOPtrack.h:42
Belle2::TOP::TOPreco::getPDFPeakNx
int getPDFPeakNx(int pixelID, int k) const
Returns total number of reflections in x of PDF peak.
Definition: TOPreco.cc:498
Belle2::TOP::TOPtrack::getPx
double getPx() const
Return momentum component.
Definition: TOPtrack.h:123
Belle2::TOP::TOPreco::m_beta
double m_beta
beta value, if set
Definition: TOPreco.h:485
Belle2::TOP::TOPreco::setChannelEffi
static void setChannelEffi()
Set relative efficiencies of pixels.
Definition: TOPreco.cc:155
Belle2::TOP::TOPreco::printChannelMask
static void printChannelMask()
Print channel mask.
Definition: TOPreco.cc:150
Belle2::TOP::TOPreco::getPDFPeakKxe
float getPDFPeakKxe(int pixelID, int k) const
Returns photon reconstructed direction in x at emission.
Definition: TOPreco.cc:554
Belle2::TOP::TOPreco::getNumofPDFPeaks
int getNumofPDFPeaks(int pixelID) const
Returns number of peaks for given pixel describing signal PDF.
Definition: TOPreco.cc:450
Belle2::TOP::TOPreco::addData
int addData(int moduleID, int pixelID, double time, double timeError)
Add data.
Definition: TOPreco.cc:214
Belle2::TOP::TOPreco::getPDFPeakKyd
float getPDFPeakKyd(int pixelID, int k) const
Returns photon reconstructed direction in y at detection.
Definition: TOPreco.cc:582
Belle2::TOP::TOPtrack::getModuleID
int getModuleID() const
Return module ID.
Definition: TOPtrack.h:217
Belle2::TOP::TOPreco::getDataSize
int getDataSize()
Return size of data list.
Definition: TOPreco.cc:245
Belle2::TOP::TOPreco::getPDFPeakYD
float getPDFPeakYD(int pixelID, int k) const
Returns unfolded y position of pixel.
Definition: TOPreco.cc:547
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::TOP::TOPGeometryPar::Instance
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
Definition: TOPGeometryPar.cc:45
Belle2::Const::speedOfLight
static const double speedOfLight
[cm/ns]
Definition: Const.h:568
Belle2::TOP::TOPtrack::getY
double getY() const
Return position component.
Definition: TOPtrack.h:111
Belle2::TOP::TOPreco::setMass
void setMass(double mass, int pdg)
Set mass of the particle hypothesis (overrides settings in the constructor)
Definition: TOPreco.cc:172
Belle2::TOP::TOPtrack::getX
double getX() const
Return position component.
Definition: TOPtrack.h:105
Belle2::TOP::TOPreco::getTimeWindow
void getTimeWindow(double &Tmin, double &Tmax)
Returns time window for photons.
Definition: TOPreco.cc:187
Belle2::TOP::TOPreco::clearData
void clearData()
Clear data list.
Definition: TOPreco.cc:208
Belle2::TOP::TOPreco::getPDFPeakXD
float getPDFPeakXD(int pixelID, int k) const
Returns unfolded x position of pixel.
Definition: TOPreco.cc:540
Belle2::TOP::TOPreco::getPDFPeakNye
int getPDFPeakNye(int pixelID, int k) const
Returns number of reflections in y in prism.
Definition: TOPreco.cc:533
Belle2::TOP::TOPreco::getLogL
double getLogL(int i=0)
Return log likelihood for i-th mass hypothesis.
Definition: TOPreco.cc:303
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOP::TOPreco::getPDFPeakType
int getPDFPeakType(int pixelID, int k) const
Returns type of the k-th PDF peak for given pixel.
Definition: TOPreco.cc:470
Belle2::TOP::TOPreco::m_hypID
int m_hypID
true hypothesis ID
Definition: TOPreco.h:484
LogVar
Class to store variables with their name which were sent to the logging service.
Definition: LogVariableStream.h:24
Belle2::TOP::TOPtrack::getPy
double getPy() const
Return momentum component.
Definition: TOPtrack.h:129
Belle2::TOP::TOPreco::dumpTrackHit
void dumpTrackHit(int LocGlob)
Print track to std output.
Definition: TOPreco.cc:386
Belle2::TOP::TOPreco::getPDFPeakKze
float getPDFPeakKze(int pixelID, int k) const
Returns photon reconstructed direction in z at emission.
Definition: TOPreco.cc:568
Belle2::TOP::TOPreco::getPDFPeakNym
int getPDFPeakNym(int pixelID, int k) const
Returns number of reflections in y before mirror.
Definition: TOPreco.cc:519
Belle2::TOP::TOPreco::setBeta
void setBeta(double beta)
Set track beta (for beta resolution studies) if beta>0 this value is used instead of beta from moment...
Definition: TOPreco.cc:437
Belle2::TOP::TOPreco::PDFoption
PDFoption
Options for PDF: rough: no dependence on y fine: y dependent PDF everywhere optimal: y dependent PDF ...
Definition: TOPreco.h:44
Belle2::TOP::TOPreco::getPDFPeakSigE
float getPDFPeakSigE(int pixelID, int k) const
Returns photon energy spread of PDF peak.
Definition: TOPreco.cc:491
Belle2::TOP::TOPreco::getPull
void getPull(int K, int &pixelID, float &T, float &T0, float &Wid, float &PhiCer, float &Wt)
Get pulls: K-th pull.
Definition: TOPreco.cc:420
Belle2::TOPAsicMask::isActive
bool isActive(int moduleID, unsigned channel) const
Returns true if channel is not explicitely labeled as masked.
Definition: TOPAsicMask.cc:27
Belle2::TOP::TOPreco::getExpectedBG
double getExpectedBG()
Return expected number of background photons.
Definition: TOPreco.cc:291
Belle2::TOPAsicMask
Class to store bit fields of masked ASICs, as reported in raw data.
Definition: TOPAsicMask.h:33
Belle2::TOP::TOPreco::getPDFPeak
void getPDFPeak(int pixelID, int k, float &position, float &width, float &numPhotons) const
Returns k-th PDF peak for given pixel describing signal PDF.
Definition: TOPreco.cc:456
Belle2::TOP::TOPreco::getPDFPeakKzd
float getPDFPeakKzd(int pixelID, int k) const
Returns photon reconstructed direction in z at detection.
Definition: TOPreco.cc:589
Belle2::TOP::TOPGeometryPar::getGeometry
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using Basf2 units.
Definition: TOPGeometryPar.cc:167
Belle2::TOP::TOPreco::getPDFPeakKxd
float getPDFPeakKxd(int pixelID, int k) const
Returns photon reconstructed direction in x at detection.
Definition: TOPreco.cc:575
Belle2::TOP::TOPreco::getPDFPeakFic
float getPDFPeakFic(int pixelID, int k) const
Returns Cerenkov azimuthal angle of PDF peak.
Definition: TOPreco.cc:477
Belle2::TOP::TOPreco::dumpLogL
void dumpLogL(int NumHyp)
Print log likelihoods to std output.
Definition: TOPreco.cc:356
Belle2::TOP::TOPreco::getBkgLevel
float getBkgLevel(int pixelID) const
Returns estimated background level for given pixel.
Definition: TOPreco.cc:464
Belle2::TOP::TOPreco::setStoreOption
void setStoreOption(StoreOption opt)
Sets option for storing PDF parameters in Fortran common TOP_PIK.
Definition: TOPreco.cc:202
Belle2::TOP::TOPreco::TOPreco
TOPreco(int NumHyp, double Masses[], int pdgCodes[], double BkgPerModule=0, double ScaleN0=1)
Constructor.
Definition: TOPreco.cc:65
Belle2::TOP::TOPreco::getPullSize
int getPullSize()
Get pulls: size.
Definition: TOPreco.cc:413
Belle2::TOP::TOPreco::getPDF
double getPDF(int pixelID, double t, double mass, int PDG, double jitter=0)
Return PDF for pixel pixelID at time t for mass hypothesis mass.
Definition: TOPreco.cc:428
Belle2::TOP::TOPreco::getPDFPeakE
float getPDFPeakE(int pixelID, int k) const
Returns photon energy of PDF peak.
Definition: TOPreco.cc:484
Belle2::TOP::TOPtrack::getZ
double getZ() const
Return position component.
Definition: TOPtrack.h:117
Belle2::TOP::TOPtrack::getCharge
int getCharge() const
Return charge.
Definition: TOPtrack.h:205
Belle2::TOP::TOPGeometryPar::getChannelMapper
const ChannelMapper & getChannelMapper() const
Returns default channel mapper (mapping of channels to pixels)
Definition: TOPGeometryPar.h:95
Belle2::TOP::TOPreco::getPDFPeakKye
float getPDFPeakKye(int pixelID, int k) const
Returns photon reconstructed direction in y at emission.
Definition: TOPreco.cc:561
Belle2::TOP::TOPreco::StoreOption
StoreOption
Options for storing PDF parameters in Fortran common TOP_PIK reduced: only position,...
Definition: TOPreco.h:51
Belle2::TOP::TOPreco::setPDFoption
void setPDFoption(PDFoption opt, int NP=0, int NC=0)
Sets PDF option.
Definition: TOPreco.cc:196
Belle2::TOP::TOPreco::setTimeWindow
void setTimeWindow(double Tmin, double Tmax)
Set time window for photons.
Definition: TOPreco.cc:180
Belle2::TOP::TOPreco::setChannelMask
static void setChannelMask(const DBObjPtr< TOPCalChannelMask > &mask, const TOPAsicMask &asicMask)
Set channel mask.
Definition: TOPreco.cc:88
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
Belle2::TOP::TOPtrack::getTrackLength
double getTrackLength() const
Return track length from IP to current position.
Definition: TOPtrack.h:141
Belle2::TOP::TOPtrack::getPz
double getPz() const
Return momentum component.
Definition: TOPtrack.h:135