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