00001 #ifndef IGUANA_MODELS_IG_NTUPLE_REP_H
00002 # define IGUANA_MODELS_IG_NTUPLE_REP_H
00003
00004
00005
00006 # include "Iguana/Models/interface/config.h"
00007 # include "Iguana/Framework/interface/IgRep.h"
00008 # include <vector>
00009 # include <deque>
00010 # include <string>
00011 # include <map>
00012
00013
00014
00015
00016
00017 class IgRepContext;
00018 class IgNTupleModel;
00019 class IgModel;
00020
00021
00022
00023
00024
00025 class IGUANA_MODELS_API IgNTupleRep : public IgRep
00026 {
00027 public:
00028 typedef std::string ColumnName;
00029 typedef std::vector<ColumnName> ColumnNames;
00030 typedef std::vector<double> Row;
00031
00032 IgNTupleRep (IgNTupleModel *model);
00033
00034
00035
00036
00037
00038 virtual IgRepContext * context (void) const;
00039 virtual IgModel * model (void) const;
00040
00041
00042
00043 virtual void copy (const IgNTupleRep &source);
00044 virtual void clear (void);
00045 virtual void addRow (const Row &values);
00046 virtual const Row &getRow (unsigned int row) const;
00047 virtual double valueAt (unsigned int column,
00048 unsigned int row) const;
00049 virtual bool empty (void) const;
00050 virtual void columnNames (const ColumnNames &names);
00051 virtual const ColumnNames & columnNames (void) const;
00052 virtual int rows (void) const;
00053
00054 protected:
00055 virtual void context (IgRepContext *context);
00056 private:
00057 typedef std::map<ColumnName, unsigned int> ColumnNamesMap;
00058 typedef std::deque<Row> Rows;
00059 ColumnNames m_columnNames;
00060 ColumnNamesMap m_columnNamesMap;
00061 Rows m_rows;
00062 IgNTupleModel * m_model;
00063 IgRepContext * m_context;
00064 };
00065
00066
00067
00068
00069 #endif // IGUANA_MODELS_IG_NTUPLE_REP_H