BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
Draw_FieldApprox.C
Go to the documentation of this file.
1
/*
2
*====================================================================
3
*
4
* Field approximation quality check
5
*
6
* Authors: M.Zyzak
7
*
8
* e-mail : M.Zyzak@gsi.de
9
*
10
*====================================================================
11
*/
12
13
#include <unistd.h>
// for dir navigation
14
15
void
Draw_FieldApprox
()
16
{
17
18
TString
fileName =
"FieldApprox.root"
;
19
const
int
NStations = 8;
20
21
TStopwatch
timer;
22
timer.
Start
();
23
// ------------------------------------------------------------------------
24
25
TStyle
* plain =
new
TStyle
(
"Plain"
,
"Plain Style(no colors/fill areas)"
);
26
// plain->SetCanvasBorderMode(0);
27
// plain->SetPadBorderMode(0);
28
plain->
SetPadColor
(0);
29
plain->
SetCanvasColor
(0);
30
plain->
SetTitleColor
(0);
31
plain->
SetStatColor
(0);
32
plain->
SetOptFit
(1111);
33
// plain->SetStatX(0.7);
34
plain->
SetStatW
(0.225);
35
plain->
SetOptStat
(0);
36
plain->
cd
();
37
38
TFile
* f =
new
TFile
(fileName.
Data
(),
"read"
);
39
40
TH2F
* stB[20];
41
TH2F
* stBx[20];
42
TH2F
* stBy[20];
43
TH2F
* stBz[20];
44
45
TCanvas
* c[20];
46
47
gStyle
->SetPalette(1);
48
49
FILE* fff;
50
fff = fopen(
"maxErr.txt"
,
"w"
);
51
52
system(
"mkdir FieldApprox -p"
);
53
chdir(
"FieldApprox"
);
54
for
(
int
ist = 0; ist < NStations; ist++) {
55
TString
nameCanv;
56
57
// if(ist<2)
58
// nameCanv = Form("MVD %i",ist+1);
59
// else
60
// nameCanv = Form("STS %i",ist-1);
61
nameCanv =
Form
(
"STS %i"
, ist + 1);
62
63
c[ist] =
new
TCanvas
(nameCanv.
Data
(), nameCanv.
Data
(), 0, 0, 1000, 900);
64
65
c[ist]->
Divide
(2, 2);
66
int
ff;
67
68
cout <<
Form
(
"station %i, dB, z = %i"
, ist + 1, ff) << endl;
69
stB[ist] = (
TH2F
*)f->Get(
Form
(
"station %i, dB"
, ist + 1));
70
stBx[ist] = (
TH2F
*)f->Get(
Form
(
"station %i, dBx"
, ist + 1));
71
stBy[ist] = (
TH2F
*)f->Get(
Form
(
"station %i, dBy"
, ist + 1));
72
stBz[ist] = (
TH2F
*)f->Get(
Form
(
"station %i, dBz"
, ist + 1));
73
74
TPaletteAxis
* palette;
75
76
c[ist]->
cd
(1);
77
stB[ist]->
GetZaxis
()->
SetTitleOffset
(2.1);
78
stB[ist]->
SetTitle
(
Form
(
"z = %i cm"
, ff));
79
stB[ist]->
Draw
(
"colz"
);
80
81
gPad
->SetRightMargin(0.2);
82
gPad
->Update();
83
84
c[ist]->
cd
(2);
85
stBx[ist]->
GetZaxis
()->
SetTitleOffset
(2.1);
86
stBx[ist]->
SetTitle
(
Form
(
"z = %i cm"
, ff));
87
stBx[ist]->
Draw
(
"colz"
);
88
89
gPad
->SetRightMargin(0.2);
90
gPad
->Update();
91
92
c[ist]->
cd
(3);
93
stBy[ist]->
GetZaxis
()->
SetTitleOffset
(2.1);
94
stBy[ist]->
SetTitle
(
Form
(
"z = %i cm"
, ff));
95
stBy[ist]->
Draw
(
"colz"
);
96
97
gPad
->SetRightMargin(0.2);
98
gPad
->Update();
99
100
c[ist]->
cd
(4);
101
stBz[ist]->
GetZaxis
()->
SetTitleOffset
(2.1);
102
stBz[ist]->
SetTitle
(
Form
(
"z = %i cm"
, ff));
103
stBz[ist]->
Draw
(
"colz"
);
104
105
gPad
->SetRightMargin(0.2);
106
gPad
->Update();
107
108
double
XmaxB =
fabs
(stB[ist]->GetMaximum());
109
double
XminB =
fabs
(stB[ist]->GetMinimum());
110
if
(XmaxB < XminB)
111
XmaxB = XminB;
112
113
double
XmaxBx =
fabs
(stBx[ist]->GetMaximum());
114
double
XminBx =
fabs
(stBx[ist]->GetMinimum());
115
if
(XmaxBx < XminBx)
116
XmaxBx = XminBx;
117
118
double
XmaxBy =
fabs
(stBy[ist]->GetMaximum());
119
double
XminBy =
fabs
(stBy[ist]->GetMinimum());
120
if
(XmaxBy < XminBy)
121
XmaxBy = XminBy;
122
123
double
XmaxBz =
fabs
(stBz[ist]->GetMaximum());
124
double
XminBz =
fabs
(stBz[ist]->GetMinimum());
125
if
(XmaxBz < XminBz)
126
XmaxBz = XminBz;
127
128
fprintf(fff,
"%.2g %.2g %.2g %.2g\n"
, XmaxB, XmaxBx, XmaxBy, XmaxBz);
129
130
nameCanv +=
".pdf"
;
131
c[ist]->
SaveAs
(nameCanv.
Data
());
132
}
133
134
timer.
Stop
();
135
Double_t
rtime = timer.
RealTime
();
136
Double_t
ctime = timer.
CpuTime
();
137
printf(
"RealTime=%f seconds, CpuTime=%f seconds\n"
, rtime, ctime);
138
139
chdir(
".."
);
140
}
Draw_FieldApprox
void Draw_FieldApprox()
Definition
Draw_FieldApprox.C:15
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition
P4_F32vec4.h:52
Double_t
double Double_t
Form
char * Form(const char *fmt,...)
gStyle
R__EXTERN TStyle * gStyle
gPad
#define gPad
TAttAxis::SetTitleOffset
virtual void SetTitleOffset(Float_t offset=1)
TCanvas
TCanvas::cd
TVirtualPad * cd(Int_t subpadnumber=0) override
TFile
TH1::GetZaxis
TAxis * GetZaxis()
TH1::SetTitle
void SetTitle(const char *title) override
TH1::Draw
void Draw(Option_t *option="") override
TH2F
TPad::Divide
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
TPad::SaveAs
void SaveAs(const char *filename="", Option_t *option="") const override
TPaletteAxis
TStopwatch
TStopwatch::RealTime
Double_t RealTime()
TStopwatch::Start
void Start(Bool_t reset=kTRUE)
TStopwatch::CpuTime
Double_t CpuTime()
TStopwatch::Stop
void Stop()
TString
TString::Data
const char * Data() const
TStyle
TStyle::SetOptStat
void SetOptStat(Int_t stat=1)
TStyle::SetCanvasColor
void SetCanvasColor(Color_t color=19)
TStyle::SetTitleColor
void SetTitleColor(Color_t color=1, Option_t *axis="X")
TStyle::cd
virtual void cd()
TStyle::SetStatColor
void SetStatColor(Color_t color=19)
TStyle::SetPadColor
void SetPadColor(Color_t color=19)
TStyle::SetStatW
void SetStatW(Float_t w=0.19)
TStyle::SetOptFit
void SetOptFit(Int_t fit=1)
reconstruction
cat
utils
Draw_FieldApprox.C
Generated on
for BmnRoot by
1.17.0