Belle II Software prerelease-11-00-00e
svd modules
Collaboration diagram for svd modules:

Namespaces

namespace  Belle2::SVD
 Namespace to encapsulate code needed for simulation and reconstrucion of the SVD.
 

Classes

class  SVDChannelMappingModule
 The Channel Mapping Check Module. More...
 
class  SVDClusterCalibrationsMonitorModule
 Module to produce a list of histogram showing the uploaded calibration constants. More...
 
class  SVDHotStripFinderModule
 A module template. More...
 
class  SVDLatencyCalibrationModule
 this module performs an analysis to find the APV25 latency More...
 
class  SVDLocalCalibrationsCheckModule
 Module to produce a list of histogram showing the uploaded local calibration constants. More...
 
class  SVDLocalCalibrationsMonitorModule
 Module to produce a list of histogram showing the uploaded local calibration constants. More...
 
class  SVDPositionErrorScaleFactorImporterModule
 Module that produces a localdb with position error scale factors for different position algorithms. More...
 
class  SVDTimeCalibrationsMonitorModule
 Module to produce a list of histogram showing the uploaded calibration constants. More...
 
class  SVDChargeSharingAnalysisModule
 Module for monitoring DSSD cluster charge deposition in regard of capacitive charge sharing between adjacent strips in a cluster for data and the simulation. More...
 
class  SVDClusterQualityEstimatorCalibrationModule
 Generate PDFs for assigning probability that cluster generated from signal particle. More...
 
class  SVDClusterQualityEstimatorModule
 Calculates the probability of a cluster originating from signal hit. More...
 
class  SVDCrossTalkCalibrationsCollectorModule
 Collector module used to create the histograms needed for the cross talk calibration. More...
 
class  SVDCrossTalkFinderModule
 Flags potential cross talk strips on Origami sensors. More...
 
class  SVDdEdxCollectorModule
 Collector module used to create the histograms needed for the SVD dE/dx calibration. More...
 
class  SVDdEdxValidationCollectorModule
 Collector module used to create the histograms needed for the SVD dE/dx calibration. More...
 
class  SVDDQMClustersOnTrackModule
 SVD DQM Module for Clusters related to Tracks. More...
 
class  SVDDQMEfficiencyModule
 Creates the basic histograms for SVD Efficiency DQM. More...
 
class  SVDDQMExpressRecoModule
 SVD DQM Module for Express Reco. More...
 
class  SVDDQMHitTimeModule
 This module to design collect the svd hit time for different detectors trigger timing and physics processes. More...
 
class  SVDUnpackerDQMModule
 SVD DQM Module for the Unpacker. More...
 
class  svdDumpModule
 Class definition of svdClsHistoManager module. More...
 
class  SVDTrackingEventLevelMdstInfoFillerModule
 This module adds additional global event level information about SVD track finding to the MDST object 'EventLevelTrackingInfo'. More...
 
class  SVDOccupancyCalibrationsCollectorModule
 This This module collects hits from shaper digits to compute per sensor SVD occupancy using mu+mu- events for calibration of the SVDOccupancyCalibration payload using CAF. More...
 
class  SVDB4CommissioningPlotsModule
 The SVD B4CommissioningPlots Module. More...
 
class  SVDClusterEvaluationModule
 The SVD ClusterEvaluation Module. More...
 
class  SVDClusterEvaluationTrueInfoModule
 Clustering Performance, using true information. More...
 
class  SVDClusterFilterModule
 generates a new StoreArray from the input StoreArray which has all specified Clusters removed More...
 
class  SVDEventT0PerformanceTTreeModule
 The module is used to create a TTree to study SVD EventT0. More...
 
class  SVDMaxStripTTreeModule
 The module is used to create a TTree to study the number of strips fired per event per APV chip. More...
 
class  SVDOccupancyAnalysisModule
 The SVD OccupancyAnalysis Module. More...
 
class  SVDPerformanceModule
 The (TB) SVD Performance Module. More...
 
class  SVDPerformanceTTreeModule
 The module is used to create a TTree to study SVD clusters, genfit unbiased residuals and many other properties related to the track they belong to. More...
 
class  SVDShaperDigitsFromTracksModule
 generates two new StoreArray from the input StoreArray. More...
 
class  SVDCoGTimeEstimatorModule
 This module builds the SVDRecoDigits (calibrated and fitted strips) from the SVDShaperDigits. More...
 
