BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
compareS.C File Reference
#include "TAxis.h"
#include "TCanvas.h"
#include "TGraph.h"
#include "TGraphErrors.h"
#include "TMultiGraph.h"
#include "TPad.h"
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <vector>
#include "TLine.h"
#include "TString.h"
#include <nlohmann/json.hpp>
Include dependency graph for compareS.C:

Go to the source code of this file.

Classes

struct  CmpSolution

Macros

#define PARAM_CNT   6
#define RES_X   1920
#define RES_Y   1080
#define PADS_X   3
#define PADS_Y   2

Functions

static Bool_t LoadCmpSolution (const char *path, CmpSolution &sol)
int compareS (const char *obtainedPath="/home/igor/bmnroot/align_new/cfg/solutions/sl9555.112e_lin3.04.json", const char *precisePath="/home/igor/data.cache/tt9555.112e_lin3.04.solution.json", const char *pdfPath=nullptr)
 Visual comparison of two alignment solutions.

Variables

static constexpr const char * PARAM_NAMES [PARAM_CNT]
static constexpr const char * PARAM_TITLES [PARAM_CNT]
static constexpr const Double_t PARAM_RANGES [PARAM_CNT] {0.25, 0.25, 0.25, 0.02, 0.02, 0.02}

Macro Definition Documentation

◆ PADS_X

#define PADS_X   3

Definition at line 55 of file compareS.C.

◆ PADS_Y

#define PADS_Y   2

Definition at line 56 of file compareS.C.

◆ PARAM_CNT

#define PARAM_CNT   6

Definition at line 45 of file compareS.C.

Referenced by compareS(), histo(), histoGL(), and LoadCmpSolution().

◆ RES_X

#define RES_X   1920

Definition at line 53 of file compareS.C.

◆ RES_Y

#define RES_Y   1080

Definition at line 54 of file compareS.C.

Function Documentation

◆ compareS()

int compareS ( const char * obtainedPath = "/home/igor/bmnroot/align_new/cfg/solutions/sl9555.112e_lin3.04.json",
const char * precisePath = "/home/igor/data.cache/tt9555.112e_lin3.04.solution.json",
const char * pdfPath = nullptr )

Both files are read in the format BmnAligner::SaveSolution writes. Typical use is checking an obtained solution against a known truth, such as the one makett.C saves next to a synthetic task.

Parameters
obtainedPath.json solution under test
precisePath.json solution to compare it against
pdfPath.pdf file to save the canvas into, null to only display
Returns
0 on success, 1 if either solution could not be loaded

Definition at line 129 of file compareS.C.

References TMultiGraph::Add(), TPad::cd(), d, TMultiGraph::Draw(), TObject::Draw(), TPad::Draw(), CmpSolution::errors, fabs(), TMultiGraph::GetXaxis(), TMultiGraph::GetYaxis(), i, CmpSolution::ids, LoadCmpSolution(), nDet, PADS_X, PADS_Y, PARAM_CNT, PARAM_NAMES, PARAM_RANGES, PARAM_TITLES, RES_X, RES_Y, TPad::SaveAs(), TCanvas::SetCanvasSize(), TAttFill::SetFillColor(), TAxis::SetLimits(), TAttLine::SetLineColor(), TAttLine::SetLineStyle(), TAttLine::SetLineWidth(), TAttMarker::SetMarkerColor(), TAttMarker::SetMarkerStyle(), TNamed::SetName(), TAttAxis::SetNdivisions(), TAxis::SetRangeUser(), TNamed::SetTitle(), CmpSolution::values, and x.

Here is the call graph for this function:

◆ LoadCmpSolution()

Bool_t LoadCmpSolution ( const char * path,
CmpSolution & sol )
static

Definition at line 65 of file compareS.C.

References CmpSolution::errors, CmpSolution::ids, PARAM_CNT, v, CmpSolution::values, and x.

Referenced by compareS().

Here is the caller graph for this function:

Variable Documentation

◆ PARAM_NAMES

const char* PARAM_NAMES[PARAM_CNT]
staticconstexpr
Initial value:
{"dX", "dY", "dZ",
"phi", "theta", "psi"}

Definition at line 46 of file compareS.C.

Referenced by compareS(), histo(), and histoGL().

◆ PARAM_RANGES

const Double_t PARAM_RANGES[PARAM_CNT] {0.25, 0.25, 0.25, 0.02, 0.02, 0.02}
staticconstexpr

Definition at line 50 of file compareS.C.

Referenced by compareS().

◆ PARAM_TITLES

const char* PARAM_TITLES[PARAM_CNT]
staticconstexpr
Initial value:
{"X shift, cm", "Y shift, cm", "Z shift, cm",
"phi rotation, rad", "theta rotation, rad", "psi rotation, rad"}

Definition at line 48 of file compareS.C.

Referenced by compareS().