9#include <alignment/calibration/MillepedeTreeConversionAlgorithm.h>
11#include <genfit/GblData.h>
31 const int max_entries = 100;
33 std::vector<gbl::GblData>* dat = NULL;
34 std::vector<gbl::GblData>::iterator it;
36 std::vector<unsigned int>* indLocal;
37 std::vector<int>* labGlobal;
38 std::vector<double>* derLocal, *derGlobal;
39 float value, error, der[max_entries];
40 int nlab, label[max_entries];
41 auto gblData = getObjectPtr<TTree>(
"GblDataTree");
42 gblData->SetBranchAddress(
"GblData", &dat);
43 TFile* f_out =
new TFile(
m_OutputFile.c_str(),
"recreate");
44 TTree* t_out =
new TTree(
"mille",
"");
45 t_out->Branch(
"value", &value,
"value/F");
46 t_out->Branch(
"error", &error,
"error/F");
47 t_out->Branch(
"nlab", &nlab,
"nlab/I");
48 t_out->Branch(
"label", label,
"label[nlab]/I");
49 t_out->Branch(
"der", der,
"der[nlab]/F");
50 n = gblData->GetEntries();
51 for (i = 0; i < n; i++) {
53 for (it = dat->begin(); it != dat->end(); ++it) {
54 it->getAllData(aValue, aErr, indLocal, derLocal, labGlobal, derGlobal);
55 if (labGlobal->size() == 0)
59 nlab = std::min((
int)labGlobal->size(), max_entries);
60 for (j = 0; j < nlab; j++) {
61 label[j] = (*labGlobal)[j];
62 der[j] = (*derGlobal)[j];
Base class for calibration algorithms.
EResult
The result of calibration.
@ c_OK
Finished successfully =0 in Python.
std::string m_OutputFile
Output file name.
~MillepedeTreeConversionAlgorithm()
Destructor.
void setOutputFile(const char *outputFile)
Set output file name.
MillepedeTreeConversionAlgorithm()
Constructor.
CalibrationAlgorithm::EResult calibrate() override
Calibration.
Abstract base class for different kinds of events.