#include <vector>
#include <string>
#include <string_view>
#include <cmath>
#include <TStyle.h>
#include <TLatex.h>
#include <TMarker.h>
#include <TROOT.h>
Go to the source code of this file.
|
| void | SetAtlasStyle () |
| void | DrawATLASLabel (float x, float y, float textsize=0.05, bool Preliminary=true) |
| void | DrawTitleLatex (std::string_view chartitle, float x, float y, int color=1, float textsize=0.04) |
| void | DrawLegendLatex (std::string_view chartitle, int markertype, float x, float y, int color=1, float textsize=0.03) |
| void | GetCoreParameters (const TH1 *hist, double &mean, double &mean_error, double &rms, double &rms_error, double &nentries) |
◆ def_Official
| #define def_Official false |
◆ def_Preliminary
| #define def_Preliminary false |
◆ DrawATLASLabel()
| void DrawATLASLabel |
( |
float | x, |
|
|
float | y, |
|
|
float | textsize = 0.05, |
|
|
bool | Preliminary = true ) |
|
inline |
◆ DrawLegendLatex()
| void DrawLegendLatex |
( |
std::string_view | chartitle, |
|
|
int | markertype, |
|
|
float | x, |
|
|
float | y, |
|
|
int | color = 1, |
|
|
float | textsize = 0.03 ) |
|
inline |
Definition at line 134 of file InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/AtlasStyle.h.
138 {
139
140 TMarker *markerdot =
new TMarker(
x - 0.4 * textsize,
y + 0.2 * textsize, markertype);
141 markerdot->SetNDC();
142 markerdot->SetMarkerColor(
color);
143 markerdot->SetMarkerSize(25 * textsize);
144 markerdot->Draw();
145
146
148}
void DrawTitleLatex(std::string_view chartitle, float x, float y, int color=1, float textsize=0.04)
◆ DrawTitleLatex()
| void DrawTitleLatex |
( |
std::string_view | chartitle, |
|
|
float | x, |
|
|
float | y, |
|
|
int | color = 1, |
|
|
float | textsize = 0.04 ) |
|
inline |
Definition at line 108 of file InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/AtlasStyle.h.
111 {
112 std::string left = std::string(chartitle);
113 std::vector<std::string>
cuts;
114 std::string::size_type
found = 0;
115 while(1){
116 left = left.substr(found);
117 found = left.find(
" - ");
118 if(found == std::string::npos){
119 cuts.push_back(std::move(left));
120 break;
121 }
122 cuts.push_back(left.substr(0,found));
124 }
125 TLatex TitleLabel;
126 TitleLabel.SetNDC();
127 TitleLabel.SetTextSize(textsize);
128 TitleLabel.SetTextColor(
color);
129 for(
unsigned int i = 0 ;
i <
cuts.size();
i++)
130 TitleLabel.DrawLatex(
x,
y-i*(1.25)*textsize,(cuts[i]).c_str());
131
132}
◆ GetCoreParameters()
| void GetCoreParameters |
( |
const TH1 * | hist, |
|
|
double & | mean, |
|
|
double & | mean_error, |
|
|
double & | rms, |
|
|
double & | rms_error, |
|
|
double & | nentries ) |
|
inline |
Definition at line 151 of file InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/AtlasStyle.h.
152 {
153
156 mean_error = 0.;
158 rms_error = 0.;
159
160 double axmin =
hist->GetMean() - 3 *
hist->GetRMS();
161 double axmax =
hist->GetMean() + 3 *
hist->GetRMS();
163 int imean = 0;
164 hist->GetBinWithContent(
hist->GetMean(), imean);
170 }else{
171 for (
int i = 0 ;
i <
nbins;
i++){
173 double ientries =
hist->GetBinContent(i+1);
174 if (value < axmin) continue;
175 if (value > axmax) break;
179 }
180 if (nentries > 0) {
183 }
184 }
185
186 if (nentries > 0) {
187 mean_error =
rms / sqrt(nentries);
188 if(nentries > 1) rms_error =
rms / sqrt(2*(nentries-1));
189 }
190
191 return;
192}
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
◆ SetAtlasStyle()