BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
histoGL.C File Reference
#include "BmnAlignModels.h"
#include "BmnRootIterator.h"
#include "BmnSimpleProgressBar.h"
#include "BmnWeightedLine.h"
#include <TCanvas.h>
#include <TF1.h>
#include <TGraph.h>
#include <TGraphErrors.h>
#include <TH1D.h>
#include <TH2D.h>
#include <TLine.h>
#include <TPad.h>
#include <TPaveText.h>
#include <TProfile.h>
#include <TROOT.h>
#include <TString.h>
#include <TStyle.h>
#include <TSystem.h>
#include <algorithm>
#include <array>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
#include <termios.h>
#include <unistd.h>
Include dependency graph for histoGL.C:

Go to the source code of this file.

Classes

struct  LinAcc
struct  DetAcc
struct  DetDraw
struct  EvoHist
struct  Panel

Macros

#define PARAM_CNT   6
#define RES_X   3440
#define RES_Y   1440
#define PADS_X   4
#define PADS_Y   3
#define RESIDUAL_RANGE_X   0.02
#define RESIDUAL_RANGE_Y   0.4
#define RESIDUAL_BINS   201
#define PROFILE_BINS   201
#define PAVE_TEXT_SIZE   0.04
#define EVO_DENSE_HEAD   200
#define EVO_TAIL_POINTS   600

Enumerations

enum  eParam {
  P_dX , P_dY , P_dZ , P_phi ,
  P_theta , P_psi
}
enum  eDrawMode { DM_PROFILE , DM_SCATTER , DM_MIX }

Functions

static void histoGLSetRawMode (bool on, struct termios *saved)
int histoGL (const char *fileListPath="/home/igor/bmnroot/align_new/cfg/run8/7466.noa_rlerr.list", Int_t selParam=P_dZ, Int_t drawMode=DM_MIX, const char *pdfPath=nullptr)
 Whole-detector histogramming estimate of the alignment corrections.

Variables

static constexpr const char * PARAM_NAMES [PARAM_CNT] {"dX", "dY", "dZ", "phi", "theta", "psi"}
static constexpr const char * PARAM_UNIT [PARAM_CNT] {"cm", "cm", "cm", "rad", "rad", "rad"}
static constexpr const Bool_t PARAM_IS_SHIFT [PARAM_CNT] {kTRUE, kTRUE, kFALSE, kFALSE, kFALSE, kFALSE}
static constexpr const Double_t PARAM_SIGN_X [PARAM_CNT] {+1.0, +1.0, -1.0, -1.0, +1.0, -1.0}
static constexpr const Double_t PARAM_SIGN_Y [PARAM_CNT] {+1.0, +1.0, -1.0, -1.0, +1.0, +1.0}
static constexpr const char * PARAM_DIAG [PARAM_CNT]
static constexpr const char * PARAM_DIAG_Y [PARAM_CNT]
static constexpr const char * COV_TITLE_X [PARAM_CNT]
static constexpr const char * COV_TITLE_Y [PARAM_CNT]

Macro Definition Documentation

◆ EVO_DENSE_HEAD

#define EVO_DENSE_HEAD   200

Definition at line 158 of file histoGL.C.

Referenced by histoGL().

◆ EVO_TAIL_POINTS

#define EVO_TAIL_POINTS   600

Definition at line 159 of file histoGL.C.

Referenced by histoGL().

◆ PADS_X

#define PADS_X   4

Definition at line 145 of file histoGL.C.

◆ PADS_Y

#define PADS_Y   3

Definition at line 146 of file histoGL.C.

◆ PARAM_CNT

#define PARAM_CNT   6

Definition at line 81 of file histoGL.C.

Referenced by EvoHist::Sample().

◆ PAVE_TEXT_SIZE

#define PAVE_TEXT_SIZE   0.04

Definition at line 153 of file histoGL.C.

◆ PROFILE_BINS

#define PROFILE_BINS   201

Definition at line 152 of file histoGL.C.

◆ RES_X

#define RES_X   3440

Definition at line 143 of file histoGL.C.

◆ RES_Y

#define RES_Y   1440

