CMS 3D CMS Logo

IgNTupleRep.h

Go to the documentation of this file.
00001 #ifndef IGUANA_MODELS_IG_NTUPLE_REP_H
00002 # define IGUANA_MODELS_IG_NTUPLE_REP_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
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 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00014 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00015 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00016 
00017 class IgRepContext;
00018 class IgNTupleModel;
00019 class IgModel;
00020 
00021 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00022 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00023 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
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     // implicit copy constructor
00034     // implicit assignment operator
00035     // implicit destructor
00036     
00037     // Methods required by the iguana architecture.
00038     virtual IgRepContext *      context (void) const;
00039     virtual IgModel *           model (void) const;
00040     
00041 
00042     // NTuple managing methods.
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 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00067 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00068 
00069 #endif // IGUANA_MODELS_IG_NTUPLE_REP_H

Generated on Tue Jun 9 17:38:47 2009 for CMSSW by  doxygen 1.5.4