Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
centrality
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Oleksii Lubynets
centrality
Commits
17944436
Commit
17944436
authored
5 years ago
by
Viktor Klochkov
Browse files
Options
Downloads
Patches
Plain Diff
some plotting
parent
86ad2a2c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.cpp
+3
-3
3 additions, 3 deletions
main.cpp
src/BordersFinderHelper.cpp
+38
-9
38 additions, 9 deletions
src/BordersFinderHelper.cpp
with
41 additions
and
12 deletions
main.cpp
+
3
−
3
View file @
17944436
...
@@ -33,9 +33,9 @@ int main(int argc, char **argv) {
...
@@ -33,9 +33,9 @@ int main(int argc, char **argv) {
std
::
unique_ptr
<
TH1F
>
histo
{(
TH1F
*
)
(
fIn
->
Get
(
argv
[
2
]))};
std
::
unique_ptr
<
TH1F
>
histo
{(
TH1F
*
)
(
fIn
->
Get
(
argv
[
2
]))};
Centrality
::
BordersFinder
bf
;
Centrality
::
BordersFinder
bf
;
bf
.
SetHisto
(
*
histo
);
bf
.
SetHisto
(
*
histo
);
bf
.
SetRanges
(
1
0
,
0
,
100
);
// number of bins, min, max value
bf
.
SetRanges
(
2
0
,
0
,
100
);
// number of bins, min, max value
// bf.SetRanges( {0,10,30,60,100} ); // centrality bins borders with array
// bf.SetRanges( {0,10,30,60,100} ); // centrality bins borders with array
bf
.
IsSpectator
(
fals
e
);
// true if impact parameter b correlated with estimator (spectators eneggy),
bf
.
IsSpectator
(
tru
e
);
// true if impact parameter b correlated with estimator (spectators eneggy),
// false - anticorrelated (multiplicity of produced particles)
// false - anticorrelated (multiplicity of produced particles)
bf
.
FindBorders
();
bf
.
FindBorders
();
...
@@ -49,7 +49,7 @@ int main(int argc, char **argv) {
...
@@ -49,7 +49,7 @@ int main(int argc, char **argv) {
std
::
unique_ptr
<
TH1F
>
h1d
=
bf
.
Convert
();
std
::
unique_ptr
<
TH1F
>
h1d
=
bf
.
Convert
();
bf
.
SetHisto
(
*
h1d
);
bf
.
SetHisto
(
*
h1d
);
bf
.
SetRanges
(
1
0
,
0
,
100
);
// number of bins, min, max value
bf
.
SetRanges
(
2
0
,
0
,
100
);
// number of bins, min, max value
// bf.SetRanges( {0,10,30,60,100} ); // centrality bins borders with array
// bf.SetRanges( {0,10,30,60,100} ); // centrality bins borders with array
bf
.
IsSpectator
(
false
);
// true if impact parameter b correlated with estimator (spectators eneggy),
bf
.
IsSpectator
(
false
);
// true if impact parameter b correlated with estimator (spectators eneggy),
// false - anticorrelated (multiplicity of produced particles)
// false - anticorrelated (multiplicity of produced particles)
...
...
This diff is collapsed.
Click to expand it.
src/BordersFinderHelper.cpp
+
38
−
9
View file @
17944436
...
@@ -6,6 +6,10 @@
...
@@ -6,6 +6,10 @@
#include
"TCanvas.h"
#include
"TCanvas.h"
#include
"TLine.h"
#include
"TLine.h"
#include
"TStyle.h"
namespace
Centrality
{
namespace
Centrality
{
void
BordersFinderHelper
::
QA
(
const
Getter
&
getter
,
const
TH1F
&
histo
)
const
void
BordersFinderHelper
::
QA
(
const
Getter
&
getter
,
const
TH1F
&
histo
)
const
...
@@ -62,25 +66,50 @@ void BordersFinderHelper::PlotHisto(const Getter& getter, TH1F& histo) const
...
@@ -62,25 +66,50 @@ void BordersFinderHelper::PlotHisto(const Getter& getter, TH1F& histo) const
void
BordersFinderHelper
::
PlotHisto2D
(
const
Getter
&
getter
,
TH2F
&
histo
,
TF1
&
func
)
const
void
BordersFinderHelper
::
PlotHisto2D
(
const
Getter
&
getter
,
TH2F
&
histo
,
TF1
&
func
)
const
{
{
std
::
unique_ptr
<
TCanvas
>
c
{
new
TCanvas
(
"c"
,
""
,
1200
,
800
)};
gStyle
->
SetOptStat
(
0000
);
std
::
unique_ptr
<
TCanvas
>
c
{
new
TCanvas
(
"c"
,
""
,
1000
,
1000
)};
histo
.
GetXaxis
()
->
SetRangeUser
(
0
,
1.1
);
histo
.
GetYaxis
()
->
SetRangeUser
(
0
,
1.1
);
histo
.
Draw
(
"colz"
);
histo
.
Draw
(
"colz"
);
func
.
SetLineColor
(
kBlack
);
func
.
Draw
(
"same"
);
func
.
Draw
(
"same"
);
const
auto
&
borders
=
getter
.
GetBorders2D
();
const
auto
&
borders
=
getter
.
GetBorders2D
();
TLine
*
line
{
nullptr
};
TLine
*
line
{
nullptr
};
for
(
uint
i
=
0
;
i
<
borders
.
size
();
++
i
)
for
(
uint
i
=
0
;
i
<
borders
.
size
()
-
1
;
++
i
)
{
{
const
float
x1
=
0.
;
const
float
x2
=
1.
;
float
x1
{
0.
};
float
x2
{
1.
};
const
float
y1
=
borders
.
at
(
i
)[
0
]
+
borders
.
at
(
i
)[
1
]
*
x1
;
float
x
{
0.5
};
const
float
y2
=
borders
.
at
(
i
)[
0
]
+
borders
.
at
(
i
)[
1
]
*
x2
;
for
(
int
iter
=
0
;
iter
<
10
;
++
iter
)
{
x
=
(
x1
+
x2
)
/
2
;
line
=
new
TLine
(
x1
,
y1
,
x2
,
y2
);
if
(
(
func
.
Eval
(
x1
)
-
borders
.
at
(
i
)[
0
]
-
borders
.
at
(
i
)[
1
]
*
x1
)
*
(
func
.
Eval
(
x
)
-
borders
.
at
(
i
)[
0
]
-
borders
.
at
(
i
)[
1
]
*
x
)
<
0
)
line
->
Draw
(
"same"
);
x2
=
x
;
else
x1
=
x
;
}
x1
=
x
-
0.06
*
borders
.
at
(
i
)[
1
];
x2
=
x
+
0.06
*
borders
.
at
(
i
)[
1
];
if
(
x1
<
0
)
x1
=
0
;
float
y1
=
borders
.
at
(
i
)[
0
]
+
borders
.
at
(
i
)[
1
]
*
x1
;
float
y2
=
borders
.
at
(
i
)[
0
]
+
borders
.
at
(
i
)[
1
]
*
x2
;
// if (y1 < 0) y1=0;
line
=
new
TLine
(
x1
,
y1
,
x2
,
y2
);
line
->
SetLineWidth
(
2
);
line
->
SetLineColor
(
kRed
);
line
->
Draw
(
"same"
);
}
}
c
->
SetLogz
(
true
);
c
->
Write
(
name_
+
"_histo_2d"
);
c
->
Write
(
name_
+
"_histo_2d"
);
if
(
ispdf_
)
if
(
ispdf_
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment