00001
00002
00014 #ifndef PyDataRep_H
00015 #define PyDataRep_H
00016
00017 #include "graphics/Color.h"
00018 #include "graphics/LineStyle.h"
00019 #include "graphics/SymbolType.h"
00020
00021 namespace hippodraw {
00022
00023 class DataRep;
00024 class RepBase;
00025 class DataSource;
00026 class PyDataSource;
00027 class NTuple;
00028 class QtCut;
00029
00037 class PyDataRep
00038 {
00039
00040 private:
00041
00043 hippodraw::DataRep * m_datarep;
00044
00048 std::vector<double> m_columnData;
00049
00051 static std::map< std::string, hippodraw::Symbol::Type > s_symbols;
00052
00054 static std::map< std::string, hippodraw::Line::Style > s_lineStyles;
00055
00057 static bool s_have_static_members;
00058
00060 static void makeColorMap();
00061
00063 static void makeSymbolMap();
00064
00066 static void makeLineStyleMap();
00067
00070 void init();
00071
00072 public:
00073
00075 PyDataRep ( hippodraw::DataRep * );
00076
00078 PyDataRep ( const std::string & type,
00079 const DataSource * ntuple,
00080 const std::vector< std::string > & bindings );
00081
00085 PyDataRep ( const std::string & type,
00086 const PyDataSource * ntuple,
00087 const std::vector< std::string > & bindings );
00088
00090 PyDataRep ();
00091
00093 PyDataRep ( PyDataRep * pyRep );
00094
00097 static const std::vector < std::string > & names ();
00098
00100 hippodraw::DataRep * getDataRep();
00101
00104 void setSize ( double value );
00105
00107 void setPointRep ( RepBase * pointRep );
00108
00110 void setAxisBinding ( const std::string &axis,
00111 const std::string &label );
00112
00114 void setAxisBindings ( const std::vector< std::string > & bindings );
00115
00117 void setWeight ( const std::string &label );
00118
00120 const std::string & name () const;
00121
00123 double getBinWidth ( const std::string &axis );
00124
00127 double getMean ( const std::string & axis );
00128
00131 double getRMS ( const std::string & axis );
00132
00134 double numberOfEntries() const;
00135
00137 void applyCut ( QtCut * cut );
00138
00141 void applyCuts ( const std::vector < QtCut * > & cuts );
00142
00145 const std::vector < std::string > & colorNames ();
00146
00149 void set ( Color::Value value );
00150
00155 void setColor ( const std::string & color );
00156
00158 void setErrorDisplay( const std::string &axis, bool flag );
00159
00161 const NTuple * createNTuple () const;
00162
00166 NTuple * getNTupleWithCuts () const;
00167
00169 const std::vector<double> &
00170 getColumnWithCuts(const std::string & column);
00171
00175 NTuple * createNTupleUnderRegion () const;
00176
00180 void addCut ( );
00181
00184 void setCutRange ( double low, double high );
00185
00188 void set ( hippodraw::Symbol::Type type );
00189
00190
00194 void setSymbol( const std::string &symbolName, float size=2.);
00195
00198 void set ( hippodraw::Line::Style style );
00199
00203 void setLineStyle( const std::string &lineStyle );
00204
00206 void normalizeTo ( const PyDataRep * target );
00207
00211 void setBinWidth ( const std::string & axis, double width );
00212
00213
00214 };
00215
00216 }
00217
00218 #endif // PyDataRep_H