|
ATLAS Offline Software
|
#include <PixelChargeInterpolationPlot.h>
|
| PixelChargeInterpolationPlot (const PixelChargeInterpolationPlot &) |
|
PixelChargeInterpolationPlot & | operator= (const PixelChargeInterpolationPlot &) |
|
void | PlotDirection (const std::string &filename, const std::string &direction="phi") |
|
void | DrawOneHisto (TH1F *histo, const std::string &direction="phi", float maximum=0) |
|
void | DrawHistoMarkers (TH1F *histo, const std::string &options="P0same", int goodj=0) |
|
void | DrawLayerLegend (float xlegend, float ylegend) |
|
void | DrawAxis (float y1, float y2, float x1, float x2, const std::string &direction="phi") |
|
std::vector< TH1F * > * | HistogramsFromConstants (const PixelChargeInterpolationParameters ¶meters, const std::string &direction="phi", int color=1, const std::string &title="") |
|
◆ PixelChargeInterpolationPlot() [1/2]
◆ ~PixelChargeInterpolationPlot()
PixelCalib::PixelChargeInterpolationPlot::~PixelChargeInterpolationPlot |
( |
| ) |
|
|
virtual |
◆ PixelChargeInterpolationPlot() [2/2]
◆ AddReference()
◆ DrawAxis()
void PixelCalib::PixelChargeInterpolationPlot::DrawAxis |
( |
float |
y1, |
|
|
float |
y2, |
|
|
float |
x1, |
|
|
float |
x2, |
|
|
const std::string & |
direction = "phi" |
|
) |
| |
|
private |
Definition at line 395 of file PixelChargeInterpolationPlot.cxx.
397 float stdtextsize = 0.05;
401 int naxbins = lastbin - firstbin;
403 std::string axtitle =
"";
406 if(direction ==
"phi"){
408 axtitle =
"Track incident angle (#phi_{i}) [#circ]";
409 }
else if(direction ==
"eta"){
411 axtitle =
"Track incident pseudorapidity (#eta_{i})";
413 if (!axbins) {
return; }
417 TGaxis *
axis =
new TGaxis(
x1-1,
y1,
x2,
y1, axbins[firstbin], axbins[lastbin], naxbins);
418 axis->UseCurrentStyle();
419 axis->SetName(direction.c_str());
420 axis->SetTitle(axtitle.c_str());
421 axis->SetTitleFont(stdfont);
422 axis->SetTitleSize(stdtextsize);
424 if(naxbins > 20)
offset = 1.8;
426 std::string
opt =
"UNW+-";
429 axbins[firstbin], axbins[lastbin], naxbins,
opt.c_str());
431 axbins[firstbin], axbins[lastbin], naxbins,
"UN-");
434 label.SetTextSize(stdtextsize);
435 label.SetTextFont(stdfont);
436 label.SetTextAlign(23);
437 double pass = (
axis->GetX2()-
axis->GetX1() ) /
double( naxbins);
438 double ylabel =
y1 - 0.05 * (
y2 -
y1);
440 for(
int i = 0 ;
i <= naxbins;
i++){
441 std::ostringstream LabelString;
442 LabelString << axbins[firstbin+
i];
443 float ylabel2 = ylabel;
444 if(naxbins > 20) ylabel2 = ylabel +
i%2 *
distance;
445 label.DrawLatex(
axis->GetX1() +
i * pass, ylabel2,
446 LabelString.str().c_str());
◆ DrawHistoMarkers()
void PixelCalib::PixelChargeInterpolationPlot::DrawHistoMarkers |
( |
TH1F * |
histo, |
|
|
const std::string & |
options = "P0same" , |
|
|
int |
goodj = 0 |
|
) |
| |
|
private |
◆ DrawLayerLegend()
void PixelCalib::PixelChargeInterpolationPlot::DrawLayerLegend |
( |
float |
xlegend, |
|
|
float |
ylegend |
|
) |
| |
|
private |
Definition at line 370 of file PixelChargeInterpolationPlot.cxx.
372 int startmarker = 21;
373 float textsize = 0.03;
376 std::vector<std::string>
names;
377 names.push_back(
"b-layer");
378 names.push_back(
"Layer 1");
379 names.push_back(
"Layer 2");
380 names.push_back(
"Disk 1");
381 names.push_back(
"Disk 2");
382 names.push_back(
"Disk 3");
386 xlegend, ylegend -
i*textsize,
◆ DrawOneHisto()
void PixelCalib::PixelChargeInterpolationPlot::DrawOneHisto |
( |
TH1F * |
histo, |
|
|
const std::string & |
direction = "phi" , |
|
|
float |
maximum = 0 |
|
) |
| |
|
private |
Definition at line 294 of file PixelChargeInterpolationPlot.cxx.
299 float ymaximum = 1.5 * maximum;
300 float yminimum = - 0.1 *
histo->GetMaximum();
301 histo->SetMaximum(ymaximum);
302 histo->SetMinimum(yminimum);
303 histo->GetXaxis()->SetLabelOffset(10);
304 histo->GetXaxis()->SetNdivisions(0);
307 int xmaximum =
histo->GetNbinsX();
328 histo->GetXaxis()->SetRange(xminimum,xmaximum);
329 histo->DrawCopy(
"AXIS");
331 DrawAxis(yminimum, ymaximum, xminimum, xmaximum, direction);
◆ HistogramsFromConstants()
Definition at line 109 of file PixelChargeInterpolationPlot.cxx.
113 std::vector <TH1F*> *
histo =
new std::vector <TH1F*>();
114 std::vector<float> anglebins;
115 std::vector<float> csbins;
117 std::string xory, colorrow;
119 if(direction ==
"phi"){
146 int nangleBins = anglebins.size() - 1;
147 int nCsBins = csbins.size() - 1;
148 int nLayerBins = nConstants / (nangleBins * nCsBins);
150 int nhisto = nCsBins;
151 int nbinhisto = nLayerBins * nangleBins;
165 static std::atomic<int> pass = 0;
167 for(
int i = 0;
i < nhisto;
i++){
168 std::ostringstream NameString, TitleString;
169 NameString << csbins[
i] <<
"_" << direction <<
p
170 <<
"clustersize_ " << csbins[
i+1];
172 else TitleString <<
"Local " + xory +
" - "
173 << (csbins[
i] + csbins[
i+1]) /2 <<
"-" << colorrow <<
" clusters";
174 TH1F *currentPlot =
new TH1F(NameString.str().c_str(),
175 TitleString.str().c_str(),nbinhisto,0,nbinhisto);
176 currentPlot->UseCurrentStyle();
177 currentPlot->GetYaxis()->SetTitle(
"Charge sharing correction [#mum]");
179 currentPlot->SetLineColor(
color);
180 currentPlot->SetMarkerColor(
color);
181 for(
int j = 0; j < nangleBins; j++ ){
182 for(
int k = 0;
k < nLayerBins;
k++){
185 if(direction ==
"phi"){
192 int iBin = (nLayerBins*j)+
k+1;
193 currentPlot->SetBinContent(iBin,
constant*1000);
195 currentPlot->SetBinError(iBin,
error*1000);
203 histo->push_back(currentPlot);
◆ operator=()
◆ Plot()
void PixelCalib::PixelChargeInterpolationPlot::Plot |
( |
const std::string & |
output | ) |
|
◆ PlotDirection()
void PixelCalib::PixelChargeInterpolationPlot::PlotDirection |
( |
const std::string & |
filename, |
|
|
const std::string & |
direction = "phi" |
|
) |
| |
|
private |
Definition at line 211 of file PixelChargeInterpolationPlot.cxx.
214 std::vector < std::vector < TH1F* > > *RefHistos = 0;
217 if(direction ==
"phi"){
225 unsigned int nhistos_all =
histograms->size();
226 unsigned int nhistos = 0;
229 for(
unsigned int i = 0;
i < nhistos_all;
i++){
236 for(
unsigned int i = 0;
i < nhistos;
i++){
237 TCanvas*
c1 =
new TCanvas();
239 float maximum = (*histograms)[
i]->GetMaximum();
240 for(
unsigned int j = 0; j < RefHistos->size(); j++){
241 float newmax = ((*RefHistos)[j])[
i]->GetMaximum();
242 if(maximum < newmax) maximum = newmax;
245 c1->SetBottomMargin(0.18);
249 size_t found =
title.find(
"PixelChargeInterpolationData");
257 unsigned int nreferences = RefHistos->size();
260 for(
unsigned int j = 0; j < nreferences; j++){
262 std::string
title = ((*RefHistos)[j])[
i]->GetTitle();
263 size_t found =
title.find(
"PixelChargeInterpolationData");
267 0.20, 0.83 - (j+1)*0.06,
268 ((*RefHistos)[j])[
i]->GetMarkerColor(),0.05);
270 0.15, 0.83 - (j+1)*0.05,
271 ((*RefHistos)[j])[
i]->GetMarkerColor());
278 for(
unsigned int i = 0;
i < nhistos;
i++){
279 std::ostringstream
name;
◆ Write()
void PixelCalib::PixelChargeInterpolationPlot::Write |
( |
| ) |
|
◆ m_etabins
double* PixelCalib::PixelChargeInterpolationPlot::m_etabins |
|
private |
◆ m_histogramsX
std::vector< TH1F* >* PixelCalib::PixelChargeInterpolationPlot::m_histogramsX |
|
private |
◆ m_histogramsY
std::vector< TH1F* >* PixelCalib::PixelChargeInterpolationPlot::m_histogramsY |
|
private |
◆ m_netabins
int PixelCalib::PixelChargeInterpolationPlot::m_netabins |
|
private |
◆ m_nlayers
const int PixelCalib::PixelChargeInterpolationPlot::m_nlayers = 3 |
|
staticprivate |
◆ m_nphibins
int PixelCalib::PixelChargeInterpolationPlot::m_nphibins |
|
private |
◆ m_oneconst
bool PixelCalib::PixelChargeInterpolationPlot::m_oneconst |
|
private |
◆ m_phibins
double* PixelCalib::PixelChargeInterpolationPlot::m_phibins |
|
private |
◆ m_referenceDrawOpt
std::vector<std::string>* PixelCalib::PixelChargeInterpolationPlot::m_referenceDrawOpt |
|
private |
◆ m_RefHistosX
std::vector< std::vector < TH1F* > >* PixelCalib::PixelChargeInterpolationPlot::m_RefHistosX |
|
private |
◆ m_RefHistosY
std::vector< std::vector < TH1F* > >* PixelCalib::PixelChargeInterpolationPlot::m_RefHistosY |
|
private |
The documentation for this class was generated from the following files:
std::vector< TH1F * > * HistogramsFromConstants(const PixelChargeInterpolationParameters ¶meters, const std::string &direction="phi", int color=1, const std::string &title="")
void DrawLayerLegend(float xlegend, float ylegend)
std::vector< std::string > * m_referenceDrawOpt
std::vector< std::vector< TH1F * > > * m_RefHistosY
TGraphErrors * GetMean(TH2F *histo)
std::vector< TH1F * > * m_histogramsY
void DrawHistoMarkers(TH1F *histo, const std::string &options="P0same", int goodj=0)
void DrawLegendLatex(const char *chartitle, int markertype, float x, float y, int color=1, float textsize=0.034)
static const int m_nlayers
void DrawAxis(float y1, float y2, float x1, float x2, const std::string &direction="phi")
void PlotDirection(const std::string &filename, const std::string &direction="phi")
void DrawTitleLatex(const char *chartitle, float x, float y, int color=1, float textsize=0.04)
void DrawATLASLabel(float x, float y, bool pre=false, float textsize=0.05)
void DrawOneHisto(TH1F *histo, const std::string &direction="phi", float maximum=0)
std::vector< TH1F * > * m_histogramsX
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
std::vector< std::vector< TH1F * > > * m_RefHistosX
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space