class  SVDDataFormatCheckModule
 This module checks the format of the data that we are going to reconstruct checking the SVDModeByte and the SVDDAQDiagnostic. More...
 
class  SVDStripMaskingModule
 This module removes the strips to be masked read form the SVDHotStripsCalibration. More...
 
class  SVD3SamplesEmulatorModule
 This module takes the SVDShaperDigit as input and select three consecutive samples starting from the one chosen by the user. More...
 
class  SVDEventInfoSetterModule
 Module to set the SVDEventInfo in the simulation. More...
 
class  SVDTriggerQualityGeneratorModule
 This module generates a StoreObjPtr that contains random trigger quality chosen between FINE and COARSE. More...
 
class  SVDZeroSuppressionEmulatorModule
 This module filters out strips that do not pass a ZS cut from the SVDShaperDigit StoreArray. More...
 
class  SVD6SampleEventSkimModule
 SVD 6-sample event skim module. More...
 
struct  ClustersOnSensor
 small struct for storing all clusters of the same sensor in one container. More...
 
class  SVDSpacePointCreatorModule
 Imports Clusters of the SVD detector and converts them to spacePoints. More...
 
class  SVDSpacePointQICalibrationModule
 Imports Clusters of the SVD detector and converts them to spacePoints. More...
 
class  SVDClusterAbsoluteTimeShifterCollectorModule
 This module creates and fills histograms based on cluster-sizes so that the mean of SVD-cluster time distribution could be calculated. More...
 
class  SVDClusterTimeShifterCollectorModule
 This module creates and fills histograms based on cluster-sizes so that the mean of SVD-cluster time distribution could be calculated. More...
 
class  SVDTimeCalibrationCollectorModule
 Collector module used to create the histograms needed for the SVD CoG-Time calibration. More...
 
class  SVDTimeGroupingModule
 Imports Clusters of the SVD detector and converts them to spacePoints. More...
 
class  SVDTimeValidationCollectorModule
 Collector module used to create the histograms needed for the SVD CoG-Time calibration. More...
 

Typedefs

typedef std::tuple< double, double, double > GroupInfo
 typedef to be used to store Gauss parameters (integral, center, sigma)
 

Functions

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.
 
void occupancyPDFName (const VxdID &sensor, int side, std::string &PDFName)
 Function to maintain common naming convention between calibration occupancy file generation and occupancy value extraction in main crossTalkFinder module.
 
template<class SpacePointType>
void provideSVDClusterSingles (const StoreArray< SVDCluster > &svdClusters, StoreArray< SpacePointType > &spacePoints)
 simply store one spacePoint for each existing SVDCluster.
 
void storeInputVectorFromSingleCluster (const SVDCluster *cls, std::vector< float > &inputVector, const SVDNoiseCalibrations &noiseCal)
 Store the input values for SVDSpacePoint selection from the given SVDCluster.
 
void findPossibleCombinations (const Belle2::ClustersOnSensor &aSensor, std::vector< std::vector< const SVDCluster * > > &foundCombinations, std::vector< std::pair< int, int > > &foundCombinationIndices, const SVDHitTimeSelection &hitTimeCut, const bool &useSVDGroupInfo, const int &numberOfSignalGroups, const bool &formSingleSignalGroup, const SVDNoiseCalibrations &noiseCal, const DBObjPtr< SVDSpacePointSNRFractionSelector > &svdSpacePointSelectionFunction, bool useSVDSpacePointSNRFractionSelector)
 stores all possible 2-Cluster-combinations.
 
void spPDFName (const VxdID &sensor, int uSize, int vSize, int maxClusterSize, std::string &PDFName, std::string &errorPDFName, bool useLegacyNaming)
 Function to set name of PDF for spacePoint quality estimation.
 
void calculatePairingProb (TFile *pdfFile, std::vector< const SVDCluster * > &clusters, double &prob, double &error, bool useLegacyNaming)
 Function to extract probability of correct (pair from signal hit) cluster pairing from preconfigured pdfs Probability defined as Pcharge * Ptime * Pucluster * Pvcluster.
 
template<class SpacePointType>
void provideSVDClusterCombinations (const StoreArray< SVDCluster > &svdClusters, StoreArray< SpacePointType > &spacePoints, SVDHitTimeSelection &hitTimeCut, bool useQualityEstimator, TFile *pdfFile, bool useLegacyNaming, unsigned int numMaxSpacePoints, std::string m_eventLevelTrackingInfoName, const bool &useSVDGroupInfo, const int &numberOfSignalGroups, const bool &formSingleSignalGroup, const SVDNoiseCalibrations &noiseCal, const DBObjPtr< SVDSpacePointSNRFractionSelector > &svdSpacePointSelectionFunction, bool useSVDSpacePointSNRFractionSelector)
 finds all possible combinations of U and V Clusters for SVDClusters.
 
