#include <TrackingMaterialPlotter.h>
Public Types | |
typedef std::pair< double, double > | Range |
Public Member Functions | |
void | draw (void) |
void | normalize (void) |
void | plotSegmentInLayer (const MaterialAccountingStep &step, int layer) |
void | plotSegmentUnassigned (const MaterialAccountingStep &step) |
TrackingMaterialPlotter (float maxZ, float maxR, float resolution) | |
Private Member Functions | |
void | fill_color () |
unsigned int | fill_gradient (unsigned int first, unsigned int last, unsigned int steps=100, unsigned int index=0) |
unsigned int | fill_gradient (const TColor &first, const TColor &last, unsigned int steps=100, unsigned int index=0) |
Private Attributes | |
std::vector< int > | m_color |
std::vector< int > | m_gradient |
XHistogram | m_tracker |
Definition at line 16 of file TrackingMaterialPlotter.h.
typedef std::pair<double, double> TrackingMaterialPlotter::Range |
Definition at line 19 of file TrackingMaterialPlotter.h.
TrackingMaterialPlotter::TrackingMaterialPlotter | ( | float | maxZ, |
float | maxR, | ||
float | resolution | ||
) |
Definition at line 89 of file TrackingMaterialPlotter.cc.
References fill_color(), fill_gradient(), m_color, m_tracker, max(), and CosmicsPD_Skims::maxZ.
{ const float rzMinZ = -maxZ; const float rzMaxZ = maxZ; const float rzMinR = 0.; const float rzMaxR = maxR; const int rzBinsZ = (int) (2. * maxZ * resolution); const int rzBinsR = (int) ( maxR * resolution); std::vector<double> max; max.push_back( 0.02 ); max.push_back( 0.04 ); m_tracker = XHistogram( 2, rzBinsZ, rzBinsR, std::make_pair(rzMinZ, rzMaxZ), std::make_pair(rzMinR, rzMaxR), m_color.size(), max); TColor::InitializeColors(); fill_color(); fill_gradient( kWhite, kBlack, 100); // 100-steps gradient from white to black }
void TrackingMaterialPlotter::draw | ( | void | ) |
Definition at line 129 of file TrackingMaterialPlotter.cc.
References svgfig::canvas(), XHistogram::colormap(), XHistogram::get(), m_color, m_gradient, m_tracker, and pileupReCalc_HLTpaths::scale.
{ const double scale = 10.; TCanvas* canvas; XHistogram::Histogram* radlen = m_tracker.get(0); canvas = new TCanvas("radlen_rz", "RadiationLengths - RZ view", (int) (600 * scale * 1.25), (int) (120 * scale * 1.50)); gStyle->SetOptStat(0); gStyle->SetPalette( m_gradient.size(), & m_gradient.front() ); gStyle->SetNumberContours( m_gradient.size() ); canvas->GetFrame()->SetFillColor(kWhite); radlen->Draw("colz"); radlen->Draw("same axis y+"); canvas->SaveAs("radlen.png"); delete canvas; XHistogram::Histogram* dedx = m_tracker.get(1); canvas = new TCanvas("dedx_rz", "-dE/dx term - RZ view", (int) (600 * scale * 1.25), (int) (120 * scale * 1.50)); canvas->GetFrame()->SetFillColor(kWhite); gStyle->SetOptStat(0); gStyle->SetPalette( m_gradient.size(), & m_gradient.front() ); gStyle->SetNumberContours( m_gradient.size() ); dedx->Draw("colz"); dedx->Draw("same axis y+"); canvas->SaveAs("dedx.png"); delete canvas; XHistogram::ColorMap* colormap = m_tracker.colormap(); canvas = new TCanvas("layer_rz", "Layers - RZ view", (int) (600 * scale * 1.25), (int) (120 * scale * 1.50)); canvas->GetFrame()->SetFillColor(kWhite); gStyle->SetOptStat(0); gStyle->SetPalette( m_color.size(), & m_color.front() ); gStyle->SetNumberContours( m_color.size() ); colormap->SetMinimum( 1 ); colormap->SetMaximum( m_color.size() ); colormap->Draw("col"); colormap->Draw("same axis y+"); canvas->SaveAs("layers.png"); delete canvas; }
void TrackingMaterialPlotter::fill_color | ( | void | ) | [private] |
Definition at line 14 of file TrackingMaterialPlotter.cc.
References m_color.
Referenced by TrackingMaterialPlotter().
{ m_color.push_back(kBlack); // unassigned m_color.push_back(kBlue); // PixelBarrel m_color.push_back(kBlue + 100); // m_color.push_back(kBlue); // m_color.push_back(kGreen); // TIB m_color.push_back(kGreen + 100); // m_color.push_back(kGreen); // m_color.push_back(kGreen + 100); // m_color.push_back(kRed); // TOB m_color.push_back(kRed + 100); // m_color.push_back(kRed); // m_color.push_back(kRed + 100); // m_color.push_back(kRed); // m_color.push_back(kRed + 100); // m_color.push_back(kBlue); // PixelEndcap Z- m_color.push_back(kBlue + 100); // m_color.push_back(kGreen); // TID Z- m_color.push_back(kGreen + 100); // m_color.push_back(kGreen); // m_color.push_back(kRed); // TEC Z- m_color.push_back(kRed + 100); // m_color.push_back(kRed); // m_color.push_back(kRed + 100); // m_color.push_back(kRed); // m_color.push_back(kRed + 100); // m_color.push_back(kRed); // m_color.push_back(kRed + 100); // m_color.push_back(kRed); // m_color.push_back(kBlue); // PixelEndcap Z+ m_color.push_back(kBlue + 100); // m_color.push_back(kGreen); // TID Z+ m_color.push_back(kGreen + 100); // m_color.push_back(kGreen); // m_color.push_back(kRed); // TEC Z+ m_color.push_back(kRed + 100); // m_color.push_back(kRed); // m_color.push_back(kRed + 100); // m_color.push_back(kRed); // m_color.push_back(kRed + 100); // m_color.push_back(kRed); // m_color.push_back(kRed + 100); // m_color.push_back(kRed); // }
unsigned int TrackingMaterialPlotter::fill_gradient | ( | unsigned int | first, |
unsigned int | last, | ||
unsigned int | steps = 100 , |
||
unsigned int | index = 0 |
||
) | [private] |
Definition at line 84 of file TrackingMaterialPlotter.cc.
References fill_gradient(), getHLTprescales::index, and relval_steps::steps.
{ return fill_gradient(* (TColor *) gROOT->GetListOfColors()->At(first), * (TColor *) gROOT->GetListOfColors()->At(last), steps, index); }
unsigned int TrackingMaterialPlotter::fill_gradient | ( | const TColor & | first, |
const TColor & | last, | ||
unsigned int | steps = 100 , |
||
unsigned int | index = 0 |
||
) | [private] |
Definition at line 61 of file TrackingMaterialPlotter.cc.
References hitfit::delta_r(), diffTwoXMLs::g1, diffTwoXMLs::g2, i, getHLTprescales::index, m_gradient, diffTwoXMLs::r1, diffTwoXMLs::r2, and relval_steps::steps.
Referenced by fill_gradient(), and TrackingMaterialPlotter().
{ if (index == 0) { // if no index was given, find the highest used one and start from that plus one index = ((TObjArray*) gROOT->GetListOfColors())->GetLast() + 1; } float r1, g1, b1, r2, g2, b2; first.GetRGB(r1, g1, b1); last.GetRGB(r2, g2, b2); float delta_r = (r2 - r1) / (steps - 1); float delta_g = (g2 - g1) / (steps - 1); float delta_b = (b2 - b1) / (steps - 1); m_gradient.resize(steps); for (unsigned int i = 0; i < steps; ++i) { new TColor(index + i, r1 + delta_r * i, g1 + delta_g * i, b1 + delta_b * i); m_gradient[i] = index + i; } return index; }
void TrackingMaterialPlotter::normalize | ( | void | ) | [inline] |
Definition at line 25 of file TrackingMaterialPlotter.h.
References m_tracker, and XHistogram::normalize().
void TrackingMaterialPlotter::plotSegmentInLayer | ( | const MaterialAccountingStep & | step, |
int | layer | ||
) |
Definition at line 118 of file TrackingMaterialPlotter.cc.
References MaterialAccountingStep::energyLoss(), XHistogram::fill(), MaterialAccountingStep::in(), MaterialAccountingStep::length(), m_tracker, MaterialAccountingStep::out(), PV3DBase< T, PVType, FrameType >::perp(), MaterialAccountingStep::radiationLengths(), w(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by TrackingMaterialAnalyser::split().
void TrackingMaterialPlotter::plotSegmentUnassigned | ( | const MaterialAccountingStep & | step | ) |
Definition at line 108 of file TrackingMaterialPlotter.cc.
References MaterialAccountingStep::energyLoss(), XHistogram::fill(), MaterialAccountingStep::in(), MaterialAccountingStep::length(), m_tracker, MaterialAccountingStep::out(), PV3DBase< T, PVType, FrameType >::perp(), MaterialAccountingStep::radiationLengths(), w(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by TrackingMaterialAnalyser::split().
std::vector<int> TrackingMaterialPlotter::m_color [private] |
Definition at line 34 of file TrackingMaterialPlotter.h.
Referenced by draw(), fill_color(), and TrackingMaterialPlotter().
std::vector<int> TrackingMaterialPlotter::m_gradient [private] |
Definition at line 35 of file TrackingMaterialPlotter.h.
Referenced by draw(), and fill_gradient().
XHistogram TrackingMaterialPlotter::m_tracker [private] |
Definition at line 32 of file TrackingMaterialPlotter.h.
Referenced by draw(), normalize(), plotSegmentInLayer(), plotSegmentUnassigned(), and TrackingMaterialPlotter().