17 m_color.emplace_back(kAzure + 1);
18 m_color.emplace_back(kAzure + 1);
19 m_color.emplace_back(kAzure + 3);
20 m_color.emplace_back(kAzure + 3);
23 m_color.emplace_back(kGreen + 2);
24 m_color.emplace_back(kGreen + 2);
25 m_color.emplace_back(kGreen - 3);
26 m_color.emplace_back(kGreen - 3);
27 m_color.emplace_back(kGreen - 1);
28 m_color.emplace_back(kGreen - 1);
38 m_color.emplace_back(kOrange + 9);
39 m_color.emplace_back(kOrange + 9);
40 m_color.emplace_back(kOrange + 9);
41 m_color.emplace_back(kOrange + 7);
42 m_color.emplace_back(kOrange + 7);
43 m_color.emplace_back(kOrange + 7);
44 m_color.emplace_back(kOrange + 5);
45 m_color.emplace_back(kOrange + 5);
46 m_color.emplace_back(kOrange + 5);
47 m_color.emplace_back(kOrange + 8);
48 m_color.emplace_back(kOrange + 10);
49 m_color.emplace_back(kOrange - 3);
50 m_color.emplace_back(kOrange - 1);
51 m_color.emplace_back(kOrange - 8);
54 m_color.emplace_back(kYellow + 2);
55 m_color.emplace_back(kYellow + 2);
56 m_color.emplace_back(kYellow + 2);
57 m_color.emplace_back(kYellow + 3);
63 m_color.emplace_back(kMagenta + 1);
64 m_color.emplace_back(kMagenta + 2);
65 m_color.emplace_back(kMagenta + 3);
66 m_color.emplace_back(kMagenta + 4);
67 m_color.emplace_back(kMagenta + 5);
68 m_color.emplace_back(kMagenta + 6);
69 m_color.emplace_back(kMagenta + 7);
70 m_color.emplace_back(kMagenta + 8);
76 unsigned int index ) {
79 index = ((TObjArray*)gROOT->GetListOfColors())->GetLast() + 1;
90 for (
unsigned int i = 0;
i <
steps; ++
i) {
99 const unsigned int&
last,
100 const unsigned int&
steps,
101 const unsigned int&
index) {
103 *(TColor*)gROOT->GetListOfColors()->At(
first), *(TColor*)gROOT->GetListOfColors()->At(
last),
steps,
index);
107 const float rzMinZ = -
maxZ;
108 const float rzMaxZ =
maxZ;
109 const float rzMinR = 0.;
110 const float rzMaxR = maxR;
114 std::vector<double>
max;
115 max.emplace_back(0.08);
116 max.emplace_back(0.00016);
118 2, rzBinsZ, rzBinsR, std::make_pair(rzMinZ, rzMaxZ), std::make_pair(rzMinR, rzMaxR),
m_color.size(),
max);
120 TColor::InitializeColors();
126 std::vector<double>
w(2);
127 w[0] =
step.radiationLengths();
128 w[1] =
step.energyLoss();
130 std::make_pair(
step.in().perp(),
step.out().perp()),
137 std::vector<double>
w(2);
138 w[0] =
step.radiationLengths();
139 w[1] =
step.energyLoss();
141 std::make_pair(
step.in().perp(),
step.out().perp()),
148 const double scale = 10.;
149 std::unique_ptr<TCanvas>
canvas;
152 canvas = std::make_unique<TCanvas>(
153 "radlen_rz",
"RadiationLengths - RZ view", (
int)(600 *
scale * 1.25), (
int)(120 *
scale * 1.50));
154 gStyle->SetOptStat(0);
157 canvas->GetFrame()->SetFillColor(kWhite);
158 radlen->Draw(
"colz");
159 radlen->Draw(
"same axis y+");
160 radlen->SaveAs(
"radlen.root");
161 canvas->SaveAs(
"radlen.png");
166 double stops[9] = {0.0000, 0.1250, 0.2500, 0.3750, 0.5000, 0.6250, 0.7500, 0.8750, 1.0000};
168 0. / 255., 5. / 255., 15. / 255., 35. / 255., 102. / 255., 196. / 255., 208. / 255., 199. / 255., 110. / 255.};
170 0. / 255., 48. / 255., 124. / 255., 192. / 255., 206. / 255., 226. / 255., 97. / 255., 16. / 255., 0. / 255.};
172 99. / 255., 142. / 255., 198. / 255., 201. / 255., 90. / 255., 22. / 255., 13. / 255., 8. / 255., 2. / 255.};
173 int palette_index = TColor::CreateGradientColorTable(9, stops,
red, green,
blue, 100 - white_slots);
174 for (
int i = 0;
i < white_slots;
i++)
175 MyPalette[
i] = kWhite;
176 for (
int i = 0;
i < 100 - white_slots;
i++)
177 MyPalette[
i + white_slots] = palette_index +
i;
179 gStyle->SetNumberContours(100);
180 gStyle->SetPalette(100, MyPalette);
181 radlen->Draw(
"colz");
182 radlen->Draw(
"same axis y+");
183 canvas->SaveAs(
"radlenColor.png");
186 canvas->SetName(
"dedx_rz");
187 canvas->SetTitle(
"-dE/dx term - RZ view");
188 canvas->GetFrame()->SetFillColor(kWhite);
190 dedx->Draw(
"same axis y+");
191 dedx->SaveAs(
"dedx.root");
192 canvas->SaveAs(
"dedx.png");
194 gStyle->SetNumberContours(100);
195 gStyle->SetPalette(100, MyPalette);
197 dedx->Draw(
"same axis y+");
198 canvas->SaveAs(
"dedxColor.png");
201 canvas->SetName(
"layer_rz");
202 canvas->SetTitle(
"Layers - RZ view");
203 canvas->GetFrame()->SetFillColor(kWhite);
204 gStyle->SetOptStat(0);
206 gStyle->SetNumberContours(
m_color.size());
207 colormap->SetMinimum(1);
208 colormap->SetMaximum(
m_color.size());
209 colormap->Draw(
"col");
210 colormap->Draw(
"same axis y+");
211 colormap->SaveAs(
"layers.root");
212 canvas->SaveAs(
"layers.png");
DD4hep_XHistogram m_tracker
Histogram * get(size_t h=0) const
access one of the histograms
void plotSegmentInLayer(const MaterialAccountingStep &step, int layer)
double delta_r(const Fourvec &a, const Fourvec &b)
Find the distance between two four-vectors in the two-dimensional space .
unsigned int fill_gradient(const TColor &first, const TColor &last, unsigned int steps=100, unsigned int index=0)
void fill(double x, double y, const std::vector< double > &weight, double norm)
fill one point
std::vector< int > m_color
ColorMap * colormap(void) const
access the colormap
void plotSegmentUnassigned(const MaterialAccountingStep &step)
DD4hep_TrackingMaterialPlotter(float maxZ, float maxR, float resolution)
std::vector< int > m_gradient