Project
Loading...
Searching...
No Matches
RectMatrix.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_RECTMATRIX_H
17#define ALICEO2_FWDALIGN_RECTMATRIX_H
18
19#include "TObject.h"
20class TString;
21
22namespace o2
23{
24namespace fwdalign
25{
26
30class RectMatrix : public TObject
31{
32
33 public:
35 RectMatrix();
36
38 RectMatrix(Int_t nrow, Int_t ncol);
39
42
44 ~RectMatrix() override;
45
46 Int_t GetNRows() const { return fNRows; }
47 Int_t GetNCols() const { return fNCols; }
48
49 Double_t Query(Int_t rown, Int_t coln) const { return operator()(rown, coln); }
50
53
54 Double_t operator()(Int_t rown, Int_t coln) const;
55 Double_t& operator()(Int_t rown, Int_t coln);
56 Double_t* operator()(Int_t row) const { return GetRow(row); }
57 Double_t* GetRow(Int_t row) const { return fRows[row]; }
58
60 void Reset() const;
61
63 void Print(Option_t* option = "") const override;
64
65 protected:
66 Int_t fNRows;
67 Int_t fNCols;
68 Double_t** fRows;
69
71};
72
73//___________________________________________________________
74inline Double_t RectMatrix::operator()(Int_t row, Int_t col) const
75{
76 return (const Double_t&)GetRow(row)[col];
77}
78
79//___________________________________________________________
80inline Double_t& RectMatrix::operator()(Int_t row, Int_t col)
81{
82 return (Double_t&)fRows[row][col];
83}
84
85} // namespace fwdalign
86} // namespace o2
87
88#endif
uint32_t col
Definition RawData.h:4
Class for rectangular matrix used for millepede2 operation.
Definition RectMatrix.h:31
Int_t GetNRows() const
Definition RectMatrix.h:46
void Reset() const
reset all
Double_t * operator()(Int_t row) const
Definition RectMatrix.h:56
Int_t fNRows
Number of rows.
Definition RectMatrix.h:66
void Print(Option_t *option="") const override
print itself
Double_t Query(Int_t rown, Int_t coln) const
Definition RectMatrix.h:49
Double_t * GetRow(Int_t row) const
Definition RectMatrix.h:57
Double_t operator()(Int_t rown, Int_t coln) const
Definition RectMatrix.h:74
RectMatrix & operator=(const RectMatrix &src)
assignment op-r
Int_t GetNCols() const
Definition RectMatrix.h:47
Int_t fNCols
Number of columns.
Definition RectMatrix.h:67
ClassDefOverride(RectMatrix, 0)
Double_t ** fRows
pointers on rows
Definition RectMatrix.h:68
~RectMatrix() override
dest-tor
RectMatrix()
default c-tor
GLenum src
Definition glcorearb.h:1767
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< int > row