| [295] | 1 | // This may look like C code, but it is really -*- C++ -*- | 
|---|
|  | 2 | // Adaptateur d objets (pour NamedObjMgr) pour Histos/NTuple | 
|---|
|  | 3 | //                                    Reza 05/99 | 
|---|
|  | 4 | //  LAL-IN2P3/CNRS               CEA-DAPNIA | 
|---|
|  | 5 |  | 
|---|
|  | 6 | #ifndef NOMMATVECADAPTER_H_SEEN | 
|---|
|  | 7 | #define NOMMATVECADAPTER_H_SEEN | 
|---|
|  | 8 |  | 
|---|
|  | 9 | #include "nomgadapter.h" | 
|---|
| [1207] | 10 | #include "generalfit.h" | 
|---|
| [544] | 11 |  | 
|---|
|  | 12 | #ifdef SANS_EVOLPLANCK | 
|---|
| [295] | 13 | #include "matrix.h" | 
|---|
|  | 14 | #include "cvector.h" | 
|---|
| [544] | 15 | #else | 
|---|
|  | 16 | #include "tmatrix.h" | 
|---|
|  | 17 | #include "tvector.h" | 
|---|
|  | 18 | #endif | 
|---|
| [295] | 19 |  | 
|---|
|  | 20 | //--------------------------------------------------------------- | 
|---|
|  | 21 | // Class Adaptateur d'objet (Pour NamedObjMgr) d'objet Vector | 
|---|
|  | 22 | //--------------------------------------------------------------- | 
|---|
|  | 23 |  | 
|---|
|  | 24 | class NOMAdapter_Vector : public NObjMgrAdapter { | 
|---|
|  | 25 | public: | 
|---|
|  | 26 | NOMAdapter_Vector(Vector* v = NULL); | 
|---|
|  | 27 | virtual                       ~NOMAdapter_Vector(); | 
|---|
|  | 28 |  | 
|---|
|  | 29 | virtual NObjMgrAdapter*       Clone(AnyDataObj* o); | 
|---|
|  | 30 |  | 
|---|
| [1165] | 31 | virtual string                GetDataObjType(); | 
|---|
|  | 32 |  | 
|---|
| [1315] | 33 | virtual AnyDataObj*           CloneDataObj(bool share=false); | 
|---|
| [1165] | 34 |  | 
|---|
| [295] | 35 | //  virtual void                      ReadFits(string const & flnm); | 
|---|
|  | 36 | //  virtual void                      SaveFits(string const & flnm); | 
|---|
|  | 37 | virtual void                  SavePPF(POutPersist& s, string const & nom); | 
|---|
|  | 38 |  | 
|---|
|  | 39 | virtual void                  Print(ostream& os); | 
|---|
|  | 40 | virtual PIDrawer*             GetDrawer(string& dopt); | 
|---|
| [344] | 41 | virtual NTupleInterface*      GetNTupleInterface(bool& adel); | 
|---|
| [295] | 42 |  | 
|---|
| [1207] | 43 | virtual GeneralFitData* GetGeneralFitData(bool& adel | 
|---|
|  | 44 | ,GeneralFitData::FitErrType errtype=GeneralFitData::DefaultError | 
|---|
|  | 45 | ,double errscale=1.,double errmin=0. | 
|---|
|  | 46 | ,int i1=0,int i2=-1,int j1=0,int j2=-1); | 
|---|
|  | 47 | virtual AnyDataObj* FitResidusObj(GeneralFit& mfit); | 
|---|
|  | 48 | virtual AnyDataObj* FitFunctionObj(GeneralFit& mfit); | 
|---|
|  | 49 |  | 
|---|
| [295] | 50 | protected: | 
|---|
|  | 51 | Vector* mVec; | 
|---|
|  | 52 | }; | 
|---|
|  | 53 |  | 
|---|
|  | 54 | // Class Interface NTuple pour Vector | 
|---|
|  | 55 | class NTupInt_Vector : public NTupleInterface { | 
|---|
|  | 56 | public: | 
|---|
|  | 57 | NTupInt_Vector(Vector* v); | 
|---|
|  | 58 | virtual               ~NTupInt_Vector(); | 
|---|
| [326] | 59 | virtual uint_4        NbLines() const ; | 
|---|
|  | 60 | virtual uint_4        NbColumns() const ; | 
|---|
|  | 61 | virtual r_8 *         GetLineD(int n) const ; | 
|---|
|  | 62 | virtual string        VarList_C(const char* nomx=NULL) const ; | 
|---|
| [295] | 63 | protected: | 
|---|
|  | 64 | Vector* mVec; | 
|---|
| [326] | 65 | mutable r_8 mRet[2]; | 
|---|
| [295] | 66 | }; | 
|---|
|  | 67 |  | 
|---|
|  | 68 |  | 
|---|
|  | 69 |  | 
|---|
|  | 70 | //--------------------------------------------------------------- | 
|---|
|  | 71 | // Class Adaptateur d'objet (Pour NamedObjMgr) d'objet Matrix | 
|---|
|  | 72 | //--------------------------------------------------------------- | 
|---|
|  | 73 |  | 
|---|
|  | 74 | class NOMAdapter_Matrix : public NObjMgrAdapter { | 
|---|
|  | 75 | public: | 
|---|
|  | 76 | NOMAdapter_Matrix(Matrix* m = NULL); | 
|---|
|  | 77 | virtual                       ~NOMAdapter_Matrix(); | 
|---|
|  | 78 |  | 
|---|
|  | 79 | virtual NObjMgrAdapter*       Clone(AnyDataObj* o); | 
|---|
|  | 80 |  | 
|---|
| [1165] | 81 | virtual string                GetDataObjType(); | 
|---|
|  | 82 |  | 
|---|
| [1315] | 83 | virtual AnyDataObj*           CloneDataObj(bool share=false); | 
|---|
| [1165] | 84 |  | 
|---|
| [295] | 85 | //  virtual void                      ReadFits(string const & flnm); | 
|---|
|  | 86 | //  virtual void                      SaveFits(string const & flnm); | 
|---|
|  | 87 | virtual void                  SavePPF(POutPersist& s, string const & nom); | 
|---|
|  | 88 |  | 
|---|
|  | 89 | virtual void                  Print(ostream& os); | 
|---|
|  | 90 | virtual P2DArrayAdapter*      Get2DArray(string& dopt); | 
|---|
| [344] | 91 | virtual NTupleInterface*      GetNTupleInterface(bool& adel); | 
|---|
| [295] | 92 |  | 
|---|
| [1207] | 93 | virtual GeneralFitData* GetGeneralFitData(bool& adel | 
|---|
|  | 94 | ,GeneralFitData::FitErrType errtype=GeneralFitData::DefaultError | 
|---|
|  | 95 | ,double errscale=1.,double errmin=0. | 
|---|
|  | 96 | ,int i1=0,int i2=-1,int j1=0,int j2=-1); | 
|---|
|  | 97 | virtual AnyDataObj* FitResidusObj(GeneralFit& mfit); | 
|---|
|  | 98 | virtual AnyDataObj* FitFunctionObj(GeneralFit& mfit); | 
|---|
|  | 99 |  | 
|---|
| [295] | 100 | protected: | 
|---|
|  | 101 | Matrix* mMtx; | 
|---|
|  | 102 | }; | 
|---|
|  | 103 |  | 
|---|
|  | 104 | // Class Interface NTuple pour Matrix | 
|---|
|  | 105 |  | 
|---|
|  | 106 | class NTupInt_Matrix : public NTupleInterface { | 
|---|
|  | 107 | public: | 
|---|
|  | 108 | NTupInt_Matrix(Matrix* m); | 
|---|
|  | 109 | virtual               ~NTupInt_Matrix(); | 
|---|
| [326] | 110 | virtual uint_4        NbLines() const ; | 
|---|
|  | 111 | virtual uint_4        NbColumns() const ; | 
|---|
|  | 112 | virtual r_8 *         GetLineD(int n) const ; | 
|---|
|  | 113 | virtual string        VarList_C(const char* nomx=NULL) const ; | 
|---|
| [295] | 114 | protected: | 
|---|
|  | 115 | Matrix* mMtx; | 
|---|
| [326] | 116 | mutable r_8 mRet[3]; | 
|---|
| [295] | 117 | }; | 
|---|
|  | 118 |  | 
|---|
|  | 119 |  | 
|---|
|  | 120 | #endif | 
|---|