Belle II Software development
PXDAnalyticGainCalibrationAlgorithm.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#include <calibration/CalibrationAlgorithm.h>
11#include <vxd/dataobjects/VxdID.h>
12#include <vector>
13
14// ROOT
15#include <TH1.h>
16
17
18namespace Belle2 {
27 public:
28
31
34
37
40
43
46
49
52
54 void setBoundaries(const std::vector<Calibration::ExpRun>& boundaries) {m_requestedBoundaries = boundaries;}
55
57 std::vector<Calibration::ExpRun> getBoundaries() const {return m_requestedBoundaries;}
58
59 protected:
60
62 virtual EResult calibrate() override;
63
65 virtual bool isBoundaryRequired(const Calibration::ExpRun& /*currentRun*/) override;
66
68 // We reset the temporary boundaries list to be the same as the requested one.
69 virtual void boundaryFindingSetup(std::vector<Calibration::ExpRun> /*runs*/, int /*iteration = 0*/) override
70 {
72 };
73
74 private:
75
77 double EstimateGain(VxdID sensorID, unsigned short uBin, unsigned short vBin, TH1* hist = nullptr);
78
80 //double CalculateMedian(std::vector<double>& signals);
81
83 //double CalculateMedian(TH1* hist);
84
86 //double FitLandau(std::vector<double>& signals);
87
89 //double FitLandau(TH1* hist);
90
92 double GetCurrentGainFromDB(VxdID sensorID, unsigned short uBin, unsigned short vBin);
93
95 std::vector<Calibration::ExpRun> m_requestedBoundaries;
96
97 };
99} // namespace Belle2
100
101
Base class for calibration algorithms.
std::vector< Calibration::ExpRun > m_boundaries
When using the boundaries functionality from isBoundaryRequired, this is used to store the boundaries...
EResult
The result of calibration.
Class implementing the PXD gain calibration algorithm.
PXDAnalyticGainCalibrationAlgorithm()
Constructor set the prefix to PXDAnalyticGainCalibrationAlgorithm.
double GetCurrentGainFromDB(VxdID sensorID, unsigned short uBin, unsigned short vBin)
Retrive current gain value from pulled in data base payload.
bool correctForward
Flag to update default gains in forward region due to low statistics.
int minClusters
Minimum number of collected clusters for estimating gains.
virtual void boundaryFindingSetup(std::vector< Calibration::ExpRun >, int) override
What we do before isBoundaryRequired gets called.
std::vector< Calibration::ExpRun > getBoundaries() const
getter for current boundaries
void setBoundaries(const std::vector< Calibration::ExpRun > &boundaries)
Setter for boundaries.
double EstimateGain(VxdID sensorID, unsigned short uBin, unsigned short vBin, TH1 *hist=nullptr)
Estimate gain as ratio of medians from MC and data for a part of PXD.
virtual EResult calibrate() override
Run algo on data.
int strategy
strategy to used for gain calibration, 0 for medians, 1 for landau fit
float safetyFactor
Safety factor for determining whether the collected number of clusters is enough.
bool useChargeRatioHistogram
Flag to use histogram of charge ratio (relative to expected MPV)
std::vector< Calibration::ExpRun > m_requestedBoundaries
During findPayloadBoundaries and isBoundaryRequired this is used to define the boundaries we want.
bool forceContinue
Force continue in low statistics runs instead of returning c_NotEnoughData.
virtual bool isBoundaryRequired(const Calibration::ExpRun &) override
Decide if a run should be a payload boundary. Only used in certain Python Algorithm Starategies.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.