Project
Loading...
Searching...
No Matches
ResidualsControllerFast.cxx
Go to the documentation of this file.
1
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3
// All rights not expressly granted are reserved.
4
//
5
// This software is distributed under the terms of the GNU General Public
6
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7
//
8
// In applying this license CERN does not waive the privileges and immunities
9
// granted to it by virtue of its status as an Intergovernmental Organization
10
// or submit itself to any jurisdiction.
11
16
17
#include "
Align/ResidualsControllerFast.h
"
18
#include "
Align/AlignmentTrack.h
"
19
#include "
Align/AlignmentPoint.h
"
20
#include "
Align/AlignableSensor.h
"
21
#include "
Framework/Logger.h
"
22
#include <TString.h>
23
#include <TMath.h>
24
#include <cstdio>
25
26
using namespace
TMath;
27
28
ClassImp
(
o2::align::ResidualsControllerFast
);
29
30
namespace
o2
31
{
32
namespace
align
33
{
34
35
//____________________________________
36
ResidualsControllerFast::ResidualsControllerFast
()
37
: mNPoints(0), mNMatSol(0), mNBook(0), mChi2(0), mChi2Ini(0), mD0(nullptr), mD1(nullptr), mSig0(nullptr), mSig1(nullptr), mVolID(nullptr), mLabel(nullptr), mSolMat(nullptr), mMatErr(nullptr)
38
{
39
// def c-tor
40
for
(
int
i
= 0;
i
< 5; ++
i
) {
41
mTrCorr
[
i
] = 0;
42
}
43
}
44
45
//________________________________________________
46
ResidualsControllerFast::~ResidualsControllerFast
()
47
{
48
// d-tor
49
delete
[]
mD0
;
50
delete
[]
mD1
;
51
delete
[]
mSig0
;
52
delete
[]
mSig1
;
53
delete
[]
mVolID
;
54
delete
[]
mLabel
;
55
delete
[]
mSolMat
;
56
delete
[]
mMatErr
;
57
}
58
59
//________________________________________________
60
void
ResidualsControllerFast::resize
(
int
np)
61
{
62
// resize container
63
if
(np >
mNBook
) {
64
delete
[]
mD0
;
65
delete
[]
mD1
;
66
delete
[]
mSig0
;
67
delete
[]
mSig1
;
68
delete
[]
mVolID
;
69
delete
[]
mLabel
;
70
delete
[]
mSolMat
;
71
delete
[]
mMatErr
;
72
//
73
mNBook
= 30 + np;
74
mD0
=
new
float
[
mNBook
];
75
mD1
=
new
float
[
mNBook
];
76
mSig0
=
new
float
[
mNBook
];
77
mSig1
=
new
float
[
mNBook
];
78
mVolID
=
new
int
[
mNBook
];
79
mLabel
=
new
int
[
mNBook
];
80
mSolMat
=
new
float
[
mNBook
* 4];
// at most 4 material params per point
81
mMatErr
=
new
float
[
mNBook
* 4];
// at most 4 material params per point
82
//
83
memset(
mD0
, 0,
mNBook
*
sizeof
(
float
));
84
memset(
mD1
, 0,
mNBook
*
sizeof
(
float
));
85
memset(
mSig0
, 0,
mNBook
*
sizeof
(
float
));
86
memset(
mSig1
, 0,
mNBook
*
sizeof
(
float
));
87
memset(
mVolID
, 0,
mNBook
*
sizeof
(
int
));
88
memset(
mLabel
, 0,
mNBook
*
sizeof
(
int
));
89
memset(
mSolMat
, 0, 4 *
mNBook
*
sizeof
(
int
));
90
memset(
mMatErr
, 0, 4 *
mNBook
*
sizeof
(
int
));
91
}
92
//
93
}
94
95
//____________________________________________
96
void
ResidualsControllerFast::Clear
(
const
Option_t*)
97
{
98
// reset record
99
mNPoints
= 0;
100
mNMatSol
= 0;
101
mTrCorr
[4] = 0;
// rest will be 100% overwritten
102
//
103
}
104
105
//____________________________________________
106
void
ResidualsControllerFast::Print
(
const
Option_t*
/*opt*/
)
const
107
{
108
// print info
109
printf(
"%3s:%1s (%9s/%5s) %6s | [ %7s:%7s ]\n"
,
"Pnt"
,
"M"
,
"Label"
,
110
"VolID"
,
"Sigma"
,
"resid"
,
"pull/LG"
);
111
for
(
int
irs = 0; irs <
mNPoints
; irs++) {
112
printf(
"%3d:%1d (%9d/%5d) %6.4f | [%+.2e:%+7.2f]\n"
,
113
irs, 0,
mLabel
[irs],
mVolID
[irs],
mSig0
[irs],
mD0
[irs],
114
mSig0
[irs] > 0 ?
mD0
[irs] /
mSig0
[irs] : -99);
115
printf(
"%3d:%1d (%9d/%5d) %6.4f | [%+.2e:%+7.2f]\n"
,
116
irs, 1,
mLabel
[irs],
mVolID
[irs],
mSig1
[irs],
mD1
[irs],
117
mSig1
[irs] > 0 ?
mD1
[irs] /
mSig1
[irs] : -99);
118
}
119
//
120
printf(
"CorrETP: "
);
121
for
(
int
i
= 0;
i
< 5;
i
++) {
122
printf(
"%+.3f "
,
mTrCorr
[
i
]);
123
}
124
printf(
"\n"
);
125
printf(
"MatCorr (corr/sig:pull)\n"
);
126
int
nmp =
mNMatSol
/ 4;
127
int
cnt = 0;
128
for
(
int
imp = 0; imp < nmp; imp++) {
129
for
(
int
ic = 0; ic < 4; ic++) {
130
printf(
"%+.2e/%.2e:%+8.3f|"
,
mSolMat
[cnt],
mMatErr
[cnt],
131
mMatErr
[cnt] > 0 ?
mSolMat
[cnt] /
mMatErr
[cnt] : -99);
132
cnt++;
133
}
134
printf(
"\n"
);
135
}
136
//
137
}
138
139
//____________________________________________
140
void
ResidualsControllerFast::setResSigMeas
(
int
ip,
int
ord,
float
res
,
float
sig)
141
{
142
// assign residual and error for measurement
143
if
(ord == 0) {
144
mD0
[ip] =
res
;
145
mSig0
[ip] = sig;
146
}
else
{
147
mD1
[ip] =
res
;
148
mSig1
[ip] = sig;
149
}
150
}
151
152
//____________________________________________
153
void
ResidualsControllerFast::setMatCorr
(
int
id
,
float
res
,
float
sig)
154
{
155
// assign residual and error for material correction
156
mSolMat
[
id
] =
res
;
157
mMatErr
[
id
] = sig;
158
}
159
160
//____________________________________________
161
void
ResidualsControllerFast::setLabel
(
int
ip,
int
lab,
int
vol)
162
{
163
// set label/volid of measured volume
164
mVolID
[ip] = vol;
165
mLabel
[ip] = lab;
166
}
167
168
}
// namespace align
169
}
// namespace o2
AlignableSensor.h
End-chain alignment volume in detector branch, where the actual measurement is done.
AlignmentPoint.h
Meausered point in the sensor.
AlignmentTrack.h
Track model for the alignment.
i
int32_t i
Definition
GPUCommonAlgorithm.h:443
Logger.h
res
uint32_t res
Definition
RawData.h:0
ClassImp
ClassImp(o2::align::ResidualsControllerFast)
ResidualsControllerFast.h
Container for control fast residuals evaluated via derivatives.
o2::align::ResidualsControllerFast
Definition
ResidualsControllerFast.h:28
o2::align::ResidualsControllerFast::mD0
float * mD0
Definition
ResidualsControllerFast.h:97
o2::align::ResidualsControllerFast::setLabel
void setLabel(int ip, int lab, int vol)
Definition
ResidualsControllerFast.cxx:161
o2::align::ResidualsControllerFast::setResSigMeas
void setResSigMeas(int ip, int ord, float res, float sig)
Definition
ResidualsControllerFast.cxx:140
o2::align::ResidualsControllerFast::mTrCorr
float mTrCorr[5]
Definition
ResidualsControllerFast.h:96
o2::align::ResidualsControllerFast::ResidualsControllerFast
ResidualsControllerFast()
Definition
ResidualsControllerFast.cxx:36
o2::align::ResidualsControllerFast::setMatCorr
void setMatCorr(int id, float res, float sig)
Definition
ResidualsControllerFast.cxx:153
o2::align::ResidualsControllerFast::mSolMat
float * mSolMat
Definition
ResidualsControllerFast.h:104
o2::align::ResidualsControllerFast::Clear
void Clear(const Option_t *opt="") final
Definition
ResidualsControllerFast.cxx:96
o2::align::ResidualsControllerFast::mNBook
int mNBook
Definition
ResidualsControllerFast.h:92
o2::align::ResidualsControllerFast::~ResidualsControllerFast
~ResidualsControllerFast() final
Definition
ResidualsControllerFast.cxx:46
o2::align::ResidualsControllerFast::mNPoints
int mNPoints
Definition
ResidualsControllerFast.h:90
o2::align::ResidualsControllerFast::mD1
float * mD1
Definition
ResidualsControllerFast.h:98
o2::align::ResidualsControllerFast::mLabel
int * mLabel
Definition
ResidualsControllerFast.h:102
o2::align::ResidualsControllerFast::Print
void Print(const Option_t *opt="") const final
Definition
ResidualsControllerFast.cxx:106
o2::align::ResidualsControllerFast::mSig0
float * mSig0
Definition
ResidualsControllerFast.h:99
o2::align::ResidualsControllerFast::resize
void resize(int n)
Definition
ResidualsControllerFast.cxx:60
o2::align::ResidualsControllerFast::mMatErr
float * mMatErr
Definition
ResidualsControllerFast.h:105
o2::align::ResidualsControllerFast::mVolID
int * mVolID
Definition
ResidualsControllerFast.h:101
o2::align::ResidualsControllerFast::mSig1
float * mSig1
Definition
ResidualsControllerFast.h:100
o2::align::ResidualsControllerFast::mNMatSol
int mNMatSol
Definition
ResidualsControllerFast.h:91
id
GLuint id
Definition
glcorearb.h:650
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
Detectors
Align
src
ResidualsControllerFast.cxx
Generated on Tue Feb 25 2025 17:02:54 for Project by
1.9.8