double myGaus (const double *x, const double *par)
 Gauss function to be used in the fit.
 
void addGausToHistogram (TH1D &hist, const double &integral, const double &center, const double &sigma, const double &sigmaN, const bool &isAddition=true)
 Add (or Subtract) a Gaussian to (or from) a histogram.
 
void subtractGausFromHistogram (TH1D &hist, const double &integral, const double &center, const double &sigma, const double &sigmaN)
 Subtract a Gaussian from a histogram.
 
int getSensorType (const VxdID &sensorID)
 Get Sensor Type of SVD sensors.
 

Detailed Description

Typedef Documentation

◆ GroupInfo

typedef std::tuple<double, double, double> GroupInfo

typedef to be used to store Gauss parameters (integral, center, sigma)

Definition at line 39 of file SVDTimeGroupingModule.h.

Function Documentation

◆ addGausToHistogram()

void addGausToHistogram ( TH1D & hist,
const double & integral,
const double & center,
const double & sigma,
const double & sigmaN,
const bool & isAddition = true )
inline

Add (or Subtract) a Gaussian to (or from) a histogram.

The gauss is calculated upto the sigmaN passed to the function.

Definition at line 177 of file SVDTimeGroupingModule.h.

180 {
181 int startBin = hist.FindBin(center - sigmaN * sigma);
182 int endBin = hist.FindBin(center + sigmaN * sigma);
183 if (startBin < 1) startBin = 1;
184 if (endBin > (hist.GetNbinsX())) endBin = hist.GetNbinsX();
185
186 for (int ijx = startBin; ijx <= endBin; ijx++) {
187 double tbinc = hist.GetBinCenter(ijx);
188 double tbincontent = hist.GetBinContent(ijx);
189
190 if (isAddition) tbincontent += integral * TMath::Gaus(tbinc, center, sigma, true);
191 else tbincontent -= integral * TMath::Gaus(tbinc, center, sigma, true);
192
193 hist.SetBinContent(ijx, tbincontent);
194 }
195 }

◆ calculatePairingProb()

void calculatePairingProb ( TFile * pdfFile,
std::vector< const SVDCluster * > & clusters,
double & prob,
double & error,
bool useLegacyNaming )
inline

Function to extract probability of correct (pair from signal hit) cluster pairing from preconfigured pdfs Probability defined as Pcharge * Ptime * Pucluster * Pvcluster.

Definition at line 280 of file SpacePointHelperFunctions.h.

