9#include <svd/modules/svdClusterQualityEstimator/SVDClusterQualityEstimatorModule.h>
10#include <svd/modules/svdClusterQualityEstimator/ClusterQualityHelperFunctions.h>
11#include <framework/utilities/FileSystem.h>
23 setDescription(
"Assignment of probability for a cluster being generated from signal hit.");
28 "SVDCluster collection name",
string(
""));
31 "Standard is true. If turned off clusters will not be assigned a quality.",
bool(
true));
34 "Path containing pdf root file", std::string(
"/data/svd/clusterQICalibration.root"));
37 "Use old PDF name convention?",
bool(
true));
46 B2ERROR(
"Input PDF filename not set!");
49 if (fullPath.empty()) {
50 B2ERROR(
"PDF file:" <<
m_inputPDF <<
"not located! Check filename input matches name of PDF file!");
58 B2FATAL(
"Couldn't open pdf file:" <<
m_inputPDF);
72 double charge = svdCluster.getCharge();
73 double time = svdCluster.getClsTime();
78 maxSize = floor(pdfEntries / 12);
80 maxSize = floor(pdfEntries / 688);
83 std::string probInputName;
84 std::string errorInputName;
86 clusterPDFName(svdCluster.getSensorID(), svdCluster.getSize(), svdCluster.isUCluster(), maxSize, probInputName, errorInputName,
89 TH2F* probPDF =
nullptr;
90 TH2F* errorPDF =
nullptr;
95 int xBin = probPDF->GetXaxis()->FindFixBin(time);
96 int yBin = probPDF->GetYaxis()->FindFixBin(charge);
98 double signalProb = probPDF->GetBinContent(xBin, yBin);
99 double signalProbError = errorPDF->GetBinContent(xBin, yBin);
101 svdCluster.setQualityIndicator(signalProb);
102 svdCluster.setQualityIndicatorError(signalProbError);
109 B2INFO(
"SVDClusterQualityEstimatorModule::terminate");
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
std::string m_svdClustersName
SVDCluster collection name.
virtual void initialize() override
Init the module.
StoreArray< SVDCluster > m_svdClusters
The storeArray for svdClusters.
std::string m_inputPDF
File path of root file containing pdf histograms.
virtual void event() override
Event.
bool m_useQualityEstimator
Standard is true.
virtual void terminate() override
Final output.
bool m_useLegacyNaming
Choice between PDF naming conventions.
TFile * m_calibrationFile
Pointer to root TFile containing PDF histograms.
SVDClusterQualityEstimatorModule()
Constructor.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
void clusterPDFName(const VxdID &sensor, int size, int side, int maxClusterSize, std::string &PDFName, std::string &errorPDFName, bool useLegacyNaming)
Function to set name of PDF for cluster quality estimation.
Abstract base class for different kinds of events.