Project
Loading...
Searching...
No Matches
SymMatrix.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
13
14#include <iostream>
15
16#include <TClass.h>
17#include <TMath.h>
19#include "Framework/Logger.h"
20
21using namespace o2::fwdalign;
22
24
26Int_t SymMatrix::fgCopyCnt = 0;
27
28//___________________________________________________________
30 : fElems(nullptr),
31 fElemsAdd(nullptr)
32{
33 fSymmetric = kTRUE;
34 fgCopyCnt++;
35}
36
37//___________________________________________________________
39 : MatrixSq(),
40 fElems(nullptr),
41 fElemsAdd(nullptr)
42{
43 fNrows = 0;
44 fNrowIndex = fNcols = fRowLwb = size;
45 fElems = new Double_t[fNcols * (fNcols + 1) / 2];
46 fSymmetric = kTRUE;
47 Reset();
48 fgCopyCnt++;
49}
50
51//___________________________________________________________
53 : MatrixSq(src),
54 fElems(nullptr),
55 fElemsAdd(nullptr)
56{
57 fNrowIndex = fNcols = src.GetSize();
58 fNrows = 0;
59 fRowLwb = src.GetSizeUsed();
60 if (fNcols) {
61 int nmainel = fNcols * (fNcols + 1) / 2;
62 fElems = new Double_t[nmainel];
63 nmainel = src.fNcols * (src.fNcols + 1) / 2;
64 memcpy(fElems, src.fElems, nmainel * sizeof(Double_t));
65 if (src.GetSizeAdded()) { // transfer extra rows to main matrix
66 Double_t* pnt = fElems + nmainel;
67 int ncl = src.GetSizeBooked() + 1;
68 for (int ir = 0; ir < src.GetSizeAdded(); ir++) {
69 memcpy(pnt, src.fElemsAdd[ir], ncl * sizeof(Double_t));
70 pnt += ncl;
71 ncl++;
72 }
73 }
74 } else {
75 fElems = nullptr;
76 }
77 fElemsAdd = nullptr;
78 fgCopyCnt++;
79}
80
81//___________________________________________________________
83{
84 Clear();
85 if (--fgCopyCnt < 1 && fgBuffer) {
86 delete fgBuffer;
87 fgBuffer = nullptr;
88 }
89}
90
91//___________________________________________________________
93{
94 if (this != &src) {
95 TObject::operator=(src);
96 if (GetSizeBooked() != src.GetSizeBooked() && GetSizeAdded() != src.GetSizeAdded()) {
97 // recreate the matrix
98 if (fElems) {
99 delete[] fElems;
100 }
101 for (int i = 0; i < GetSizeAdded(); i++) {
102 delete[] fElemsAdd[i];
103 }
104 delete[] fElemsAdd;
105
106 fNrowIndex = src.GetSize();
107 fNcols = src.GetSize();
108 fNrows = 0;
109 fRowLwb = src.GetSizeUsed();
110 fElems = new Double_t[GetSize() * (GetSize() + 1) / 2];
111 int nmainel = src.GetSizeBooked() * (src.GetSizeBooked() + 1);
112 memcpy(fElems, src.fElems, nmainel * sizeof(Double_t));
113 if (src.GetSizeAdded()) { // transfer extra rows to main matrix
114 Double_t* pnt = fElems + nmainel; //*sizeof(Double_t);
115 int ncl = src.GetSizeBooked() + 1;
116 for (int ir = 0; ir < src.GetSizeAdded(); ir++) {
117 ncl += ir;
118 memcpy(pnt, src.fElemsAdd[ir], ncl * sizeof(Double_t));
119 pnt += ncl; //*sizeof(Double_t);
120 }
121 }
122
123 } else {
124 memcpy(fElems, src.fElems, GetSizeBooked() * (GetSizeBooked() + 1) / 2 * sizeof(Double_t));
125 int ncl = GetSizeBooked() + 1;
126 for (int ir = 0; ir < GetSizeAdded(); ir++) { // dynamic rows
127 ncl += ir;
128 memcpy(fElemsAdd[ir], src.fElemsAdd[ir], ncl * sizeof(Double_t));
129 }
130 }
131 }
132 return *this;
133}
134
135//___________________________________________________________
137{
138 if (GetSizeUsed() != src.GetSizeUsed()) {
139 LOG(error) << "Matrix sizes are different";
140 return *this;
141 }
142 for (int i = 0; i < GetSizeUsed(); i++) {
143 for (int j = i; j < GetSizeUsed(); j++) {
144 (*this)(j, i) += src(j, i);
145 }
146 }
147 return *this;
148}
149
150//___________________________________________________________
152{
153 if (GetSizeUsed() != src.GetSizeUsed()) {
154 LOG(error) << "Matrix sizes are different";
155 return *this;
156 }
157 for (int i = 0; i < GetSizeUsed(); i++) {
158 for (int j = i; j < GetSizeUsed(); j++) {
159 (*this)(j, i) -= src(j, i);
160 }
161 }
162 return *this;
163}
164
165//___________________________________________________________
166void SymMatrix::Clear(Option_t*)
167{
168 if (fElems) {
169 delete[] fElems;
170 fElems = nullptr;
171 }
172
173 if (fElemsAdd) {
174 for (int i = 0; i < GetSizeAdded(); i++) {
175 delete[] fElemsAdd[i];
176 }
177 delete[] fElemsAdd;
178 fElemsAdd = nullptr;
179 }
180 fNrowIndex = fNcols = fNrows = fRowLwb = 0;
181}
182
183//___________________________________________________________
185{
186 Int_t nel = 0;
187 for (int i = GetSizeUsed(); i--;) {
188 for (int j = i + 1; j--;) {
189 if (!IsZero(GetEl(i, j))) {
190 nel++;
191 }
192 }
193 }
194 return 2. * nel / ((GetSizeUsed() + 1) * GetSizeUsed());
195}
196
197//___________________________________________________________
198void SymMatrix::Print(Option_t* option) const
199{
200 printf("Symmetric Matrix: Size = %d (%d rows added dynamically), %d used\n", GetSize(), GetSizeAdded(), GetSizeUsed());
201 TString opt = option;
202 opt.ToLower();
203 if (opt.IsNull()) {
204 return;
205 }
206 opt = "%";
207 opt += 1 + int(TMath::Log10(double(GetSize())));
208 opt += "d|";
209 for (Int_t i = 0; i < GetSizeUsed(); i++) {
210 printf(opt, i);
211 for (Int_t j = 0; j <= i; j++) {
212 printf("%+.3e|", GetEl(i, j));
213 }
214 printf("\n");
215 }
216}
217
218//___________________________________________________________
219void SymMatrix::MultiplyByVec(const Double_t* vecIn, Double_t* vecOut) const
220{
221 for (int i = GetSizeUsed(); i--;) {
222 vecOut[i] = 0.0;
223 for (int j = GetSizeUsed(); j--;) {
224 vecOut[i] += vecIn[j] * GetEl(i, j);
225 }
226 }
227}
228
229//___________________________________________________________
231{
232 int sz = GetSizeUsed();
233 if (sz != right.GetSizeUsed()) {
234 LOG(error) << "Matrix sizes are different";
235 return kFALSE;
236 }
237 if (!fgBuffer || fgBuffer->GetSizeUsed() != sz) {
238 delete fgBuffer;
239 fgBuffer = new SymMatrix(*this);
240 } else {
241 (*fgBuffer) = *this;
242 }
243
244 for (int i = sz; i--;) {
245 for (int j = i + 1; j--;) {
246 double val = 0.;
247 for (int k = sz; k--;) {
248 val += fgBuffer->GetEl(i, k) * right.GetEl(k, j);
249 }
250 SetEl(i, j, val);
251 }
252 }
253
254 return kTRUE;
255}
256
257//___________________________________________________________
259{
260 if (!fgBuffer || fgBuffer->GetSizeUsed() != GetSizeUsed()) {
261 delete fgBuffer;
262 fgBuffer = new SymMatrix(*this);
263 } else {
264 (*fgBuffer) = *this;
265 }
266
267 SymMatrix& mchol = *fgBuffer;
268
269 for (int i = 0; i < GetSizeUsed(); i++) {
270 Double_t* rowi = mchol.GetRow(i);
271 for (int j = i; j < GetSizeUsed(); j++) {
272 Double_t* rowj = mchol.GetRow(j);
273 double sum = rowj[i];
274 for (int k = i - 1; k >= 0; k--) {
275 if (rowi[k] && rowj[k]) {
276 sum -= rowi[k] * rowj[k];
277 }
278 }
279 if (i == j) {
280 if (sum <= 0.0) { // not positive-definite
281 LOG(debug) << "The matrix is not positive definite [" << sum
282 << "]: Choleski decomposition is not possible";
283 // Print("l");
284 return nullptr;
285 }
286 rowi[i] = TMath::Sqrt(sum);
287 } else {
288 rowj[i] = sum / rowi[i];
289 }
290 }
291 }
292 return fgBuffer;
293}
294
295//___________________________________________________________
297{
298 SymMatrix* mchol = DecomposeChol();
299 if (!mchol) {
300 LOG(error) << "Failed to invert the matrix";
301 return kFALSE;
302 }
303
304 InvertChol(mchol);
305 return kTRUE;
306}
307
308//___________________________________________________________
310{
311 Double_t sum;
312 SymMatrix& mchol = *pmchol;
313
314 // Invert decomposed triangular L matrix (Lower triangle is filled)
315 for (int i = 0; i < GetSizeUsed(); i++) {
316 mchol(i, i) = 1.0 / mchol(i, i);
317 for (int j = i + 1; j < GetSizeUsed(); j++) {
318 Double_t* rowj = mchol.GetRow(j);
319 sum = 0.0;
320 for (int k = i; k < j; k++) {
321 if (rowj[k]) {
322 double& mki = mchol(k, i);
323 if (mki) {
324 sum -= rowj[k] * mki;
325 }
326 }
327 }
328 rowj[i] = sum / rowj[j];
329 }
330 }
331
332 // take product of the inverted Choleski L matrix with its transposed
333 for (int i = GetSizeUsed(); i--;) {
334 for (int j = i + 1; j--;) {
335 sum = 0;
336 for (int k = i; k < GetSizeUsed(); k++) {
337 double& mik = mchol(i, k);
338 if (mik) {
339 double& mjk = mchol(j, k);
340 if (mjk) {
341 sum += mik * mjk;
342 }
343 }
344 }
345 (*this)(j, i) = sum;
346 }
347 }
348}
349
350//___________________________________________________________
351Bool_t SymMatrix::SolveChol(Double_t* b, Bool_t invert)
352{
353 Int_t i, k;
354 Double_t sum;
355
356 SymMatrix* pmchol = DecomposeChol();
357 if (!pmchol) {
358 LOG(debug) << "SolveChol failed";
359 // Print("l");
360 return kFALSE;
361 }
362 SymMatrix& mchol = *pmchol;
363
364 for (i = 0; i < GetSizeUsed(); i++) {
365 Double_t* rowi = mchol.GetRow(i);
366 for (sum = b[i], k = i - 1; k >= 0; k--) {
367 if (rowi[k] && b[k]) {
368 sum -= rowi[k] * b[k];
369 }
370 }
371 b[i] = sum / rowi[i];
372 }
373
374 for (i = GetSizeUsed() - 1; i >= 0; i--) {
375 for (sum = b[i], k = i + 1; k < GetSizeUsed(); k++) {
376 if (b[k]) {
377 double& mki = mchol(k, i);
378 if (mki) {
379 sum -= mki * b[k];
380 }
381 }
382 }
383 b[i] = sum / mchol(i, i);
384 }
385
386 if (invert) {
387 InvertChol(pmchol);
388 }
389 return kTRUE;
390}
391
392//___________________________________________________________
393Bool_t SymMatrix::SolveCholN(Double_t* bn, int nRHS, Bool_t invert)
394{
395 int sz = GetSizeUsed();
396 Int_t i, k;
397 Double_t sum;
398
399 SymMatrix* pmchol = DecomposeChol();
400 if (!pmchol) {
401 LOG(debug) << "SolveChol failed";
402 // Print("l");
403 return kFALSE;
404 }
405 SymMatrix& mchol = *pmchol;
406
407 for (int ir = 0; ir < nRHS; ir++) {
408 double* b = bn + ir * sz;
409
410 for (i = 0; i < sz; i++) {
411 Double_t* rowi = mchol.GetRow(i);
412 for (sum = b[i], k = i - 1; k >= 0; k--) {
413 if (rowi[k] && b[k]) {
414 sum -= rowi[k] * b[k];
415 }
416 }
417 b[i] = sum / rowi[i];
418 }
419
420 for (i = sz - 1; i >= 0; i--) {
421 for (sum = b[i], k = i + 1; k < sz; k++) {
422 if (b[k]) {
423 double& mki = mchol(k, i);
424 if (mki) {
425 sum -= mki * b[k];
426 }
427 }
428 }
429 b[i] = sum / mchol(i, i);
430 }
431 }
432
433 if (invert) {
434 InvertChol(pmchol);
435 }
436 return kTRUE;
437}
438
439//___________________________________________________________
440Bool_t SymMatrix::SolveChol(TVectorD& b, Bool_t invert)
441{
442 return SolveChol((Double_t*)b.GetMatrixArray(), invert);
443}
444
445//___________________________________________________________
446Bool_t SymMatrix::SolveChol(Double_t* brhs, Double_t* bsol, Bool_t invert)
447{
448 memcpy(bsol, brhs, GetSizeUsed() * sizeof(Double_t));
449 return SolveChol(bsol, invert);
450}
451
452//___________________________________________________________
453Bool_t SymMatrix::SolveChol(const TVectorD& brhs, TVectorD& bsol, Bool_t invert)
454{
455 bsol = brhs;
456 return SolveChol(bsol, invert);
457}
458
459//___________________________________________________________
460void SymMatrix::AddRows(int nrows)
461{
462 if (nrows < 1) {
463 return;
464 }
465 Double_t** pnew = new Double_t*[nrows + fNrows];
466 for (int ir = 0; ir < fNrows; ir++) {
467 pnew[ir] = fElemsAdd[ir]; // copy old extra rows
468 }
469 for (int ir = 0; ir < nrows; ir++) {
470 int ncl = GetSize() + 1;
471 pnew[fNrows] = new Double_t[ncl];
472 memset(pnew[fNrows], 0, ncl * sizeof(Double_t));
473 fNrows++;
474 fNrowIndex++;
475 fRowLwb++;
476 }
477 delete[] fElemsAdd;
478 fElemsAdd = pnew;
479}
480
481//___________________________________________________________
483{
484 // if additional rows exist, regularize it
485 if (fElemsAdd) {
486 delete[] fElems;
487 for (int i = 0; i < fNrows; i++) {
488 delete[] fElemsAdd[i];
489 }
490 delete[] fElemsAdd;
491 fElemsAdd = nullptr;
492 fNcols = fRowLwb = fNrowIndex;
493 fElems = new Double_t[GetSize() * (GetSize() + 1) / 2];
494 fNrows = 0;
495 }
496 if (fElems) {
497 memset(fElems, 0, GetSize() * (GetSize() + 1) / 2 * sizeof(Double_t));
498 }
499}
500
501//___________________________________________________________
502/*
503void SymMatrix::AddToRow(Int_t r, Double_t* valc, Int_t* indc, Int_t n)
504{
505 // for (int i=n;i--;) {
506 // (*this)(indc[i],r) += valc[i];
507 // }
508 // return;
509
510 double* row;
511 if (r >= fNrowIndex) {
512 AddRows(r - fNrowIndex + 1);
513 row = &((fElemsAdd[r - fNcols])[0]);
514 } else {
515 row = &fElems[GetIndex(r, 0)];
516 }
517
518 int nadd = 0;
519 for (int i = n; i--;) {
520 if (indc[i] > r) {
521 continue;
522 }
523 row[indc[i]] += valc[i];
524 nadd++;
525 }
526 if (nadd == n) {
527 return;
528 }
529
530 // add to col>row
531 for (int i = n; i--;) {
532 if (indc[i] > r)
533 (*this)(indc[i], r) += valc[i];
534 }
535}
536*/
537
538//___________________________________________________________
539Double_t* SymMatrix::GetRow(Int_t r)
540{
541 if (r >= GetSize()) {
542 int nn = GetSize();
543 AddRows(r - GetSize() + 1);
544 LOG(debug) << Form("create %d of %d\n", r, nn);
545 return &((fElemsAdd[r - GetSizeBooked()])[0]);
546 } else {
547 return &fElems[GetIndex(r, 0)];
548 }
549}
550
551//___________________________________________________________
552int SymMatrix::SolveSpmInv(double* vecB, Bool_t stabilize)
553{
554 Int_t nRank = 0;
555 int iPivot;
556 double vPivot = 0.;
557 double eps = 1e-14;
558 int nGlo = GetSizeUsed();
559 bool* bUnUsed = new bool[nGlo];
560 double *rowMax, *colMax = nullptr;
561 rowMax = new double[nGlo];
562
563 if (stabilize) {
564 colMax = new double[nGlo];
565 for (Int_t i = nGlo; i--;) {
566 rowMax[i] = colMax[i] = 0.0;
567 }
568 for (Int_t i = nGlo; i--;) {
569 for (Int_t j = i + 1; j--;) {
570 double vl = TMath::Abs(Query(i, j));
571 if (IsZero(vl)) {
572 continue;
573 }
574 if (vl > rowMax[i]) {
575 rowMax[i] = vl; // Max elemt of row i
576 }
577 if (vl > colMax[j]) {
578 colMax[j] = vl; // Max elemt of column j
579 }
580 if (i == j) {
581 continue;
582 }
583 if (vl > rowMax[j]) {
584 rowMax[j] = vl; // Max elemt of row j
585 }
586 if (vl > colMax[i]) {
587 colMax[i] = vl; // Max elemt of column i
588 }
589 }
590 }
591
592 for (Int_t i = nGlo; i--;) {
593 if (!IsZero(rowMax[i])) {
594 rowMax[i] = 1. / rowMax[i]; // Max elemt of row i
595 }
596 if (!IsZero(colMax[i])) {
597 colMax[i] = 1. / colMax[i]; // Max elemt of column i
598 }
599 }
600 }
601
602 for (Int_t i = nGlo; i--;) {
603 bUnUsed[i] = true;
604 }
605
606 if (!fgBuffer || fgBuffer->GetSizeUsed() != GetSizeUsed()) {
607 delete fgBuffer;
608 fgBuffer = new SymMatrix(*this);
609 } else {
610 (*fgBuffer) = *this;
611 }
612
613 if (stabilize) {
614 for (int i = 0; i < nGlo; i++) { // Small loop for matrix equilibration (gives a better conditioning)
615 for (int j = 0; j <= i; j++) {
616 double vl = Query(i, j);
617 if (!IsZero(vl)) {
618 SetEl(i, j, TMath::Sqrt(rowMax[i]) * vl * TMath::Sqrt(colMax[j])); // Equilibrate the V matrix
619 }
620 }
621 for (int j = i + 1; j < nGlo; j++) {
622 double vl = Query(j, i);
623 if (!IsZero(vl)) {
624 fgBuffer->SetEl(j, i, TMath::Sqrt(rowMax[i]) * vl * TMath::Sqrt(colMax[j])); // Equilibrate the V matrix
625 }
626 }
627 }
628 }
629 for (Int_t j = nGlo; j--;) {
630 fgBuffer->DiagElem(j) = TMath::Abs(QueryDiag(j)); // save diagonal elem absolute values
631 }
632 for (Int_t i = 0; i < nGlo; i++) {
633 vPivot = 0.0;
634 iPivot = -1;
635
636 for (Int_t j = 0; j < nGlo; j++) { // First look for the pivot, ie max unused diagonal element
637 double vl;
638 if (bUnUsed[j] && (TMath::Abs(vl = QueryDiag(j)) > TMath::Max(TMath::Abs(vPivot), eps * fgBuffer->QueryDiag(j)))) {
639 vPivot = vl;
640 iPivot = j;
641 }
642 }
643
644 if (iPivot >= 0) { // pivot found
645 nRank++;
646 bUnUsed[iPivot] = false; // This value is used
647 vPivot = 1.0 / vPivot;
648 DiagElem(iPivot) = -vPivot; // Replace pivot by its inverse
649 //
650 for (Int_t j = 0; j < nGlo; j++) {
651 for (Int_t jj = 0; jj < nGlo; jj++) {
652 if (j != iPivot && jj != iPivot) { // Other elements (!!! do them first as you use old matV[k][j]'s !!!)
653 double& r = j >= jj ? (*this)(j, jj) : (*fgBuffer)(jj, j);
654 r -= vPivot * (j > iPivot ? Query(j, iPivot) : fgBuffer->Query(iPivot, j)) * (iPivot > jj ? Query(iPivot, jj) : fgBuffer->Query(jj, iPivot));
655 }
656 }
657 }
658
659 for (Int_t j = 0; j < nGlo; j++) {
660 if (j != iPivot) { // Pivot row or column elements
661 (*this)(j, iPivot) *= vPivot;
662 (*fgBuffer)(iPivot, j) *= vPivot;
663 }
664 }
665 } else { // No more pivot value (clear those elements)
666 for (Int_t j = 0; j < nGlo; j++) {
667 if (bUnUsed[j]) {
668 vecB[j] = 0.0;
669 for (Int_t k = 0; k < nGlo; k++) {
670 (*this)(j, k) = 0.;
671 if (j != k) {
672 (*fgBuffer)(j, k) = 0;
673 }
674 }
675 }
676 }
677 break; // No more pivots anyway, stop here
678 }
679 }
680
681 if (stabilize) {
682 for (Int_t i = 0; i < nGlo; i++) {
683 for (Int_t j = 0; j < nGlo; j++) {
684 double vl = TMath::Sqrt(colMax[i]) * TMath::Sqrt(rowMax[j]); // Correct matrix V
685 if (i >= j) {
686 (*this)(i, j) *= vl;
687 } else {
688 (*fgBuffer)(j, i) *= vl;
689 }
690 }
691 }
692 }
693 for (Int_t j = 0; j < nGlo; j++) {
694 rowMax[j] = 0.0;
695 for (Int_t jj = 0; jj < nGlo; jj++) { // Reverse matrix elements
696 double vl;
697 if (j >= jj) {
698 vl = (*this)(j, jj) = -Query(j, jj);
699 } else {
700 vl = (*fgBuffer)(j, jj) = -fgBuffer->Query(j, jj);
701 }
702 rowMax[j] += vl * vecB[jj];
703 }
704 }
705
706 for (Int_t j = 0; j < nGlo; j++) {
707 vecB[j] = rowMax[j]; // The final result
708 }
709
710 delete[] bUnUsed;
711 delete[] rowMax;
712 if (stabilize) {
713 delete[] colMax;
714 }
715
716 return nRank;
717}
std::ostringstream debug
std::vector< double > sum
int32_t i
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder Print launch bounds used for RTC code as debugging for exit after Allow RTC with slave GPUReconstruction instances with optConstexpr and optSpecialcode Maximum number of RTC cache files per backend in the cache the oldest are Prepend RTC compilation commands by this string Load a parameter object containing the launch bounds from a file h configStandalone Processing proc_param TPC Cluster Z Error Parameterization h nn
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder Print launch bounds used for RTC code as debugging option
char error[CURL_ERROR_SIZE]
uint32_t j
Definition RawData.h:0
ClassImp(SymMatrix)
Fast symmetric matrix (from AliROOT) with dynamically expandable size.
static Bool_t IsZero(Double_t x, Double_t thresh=1e-64)
Definition MatrixSq.h:134
virtual Double_t Query(Int_t rown, Int_t coln) const
Definition MatrixSq.h:44
Bool_t fSymmetric
is the matrix symmetric? Only lower triangle is filled
Definition MatrixSq.h:145
virtual Double_t QueryDiag(Int_t rc) const
Definition MatrixSq.h:48
Fast symmetric matrix with dynamically expandable size.
Definition SymMatrix.h:38
SymMatrix()
default constructor
Definition SymMatrix.cxx:29
SymMatrix & operator-=(const SymMatrix &src)
minus operator
Int_t GetSizeUsed() const
Definition SymMatrix.h:58
static Int_t fgCopyCnt
matrix copy counter
Definition SymMatrix.h:216
void Print(const Option_t *option="") const override
print itself
int SolveSpmInv(double *vecB, Bool_t stabilize=kTRUE)
Obtain solution of a system of linear equations with symmetric matrix and the inverse (using 'singula...
~SymMatrix() override
destructor
Definition SymMatrix.cxx:82
Double_t ** fElemsAdd
Elements (rows) added dynamicaly.
Definition SymMatrix.h:213
void SetEl(Int_t row, Int_t col, Double_t val)
Definition SymMatrix.h:209
Bool_t SolveChol(Double_t *brhs, Bool_t invert=kFALSE)
Solves the set of n linear equations A x = b.
void MultiplyByVec(const Double_t *vecIn, Double_t *vecOut) const override
fill vecOut by matrix*vecIn
Int_t GetSize() const override
Definition SymMatrix.h:57
Float_t GetDensity() const override
get fraction of non-zero elements
Double_t DiagElem(Int_t r) const override
Definition SymMatrix.h:77
static SymMatrix * fgBuffer
buffer for fast solution
Definition SymMatrix.h:215
Double_t * fElems
Elements booked by constructor.
Definition SymMatrix.h:212
Int_t GetSizeAdded() const
Definition SymMatrix.h:60
SymMatrix & operator=(const SymMatrix &src)
assignment operator
Definition SymMatrix.cxx:92
Bool_t InvertChol()
Invert matrix using Choleski decomposition.
SymMatrix * DecomposeChol()
Return a matrix with Choleski decomposition.
Double_t GetEl(Int_t row, Int_t col) const
Definition SymMatrix.h:208
Bool_t SolveCholN(Double_t *bn, int nRHS, Bool_t invert=kFALSE)
Solves the set of n linear equations A x = b; this version solve multiple RHSs at once.
virtual Int_t GetIndex(Int_t row, Int_t col) const
Definition SymMatrix.h:222
void Clear(Option_t *option="") override
clear dynamic part
void Reset() override
Double_t * GetRow(Int_t r)
get pointer on the row
Int_t GetSizeBooked() const
Definition SymMatrix.h:59
void AddRows(int nrows=1)
add empty rows
SymMatrix & operator+=(const SymMatrix &src)
add operator
Bool_t Multiply(const SymMatrix &right)
multiply from the right
GLenum src
Definition glcorearb.h:1767
GLsizeiptr size
Definition glcorearb.h:659
GLdouble GLdouble right
Definition glcorearb.h:4077
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLuint GLfloat * val
Definition glcorearb.h:1582
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)