282 {
283
284 int maxSize;
285 int pdfEntries = pdfFile->GetListOfKeys()->GetSize();
286 if (useLegacyNaming == true) {
287 maxSize = floor(sqrt((pdfEntries - 4) / 6)); //4(time+size)+3(sensors)*2(prob/error)*size^2(u/v combo.)
288 } else {
289 maxSize = floor(sqrt((pdfEntries - 4) / 344)); //4(time+size)+172(sensorType)*2(prob/error)*size^2(u/v combo.)
290 }
291 std::string chargeProbInput;
292 std::string chargeErrorInput;
293
294 spPDFName(clusters[0]->getSensorID(), clusters[0]->getSize(), clusters[1]->getSize(), maxSize,
295 chargeProbInput, chargeErrorInput, useLegacyNaming);
296 std::string timeProbInput = "timeProb";
297 std::string timeErrorInput = "timeError";
298 std::string sizeProbInput = "sizeProb";
299 std::string sizeErrorInput = "sizeError";
300
301
302 TH2F* chargePDF = nullptr;
303 TH2F* chargeError = nullptr;
304 TH2F* timePDF = nullptr;
305 TH2F* timeError = nullptr;
306 TH2F* sizePDF = nullptr;
307 TH2F* sizeError = nullptr;
308
309 pdfFile->GetObject(chargeProbInput.c_str(), chargePDF);
310 pdfFile->GetObject(chargeErrorInput.c_str(), chargeError);
311 pdfFile->GetObject(timeProbInput.c_str(), timePDF);
312 pdfFile->GetObject(timeErrorInput.c_str(), timeError);
313 pdfFile->GetObject(sizeProbInput.c_str(), sizePDF);
314 pdfFile->GetObject(sizeErrorInput.c_str(), sizeError);
315
316 int xChargeBin = chargePDF->GetXaxis()->FindFixBin(clusters[0]->getCharge());
317 int yChargeBin = chargePDF->GetYaxis()->FindFixBin(clusters[1]->getCharge());
318
319 int xTimeBin = timePDF->GetXaxis()->FindFixBin(clusters[0]->getClsTime());
320 int yTimeBin = timePDF->GetYaxis()->FindFixBin(clusters[1]->getClsTime());
321
322
323 int xSizeBin = sizePDF->GetXaxis()->FindFixBin(clusters[0]->getSize());
324 int ySizeBin = sizePDF->GetYaxis()->FindFixBin(clusters[1]->getSize());
325
326 double chargeProb = chargePDF->GetBinContent(xChargeBin, yChargeBin);
327 double timeProb = timePDF->GetBinContent(xTimeBin, yTimeBin);
328 double sizeProb = sizePDF->GetBinContent(xSizeBin, ySizeBin);
329 double chargeProbError = chargePDF->GetBinContent(xChargeBin, yChargeBin);
330 double timeProbError = timePDF->GetBinContent(xTimeBin, yTimeBin);
331 double sizeProbError = sizePDF->GetBinContent(xSizeBin, ySizeBin);
332
333
334 if (chargeProbError == 0) {
335 B2DEBUG(21, "svdClusterProbabilityEstimator has not been run, spacePoint QI will return zero!");
336 }
337
338 prob = chargeProb * timeProb * sizeProb * clusters[0]->getQuality() * clusters[1]->getQuality();
339 error = prob * sqrt(pow(timeProb * sizeProb * clusters[0]->getQuality() * clusters[1]->getQuality() * chargeProbError, 2) +
340 pow(chargeProb * sizeProb * clusters[0]->getQuality() * clusters[1]->getQuality() * timeProbError, 2) +
341 pow(chargeProb * timeProb * clusters[0]->getQuality() * clusters[1]->getQuality() * sizeProbError, 2) +
342 pow(chargeProb * timeProb * sizeProb * clusters[1]->getQuality() * clusters[0]->getQualityError(), 2) +
343 pow(chargeProb * timeProb * sizeProb * clusters[0]->getQuality() * clusters[1]->getQualityError(), 2));
344 }
double sqrt(double a)
sqrt for double
Definition beamHelpers.h:28
void spPDFName(const VxdID &sensor, int uSize, int vSize, int maxClusterSize, std::string &PDFName, std::string &errorPDFName, bool useLegacyNaming)
Function to set name of PDF for spacePoint quality estimation.

◆ clusterPDFName()

void clusterPDFName ( const VxdID & sensor,
int size,
int side,
int maxClusterSize,
std::string & PDFName,
std::string & errorPDFName,
bool useLegacyNaming )
inline

Function to set name of PDF for cluster quality estimation.

Legacy naming convention for PDFs distributed by sensor type rather than sensor ID, not used after 2018 MC calibrated PDFs.

Definition at line 24 of file ClusterQualityHelperFunctions.h.

26 {
27 if (useLegacyNaming == true) {
28 std::string sensorSide;
29 if (side == 1) sensorSide = "u";
30 if (side == 0) sensorSide = "v";
31
32 if (size > maxClusterSize) size = maxClusterSize;
33 std::string sensorName;
34 if (sensor.getLayerNumber() == 3) sensorName = "l3";
35 if (sensor.getLayerNumber() > 3 && sensor.getSensorNumber() == 1) sensorName = "trap";
36 if (sensor.getLayerNumber() > 3 && sensor.getSensorNumber() > 1) sensorName = "large";
37
38 PDFName = sensorSide + sensorName + std::to_string(size);
39 errorPDFName = PDFName + "Error";
40 } else {
41
42 std::string sensorSide;
43 if (side == 1) sensorSide = "u";
44 if (side == 0) sensorSide = "v";
45 int layer = sensor.getLayerNumber();
46 int ladder = sensor.getLadderNumber();
47 int sens = sensor.getSensorNumber();
48
49 if (size > maxClusterSize) size = maxClusterSize;
50
51 PDFName = std::to_string(layer) + "." + std::to_string(ladder) + "." + std::to_string(sens) + "." + sensorSide + "." +
52 std::to_string(size);
53 errorPDFName = PDFName + "_Error";
54
55 }
56 }

