| 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" | 
|---|
| 10 | #include "generalfit.h" | 
|---|
| 11 |  | 
|---|
| 12 | #ifdef SANS_EVOLPLANCK | 
|---|
| 13 | #include "matrix.h" | 
|---|
| 14 | #include "cvector.h" | 
|---|
| 15 | #else | 
|---|
| 16 | #include "tmatrix.h" | 
|---|
| 17 | #include "tvector.h" | 
|---|
| 18 | #endif | 
|---|
| 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 |  | 
|---|
| 31 | virtual string                GetDataObjType(); | 
|---|
| 32 |  | 
|---|
| 33 | virtual AnyDataObj*           CloneDataObj(bool share=false); | 
|---|
| 34 |  | 
|---|
| 35 | virtual void                  SavePPF(POutPersist& s, string const & nom); | 
|---|
| 36 |  | 
|---|
| 37 | virtual void                  Print(ostream& os, int lev=0); | 
|---|
| 38 | virtual PIDrawer*             GetDrawer(string& dopt); | 
|---|
| 39 | virtual NTupleInterface*      GetNTupleInterface(bool& adel); | 
|---|
| 40 |  | 
|---|
| 41 | virtual GeneralFitData* GetGeneralFitData(bool& adel | 
|---|
| 42 | ,GeneralFitData::FitErrType errtype=GeneralFitData::DefaultError | 
|---|
| 43 | ,double errscale=1.,double errmin=0. | 
|---|
| 44 | ,int i1=0,int i2=-1,int j1=0,int j2=-1); | 
|---|
| 45 | virtual AnyDataObj* FitResidusObj(GeneralFit& mfit); | 
|---|
| 46 | virtual AnyDataObj* FitFunctionObj(GeneralFit& mfit); | 
|---|
| 47 |  | 
|---|
| 48 | protected: | 
|---|
| 49 | Vector* mVec; | 
|---|
| 50 | }; | 
|---|
| 51 |  | 
|---|
| 52 | // Class Interface NTuple pour Vector | 
|---|
| 53 | class NTupInt_Vector : public NTupleInterface { | 
|---|
| 54 | public: | 
|---|
| 55 | NTupInt_Vector(Vector* v); | 
|---|
| 56 | virtual               ~NTupInt_Vector(); | 
|---|
| 57 | virtual sa_size_t     NbLines() const ; | 
|---|
| 58 | virtual sa_size_t     NbColumns() const ; | 
|---|
| 59 | virtual r_8 *         GetLineD(sa_size_t n) const ; | 
|---|
| 60 | virtual string        VarList_C(const char* nomx=NULL) const ; | 
|---|
| 61 | protected: | 
|---|
| 62 | Vector* mVec; | 
|---|
| 63 | mutable r_8 mRet[2]; | 
|---|
| 64 | }; | 
|---|
| 65 |  | 
|---|
| 66 |  | 
|---|
| 67 |  | 
|---|
| 68 | //--------------------------------------------------------------- | 
|---|
| 69 | // Class Adaptateur d'objet (Pour NamedObjMgr) d'objet Matrix | 
|---|
| 70 | //--------------------------------------------------------------- | 
|---|
| 71 |  | 
|---|
| 72 | class NOMAdapter_Matrix : public NObjMgrAdapter { | 
|---|
| 73 | public: | 
|---|
| 74 | NOMAdapter_Matrix(Matrix* m = NULL); | 
|---|
| 75 | virtual                       ~NOMAdapter_Matrix(); | 
|---|
| 76 |  | 
|---|
| 77 | virtual NObjMgrAdapter*       Clone(AnyDataObj* o); | 
|---|
| 78 |  | 
|---|
| 79 | virtual string                GetDataObjType(); | 
|---|
| 80 |  | 
|---|
| 81 | virtual AnyDataObj*           CloneDataObj(bool share=false); | 
|---|
| 82 |  | 
|---|
| 83 | virtual void                  SavePPF(POutPersist& s, string const & nom); | 
|---|
| 84 |  | 
|---|
| 85 | virtual void                  Print(ostream& os, int lev=0); | 
|---|
| 86 | virtual P2DArrayAdapter*      Get2DArray(string& dopt); | 
|---|
| 87 | virtual NTupleInterface*      GetNTupleInterface(bool& adel); | 
|---|
| 88 |  | 
|---|
| 89 | virtual GeneralFitData* GetGeneralFitData(bool& adel | 
|---|
| 90 | ,GeneralFitData::FitErrType errtype=GeneralFitData::DefaultError | 
|---|
| 91 | ,double errscale=1.,double errmin=0. | 
|---|
| 92 | ,int i1=0,int i2=-1,int j1=0,int j2=-1); | 
|---|
| 93 | virtual AnyDataObj* FitResidusObj(GeneralFit& mfit); | 
|---|
| 94 | virtual AnyDataObj* FitFunctionObj(GeneralFit& mfit); | 
|---|
| 95 |  | 
|---|
| 96 | protected: | 
|---|
| 97 | Matrix* mMtx; | 
|---|
| 98 | }; | 
|---|
| 99 |  | 
|---|
| 100 | // Class Interface NTuple pour Matrix | 
|---|
| 101 |  | 
|---|
| 102 | class NTupInt_Matrix : public NTupleInterface { | 
|---|
| 103 | public: | 
|---|
| 104 | NTupInt_Matrix(Matrix* m); | 
|---|
| 105 | virtual               ~NTupInt_Matrix(); | 
|---|
| 106 | virtual sa_size_t     NbLines() const ; | 
|---|
| 107 | virtual sa_size_t     NbColumns() const ; | 
|---|
| 108 | virtual r_8 *         GetLineD(sa_size_t n) const ; | 
|---|
| 109 | virtual string        VarList_C(const char* nomx=NULL) const ; | 
|---|
| 110 | protected: | 
|---|
| 111 | Matrix* mMtx; | 
|---|
| 112 | mutable r_8 mRet[3]; | 
|---|
| 113 | }; | 
|---|
| 114 |  | 
|---|
| 115 |  | 
|---|
| 116 | #endif | 
|---|