49 m_color.push_back(kOrange + 10);
64 m_color.push_back(kMagenta + 1);
65 m_color.push_back(kMagenta + 2);
66 m_color.push_back(kMagenta + 3);
67 m_color.push_back(kMagenta + 4);
68 m_color.push_back(kMagenta + 5);
69 m_color.push_back(kMagenta + 6);
70 m_color.push_back(kMagenta + 7);
71 m_color.push_back(kMagenta + 8);
79 index = ((TObjArray*) gROOT->GetListOfColors())->GetLast() + 1;
83 first.GetRGB(r1, g1, b1);
84 last.GetRGB(r2, g2, b2);
86 float delta_g = (g2 -
g1) / (steps - 1);
87 float delta_b = (b2 - b1) / (steps - 1);
90 for (
unsigned int i = 0;
i <
steps; ++
i) {
91 new TColor(static_cast<Int_t>(index +
i), r1 + delta_r *
i, g1 + delta_g * i, b1 + delta_b * i);
100 return fill_gradient(* (TColor *) gROOT->GetListOfColors()->At(first), * (TColor *) gROOT->GetListOfColors()->At(last),
steps,
index);
105 const float rzMinZ = -
maxZ;
106 const float rzMaxZ =
maxZ;
107 const float rzMinR = 0.;
108 const float rzMaxR = maxR;
109 const int rzBinsZ = (
int) (2. * maxZ * resolution);
110 const int rzBinsR = (
int) ( maxR * resolution);
112 std::vector<double>
max;
113 max.push_back( 0.08 );
114 max.push_back( 0.00016 );
117 TColor::InitializeColors();
124 std::vector<double>
w(2);
134 std::vector<double>
w(2);
139 w, step.
length(), layer+1 );
145 const double scale = 10.;
149 canvas =
new TCanvas(
"radlen_rz",
"RadiationLengths - RZ view", (
int) (600 * scale * 1.25), (
int) (120 * scale * 1.50));
150 gStyle->SetOptStat(0);
152 gStyle->SetNumberContours(
m_gradient.size() );
153 canvas->GetFrame()->SetFillColor(kWhite);
154 radlen->Draw(
"colz");
155 radlen->Draw(
"same axis y+");
156 radlen->SaveAs(
"radlen.root");
157 canvas->SaveAs(
"radlen.png");
162 double stops[9] = { 0.0000, 0.1250, 0.2500, 0.3750, 0.5000, 0.6250, 0.7500, 0.8750, 1.0000};
163 double red[9] = { 0./255., 5./255., 15./255., 35./255., 102./255., 196./255., 208./255., 199./255., 110./255.};
164 double green[9] = { 0./255., 48./255., 124./255., 192./255., 206./255., 226./255., 97./255., 16./255., 0./255.};
165 double blue[9] = { 99./255., 142./255., 198./255., 201./255., 90./255., 22./255., 13./255., 8./255., 2./255.};
166 int palette_index = TColor::CreateGradientColorTable(9, stops, red, green, blue, 100 - white_slots);
167 for (
int i=0;
i<white_slots;
i++) MyPalette[
i] = kWhite;
168 for (
int i=0;
i<100-white_slots;
i++) MyPalette[
i + white_slots] = palette_index +
i;
170 gStyle->SetNumberContours( 100 );
171 gStyle->SetPalette(100, MyPalette);
172 radlen->Draw(
"colz");
173 radlen->Draw(
"same axis y+");
174 canvas->SaveAs(
"radlenColor.png");
179 canvas =
new TCanvas(
"dedx_rz",
"-dE/dx term - RZ view", (
int) (600 * scale * 1.25), (
int) (120 * scale * 1.50));
180 canvas->GetFrame()->SetFillColor(kWhite);
181 gStyle->SetOptStat(0);
183 gStyle->SetNumberContours(
m_gradient.size() );
185 dedx->Draw(
"same axis y+");
186 dedx->SaveAs(
"dedx.root");
187 canvas->SaveAs(
"dedx.png");
189 gStyle->SetNumberContours( 100 );
190 gStyle->SetPalette(100, MyPalette);
192 dedx->Draw(
"same axis y+");
193 canvas->SaveAs(
"dedxColor.png");
197 canvas =
new TCanvas(
"layer_rz",
"Layers - RZ view", (
int) (600 * scale * 1.25), (
int) (120 * scale * 1.50));
198 canvas->GetFrame()->SetFillColor(kWhite);
199 gStyle->SetOptStat(0);
201 gStyle->SetNumberContours(
m_color.size() );
202 colormap->SetMinimum( 1 );
203 colormap->SetMaximum(
m_color.size() );
204 colormap->Draw(
"col");
205 colormap->Draw(
"same axis y+");
206 colormap->SaveAs(
"layers.root");
207 canvas->SaveAs(
"layers.png");
void plotSegmentUnassigned(const MaterialAccountingStep &step)
ColorMap * colormap(void) const
access the colormap
double length(void) const
double radiationLengths(void) const
Histogram * get(size_t h=0) const
access one of the histograms
std::vector< int > m_color
double energyLoss(void) const
TrackingMaterialPlotter(float maxZ, float maxR, float resolution)
double delta_r(const Fourvec &a, const Fourvec &b)
Find the distance between two four-vectors in the two-dimensional space .
std::vector< int > m_gradient
unsigned int fill_gradient(const TColor &first, const TColor &last, unsigned int steps=100, unsigned int index=0)
const GlobalPoint & out(void) const
void plotSegmentInLayer(const MaterialAccountingStep &step, int layer)
void fill(double x, double y, const std::vector< double > &weight, double norm)
fill one point
const GlobalPoint & in(void) const