◆ findPossibleCombinations()

void findPossibleCombinations ( const Belle2::ClustersOnSensor & aSensor,
std::vector< std::vector< const SVDCluster * > > & foundCombinations,
std::vector< std::pair< int, int > > & foundCombinationIndices,
const SVDHitTimeSelection & hitTimeCut,
const bool & useSVDGroupInfo,
const int & numberOfSignalGroups,
const bool & formSingleSignalGroup,
const SVDNoiseCalibrations & noiseCal,
const DBObjPtr< SVDSpacePointSNRFractionSelector > & svdSpacePointSelectionFunction,
bool useSVDSpacePointSNRFractionSelector )
inline

stores all possible 2-Cluster-combinations.

first parameter is a struct containing all clusters on current sensor. second parameter is the container which collects all combinations found.

for each u cluster, a v cluster is combined to a possible combination. Condition which has to be fulfilled: the first entry is always an u cluster, the second always a v-cluster

Definition at line 158 of file SpacePointHelperFunctions.h.

164 {
165
166 for (size_t iU = 0; iU < aSensor.clustersU.size(); ++iU) {
167 const SVDCluster* uCluster = aSensor.clustersU[iU];
168 if (! hitTimeCut.isClusterInTime(uCluster->getSensorID(), 1, uCluster->getClsTime())) {
169 B2DEBUG(29, "Cluster rejected due to timing cut. Cluster time: " << uCluster->getClsTime());
170 continue;
171 }
172 for (size_t iV = 0; iV < aSensor.clustersV.size(); ++iV) {
173 const SVDCluster* vCluster = aSensor.clustersV[iV];
174 if (! hitTimeCut.isClusterInTime(vCluster->getSensorID(), 0, vCluster->getClsTime())) {
175 B2DEBUG(29, "Cluster rejected due to timing cut. Cluster time: " << vCluster->getClsTime());
176 continue;
177 }
178
179 if (! hitTimeCut.areClusterTimesCompatible(vCluster->getSensorID(), uCluster->getClsTime(), vCluster->getClsTime())) {
180 B2DEBUG(29, "Cluster combination rejected due to timing cut. Cluster time U (" << uCluster->getClsTime() <<
181 ") is incompatible with Cluster time V (" << vCluster->getClsTime() << ")");
182 continue;
183 }
184
185 if (useSVDGroupInfo) {
186 const std::vector<int>& uTimeGroupId = uCluster->getTimeGroupId();
187 const std::vector<int>& vTimeGroupId = vCluster->getTimeGroupId();
188
189 if (int(uTimeGroupId.size()) && int(vTimeGroupId.size())) { // indirect check if the clusterizer module is disabled
190 bool isContinue = true;
191 for (auto& uitem : uTimeGroupId) {
192 if (uitem < 0 || uitem >= numberOfSignalGroups) continue;
193 for (auto& vitem : vTimeGroupId) {
194 if (vitem < 0 || vitem >= numberOfSignalGroups) continue;
195 if ((uitem == vitem) || formSingleSignalGroup) { isContinue = false; break; }
196 }
197 if (!isContinue) break;
198 }
199
200 if (isContinue) {
201 B2DEBUG(29, "Cluster combination rejected due to different time-group Id.");
202 continue;
203 }
204 }
205 }
206
207 if (useSVDSpacePointSNRFractionSelector) {
208 std::vector<float> inputU;
209 std::vector<float> inputV;
210
211 storeInputVectorFromSingleCluster(uCluster, inputU, noiseCal);
212 storeInputVectorFromSingleCluster(vCluster, inputV, noiseCal);
213
214 bool pass = svdSpacePointSelectionFunction->passSNRFractionSelection(inputU, inputV);
215 if (!pass) {
216 B2DEBUG(29, "Cluster combination rejected due to SVDSpacePointSNRFractionSelector");
217 continue;
218 }
219 }
220
221 foundCombinations.push_back({uCluster, vCluster});
222 foundCombinationIndices.emplace_back(aSensor.indicesU[iU], aSensor.indicesV[iV]);
223
224
225 }
226 }
227
228
229
230
231 }
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition SVDCluster.h:29
float getClsTime() const
Get average of waveform maximum times of cluster strip signals.
Definition SVDCluster.h:134
VxdID getSensorID() const
Get the sensor ID.
Definition SVDCluster.h:102
const std::vector< int > & getTimeGroupId() const
Get ID of the time-group.
Definition SVDCluster.h:184
bool isClusterInTime(const Belle2::VxdID &sensorID, const bool &isU, const double &svdTime, const double &svdTimeError=0, const double &t0=0, const double &t0Error=0) const
Return whether the cluster is estimated to be in time with the event or off-time.
bool areClusterTimesCompatible(const Belle2::VxdID &sensorID, const double &uTime, const double &vTime=0) const
Return whether the cluster is estimated to be in time with the event or off-time.
void storeInputVectorFromSingleCluster(const SVDCluster *cls, std::vector< float > &inputVector, const SVDNoiseCalibrations &noiseCal)
Store the input values for SVDSpacePoint selection from the given SVDCluster.
std::vector< const SVDCluster * > clustersU
stores all SVDclusters of U type.
std::vector< const SVDCluster * > clustersV
stores all SVDclusters of V type.
std::vector< int > indicesV
stores the StoreArray indices of the clusters in clustersV, in the same order
std::vector< int > indicesU
stores the StoreArray indices of the clusters in clustersU, in the same order

