File indexing completed on 2023-03-17 11:25:49
0001 #ifndef TrackingMaterialPlotter_h
0002 #define TrackingMaterialPlotter_h
0003
0004 #include <algorithm>
0005 #include <vector>
0006 #include <sstream>
0007 #include <iostream>
0008 #include <iomanip>
0009
0010 #include <TH2F.h>
0011 #include <TColor.h>
0012
0013 #include "XHistogram.h"
0014 class MaterialAccountingStep;
0015
0016 class TrackingMaterialPlotter {
0017 public:
0018 typedef std::pair<double, double> Range;
0019
0020 TrackingMaterialPlotter(float maxZ, float maxR, float resolution);
0021 void plotSegmentUnassigned(const MaterialAccountingStep& step);
0022 void plotSegmentInLayer(const MaterialAccountingStep& step, int layer);
0023
0024 void normalize(void) { m_tracker.normalize(); }
0025
0026 void draw(void);
0027
0028 private:
0029 XHistogram m_tracker;
0030
0031 std::vector<int> m_color;
0032 std::vector<int> m_gradient;
0033
0034 void fill_color();
0035 unsigned int fill_gradient(const TColor& first, const TColor& last, unsigned int steps = 100, unsigned int index = 0);
0036 unsigned int fill_gradient(unsigned int first, unsigned int last, unsigned int steps = 100, unsigned int index = 0);
0037 };
0038
0039 #endif