10#include <ecl/calibration/eclAutocovarianceCalibrationC4Algorithm.h>
13#include <ecl/dataobjects/ECLElementNumbers.h>
28 "Perform validation of coveriance matrix calibration"
41 auto Chi2VsCrysID = getObjectPtr<TH2F>(
"Chi2VsCrysID");
43 std::vector<double> cryIDs;
44 std::vector<double> means;
45 std::vector<double> RMSs;
46 std::vector<double> counts;
50 TH1F* hChi2 = (TH1F*)Chi2VsCrysID->ProjectionY(
"hChi2", crysID + 1, crysID + 1);
52 int totalCounts = hChi2->GetEntries();
55 B2INFO(
"eclAutocovarianceCalibrationC4Algorithm: Warning Below Count Limit: crysID totalCounts m_minEntries: " << crysID <<
" " <<
59 float mean = hChi2->GetMean();
61 cryIDs.push_back(crysID + 1);
62 means.push_back(mean);
63 RMSs.push_back(hChi2->GetRMS());
64 counts.push_back(totalCounts);
69 auto gMeanVsCrysID =
new TGraph(cryIDs.size(), cryIDs.data(), means.data());
70 gMeanVsCrysID->SetName(
"gMeanVsCrysID");
71 gMeanVsCrysID->SetMarkerStyle(20);
72 auto gRMSVsCrysID =
new TGraph(cryIDs.size(), cryIDs.data(), RMSs.data());
73 gRMSVsCrysID->SetName(
"gRMSVsCrysID");
74 gRMSVsCrysID->SetMarkerStyle(20);
75 auto gCountsVsCrysID =
new TGraph(cryIDs.size(), cryIDs.data(), counts.data());
76 gCountsVsCrysID->SetName(
"gCountsVsCrysID");
77 gCountsVsCrysID->SetMarkerStyle(20);
81 TDirectory::TContext context;
82 TFile* histfile =
new TFile(fName,
"recreate");
84 gMeanVsCrysID->Write();
85 gRMSVsCrysID->Write();
86 gCountsVsCrysID->Write();
87 Chi2VsCrysID->Write();
Base class for calibration algorithms.
void setDescription(const std::string &description)
Set algorithm description (in constructor)
EResult
The result of calibration.
@ c_OK
Finished successfully =0 in Python.
int m_minEntries
Minimum entries to fit a crystal.
std::string m_outputName
file name for histogram output
eclAutocovarianceCalibrationC4Algorithm()
..Constructor
virtual EResult calibrate() override
..Run algorithm on events
const int c_NCrystals
Number of crystals.
Abstract base class for different kinds of events.