Project
Loading...
Searching...
No Matches
MatrixSq.h
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
15
16#ifndef ALICEO2_FWDALIGN_MATRIXSQ_H
17#define ALICEO2_FWDALIGN_MATRIXSQ_H
18
19#include <TMatrixDBase.h>
20#include <TVectorD.h>
21
22namespace o2
23{
24namespace fwdalign
25{
26
28class MatrixSq : public TMatrixDBase
29{
30
31 public:
32 MatrixSq() : fSymmetric(kFALSE) {}
33 MatrixSq(const MatrixSq& src);
34 ~MatrixSq() override = default;
35
38
39 virtual Int_t GetSize() const { return fNcols; }
40 virtual Float_t GetDensity() const = 0;
41
42 void Clear(Option_t* option = "") override = 0;
43
44 virtual Double_t Query(Int_t rown, Int_t coln) const { return operator()(rown, coln); }
45 Double_t operator()(Int_t rown, Int_t coln) const override = 0;
46 Double_t& operator()(Int_t rown, Int_t coln) override = 0;
47
48 virtual Double_t QueryDiag(Int_t rc) const { return DiagElem(rc); }
49 virtual Double_t DiagElem(Int_t r) const = 0;
50 virtual Double_t& DiagElem(Int_t r) = 0;
51 virtual void AddToRow(Int_t r, Double_t* valc, Int_t* indc, Int_t n) = 0;
52
53 void Print(Option_t* option = "") const override = 0;
54 virtual void Reset() = 0;
55
57 virtual void PrintCOO() const;
58
60 virtual void MultiplyByVec(const Double_t* vecIn, Double_t* vecOut) const;
61
62 virtual void MultiplyByVec(const TVectorD& vecIn, TVectorD& vecOut) const;
63
64 Bool_t IsSymmetric() const override { return fSymmetric; }
65 void SetSymmetric(Bool_t v = kTRUE) { fSymmetric = v; }
66
67 // ---------------------------------- Dummy methods of MatrixBase
68 const Double_t* GetMatrixArray() const override
69 {
70 Error("GetMatrixArray", "Dummy");
71 return nullptr;
72 };
73 Double_t* GetMatrixArray() override
74 {
75 Error("GetMatrixArray", "Dummy");
76 return nullptr;
77 };
78 const Int_t* GetRowIndexArray() const override
79 {
80 Error("GetRowIndexArray", "Dummy");
81 return nullptr;
82 };
83 Int_t* GetRowIndexArray() override
84 {
85 Error("GetRowIndexArray", "Dummy");
86 return nullptr;
87 };
88 const Int_t* GetColIndexArray() const override
89 {
90 Error("GetColIndexArray", "Dummy");
91 return nullptr;
92 };
93 Int_t* GetColIndexArray() override
94 {
95 Error("GetColIndexArray", "Dummy");
96 return nullptr;
97 };
99 {
100 Error("SetRowIndexArray", "Dummy");
101 return *this;
102 }
104 {
105 Error("SetColIndexArray", "Dummy");
106 return *this;
107 }
108 TMatrixDBase& GetSub(Int_t, Int_t, Int_t, Int_t, TMatrixDBase&, Option_t*) const override
109 {
110 Error("GetSub", "Dummy");
111 return *((TMatrixDBase*)this);
112 }
113 TMatrixDBase& SetSub(Int_t, Int_t, const TMatrixDBase&) override
114 {
115 Error("GetSub", "Dummy");
116 return *this;
117 }
118 TMatrixDBase& ResizeTo(Int_t, Int_t, Int_t) override
119 {
120 Error("ResizeTo", "Dummy");
121 return *this;
122 }
123 TMatrixDBase& ResizeTo(Int_t, Int_t, Int_t, Int_t, Int_t) override
124 {
125 Error("ResizeTo", "Dummy");
126 return *this;
127 }
128 virtual void Allocate(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
129 {
130 Error("Allocate", "Dummy");
131 return;
132 }
133
134 static Bool_t IsZero(Double_t x, Double_t thresh = 1e-64) { return x > 0 ? (x < thresh) : (x > -thresh); }
135
136 protected:
137 void Swap(int& r, int& c) const
138 {
139 int t = r;
140 r = c;
141 c = t;
142 }
143
144 protected:
145 Bool_t fSymmetric;
146
148};
149
150//___________________________________________________________
151inline void MatrixSq::MultiplyByVec(const TVectorD& vecIn, TVectorD& vecOut) const
152{
153 MultiplyByVec(vecIn.GetMatrixArray(), vecOut.GetMatrixArray());
154}
155
156} // namespace fwdalign
157} // namespace o2
158
159#endif
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 option
uint32_t c
Definition RawData.h:2
void Print(Option_t *option="") const override=0
void Swap(int &r, int &c) const
Definition MatrixSq.h:137
static Bool_t IsZero(Double_t x, Double_t thresh=1e-64)
Definition MatrixSq.h:134
Bool_t IsSymmetric() const override
Definition MatrixSq.h:64
Int_t * GetColIndexArray() override
Definition MatrixSq.h:93
ClassDefOverride(MatrixSq, 1)
TMatrixDBase & SetSub(Int_t, Int_t, const TMatrixDBase &) override
Definition MatrixSq.h:113
virtual Int_t GetSize() const
Definition MatrixSq.h:39
const Int_t * GetRowIndexArray() const override
Definition MatrixSq.h:78
TMatrixDBase & ResizeTo(Int_t, Int_t, Int_t) override
Definition MatrixSq.h:118
Double_t * GetMatrixArray() override
Definition MatrixSq.h:73
TMatrixDBase & GetSub(Int_t, Int_t, Int_t, Int_t, TMatrixDBase &, Option_t *) const override
Definition MatrixSq.h:108
TMatrixDBase & SetColIndexArray(Int_t *) override
Definition MatrixSq.h:103
const Int_t * GetColIndexArray() const override
Definition MatrixSq.h:88
virtual void Allocate(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
Definition MatrixSq.h:128
virtual Double_t Query(Int_t rown, Int_t coln) const
Definition MatrixSq.h:44
virtual void AddToRow(Int_t r, Double_t *valc, Int_t *indc, Int_t n)=0
const Double_t * GetMatrixArray() const override
Definition MatrixSq.h:68
void Clear(Option_t *option="") override=0
Bool_t fSymmetric
is the matrix symmetric? Only lower triangle is filled
Definition MatrixSq.h:145
Double_t & operator()(Int_t rown, Int_t coln) override=0
virtual void PrintCOO() const
print matrix in COO sparse format
Definition MatrixSq.cxx:57
virtual Float_t GetDensity() const =0
virtual Double_t QueryDiag(Int_t rc) const
Definition MatrixSq.h:48
virtual void MultiplyByVec(const Double_t *vecIn, Double_t *vecOut) const
fill vecOut by matrix * vecIn (vector should be of the same size as the matrix)
Definition MatrixSq.cxx:46
virtual void Reset()=0
virtual Double_t & DiagElem(Int_t r)=0
virtual Double_t DiagElem(Int_t r) const =0
MatrixSq & operator=(const MatrixSq &src)
= operator
Definition MatrixSq.cxx:35
~MatrixSq() override=default
void SetSymmetric(Bool_t v=kTRUE)
Definition MatrixSq.h:65
TMatrixDBase & SetRowIndexArray(Int_t *) override
Definition MatrixSq.h:98
TMatrixDBase & ResizeTo(Int_t, Int_t, Int_t, Int_t, Int_t) override
Definition MatrixSq.h:123
Double_t operator()(Int_t rown, Int_t coln) const override=0
Int_t * GetRowIndexArray() override
Definition MatrixSq.h:83
GLdouble n
Definition glcorearb.h:1982
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLboolean r
Definition glcorearb.h:1233
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...