Definition at line 144 of file histoGL.C.

◆ RESIDUAL_BINS

#define RESIDUAL_BINS   201

Definition at line 151 of file histoGL.C.

◆ RESIDUAL_RANGE_X

#define RESIDUAL_RANGE_X   0.02

Definition at line 149 of file histoGL.C.

◆ RESIDUAL_RANGE_Y

#define RESIDUAL_RANGE_Y   0.4

Definition at line 150 of file histoGL.C.

Enumeration Type Documentation

◆ eDrawMode

enum eDrawMode
Enumerator
DM_PROFILE 
DM_SCATTER 
DM_MIX 

Definition at line 133 of file histoGL.C.

◆ eParam

enum eParam
Enumerator
P_dX 
P_dY 
P_dZ 
P_phi 
P_theta 
P_psi 

Definition at line 82 of file histoGL.C.

Function Documentation

◆ histoGL()

int histoGL ( const char * fileListPath = "/home/igor/bmnroot/align_new/cfg/run8/7466.noa_rlerr.list",
Int_t selParam = P_dZ,
Int_t drawMode = DM_MIX,
const char * pdfPath = nullptr )

Companion to histo.C: the same reading rules, but every hit of the detector is pooled into one histogram set, so the numbers are ensemble corrections rather than per-element ones. Useful for judging a global shift or rotation of the whole assembly.

Parameters
fileListPathtext file listing the .root files to read
selParamcorrection shown in the two evolution panels, one of the P_dX .. P_psi constants
drawModeslope panel style: DM_PROFILE, DM_SCATTER or DM_MIX
pdfPath.pdf file to save the canvas into, null to only display
Returns
0 on success, non-zero if the input data could not be read

Definition at line 260 of file histoGL.C.

References BmnWeightedLine::Add(), TH1::AddDirectory(), TPaveText::AddText(), BmnWeightedLine::At0(), DetDraw::betaX, DetDraw::betaXX, DetDraw::betaXY, DetDraw::betaY, DetDraw::betaYX, DetDraw::betaYY, BmnDefaultHitFilter(), BmnDefaultTrackFilter(), TCanvas::cd(), TPad::cd(), BmnSimpleProgressBar::Clear(), TPad::Clear(), BmnRootIterator::CountElements(), COV_TITLE_X, COV_TITLE_Y, BmnWeightedLine::Det(), DM_MIX, DM_PROFILE, DM_SCATTER, TGraph::Draw(), TH1::Draw(), TObject::Draw(), TPad::Draw(), TPaveText::Draw(), BmnDataIterator::EndOfHits(), BmnDataIterator::EndOfTracks(), EvoHist::errX, EvoHist::errY, EVO_DENSE_HEAD, EVO_TAIL_POINTS, TH1::Fill(), TH2::Fill(), TProfile::Fill(), TH1::Fit(), TH1::GetFunction(), TH1::GetMaximum(), TH1::GetMean(), BmnRootIterator::GetTotalTracks(), TGraph::GetXaxis(), histoGLSetRawMode(), BmnRootIterator::HitWx(), BmnRootIterator::HitWy(), BmnRootIterator::HitX(), BmnRootIterator::HitY(), BmnRootIterator::HitZ(), i, BmnDetectorModel::Init(), BmnSimpleProgressBar::Init(), BmnDataIterator::Initialized(), LinAcc::line, TPad::Modified(), BmnWeightedLine::N(), EvoHist::n, BmnRootIterator::NextHit(), BmnRootIterator::NextTrack(), P_dX, P_dY, P_dZ, P_phi, P_psi, P_theta, PADS_X, PADS_Y, PARAM_CNT, PARAM_DIAG, PARAM_DIAG_Y, PARAM_NAMES, PARAM_SIGN_X, PARAM_SIGN_Y, PARAM_UNIT, PAVE_TEXT_SIZE, PROFILE_BINS, RES_X, RES_Y, BmnRootIterator::ResetAll(), BmnRootIterator::ResetHits(), RESIDUAL_BINS, RESIDUAL_RANGE_X, RESIDUAL_RANGE_Y, DetDraw::rx, DetDraw::ry, EvoHist::Sample(), TPad::SaveAs(), TObject::SetBit(), TCanvas::SetCanvasSize(), TAttFill::SetFillColor(), TAttFill::SetFillColorAlpha(), TPad::SetGridx(), TPad::SetGridy(), TAxis::SetLimits(), TAttLine::SetLineColor(), TAttLine::SetLineStyle(), TAttLine::SetLineWidth(), TPad::SetLogx(), TAttMarker::SetMarkerColor(), TAttMarker::SetMarkerStyle(), TGraph::SetMaximum(), TGraph::SetMinimum(), TGraph::SetPoint(), TGraphErrors::SetPointError(), TH1::SetStats(), TAttText::SetTextSize(), TGraph::SetTitle(), BmnWeightedLine::Slope(), TCanvas::Update(), TPad::Update(), EvoHist::valX, EvoHist::valY, DetAcc::x, DetDraw::xBar, DetAcc::y, DetDraw::yBar, yhi, and z.

