8#include <svd/calibration/SVDOccupancyCalibrationsAlgorithm.h>
10#include <svd/calibration/SVDOccupancyCalibrations.h>
12#include <framework/logging/Logger.h>
24 setDescription(
"Calibration algorithm for SVDOccupancyCalibrations payloads");
34 auto tree = getObjectPtr<TTree>(
"HTreeOccupancyCalib");
36 TH1F* hocc =
new TH1F(
"",
"", 768, 0, 768);
39 B2WARNING(
"No tree object.");
40 }
else if (!tree->GetEntries()) {
41 B2WARNING(
"No data in the tree.");
49 tree->SetBranchAddress(
"hist", &hocc);
50 tree->SetBranchAddress(
"layer", &layer);
51 tree->SetBranchAddress(
"ladder", &ladder);
52 tree->SetBranchAddress(
"sensor", &sensor);
53 tree->SetBranchAddress(
"view", &side);
55 for (
int i = 0; i < tree->GetEntries(); i++) {
59 if (!side && layer != 3) nstrips = 512;
61 for (
int iterStrip = 0; iterStrip < nstrips; iterStrip++) {
62 occCal = hocc->GetBinContent(iterStrip + 1);
64 payload->set(layer, ladder, sensor,
bool(side), iterStrip, occCal);
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.
std::string m_id
identifier
virtual EResult calibrate() override
Run algo on data.
SVDOccupancyCalibrationsAlgorithm(const std::string &str)
Constructor set the prefix to SVDOccupancyCalibrationsCollector.
SVDCalibrationsBase< SVDCalibrationsVector< float > > t_payload
typedef of the Occupancy payload of all SVD strips
Abstract base class for different kinds of events.