◆ getSensorType()

int getSensorType ( const VxdID & sensorID)
inline

Get Sensor Type of SVD sensors.

Definition at line 210 of file SVDTimeGroupingModule.h.

211 {
212 int layer = sensorID.getLayerNumber();
213 int sensor = sensorID.getSensorNumber();
214 if (layer == 3)
215 return 0;
216 else {
217 if (sensor == 1)
218 return 1;
219 else
220 return 2;
221 }
222 }
baseType getSensorNumber() const
Get the sensor id.
Definition VxdID.h:99
baseType getLayerNumber() const
Get the layer id.
Definition VxdID.h:95

◆ myGaus()

double myGaus ( const double * x,
const double * par )
inline

Gauss function to be used in the fit.

Definition at line 167 of file SVDTimeGroupingModule.h.

168 {
169 return par[0] * TMath::Gaus(x[0], par[1], par[2], true);
170 }

◆ occupancyPDFName()

void occupancyPDFName ( const VxdID & sensor,
int side,
std::string & PDFName )
inline

Function to maintain common naming convention between calibration occupancy file generation and occupancy value extraction in main crossTalkFinder module.

Definition at line 27 of file SVDCrossTalkFinderHelperFunctions.h.

28 {
29
30 int layer = sensor.getLayerNumber();
31 int ladder = sensor.getLadderNumber();
32 int sens = sensor.getSensorNumber();
33
34
35 PDFName = std::to_string(layer) + "." + std::to_string(ladder) + "." + std::to_string(sens) + "." + std::to_string(side);
36
37
38 }

◆ provideSVDClusterCombinations()

template<class SpacePointType>
void provideSVDClusterCombinations ( const StoreArray< SVDCluster > & svdClusters,
StoreArray< SpacePointType > & spacePoints,
SVDHitTimeSelection & hitTimeCut,
bool useQualityEstimator,
TFile * pdfFile,
bool useLegacyNaming,
unsigned int numMaxSpacePoints,
std::string m_eventLevelTrackingInfoName,
const bool & useSVDGroupInfo,
const int & numberOfSignalGroups,
const bool & formSingleSignalGroup,
const SVDNoiseCalibrations & noiseCal,
const DBObjPtr< SVDSpacePointSNRFractionSelector > & svdSpacePointSelectionFunction,
bool useSVDSpacePointSNRFractionSelector )

finds all possible combinations of U and V Clusters for SVDClusters.

first parameter is a storeArray containing SVDClusters. second parameter is a storeArra containing SpacePoints (will be filled in the function). third parameter tels the spacePoint where to get the name of the storeArray containing the related clusters relationweights code the type of the cluster. +1 for u and -1 for v

Definition at line 353 of file SpacePointHelperFunctions.h.

