BmnRoot
26.10.0-233-gb9bbe585
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
align.C
Go to the documentation of this file.
1
/*
2
BM@N alignment routine
3
BM@N experiment at NICA complex, JINR, 2025
4
5
Department: Math & Soft Group of HEP lab
6
Author: Igor Polev, polev@jinr.int
7
8
ROOT alignment macro -- main entry point of the (sub-)project
9
*/
10
11
// headers below are for IDE syntax to work and they will be turned off during execution in ROOT macro mode
12
#ifndef __CLING__
13
#include "
BmnAlignModels.h
"
// IWYU pragma: keep
14
#include "
BmnAlignReport.h
"
15
#include "
BmnAligner.h
"
16
#endif
17
18
#include "fairlogger/Logger.h"
19
20
/**
21
* @brief Solve the detector alignment problem on a set of reconstructed tracks.
22
*
23
* Reads tracks and hits, fits the rigid-body corrections of every alignable
24
* detector element (and of the composite nodes the detector model declares),
25
* writes the result out and reports on it. The measurement and detector models
26
* selected in the body decide what "alignable element" means; see
27
* BmnAlignModels.h for what is available.
28
*
29
* @param fileListPath text file listing the .root files to read, one per
30
* line; lines starting with '#' are ignored
31
* @param solutionPath .json file to write the solution into, null to skip
32
* @param constraintsPath .json file of exact linear constraints, null for none
33
* @param presigmaPath .json file of per-parameter priors, null for none.
34
* A model with composite nodes needs these to be solvable
35
* @param startApproxPath .json solution to start the iteration from, null to
36
* start from the nominal geometry
37
* @param dumpPath .root file to write a compacted copy of the input data
38
* into, null to skip
39
*
40
* @return 0 on success, -1 if any stage failed
41
*/
42
int
align
(
43
const
char
* fileListPath =
"/home/igor/bmnroot/align_new/cfg/run9/9555.noa_rlerr.list"
,
44
const
char
* solutionPath =
"/home/igor/bmnroot/align_new/cfg/solutions/sl9555.112e_lin3.01.json"
,
45
const
char
* constraintsPath =
"/home/igor/bmnroot/align_new/cfg/constraints/cnstr_r9_lin3.json"
,
46
const
char
* presigmaPath =
"/home/igor/bmnroot/align_new/cfg/presigmas/psg_r9_lin3.json"
,
47
const
char
* startApproxPath =
nullptr
,
//"/home/igor/bmnroot/align_new/cfg/run8/slALL.e76.start_from_e11.json",
48
const
char
* dumpPath =
nullptr
)
//"/home/igor/data.cache/dump.9555_ev0_p0.noa_rlerr.root")
49
{
50
// the collision target installed in the run, as a FairRoot ASCII geometry file
51
constexpr
const
char
* TARGET_GEO{
"/home/igor/bmnroot/align_new/cfg/target_Sn.geo"
};
52
53
fair::Logger::SetConsoleColor(
true
);
54
fair::Logger::SetConsoleSeverity(
"info"
);
55
fair::Logger::InitFileSink(
"info"
,
"logs/align"
);
56
57
// Alignment problem setup: select measurement and detector model below
58
// ========================
59
BmnMeasureLin3
measurementModel;
60
BmnRun9DM
detectorModel(
kTRUE
);
61
if
(!detectorModel.
Init
(TARGET_GEO))
62
return
-1;
// mandatory, see BmnDetectorModel
63
64
// Alignment solver -- the algorithm itself
65
// ========================
66
BmnAligner
aligner(&measurementModel, &detectorModel, fileListPath, constraintsPath, presigmaPath,
67
16
// parallel threads count
68
);
69
if
(!aligner.
Initialized
())
70
return
-1;
71
if
(!aligner.
PrepareData
(dumpPath))
72
return
-1;
// mandatory step
73
if
(!aligner.
LoadSolution
(startApproxPath))
74
return
-1;
// optional: starting point
75
if
(!aligner.
Align
(0.0))
76
return
-1;
// calculations
77
if
(!aligner.
SaveSolution
(solutionPath))
78
return
-1;
// optional step
79
80
// Reports section
81
// ========================
82
BmnAlignReport::Results
(aligner);
83
// BmnAlignReport::ModesBelow(aligner, 1e0);
84
// BmnAlignReport::Correlations(aligner, 0.8, 100);
85
BmnAlignReport::Draw
(aligner);
86
87
return
0;
88
}
BmnAlignModels.h
BmnAlignReport.h
BmnAligner.h
kTRUE
constexpr Bool_t kTRUE
align
int align(const char *fileListPath="/home/igor/bmnroot/align_new/cfg/run9/9555.noa_rlerr.list", const char *solutionPath="/home/igor/bmnroot/align_new/cfg/solutions/sl9555.112e_lin3.01.json", const char *constraintsPath="/home/igor/bmnroot/align_new/cfg/constraints/cnstr_r9_lin3.json", const char *presigmaPath="/home/igor/bmnroot/align_new/cfg/presigmas/psg_r9_lin3.json", const char *startApproxPath=nullptr, const char *dumpPath=nullptr)
Solve the detector alignment problem on a set of reconstructed tracks.
Definition
align.C:42
BmnAlignReport::Draw
static void Draw(const BmnAligner &aligner, Int_t number=-1)
Definition
BmnAlignReport.cxx:614
BmnAlignReport::Results
static void Results(const BmnAligner &aligner)
Definition
BmnAlignReport.cxx:50
BmnAligner
Definition
BmnAligner.h:36
BmnAligner::Initialized
Bool_t Initialized() const noexcept
Definition
BmnAligner.h:66
BmnAligner::LoadSolution
Bool_t LoadSolution(const char *jsonPath)
Definition
BmnAligner.cxx:480
BmnAligner::Align
Bool_t Align(Double_t zeroRand=0.0, Int_t maxRounds=3)
Definition
BmnAligner.cxx:617
BmnAligner::PrepareData
Bool_t PrepareData(const char *dumpPath=nullptr, Bool_t fitTargetZ=kTRUE)
Definition
BmnAligner.cxx:218
BmnAligner::SaveSolution
Bool_t SaveSolution(const char *jsonPath, Bool_t withAlpha=kFALSE)
Definition
BmnAligner.cxx:528
BmnDetectorModel::Init
Bool_t Init(const char *targetGeoFile=nullptr)
Definition
BmnDetectorModel.h:120
BmnMeasureLin3
Definition
BmnMeasureLin3.h:34
BmnRun9DM
Definition
BmnRun9DM.h:53
align_new
macro
align.C
Generated on
for BmnRoot by
1.17.0