| 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                      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);
 | 
|---|
| 41 |   virtual NTupleInterface*      GetNTupleInterface(bool& adel);
 | 
|---|
| 42 | 
 | 
|---|
| 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 | 
 | 
|---|
| 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();
 | 
|---|
| 59 |   virtual sa_size_t     NbLines() const ;
 | 
|---|
| 60 |   virtual sa_size_t     NbColumns() const ;
 | 
|---|
| 61 |   virtual r_8 *         GetLineD(sa_size_t n) const ;
 | 
|---|
| 62 |   virtual string        VarList_C(const char* nomx=NULL) const ;
 | 
|---|
| 63 | protected:
 | 
|---|
| 64 |   Vector* mVec;
 | 
|---|
| 65 |   mutable r_8 mRet[2];
 | 
|---|
| 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 | 
 | 
|---|
| 81 |   virtual string                GetDataObjType();
 | 
|---|
| 82 | 
 | 
|---|
| 83 |   virtual AnyDataObj*           CloneDataObj(bool share=false);
 | 
|---|
| 84 | 
 | 
|---|
| 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);
 | 
|---|
| 91 |   virtual NTupleInterface*      GetNTupleInterface(bool& adel);
 | 
|---|
| 92 | 
 | 
|---|
| 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 | 
 | 
|---|
| 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();
 | 
|---|
| 110 |   virtual sa_size_t     NbLines() const ;
 | 
|---|
| 111 |   virtual sa_size_t     NbColumns() const ;
 | 
|---|
| 112 |   virtual r_8 *         GetLineD(sa_size_t n) const ;
 | 
|---|
| 113 |   virtual string        VarList_C(const char* nomx=NULL) const ;
 | 
|---|
| 114 | protected:
 | 
|---|
| 115 |   Matrix* mMtx;
 | 
|---|
| 116 |   mutable r_8 mRet[3];
 | 
|---|
| 117 | };
 | 
|---|
| 118 | 
 | 
|---|
| 119 | 
 | 
|---|
| 120 | #endif
 | 
|---|