Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGDMLMatrix.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gdml:$Id$
0002 // Author: Andrei Gheata 05/12/2018
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGDMLMATRIX
0013 #define ROOT_TGDMLMATRIX
0014 
0015 #include <TNamed.h>
0016 
0017 ////////////////////////////////////////////////////////////////////////////
0018 //                                                                        //
0019 // TGDMLProperty - A property with a name and a reference name pointing   //
0020 //     to a GDML matrix object                                            //
0021 ////////////////////////////////////////////////////////////////////////////
0022 
0023 typedef TNamed TGDMLProperty;
0024 
0025 ////////////////////////////////////////////////////////////////////////////
0026 //                                                                        //
0027 // TGDMLMatrix - A matrix used for GDML parsing, the objects have to be   //
0028 //     exposed via TGeoManager interfcace to be able to construct optical //
0029 //     surfaces.                                                          //
0030 //                                                                        //
0031 ////////////////////////////////////////////////////////////////////////////
0032 
0033 class TGDMLMatrix : public TNamed {
0034 public:
0035    TGDMLMatrix() {}
0036    TGDMLMatrix(const char *name, size_t rows, size_t cols);
0037    TGDMLMatrix(const TGDMLMatrix &rhs);
0038    TGDMLMatrix &operator=(const TGDMLMatrix &rhs);
0039    ~TGDMLMatrix() override { delete[] fMatrix; }
0040 
0041    void Set(size_t r, size_t c, Double_t a);
0042    Double_t Get(size_t r, size_t c) const;
0043    size_t GetRows() const { return fNrows; }
0044    size_t GetCols() const { return fNcols; }
0045    void SetMatrixAsString(const char *mat) { fTitle = mat; }
0046    const char *GetMatrixAsString() const { return fTitle.Data(); }
0047 
0048    void Print(Option_t *option = "") const override;
0049 
0050 private:
0051    Int_t fNelem = 0;            // Number of elements
0052    size_t fNrows = 0;           // Number of rows
0053    size_t fNcols = 0;           // Number of columns
0054    Double_t *fMatrix = nullptr; // [fNelem] Matrix elements
0055 
0056    ClassDefOverride(TGDMLMatrix, 1) // Class representing a matrix used temporary for GDML parsing
0057 };
0058 
0059 #endif /* ROOT_TGDMLMATRIX */