#include <vector>
#include <string>
#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 (const char *chartitle, float x, float y, int color=1, float textsize=0.04) |
| void | DrawLegendLatex (const char *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 |
( |
const char * | chartitle, |
|
|
int | markertype, |
|
|
float | x, |
|
|
float | y, |
|
|
int | color = 1, |
|
|
float | textsize = 0.03 ) |
|
inline |
Definition at line 133 of file InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/AtlasStyle.h.
137 {
138
139 TMarker *markerdot =
new TMarker(
x - 0.4 * textsize,
y + 0.2 * textsize, markertype);
140 markerdot->SetNDC();
141 markerdot->SetMarkerColor(
color);
142 markerdot->SetMarkerSize(25 * textsize);
143 markerdot->Draw();
144
145
147}
void DrawTitleLatex(const char *chartitle, float x, float y, int color=1, float textsize=0.04)
◆ DrawTitleLatex()
| void DrawTitleLatex |
( |
const char * | chartitle, |
|
|
float | x, |
|
|
float | y, |
|
|
int | color = 1, |
|
|
float | textsize = 0.04 ) |
|
inline |
Definition at line 107 of file InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/AtlasStyle.h.
110 {
111 std::string left = std::string(chartitle);
112 std::vector<std::string>
cuts;
113 std::string::size_type
found = 0;
114 while(1){
115 left = left.substr(found);
116 found = left.find(
" - ");
117 if(found == std::string::npos){
118 cuts.push_back(std::move(left));
119 break;
120 }
121 cuts.push_back(left.substr(0,found));
123 }
124 TLatex TitleLabel;
125 TitleLabel.SetNDC();
126 TitleLabel.SetTextSize(textsize);
127 TitleLabel.SetTextColor(
color);
128 for(
unsigned int i = 0 ;
i <
cuts.size();
i++)
129 TitleLabel.DrawLatex(
x,
y-i*(1.25)*textsize,(cuts[i]).c_str());
130
131}
◆ GetCoreParameters()
| void GetCoreParameters |
( |
const TH1 * | hist, |
|
|
double & | mean, |
|
|
double & | mean_error, |
|
|
double & | rms, |
|
|
double & | rms_error, |
|
|
double & | nentries ) |
|
inline |
Definition at line 150 of file InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/AtlasStyle.h.
151 {
152
155 mean_error = 0.;
157 rms_error = 0.;
158
159 double axmin =
hist->GetMean() - 3 *
hist->GetRMS();
160 double axmax =
hist->GetMean() + 3 *
hist->GetRMS();
162 int imean = 0;
163 hist->GetBinWithContent(
hist->GetMean(), imean);
169 }else{
170 for (
int i = 0 ;
i <
nbins;
i++){
172 double ientries =
hist->GetBinContent(i+1);
173 if (value < axmin) continue;
174 if (value > axmax) break;
178 }
179 if (nentries > 0) {
182 }
183 }
184
185 if (nentries > 0) {
186 mean_error =
rms / sqrt(nentries);
187 if(nentries > 1) rms_error =
rms / sqrt(2*(nentries-1));
188 }
189
190 return;
191}
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()