9#include <svd/calibration/SVDCrossTalkCalibrationsAlgorithm.h>
10#include <svd/calibration/SVDCrossTalkStripsCalibrations.h>
21 setDescription(
"Calibration algorithm for SVDCrossTalkCalibrations payload");
27 int isCrossTalkCal = 0;
30 auto tree = getObjectPtr<TTree>(
"HTreeCrossTalkCalib");
32 TH1F* hist =
new TH1F(
"",
"", 768, 0, 768);
36 }
else if (!tree->GetEntries()) {
37 B2WARNING(
"Empty tree");
45 tree->SetBranchAddress(
"hist", &hist);
46 tree->SetBranchAddress(
"layer", &layer);
47 tree->SetBranchAddress(
"ladder", &ladder);
48 tree->SetBranchAddress(
"sensor", &sensor);
49 tree->SetBranchAddress(
"side", &side);
53 for (
int i = 0; i < tree->GetEntries(); i++) {
57 if (side == 0 && layer != 3) nstrips = 512;
59 for (
int strip = 0; strip < nstrips; strip++) {
61 isCrossTalkCal = hist->GetBinContent(strip + 1);
63 if (layer == 4 && ladder == 1 && sensor == 2 && side == 1
65 std::cout <<
"Not enough Data: " << hist->GetEntries() <<
" entries found" << std::endl;
69 payload->set(layer, ladder, sensor, side, strip, isCrossTalkCal);
Base class for calibration algorithms.
void saveCalibration(TClonesArray *data, const std::string &name)
Store DBArray payload with given name with default IOV.
void setDescription(const std::string &description)
Set algorithm description (in constructor)
EResult
The result of calibration.
@ c_OK
Finished successfully =0 in Python.
@ c_NotEnoughData
Needs more data =2 in Python.
int m_minEntries
Minimum number of required entries for collector histogram L4.1.2 u-side.
std::string m_id
Identifier string.
SVDCrossTalkCalibrationsAlgorithm(const std::string &str)
Constructor
virtual EResult calibrate() override
Run algo on data.
SVDCalibrationsBase< SVDCalibrationsBitmap > t_payload
typedef of the SVDCrossTalkStripsCalibrations payload for all SVD strips
Abstract base class for different kinds of events.