BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
histo.C File Reference
#include "BmnAlignModels.h"
#include "BmnRootIterator.h"
#include "BmnSimpleProgressBar.h"
#include "BmnWeightedLine.h"
#include <TCanvas.h>
#include <TF1.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 <array>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
#include <termios.h>
#include <unistd.h>
Include dependency graph for histo.C:

Go to the source code of this file.

Classes

struct  LinAcc
struct  DetAcc
struct  DetDraw
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

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 histoSetRawMode (bool on, struct termios *saved)
int histo (const char *fileListPath="/home/igor/bmnroot/align_new/cfg/run8/7466.noa_rlerr.list", Int_t drawDetIdx=0, Int_t drawMode=DM_MIX, const char *pdfPath=nullptr)
 Per-element histogramming estimate of the alignment corrections.

Variables

static constexpr const char * PARAM_NAMES [PARAM_CNT] {"dX", "dY", "dZ", "phi", "theta", "psi"}
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

◆ PADS_X

#define PADS_X   4

Definition at line 137 of file histo.C.

◆ PADS_Y

#define PADS_Y   3

Definition at line 138 of file histo.C.

◆ PARAM_CNT

#define PARAM_CNT   6

Definition at line 75 of file histo.C.

◆ PAVE_TEXT_SIZE

#define PAVE_TEXT_SIZE   0.04

Definition at line 145 of file histo.C.

Referenced by histo(), and histoGL().

◆ PROFILE_BINS

#define PROFILE_BINS   201

Definition at line 144 of file histo.C.

Referenced by histo(), and histoGL().

◆ RES_X

#define RES_X   3440

Definition at line 135 of file histo.C.

◆ RES_Y

#define RES_Y   1440

Definition at line 136 of file histo.C.

◆ RESIDUAL_BINS

#define RESIDUAL_BINS   201

Definition at line 143 of file histo.C.

Referenced by histo(), and histoGL().

◆ RESIDUAL_RANGE_X

#define RESIDUAL_RANGE_X   0.02

Definition at line 141 of file histo.C.

Referenced by histo(), and histoGL().

◆ RESIDUAL_RANGE_Y

#define RESIDUAL_RANGE_Y   0.4

Definition at line 142 of file histo.C.

Referenced by histo(), and histoGL().

Enumeration Type Documentation

◆ eDrawMode

enum eDrawMode
Enumerator
DM_PROFILE 
DM_SCATTER 
DM_MIX 

Definition at line 126 of file histo.C.

◆ eParam

enum eParam
Enumerator
P_dX 
P_dY 
P_dZ 
P_phi 
P_theta 
P_psi 

Definition at line 76 of file histo.C.

Function Documentation

◆ histo()

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

Diagnostic alternative to the global fit: for one alignable element at a time it fills the classic residual-histogram set and reads a first-order estimate of each of the 6 corrections off it, following the linearized measurement model derived in the file header. Navigate between elements interactively with the keyboard.

Parameters
fileListPathtext file listing the .root files to read
drawDetIdxindex of the detector element to start on, 0 .. BmnDetectorModel::Alignables() - 1
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 230 of file histo.C.

References BmnWeightedLine::Add(), TH1::AddDirectory(), TPaveText::AddText(), BmnRun8DM::Alignables(), BmnWeightedLine::At0(), DetDraw::betaX, DetDraw::betaXX, DetDraw::betaXY, DetDraw::betaY, DetDraw::betaYX, DetDraw::betaYY, BmnDefaultHitFilter(), BmnDefaultTrackFilter(), TCanvas::cd(), TPad::cd(), BmnSimpleProgressBar::Clear(), TCanvas::Clear(), BmnRootIterator::CountElements(), COV_TITLE_X, COV_TITLE_Y, d, BmnRun8DM::DecodeID(), BmnWeightedLine::Det(), DM_MIX, DM_PROFILE, DM_SCATTER, TH1::Draw(), TObject::Draw(), TPad::Draw(), TPaveText::Draw(), BmnDetectorModel::EncodedID(), BmnDataIterator::EndOfHits(), BmnDataIterator::EndOfTracks(), TH1::Fill(), TH2::Fill(), TProfile::Fill(), TH1::Fit(), TH1::GetFunction(), TH1::GetMaximum(), TH1::GetMean(), histoSetRawMode(), BmnRootIterator::HitDetectorID(), BmnRootIterator::HitWx(), BmnRootIterator::HitWy(), BmnRootIterator::HitX(), BmnRootIterator::HitY(), BmnRootIterator::HitZ(), i, BmnDetectorModel::Idx(), BmnDetectorModel::Init(), BmnSimpleProgressBar::Init(), BmnDataIterator::Initialized(), nDet, 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, 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, TPad::SaveAs(), TObject::SetBit(), TCanvas::SetCanvasSize(), TAttFill::SetFillColor(), TAttLine::SetLineColor(), TAttLine::SetLineStyle(), TAttLine::SetLineWidth(), TAttMarker::SetMarkerColor(), TAttMarker::SetMarkerStyle(), TH1::SetStats(), TAttText::SetTextSize(), TCanvas::SetTitle(), BmnWeightedLine::Slope(), TCanvas::Update(), DetAcc::x, DetDraw::xBar, DetAcc::y, DetDraw::yBar, and z.

Referenced by dch_noise_hist(), BmnTrackingQaOffline::DoAnalisys(), Draw_L1_histo(), BmnStsKFTrackFitter::EvalMaterial(), CbmStsFindHitsQa::Finish(), CbmStsFindTracksQa::Finish(), CbmStsReconstructionQa::Finish(), CbmStsSimulationQa::Finish(), CbmL1::InputPerformance(), BmnTrackingQaOfflineDraw::ProcessHistos(), CbmStsFindHitsQa::Reset(), CbmStsFindTracksQa::Reset(), CbmStsReconstructionQa::Reset(), and BmnTriggerEfficiencyRun7::triggerEfficiency().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ histoSetRawMode()

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

Definition at line 185 of file histo.C.

Referenced by histo().

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 108 of file histo.C.

Referenced by histo(), and histoGL().

◆ 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 114 of file histo.C.

Referenced by histo(), and histoGL().

◆ 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 94 of file histo.C.

Referenced by histo(), and histoGL().

◆ 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 101 of file histo.C.

Referenced by histo(), and histoGL().

◆ PARAM_IS_SHIFT

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

Definition at line 89 of file histo.C.

◆ PARAM_NAMES

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

Definition at line 85 of file histo.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 92 of file histo.C.

Referenced by histo(), and histoGL().

◆ 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 93 of file histo.C.

Referenced by histo(), and histoGL().