Belle II Software development
TOPRecoManager.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <top/reconstruction_cpp/InverseRaytracer.h>
12#include <top/reconstruction_cpp/FastRaytracer.h>
13#include <top/reconstruction_cpp/YScanner.h>
14#include <top/reconstruction_cpp/BackgroundPDF.h>
15#include <top/dbobjects/TOPCalChannelMask.h>
16#include <top/dbobjects/TOPCalChannelT0.h>
17#include <top/dbobjects/TOPCalTimebase.h>
18#include <framework/database/DBObjPtr.h>
19#include <top/dataobjects/TOPAsicMask.h>
20#include <top/geometry/TOPGeometryPar.h>
21
22#include <vector>
23
24namespace Belle2 {
29 namespace TOP {
30
35
36 public:
37
43
49 static const InverseRaytracer* getInverseRaytracer(int moduleID);
50
56 static const FastRaytracer* getFastRaytracer(int moduleID);
57
63 static const YScanner* getYScanner(int moduleID);
64
70 static const BackgroundPDF* getBackgroundPDF(int moduleID);
71
76 static const std::vector<BackgroundPDF>& getBackgroundPDFs() {return getInstance().backgroundPDFs();}
77
82 static double getMinTime()
83 {
85 return getInstance().m_minTime;
86 }
88 }
89
94 static double getMaxTime()
95 {
97 return getInstance().m_maxTime;
98 }
100 }
101
106 static double getTimeWindowSize() {return getMaxTime() - getMinTime();}
107
113 static void setTimeWindow(double minTime, double maxTime)
114 {
115 getInstance().m_minTime = minTime;
116 getInstance().m_maxTime = maxTime;
117 }
118
123 {
126 }
127
133 static void setChannelMask(const DBObjPtr<TOPCalChannelMask>& mask,
134 const TOPAsicMask& asicMask);
135
140 static void setUncalibratedChannelsOff(const DBObjPtr<TOPCalChannelT0>& channelT0);
141
146 static void setUncalibratedChannelsOff(const DBObjPtr<TOPCalTimebase>& timebase);
147
151 static void setChannelEffi();
152
159 static void setMirrorCenter(int moduleID, double xc, double yc);
160
161 private:
162
164 TOPRecoManager() = default;
170 ~TOPRecoManager() = default;
171
173 void set();
174
180 std::vector<InverseRaytracer>& inverseRaytracers();
181
187 std::vector<FastRaytracer>& fastRaytracers();
188
194 std::vector<YScanner>& yScanners();
195
201 std::vector<BackgroundPDF>& backgroundPDFs();
202
203 std::vector<InverseRaytracer> m_inverseRaytracers;
204 std::vector<FastRaytracer> m_fastRaytracers;
205 std::vector<YScanner> m_yScanners;
206 std::vector<BackgroundPDF> m_backgroundPDFs;
207 double m_minTime = 0;
208 double m_maxTime = 0;
209 bool m_redoBkg = false;
210
211 };
212
213 //--- inline functions ------------------------------------------------------------
214
215 inline std::vector<InverseRaytracer>& TOPRecoManager::inverseRaytracers()
216 {
217 if (m_inverseRaytracers.empty()) set();
218 return m_inverseRaytracers;
219 }
220
221 inline std::vector<FastRaytracer>& TOPRecoManager::fastRaytracers()
222 {
223 if (m_fastRaytracers.empty()) set();
224 return m_fastRaytracers;
225 }
226
227 inline std::vector<YScanner>& TOPRecoManager::yScanners()
228 {
229 if (m_yScanners.empty()) set();
230 return m_yScanners;
231 }
232
233 inline std::vector<BackgroundPDF>& TOPRecoManager::backgroundPDFs()
234 {
235 if (m_backgroundPDFs.empty()) set();
236 if (m_redoBkg) {
237 for (auto& pdf : m_backgroundPDFs) pdf.set();
238 m_redoBkg = false;
239 }
240 return m_backgroundPDFs;
241 }
242
243 } // namespace TOP
245} // namespace Belle2
246
Class for accessing objects in the database.
Definition DBObjPtr.h:21
Class to store bit fields of masked ASICs, as reported in raw data.
Definition TOPAsicMask.h:23
const TOPNominalTDC & getNominalTDC() const
Returns nominal time-to-digit conversion parameters.
double getTimeMin() const
Returns time range lower limit.
double getTimeMax() const
Returns time range upper limit.
Parametrization of background PDF in pixels of single module.
Fast photon propagation in quartz optics.
Utility for solving inverse ray-tracing problem.
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using basf2 units.
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
std::vector< YScanner > & yScanners()
Interface to y-scanners of all modules.
TOPRecoManager(TOPRecoManager &)=delete
Singleton: no copy constructor.
static const InverseRaytracer * getInverseRaytracer(int moduleID)
Returns inverse ray-tracer of a given module.
static void setDefaultTimeWindow()
Sets default time window (functions getMinTime(), getMaxTime() will then return default values from D...
static const std::vector< BackgroundPDF > & getBackgroundPDFs()
Returns background PDF's of all modules.
static void setMirrorCenter(int moduleID, double xc, double yc)
Sets the mirror center-of-curvature.
std::vector< YScanner > m_yScanners
collection of y-scanners
double m_maxTime
time window upper edge
double m_minTime
time window lower edge
std::vector< BackgroundPDF > m_backgroundPDFs
collection of background PDF's
std::vector< InverseRaytracer > & inverseRaytracers()
Interface to inverse ray-tracers of all modules.
~TOPRecoManager()=default
Singleton: private destructor.
void set()
Sets the reconstruction object collections.
static void setChannelMask(const DBObjPtr< TOPCalChannelMask > &mask, const TOPAsicMask &asicMask)
Sets channel masks.
std::vector< InverseRaytracer > m_inverseRaytracers
collection of inverse raytracers
std::vector< FastRaytracer > m_fastRaytracers
collection of fast raytracers
static double getMaxTime()
Returns time window upper edge.
static double getTimeWindowSize()
Returns size of time window.
TOPRecoManager & operator=(const TOPRecoManager &)=delete
Singleton: no assignment operator.
static const YScanner * getYScanner(int moduleID)
Returns y-scanner of a given module.
std::vector< FastRaytracer > & fastRaytracers()
Interface to fast ray-tracers of all modules.
static void setChannelEffi()
Sets relative efficiencies of pixels.
static const FastRaytracer * getFastRaytracer(int moduleID)
Returns fast ray-tracer of a given module.
std::vector< BackgroundPDF > & backgroundPDFs()
Interface to background PDF's of all modules.
static void setTimeWindow(double minTime, double maxTime)
Sets time window.
static const BackgroundPDF * getBackgroundPDF(int moduleID)
Returns background PDF of a given module.
static TOPRecoManager & getInstance()
Returns instance of the class.
TOPRecoManager()=default
Singleton: private constructor.
bool m_redoBkg
flag to signal whether backgroundPDF has to be redone
static double getMinTime()
Returns time window lower edge.
static void setUncalibratedChannelsOff(const DBObjPtr< TOPCalChannelT0 > &channelT0)
Sets uncalibrated channels off.
Utility for expanding the PDF in y direction.
Definition YScanner.h:33
Abstract base class for different kinds of events.