359 {
360 std::unordered_map<VxdID::baseType, ClustersOnSensor>
361 activatedSensors; // collects one entry per sensor, each entry will contain all Clusters on it TODO: better to use a sorted vector/list?
362 std::vector<std::vector<const SVDCluster*> >
363 foundCombinations; // collects all combinations of Clusters which were possible (condition: 1u+1v-Cluster on the same sensor)
364 std::vector<std::pair<int, int> >
365 foundCombinationIndices; // StoreArray indices of the (u, v) clusters of each entry of foundCombinations
366
367 // sort Clusters by sensor. After the loop, each entry of activatedSensors contains all U and V-type clusters on that sensor
368 for (unsigned int i = 0; i < uint(svdClusters.getEntries()); ++i) {
369 SVDCluster* currentCluster = svdClusters[i];
370
371 activatedSensors[currentCluster->getSensorID().getID()].addCluster(currentCluster, i);
372 }
373
374 for (auto& aSensor : activatedSensors)
375 findPossibleCombinations(aSensor.second, foundCombinations, foundCombinationIndices, hitTimeCut, useSVDGroupInfo,
376 numberOfSignalGroups, formSingleSignalGroup, noiseCal, svdSpacePointSelectionFunction,
377 useSVDSpacePointSNRFractionSelector);
378
379 // Do not make space-points if their number would be too large to be considered by tracking
380 if (foundCombinations.size() > numMaxSpacePoints) {
381 StoreObjPtr<EventLevelTrackingInfo> m_eventLevelTrackingInfo(m_eventLevelTrackingInfoName);
382 if (m_eventLevelTrackingInfo.isValid()) {
383 m_eventLevelTrackingInfo->setSVDSpacePointCreatorAbortionFlag();
384 }
385 return;
386 }
387
388 // RelationArray is much cheaper than addRelationTo
389 // The relation weight codes the type of the cluster: +1 for u and -1 for v.
390 RelationArray spacePointsToClusters(spacePoints, svdClusters);
391
392 for (size_t iCombi = 0; iCombi < foundCombinations.size(); ++iCombi) {
393 auto& clusterCombi = foundCombinations[iCombi];
394 const int spacePointIndex = spacePoints.getEntries();
395 SpacePointType* newSP = spacePoints.appendNew(clusterCombi);
396 if (useQualityEstimator == true) {
397 double probability;
398 double error;
399 calculatePairingProb(pdfFile, clusterCombi, probability, error, useLegacyNaming);
400 newSP->setQualityEstimation(probability);
401 newSP->setQualityEstimationError(error);
402 }
403 // the first cluster of the combination is always the u one, the second one the v one
404 spacePointsToClusters.add(spacePointIndex, foundCombinationIndices[iCombi].first, 1.);
405 spacePointsToClusters.add(spacePointIndex, foundCombinationIndices[iCombi].second, -1.);
406 }
407 }
Low-level class to create/modify relations between StoreArrays.
T * appendNew()
Construct a new T object at the end of the array.
Definition StoreArray.h:246
int getEntries() const
Get the number of objects in the array.
Definition StoreArray.h:216
baseType getID() const
Get the unique id.
Definition VxdID.h:93
void findPossibleCombinations(const Belle2::ClustersOnSensor &aSensor, std::vector< std::vector< const SVDCluster * > > &foundCombinations, std::vector< std::pair< int, int > > &foundCombinationIndices, const SVDHitTimeSelection &hitTimeCut, const bool &useSVDGroupInfo, const int &numberOfSignalGroups, const bool &formSingleSignalGroup, const SVDNoiseCalibrations &noiseCal, const DBObjPtr< SVDSpacePointSNRFractionSelector > &svdSpacePointSelectionFunction, bool useSVDSpacePointSNRFractionSelector)
stores all possible 2-Cluster-combinations.
void calculatePairingProb(TFile *pdfFile, std::vector< const SVDCluster * > &clusters, double &prob, double &error, bool useLegacyNaming)
Function to extract probability of correct (pair from signal hit) cluster pairing from preconfigured ...

◆ provideSVDClusterSingles()

template<class SpacePointType>
void provideSVDClusterSingles ( const StoreArray< SVDCluster > & svdClusters,
StoreArray< SpacePointType > & spacePoints )

simply store one spacePoint for each existing SVDCluster.

first parameter is a storeArray containing SVDClusters. second parameter is a storeArra containing SpacePoints (will be filled in the function).

Definition at line 96 of file SpacePointHelperFunctions.h.

98 {
99 // RelationArray is much cheaper than addRelationTo
100 RelationArray spacePointsToClusters(spacePoints, svdClusters);
101 for (unsigned int i = 0; i < uint(svdClusters.getEntries()); ++i) {
102 const SVDCluster* currentCluster = svdClusters[i];
103 std::vector<const SVDCluster*> currentClusterCombi = { currentCluster };
104 const int spacePointIndex = spacePoints.getEntries();
105 spacePoints.appendNew(currentClusterCombi);
106 spacePointsToClusters.add(spacePointIndex, i);
107 }
108 }

