Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
34class TGDMLMatrix : public TNamed {
35public:
37 TGDMLMatrix(const char *name, size_t rows,size_t cols);
38 TGDMLMatrix(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 */
ROOT::R::TRInterface & r
Definition Object.C:4
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
TNamed TGDMLProperty
Definition TGDMLMatrix.h:24
char name[80]
Definition TGX11.cxx:110
This class is used in the process of reading and writing the GDML "matrix" tag.
Definition TGDMLMatrix.h:34
size_t fNrows
Definition TGDMLMatrix.h:54
TGDMLMatrix & operator=(const TGDMLMatrix &rhs)
Double_t Get(size_t r, size_t c) const
void Set(size_t r, size_t c, Double_t a)
void SetMatrixAsString(const char *mat)
Definition TGDMLMatrix.h:46
const char * GetMatrixAsString() const
Definition TGDMLMatrix.h:47
void Print(Option_t *option="") const
Print TNamed name and title.
size_t GetRows() const
Definition TGDMLMatrix.h:44
Double_t * fMatrix
Definition TGDMLMatrix.h:56
size_t GetCols() const
Definition TGDMLMatrix.h:45
size_t fNcols
Definition TGDMLMatrix.h:55
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
TString fTitle
Definition TNamed.h:33
const char * Data() const
Definition TString.h:369