Here is the call graph for this function:

◆ histoGLSetRawMode()

void histoGLSetRawMode ( bool on,
struct termios * saved )
static

Definition at line 216 of file histoGL.C.

Referenced by histoGL().

Here is the caller graph for this function:

Variable Documentation

◆ COV_TITLE_X

const char* COV_TITLE_X[PARAM_CNT]
staticconstexpr
Initial value:
{"X residual, cm",
"Y residual, cm",
"track x-slope #beta_{x}",
"#beta_{x} #upoint y_{bar}, cm",
"#beta_{x} #upoint x_{bar}, cm",
"y_{bar}, cm"}

Definition at line 115 of file histoGL.C.

◆ COV_TITLE_Y

const char* COV_TITLE_Y[PARAM_CNT]
staticconstexpr
Initial value:
{"X residual, cm",
"Y residual, cm",
"track y-slope #beta_{y}",
"#beta_{y} #upoint y_{bar}, cm",
"#beta_{y} #upoint x_{bar}, cm",
"x_{bar}, cm"}

Definition at line 121 of file histoGL.C.

◆ PARAM_DIAG

const char* PARAM_DIAG[PARAM_CNT]
staticconstexpr
Initial value:
{
"mean of X-residual",
"mean of Y-residual",
"slope of X-res vs track x-slope",
"slope of X-res vs (x-slope * y)",
"slope of X-res vs (x-slope * x)",
"slope of X-res vs y"}

Definition at line 101 of file histoGL.C.

◆ PARAM_DIAG_Y

const char* PARAM_DIAG_Y[PARAM_CNT]
staticconstexpr
Initial value:
{
"mean of X-residual",
"mean of Y-residual",
"slope of Y-res vs track y-slope",
"slope of Y-res vs (y-slope * y)",
"slope of Y-res vs (y-slope * x)",
"slope of Y-res vs x"}

Definition at line 108 of file histoGL.C.

◆ PARAM_IS_SHIFT

const Bool_t PARAM_IS_SHIFT[PARAM_CNT] {kTRUE, kTRUE, kFALSE, kFALSE, kFALSE, kFALSE}
staticconstexpr

Definition at line 96 of file histoGL.C.

Referenced by LinAcc::Error(), and LinAcc::Value().

◆ PARAM_NAMES

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

Definition at line 91 of file histoGL.C.

◆ PARAM_SIGN_X

const Double_t PARAM_SIGN_X[PARAM_CNT] {+1.0, +1.0, -1.0, -1.0, +1.0, -1.0}
staticconstexpr

Definition at line 99 of file histoGL.C.

Referenced by EvoHist::Sample().

◆ PARAM_SIGN_Y

const Double_t PARAM_SIGN_Y[PARAM_CNT] {+1.0, +1.0, -1.0, -1.0, +1.0, +1.0}
staticconstexpr

Definition at line 100 of file histoGL.C.

Referenced by EvoHist::Sample().

◆ PARAM_UNIT

const char* PARAM_UNIT[PARAM_CNT] {"cm", "cm", "cm", "rad", "rad", "rad"}
staticconstexpr

Definition at line 92 of file histoGL.C.

Referenced by histoGL().