9#include <top/reconstruction_cpp/TOPRecoManager.h>
10#include <framework/logging/Logger.h>
28 for (
unsigned moduleID = 1; moduleID <= geo->getNumModules(); moduleID++) {
39 unsigned k = moduleID - 1;
40 if (k < collection.size()) {
41 collection[k].clear();
42 return &collection[k];
45 B2ERROR(
"TOPRecoManager::getInverseRaytracer: invalid moduleID" <<
LogVar(
"moduleID", moduleID));
52 unsigned k = moduleID - 1;
53 if (k < collection.size()) {
54 collection[k].clear();
55 return &collection[k];
58 B2ERROR(
"TOPRecoManager::getFastRaytracer: invalid moduleID" <<
LogVar(
"moduleID", moduleID));
65 unsigned k = moduleID - 1;
66 if (k < collection.size()) {
67 collection[k].clear();
68 return &collection[k];
71 B2ERROR(
"TOPRecoManager::getYScanner: invalid moduleID" <<
LogVar(
"moduleID", moduleID));
79 unsigned k = moduleID - 1;
80 if (k < collection.size()) {
81 return &collection[k];
84 B2ERROR(
"TOPRecoManager::getBackgroundPDF: invalid moduleID" <<
LogVar(
"moduleID", moduleID));
93 auto& pixelMasks = yScanner.pixelMasks();
94 int moduleID = pixelMasks.getModuleID();
95 unsigned numChannels = pixelMasks.getNumPixels();
96 for (
unsigned channel = 0; channel < numChannels; channel++) {
97 int pixelID = mapper.getPixelID(channel);
98 pixelMasks.set(pixelID, mask->isActive(moduleID, channel) and asicMask.
isActive(moduleID, channel));
103 B2INFO(
"TOPRecoManager: new channel masks have been passed to reconstruction");
110 auto& pixelMasks = yScanner.pixelMasks();
111 int moduleID = pixelMasks.getModuleID();
112 unsigned numChannels = pixelMasks.getNumPixels();
113 for (
unsigned channel = 0; channel < numChannels; channel++) {
114 if (channelT0->isCalibrated(moduleID, channel))
continue;
115 int pixelID = mapper.getPixelID(channel);
116 pixelMasks.setPixelOff(pixelID);
121 B2INFO(
"TOPRecoManager: channelT0-uncalibrated channels have been masked off");
129 auto& pixelMasks = yScanner.pixelMasks();
130 int moduleID = pixelMasks.getModuleID();
131 unsigned numChannels = pixelMasks.getNumPixels();
132 for (
unsigned channel = 0; channel < numChannels; channel++) {
133 const auto* fe = fe_mapper.getMap(moduleID, channel / 128);
135 B2ERROR(
"TOPRecoManager::setUncalibratedChannelsOff no front-end map found");
138 auto scrodID = fe->getScrodID();
139 const auto* sampleTimes = timebase->getSampleTimes(scrodID, channel);
140 if (sampleTimes->isCalibrated())
continue;
141 int pixelID = ch_mapper.getPixelID(channel);
142 pixelMasks.setPixelOff(pixelID);
147 B2INFO(
"TOPRecoManager: timebase-uncalibrated channels have been masked off");
152 const double minEffi = 0.1;
153 const double maxEffi = 2.0;
155 auto& pixelEfficiencies = yScanner.pixelEfficiencies();
156 int moduleID = pixelEfficiencies.getModuleID();
157 int numPixels = pixelEfficiencies.getNumPixels();
158 for (
int pixelID = 1; pixelID <= numPixels; pixelID++) {
160 if (effi < minEffi) {
161 B2WARNING(
"TOPRecoManager::setChannelEffi: relative pixel efficiency found rather small"
162 <<
LogVar(
"slot", moduleID)
163 <<
LogVar(
"pixel", pixelID)
164 <<
LogVar(
"efficiency", effi)
165 <<
" -> will set it to " << minEffi);
167 }
else if (effi > maxEffi) {
168 B2WARNING(
"TOPRecoManager::setChannelEffi: relative pixel efficiency found rather large"
169 <<
LogVar(
"slot", moduleID)
170 <<
LogVar(
"pixel", pixelID)
171 <<
LogVar(
"efficiency", effi)
172 <<
" -> will set it to " << maxEffi);
175 pixelEfficiencies.set(pixelID, effi);
180 B2INFO(
"TOPRecoManager: new relative pixel efficiencies have been passed to reconstruction");
188 unsigned k = moduleID - 1;
196 B2ERROR(
"TOPRecoManager::setMirrorCenter: invalid moduleID" <<
LogVar(
"moduleID", moduleID));
Class for accessing objects in the database.
Class to store bit fields of masked ASICs, as reported in raw data.
Parametrization of background PDF in pixels of single module.
Fast photon propagation in quartz optics.
Utility for solving inverse ray-tracing problem.
double getRelativePixelEfficiency(int moduleID, int pixelID) const
Returns relative pixel efficiency (including CE, RQE and threshold efficiency)
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using basf2 units.
const ChannelMapper & getChannelMapper() const
Returns default channel mapper (mapping of channels to pixels)
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
const FrontEndMapper & getFrontEndMapper() const
Returns front-end mapper (mapping of SCROD's to positions within TOP modules)
Singleton class providing pre-constructed reconstruction objects.
std::vector< YScanner > & yScanners()
Interface to y-scanners of all modules.
static const InverseRaytracer * getInverseRaytracer(int moduleID)
Returns inverse ray-tracer of a given module.
static void setMirrorCenter(int moduleID, double xc, double yc)
Sets the mirror center-of-curvature.
std::vector< YScanner > m_yScanners
collection of y-scanners
std::vector< BackgroundPDF > m_backgroundPDFs
collection of background PDF's
std::vector< InverseRaytracer > & inverseRaytracers()
Interface to inverse ray-tracers of all modules.
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 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 const BackgroundPDF * getBackgroundPDF(int moduleID)
Returns background PDF of a given module.
static TOPRecoManager & getInstance()
Returns instance of the class.
bool m_redoBkg
flag to signal whether backgroundPDF has to be redone
static void setUncalibratedChannelsOff(const DBObjPtr< TOPCalChannelT0 > &channelT0)
Sets uncalibrated channels off.
Utility for expanding the PDF in y direction.
Class to store variables with their name which were sent to the logging service.
bool isActive(int moduleID, unsigned channel) const
Returns true if channel is not explicitely labeled as masked.
Abstract base class for different kinds of events.