Go to the documentation of this file.00001 #ifndef TrackingMaterialPlotter_h
00002 #define TrackingMaterialPlotter_h
00003
00004 #include <algorithm>
00005 #include <vector>
00006 #include <sstream>
00007 #include <iostream>
00008 #include <iomanip>
00009
00010 #include <TH2F.h>
00011 #include <TColor.h>
00012
00013 #include "XHistogram.h"
00014 class MaterialAccountingStep;
00015
00016 class TrackingMaterialPlotter {
00017 public:
00018
00019 typedef std::pair<double, double> Range;
00020
00021 TrackingMaterialPlotter( float maxZ, float maxR, float resolution );
00022 void plotSegmentUnassigned( const MaterialAccountingStep & step );
00023 void plotSegmentInLayer( const MaterialAccountingStep & step, int layer );
00024
00025 void normalize( void ) {
00026 m_tracker.normalize();
00027 }
00028
00029 void draw( void );
00030
00031 private:
00032 XHistogram m_tracker;
00033
00034 std::vector<int> m_color;
00035 std::vector<int> m_gradient;
00036
00037 void fill_color();
00038 unsigned int fill_gradient(const TColor & first, const TColor & last, unsigned int steps = 100, unsigned int index = 0);
00039 unsigned int fill_gradient(unsigned int first, unsigned int last, unsigned int steps = 100, unsigned int index = 0);
00040
00041 };
00042
00043 #endif // TrackingMaterialPlotter_h