Logo ROOT  
Reference Guide
TGDMLMatrix.h
Go to the documentation of this file.
1 // @(#)root/gdml:$Id$
2 // Author: Andrei Gheata 05/12/2018
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGDMLMATRIX
13 #define ROOT_TGDMLMATRIX
14 
15 #include <TNamed.h>
16 
17 
18 ////////////////////////////////////////////////////////////////////////////
19 // //
20 // TGDMLProperty - A property with a name and a reference name pointing //
21 // to a GDML matrix object //
22 ////////////////////////////////////////////////////////////////////////////
23 
25 
26 ////////////////////////////////////////////////////////////////////////////
27 // //
28 // TGDMLMatrix - A matrix used for GDML parsing, the objects have to be //
29 // exposed via TGeoManager interfcace to be able to construct optical //
30 // surfaces. //
31 // //
32 ////////////////////////////////////////////////////////////////////////////
33 
34 class TGDMLMatrix : public TNamed {
35 public:
37  TGDMLMatrix(const char *name, size_t rows,size_t cols);
38  TGDMLMatrix(const TGDMLMatrix& rhs);
39  TGDMLMatrix& operator=(const TGDMLMatrix& rhs);
40  ~TGDMLMatrix() { delete [] fMatrix; }
41 
42  void Set(size_t r, size_t c, Double_t a);
43  Double_t Get(size_t r, size_t c) const;
44  size_t GetRows() const { return fNrows; }
45  size_t GetCols() const { return fNcols; }
46  void SetMatrixAsString(const char *mat) { fTitle = mat; }
47  const char *GetMatrixAsString() const { return fTitle.Data(); }
48 
49  void Print(Option_t *option="") const;
50 
51  private:
52 
53  Int_t fNelem = 0; // Number of elements
54  size_t fNrows = 0; // Number of rows
55  size_t fNcols = 0; // Number of columns
56  Double_t *fMatrix = nullptr; // [fNelem] Matrix elements
57 
58  ClassDef(TGDMLMatrix, 1) // Class representing a matrix used temporary for GDML parsing
59 };
60 
61 #endif /* ROOT_TGDMLMATRIX */
c
#define c(i)
Definition: RSha256.hxx:101
TGDMLMatrix::GetRows
size_t GetRows() const
Definition: TGDMLMatrix.h:44
Option_t
const char Option_t
Definition: RtypesCore.h:66
TString::Data
const char * Data() const
Definition: TString.h:369
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TNamed.h
TGDMLMatrix::GetMatrixAsString
const char * GetMatrixAsString() const
Definition: TGDMLMatrix.h:47
TGDMLMatrix::Print
void Print(Option_t *option="") const
Print TNamed name and title.
Definition: TGDMLMatrix.cxx:85
TNamed::fTitle
TString fTitle
Definition: TNamed.h:33
TGDMLMatrix::TGDMLMatrix
TGDMLMatrix()
Definition: TGDMLMatrix.h:36
TGDMLMatrix::fNrows
size_t fNrows
Definition: TGDMLMatrix.h:54
TGDMLMatrix::fNcols
size_t fNcols
Definition: TGDMLMatrix.h:55
TGDMLProperty
TNamed TGDMLProperty
Definition: TGDMLMatrix.h:24
a
auto * a
Definition: textangle.C:12
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TGDMLMatrix::fMatrix
Double_t * fMatrix
Definition: TGDMLMatrix.h:56
TGDMLMatrix::Set
void Set(size_t r, size_t c, Double_t a)
Definition: TGDMLMatrix.cxx:71
TGDMLMatrix::~TGDMLMatrix
~TGDMLMatrix()
Definition: TGDMLMatrix.h:40
TGDMLMatrix
This class is used in the process of reading and writing the GDML "matrix" tag.
Definition: TGDMLMatrix.h:34
TGDMLMatrix::fNelem
Int_t fNelem
Definition: TGDMLMatrix.h:53
Double_t
double Double_t
Definition: RtypesCore.h:59
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGDMLMatrix::GetCols
size_t GetCols() const
Definition: TGDMLMatrix.h:45
name
char name[80]
Definition: TGX11.cxx:110
TGDMLMatrix::SetMatrixAsString
void SetMatrixAsString(const char *mat)
Definition: TGDMLMatrix.h:46
TGDMLMatrix::operator=
TGDMLMatrix & operator=(const TGDMLMatrix &rhs)
Definition: TGDMLMatrix.cxx:53
TGDMLMatrix::Get
Double_t Get(size_t r, size_t c) const
Definition: TGDMLMatrix.cxx:78
int