// Author: I. Froehlich
// Written: 1.08.2009
// Revised: 
// PArray
// 1 or 2dim array from file(s)

#ifndef _PARRAY_H_
#define _PARRAY_H_

#include "TObject.h"
#include "TGraph.h"
#include "TGraph2D.h"
#include "TArrayD.h"


#define PARRAY_GRANULARITY 10
#define PARRAY_MAX_COLUMNS 10

class PArray : public TObject {

 private:

    Int_t dim;        //! Dimension of the function
    FILE *fp;         //! input file pointer

    TArrayD *vals_1d[PARRAY_MAX_COLUMNS];
    TArrayD *vals_2d;
    Int_t    real_size_1d;
    Double_t scaling;
   

 public:

    //constructor
    PArray(Int_t dimension);
    ~PArray();
 
    void Scaling(Double_t sc) {
	scaling=sc;
    };
    Bool_t    OpenFile(const char *filename, Int_t syntax, Int_t num_columns, Double_t y=0);
    TGraph   *GetTGraph(Int_t xcol, Int_t ycol);
    TGraph2D *GetTGraph2D(Int_t xcol, Int_t ycol);


    ClassDef(PArray, 0)  //Tool class to convert txt-files to TGraph(s)
};

#endif
 PArray.h:1
 PArray.h:2
 PArray.h:3
 PArray.h:4
 PArray.h:5
 PArray.h:6
 PArray.h:7
 PArray.h:8
 PArray.h:9
 PArray.h:10
 PArray.h:11
 PArray.h:12
 PArray.h:13
 PArray.h:14
 PArray.h:15
 PArray.h:16
 PArray.h:17
 PArray.h:18
 PArray.h:19
 PArray.h:20
 PArray.h:21
 PArray.h:22
 PArray.h:23
 PArray.h:24
 PArray.h:25
 PArray.h:26
 PArray.h:27
 PArray.h:28
 PArray.h:29
 PArray.h:30
 PArray.h:31
 PArray.h:32
 PArray.h:33
 PArray.h:34
 PArray.h:35
 PArray.h:36
 PArray.h:37
 PArray.h:38
 PArray.h:39
 PArray.h:40
 PArray.h:41
 PArray.h:42
 PArray.h:43
 PArray.h:44
 PArray.h:45
 PArray.h:46
 PArray.h:47
 PArray.h:48
 PArray.h:49