ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
plot_map.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file plot_map.C
1
//#include "../prttools/prttools.C"
2
#include "
prttools.C
"
3
#include "
DrcPidFast.h
"
4
5
void
plot_map
(
int
pdg
= 211) {
6
7
prt_setRootPalette
(1);
8
TH2F *hsep =
new
TH2F(
"hsep"
,
"#pi/K separation power [s.d.] ;polar angle [deg];momentum [GeV/c]"
,
9
141, 19.5, 160.5, 50, 0.1, 10.1);
10
TH1F *hPi =
new
TH1F(
"hPi"
,
"hPi"
, 500, -100, 100);
11
TH1F *hK =
new
TH1F(
"hK"
,
"hK"
, 500, -100, 100);
12
double
m1 = 0,
m2
= 0,
s1
= 0, s2 = 0, sep = 0;
13
DrcPidFast
pid
;
14
DrcPidInfo
info
;
15
TF1 *
ff
;
16
// TCanvas *cc = new TCanvas("cc","cc",800,500);
17
for
(
double
m
= 0.6;
m
<= 10;
m
=
m
+ 0.2) {
18
if
(
m
> 3) {
19
delete
hK;
20
delete
hPi;
21
hK =
new
TH1F(
"hK"
,
"hK"
, 200, -20, 20);
22
hPi =
new
TH1F(
"hPi"
,
"hPi"
, 200, -20, 20);
23
}
24
if
(
m
< 1) {
25
delete
hK;
26
delete
hPi;
27
hK =
new
TH1F(
"hK"
,
"hK"
, 1000, -500, 500);
28
hPi =
new
TH1F(
"hPi"
,
"hPi"
, 1000, -500, 500);
29
}
30
31
for
(
int
t
= 20;
t
<= 160;
t
++) {
32
TVector3
mom
(0, 0,
m
);
33
mom.RotateX(
t
/ 180. * TMath::Pi());
34
for
(
int
i = 0; i < 2000; i++) {
35
info = pid.
GetInfo
(
pdg
, mom, 0.5);
36
hPi->Fill(info.
sigma
[2]);
37
hK->Fill(info.
sigma
[3]);
38
}
39
40
{
41
hK->Fit(
"gaus"
,
"Q0"
);
42
ff = hK->GetFunction(
"gaus"
);
43
if
(ff) m1 = ff->GetParameter(1);
44
if
(ff)
s1
= ff->GetParameter(2);
45
hPi->Fit(
"gaus"
,
"Q0"
);
46
ff = hPi->GetFunction(
"gaus"
);
47
if
(ff)
m2
= ff->GetParameter(1);
48
if
(ff) s2 = ff->GetParameter(2);
49
50
if
(
s1
+ s2 > 0) sep = (fabs(
m2
- m1)) / (0.5 * (
s1
+ s2));
51
}
52
53
// hPi->Draw();
54
// hPi->SetLineColor(kBlue);
55
// hK->SetLineColor(kRed);
56
// hK->Draw("same");
57
// cc->Update();
58
// cc->WaitPrimitive();
59
60
hsep->Fill(
t
,
m
, sep);
61
62
hPi->Reset();
63
hK->Reset();
64
}
65
}
66
67
// prt_canvasAdd("diff",800,500);
68
// hPi->Draw();
69
// hPi->SetLineColor(kBlue);
70
// hK->SetLineColor(kRed);
71
// hK->Draw("same");
72
73
gStyle->SetOptStat(0);
74
prt_canvasAdd
(
"map_sep"
, 800, 500);
75
gPad->SetLogz();
76
hsep->Draw(
"colz"
);
77
hsep->GetYaxis()->SetRangeUser(0.6, 10);
78
hsep->SetMaximum(10);
79
hsep->SetMinimum(1);
80
81
// draw ctr map
82
prt_canvasAdd
(
"map_ctr"
, 800, 500);
83
pid.
GetTrrMap
()->SetTitle(
"Cherenkov track resolution [mrad]"
);
84
pid.
GetTrrMap
()->Draw(
"colz"
);
85
86
prt_savepath
=
"data/plot_map"
;
87
prt_canvasSave
(2);
88
}
ecce-detectors
blob
master
FastPID
hpDIRC
plot_map.C
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:45
using
1.8.2 with
ECCE GitHub integration