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// TGDMLProperty - A property with a name and a reference name pointing //
20// to a GDML matrix object //
21////////////////////////////////////////////////////////////////////////////
22
24
25////////////////////////////////////////////////////////////////////////////
26// //
27// TGDMLMatrix - A matrix used for GDML parsing, the objects have to be //
28// exposed via TGeoManager interfcace to be able to construct optical //
29// surfaces. //
30// //
31////////////////////////////////////////////////////////////////////////////
32
33class TGDMLMatrix : public TNamed {
34public:
36 TGDMLMatrix(const char *name, size_t rows, size_t cols);
37 TGDMLMatrix(const TGDMLMatrix &rhs);
39 ~TGDMLMatrix() override { delete[] fMatrix; }
40
41 void Set(size_t r, size_t c, Double_t a);
42 Double_t Get(size_t r, size_t c) const;
43 size_t GetRows() const { return fNrows; }
44 size_t GetCols() const { return fNcols; }
45 void SetMatrixAsString(const char *mat) { fTitle = mat; }
46 const char *GetMatrixAsString() const { return fTitle.Data(); }
47
48 void Print(Option_t *option = "") const override;
49
50private:
51 Int_t fNelem = 0; // Number of elements
52 size_t fNrows = 0; // Number of rows
53 size_t fNcols = 0; // Number of columns
54 Double_t *fMatrix = nullptr; // [fNelem] Matrix elements
55
56 ClassDefOverride(TGDMLMatrix, 1) // Class representing a matrix used temporary for GDML parsing
57};
58
59#endif /* ROOT_TGDMLMATRIX */
#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 ClassDefOverride(name, id)
Definition Rtypes.h:346
TNamed TGDMLProperty
Definition TGDMLMatrix.h:23
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
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:33
size_t fNrows
Definition TGDMLMatrix.h:52
TGDMLMatrix & operator=(const TGDMLMatrix &rhs)
void Print(Option_t *option="") const override
This method must be overridden when a class wants to print itself.
Double_t Get(size_t r, size_t c) const
void Set(size_t r, size_t c, Double_t a)
~TGDMLMatrix() override
Definition TGDMLMatrix.h:39
void SetMatrixAsString(const char *mat)
Definition TGDMLMatrix.h:45
const char * GetMatrixAsString() const
Definition TGDMLMatrix.h:46
size_t GetRows() const
Definition TGDMLMatrix.h:43
Double_t * fMatrix
Definition TGDMLMatrix.h:54
size_t GetCols() const
Definition TGDMLMatrix.h:44
size_t fNcols
Definition TGDMLMatrix.h:53
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:376