44 fNrowIndex = fNcols = fRowLwb =
size;
45 fElems =
new Double_t[fNcols * (fNcols + 1) / 2];
57 fNrowIndex = fNcols =
src.GetSize();
59 fRowLwb =
src.GetSizeUsed();
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()) {
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));
95 TObject::operator=(
src);
106 fNrowIndex =
src.GetSize();
107 fNcols =
src.GetSize();
109 fRowLwb =
src.GetSizeUsed();
111 int nmainel =
src.GetSizeBooked() * (
src.GetSizeBooked() + 1);
112 memcpy(
fElems,
src.fElems, nmainel *
sizeof(Double_t));
113 if (
src.GetSizeAdded()) {
114 Double_t* pnt =
fElems + nmainel;
115 int ncl =
src.GetSizeBooked() + 1;
116 for (
int ir = 0;
ir <
src.GetSizeAdded();
ir++) {
118 memcpy(pnt,
src.fElemsAdd[
ir], ncl *
sizeof(Double_t));
139 LOG(
error) <<
"Matrix sizes are different";
154 LOG(
error) <<
"Matrix sizes are different";
180 fNrowIndex = fNcols = fNrows = fRowLwb = 0;
188 for (
int j =
i + 1;
j--;) {
207 opt += 1 + int(TMath::Log10(
double(
GetSize())));
211 for (Int_t
j = 0;
j <=
i;
j++) {
233 if (sz !=
right.GetSizeUsed()) {
234 LOG(
error) <<
"Matrix sizes are different";
244 for (
int i = sz;
i--;) {
245 for (
int j =
i + 1;
j--;) {
247 for (
int k = sz; k--;) {
270 Double_t* rowi = mchol.
GetRow(
i);
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];
281 LOG(
debug) <<
"The matrix is not positive definite [" <<
sum
282 <<
"]: Choleski decomposition is not possible";
286 rowi[
i] = TMath::Sqrt(
sum);
288 rowj[
i] =
sum / rowi[
i];
300 LOG(
error) <<
"Failed to invert the matrix";
316 mchol(
i,
i) = 1.0 / mchol(
i,
i);
318 Double_t* rowj = mchol.
GetRow(
j);
320 for (
int k =
i; k <
j; k++) {
322 double& mki = mchol(k,
i);
324 sum -= rowj[k] * mki;
328 rowj[
i] =
sum / rowj[
j];
334 for (
int j =
i + 1;
j--;) {
337 double& mik = mchol(
i, k);
339 double& mjk = mchol(
j, k);
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];
377 double& mki = mchol(k,
i);
407 for (
int ir = 0;
ir < nRHS;
ir++) {
408 double*
b = bn +
ir * sz;
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];
420 for (
i = sz - 1;
i >= 0;
i--) {
421 for (
sum =
b[
i], k =
i + 1; k < sz; k++) {
423 double& mki = mchol(k,
i);
448 memcpy(bsol, brhs,
GetSizeUsed() *
sizeof(Double_t));
465 Double_t** pnew =
new Double_t*[nrows + fNrows];
466 for (
int ir = 0;
ir < fNrows;
ir++) {
469 for (
int ir = 0;
ir < nrows;
ir++) {
471 pnew[fNrows] =
new Double_t[ncl];
472 memset(pnew[fNrows], 0, ncl *
sizeof(Double_t));
487 for (
int i = 0;
i < fNrows;
i++) {
492 fNcols = fRowLwb = fNrowIndex;
559 bool* bUnUsed =
new bool[nGlo];
560 double *rowMax, *colMax =
nullptr;
561 rowMax =
new double[nGlo];
564 colMax =
new double[nGlo];
565 for (Int_t
i = nGlo;
i--;) {
566 rowMax[
i] = colMax[
i] = 0.0;
568 for (Int_t
i = nGlo;
i--;) {
569 for (Int_t
j =
i + 1;
j--;) {
570 double vl = TMath::Abs(
Query(
i,
j));
574 if (vl > rowMax[
i]) {
577 if (vl > colMax[
j]) {
583 if (vl > rowMax[
j]) {
586 if (vl > colMax[
i]) {
592 for (Int_t
i = nGlo;
i--;) {
594 rowMax[
i] = 1. / rowMax[
i];
597 colMax[
i] = 1. / colMax[
i];
602 for (Int_t
i = nGlo;
i--;) {
614 for (
int i = 0;
i < nGlo;
i++) {
615 for (
int j = 0;
j <=
i;
j++) {
618 SetEl(
i,
j, TMath::Sqrt(rowMax[
i]) * vl * TMath::Sqrt(colMax[
j]));
621 for (
int j =
i + 1;
j < nGlo;
j++) {
629 for (Int_t
j = nGlo;
j--;) {
632 for (Int_t
i = 0;
i < nGlo;
i++) {
636 for (Int_t
j = 0;
j < nGlo;
j++) {
646 bUnUsed[iPivot] =
false;
647 vPivot = 1.0 / vPivot;
650 for (Int_t
j = 0;
j < nGlo;
j++) {
651 for (Int_t jj = 0; jj < nGlo; jj++) {
652 if (
j != iPivot && jj != iPivot) {
653 double&
r =
j >= jj ? (*this)(
j, jj) : (*fgBuffer)(jj,
j);
659 for (Int_t
j = 0;
j < nGlo;
j++) {
661 (*this)(
j, iPivot) *= vPivot;
662 (*fgBuffer)(iPivot,
j) *= vPivot;
666 for (Int_t
j = 0;
j < nGlo;
j++) {
669 for (Int_t k = 0; k < nGlo; k++) {
672 (*fgBuffer)(
j, k) = 0;
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]);
688 (*fgBuffer)(
j,
i) *= vl;
693 for (Int_t
j = 0;
j < nGlo;
j++) {
695 for (Int_t jj = 0; jj < nGlo; jj++) {
698 vl = (*this)(
j, jj) = -
Query(
j, jj);
702 rowMax[
j] += vl * vecB[jj];
706 for (Int_t
j = 0;
j < nGlo;
j++) {
std::vector< double > sum
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]
Fast symmetric matrix (from AliROOT) with dynamically expandable size.
static Bool_t IsZero(Double_t x, Double_t thresh=1e-64)
virtual Double_t Query(Int_t rown, Int_t coln) const
Bool_t fSymmetric
is the matrix symmetric? Only lower triangle is filled
virtual Double_t QueryDiag(Int_t rc) const
Fast symmetric matrix with dynamically expandable size.
SymMatrix()
default constructor
SymMatrix & operator-=(const SymMatrix &src)
minus operator
Int_t GetSizeUsed() const
static Int_t fgCopyCnt
matrix copy counter
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
Double_t ** fElemsAdd
Elements (rows) added dynamicaly.
void SetEl(Int_t row, Int_t col, Double_t val)
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
Float_t GetDensity() const override
get fraction of non-zero elements
Double_t DiagElem(Int_t r) const override
static SymMatrix * fgBuffer
buffer for fast solution
Double_t * fElems
Elements booked by constructor.
Int_t GetSizeAdded() const
SymMatrix & operator=(const SymMatrix &src)
assignment operator
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
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
void Clear(Option_t *option="") override
clear dynamic part
Double_t * GetRow(Int_t r)
get pointer on the row
Int_t GetSizeBooked() const
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
GLboolean GLboolean GLboolean b
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)