00001
00002
00014 #ifndef PyDataRep_H
00015 #define PyDataRep_H
00016
00017 #include "graphics/SymbolType.h"
00018 #include "graphics/LineStyle.h"
00019
00020 #include <vector>
00021 #include <string>
00022 #include <map>
00023
00024 class RepBase;
00025 class DataRep;
00026 class DataSource;
00027 class PyDataSource;
00028 class NTuple;
00029 class QtCut;
00030
00037 class PyDataRep
00038 {
00039
00040 private:
00041
00043 DataRep * m_datarep;
00044
00046 static std::map< std::string, std::vector<int> > s_colorMap;
00047
00049 static std::map< std::string, hippodraw::Symbol::Type > s_symbols;
00050
00052 static std::map< std::string, hippodraw::Line::Style > s_lineStyles;
00053
00055 static bool s_have_static_members;
00056
00058 static void makeColorMap();
00059
00061 static void makeSymbolMap();
00062
00064 static void makeLineStyleMap();
00065
00068 void init();
00069
00070 public:
00071
00073 PyDataRep ( DataRep * );
00074
00076 PyDataRep ( const std::string & type,
00077 const DataSource * ntuple,
00078 const std::vector< std::string > & bindings );
00079
00083 PyDataRep ( const std::string & type,
00084 const PyDataSource * ntuple,
00085 const std::vector< std::string > & bindings );
00086
00088 PyDataRep ();
00089
00091 PyDataRep ( PyDataRep * pyRep );
00092
00094 DataRep * getDataRep();
00095
00097 void setPointRep ( RepBase * pointRep );
00098
00100 void setAxisBinding ( const std::string &axis,
00101 const std::string &label );
00102
00104 void setAxisBindings ( const std::vector< std::string > & bindings );
00105
00107 void setWeight ( const std::string &label );
00108
00110 const std::string & name () const;
00111
00113 double getBinWidth ( const std::string &axis );
00114
00117 double getMean ( const std::string & axis );
00118
00121 double getRMS ( const std::string & axis );
00122
00124 double numberOfEntries() const;
00125
00127 void applyCut ( QtCut * cut );
00128
00133 void setColor ( const std::string & color );
00134
00136 void setErrorDisplay( const std::string &axis, bool flag );
00137
00139 const NTuple * createNTuple () const;
00140
00144 NTuple * getNTupleWithCuts () const;
00145
00147 void setSymbol( const std::string &symbolName, float size=2.);
00148
00150 void setLineStyle( const std::string &lineStyle );
00151
00153 void normalizeTo ( const PyDataRep * target );
00154
00158 void setBinWidth ( const std::string & axis, double width );
00159
00160 };
00161
00162 #endif // PyDataRep_H