◆ spPDFName()

void spPDFName ( const VxdID & sensor,
int uSize,
int vSize,
int maxClusterSize,
std::string & PDFName,
std::string & errorPDFName,
bool useLegacyNaming )
inline

Function to set name of PDF for spacePoint quality estimation.

Legacy naming convention for PDFs distributed by sensor type rather than sensor ID, not used after 2018 MC calibrated PDFs.

Definition at line 238 of file SpacePointHelperFunctions.h.

240 {
241 if (useLegacyNaming == true) {
242
243 if (uSize > maxClusterSize) uSize = maxClusterSize;
244 if (vSize > maxClusterSize) vSize = maxClusterSize;
245
246 std::string sensorName;
247
248 if (sensor.getLayerNumber() == 3) sensorName = "l3";
249 if (sensor.getLayerNumber() > 3 && sensor.getSensorNumber() == 1) sensorName = "trap";
250 if (sensor.getLayerNumber() > 3 && sensor.getSensorNumber() > 1) sensorName = "large";
251
252 PDFName = sensorName + std::to_string(uSize) + std::to_string(vSize);
253 errorPDFName = "error" + PDFName;
254 } else {
255
256 if (uSize > maxClusterSize) uSize = maxClusterSize;
257 if (vSize > maxClusterSize) vSize = maxClusterSize;
258
259 int layer = sensor.getLayerNumber();
260 int ladder = sensor.getLadderNumber();
261 int sens = sensor.getSensorNumber();
262
263 PDFName = std::to_string(layer) + "." + std::to_string(ladder) + "." + std::to_string(sens) + "." + std::to_string(
264 uSize) + "." + std::to_string(vSize);
265 errorPDFName = PDFName + "_Error";
266 }
267
268
269
270 }

◆ storeInputVectorFromSingleCluster()

void storeInputVectorFromSingleCluster ( const SVDCluster * cls,
std::vector< float > & inputVector,
const SVDNoiseCalibrations & noiseCal )
inline

Store the input values for SVDSpacePoint selection from the given SVDCluster.

Definition at line 113 of file SpacePointHelperFunctions.h.

116 {
117 inputVector.clear();
118 inputVector.resize(3, 0.0);
119
120 auto shaperDigits = cls->getRelationsTo<SVDShaperDigit>();
121 float noise = 0;
122 for (auto iSD : shaperDigits) {
123 auto samples = iSD.getSamples();
124 std::vector<float> selectedSamples;
125 if (samples.size() == 6) {
126 Belle2::SVD::SVDMaxSumAlgorithm maxSum(samples);
127 auto maxSamples = maxSum.getSelectedSamples();
128 selectedSamples.assign(maxSamples.begin(), maxSamples.end());
129 } else {
130 selectedSamples.assign(samples.begin(), samples.end());
131 }
132 if (selectedSamples.size() < 3) continue;
133
134 inputVector[0] += selectedSamples[0];
135 inputVector[1] += selectedSamples[1];
136 inputVector[2] += selectedSamples[2];
137
138 VxdID thisSensorID = iSD.getSensorID();
139 bool thisSide = iSD.isUStrip();
140 int thisCellID = iSD.getCellID();
141 float thisNoise = noiseCal.getNoise(thisSensorID, thisSide, thisCellID);
142 noise += thisNoise * thisNoise;
143 }
144 noise = sqrt(noise);
145 inputVector[0] = inputVector[0] / noise;
146 inputVector[1] = inputVector[1] / noise;
147 inputVector[2] = inputVector[2] / noise;
148 }
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
float getNoise(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This is the method for getting the noise.
The SVD ShaperDigit class.
Class implementing the MaxSum algorithm.
Class to uniquely identify a any structure of the PXD and SVD.
Definition VxdID.h:32

◆ subtractGausFromHistogram()

void subtractGausFromHistogram ( TH1D & hist,
const double & integral,
const double & center,
const double & sigma,
const double & sigmaN )
inline

Subtract a Gaussian from a histogram.

The gauss is calculated upto the sigmaN passed to the function.

Definition at line 202 of file SVDTimeGroupingModule.h.

205 {
206 addGausToHistogram(hist, integral, center, sigma, sigmaN, false);
207 }
void addGausToHistogram(TH1D &hist, const double &integral, const double &center, const double &sigma, const double &sigmaN, const bool &isAddition=true)
Add (or Subtract) a Gaussian to (or from) a histogram.