Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Semileptonic decays of heavy-flavour hadrons
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
amtolvau
Semileptonic decays of heavy-flavour hadrons
Commits
4b7ce79b
Commit
4b7ce79b
authored
1 year ago
by
amtolvau
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
4a507421
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Simulation code/Data_analysis.h
+74
-0
74 additions, 0 deletions
Simulation code/Data_analysis.h
with
74 additions
and
0 deletions
Simulation code/Data_analysis.h
0 → 100644
+
74
−
0
View file @
4b7ce79b
// Header file for analysing the data
#ifndef Data_analysis_H
#define Data_analysis_H
#include
<vector>
#include
<string>
#include
"Pythia8/Basics.h"
typedef
std
::
vector
<
double
>
vector1d
;
typedef
std
::
vector
<
std
::
vector
<
double
>
>
vector2d
;
typedef
std
::
vector
<
int
>
vectorInt
;
class
OurDataTab
{
public:
// Constructors
OurDataTab
();
OurDataTab
(
int
id_data
,
vector1d
pT_data
,
vector1d
rapidity_data
,
vector2d
cross_section_data
)
:
id
(
id_data
),
pT_v
(
pT_data
),
rapidity_v
(
rapidity_data
),
cross_section_v
(
cross_section_data
)
{
}
OurDataTab
(
const
OurDataTab
&
t
)
:
id
(
t
.
id
),
pT_v
(
t
.
pT_v
),
rapidity_v
(
t
.
rapidity_v
),
cross_section_v
(
t
.
cross_section_v
)
{
}
// Functions for input
void
reset
()
{
id
=
0
;
pT_v
.
clear
();
rapidity_v
.
clear
();
cross_section_v
.
clear
();
}
inline
void
readFile2DataTab
(
std
::
string
&
filename
);
// Functions for output
int
return_id
()
const
{
return
id
;
}
void
return_pT_values
(
vector1d
&
v
)
{
v
.
clear
();
int
integer
=
pT_v
.
size
();
for
(
int
i
=
0
;
i
<
integer
;
i
++
){
v
.
push_back
(
pT_v
[
i
]);}
}
double
return_pT_element
(
int
i
)
const
{
return
pT_v
[
i
];
}
double
return_pTmin
()
const
{
return
pT_v
[
0
];
}
double
return_pTmax
()
const
{
return
pT_v
[
pT_v
.
size
()
-
1
];
}
void
return_rapidity_values
(
vector1d
&
v
)
{
v
.
clear
();
int
integer
=
rapidity_v
.
size
();
for
(
int
j
=
0
;
j
<
integer
;
j
++
){
v
.
push_back
(
rapidity_v
[
j
]);}
}
double
return_rapidity_element
(
int
j
)
const
{
return
rapidity_v
[
j
];
}
double
return_rapiditymin
()
const
{
return
rapidity_v
[
0
];
}
double
return_rapiditymax
()
const
{
return
rapidity_v
[
rapidity_v
.
size
()
-
1
];
}
void
return_cross_section_values
(
vector2d
&
v
)
{
v
.
clear
();
vector1d
temp
;
temp
.
clear
();
int
integer1
=
cross_section_v
.
size
();
for
(
int
i
=
0
;
i
<
integer1
;
i
++
){
int
integer2
=
cross_section_v
[
i
].
size
();
for
(
int
j
=
0
;
j
<
integer2
;
j
++
){
temp
.
push_back
(
cross_section_v
[
i
][
j
]);}
v
.
push_back
(
temp
);
temp
.
clear
();}
}
double
return_cross_section_element
(
int
i
,
int
j
)
const
{
return
cross_section_v
[
i
][
j
];
}
// Functions for random number generation
double
generate_pT
(
Pythia8
::
Rndm
&
random
);
double
generate_rapidity
(
Pythia8
::
Rndm
&
random
);
double
generate_theta
(
Pythia8
::
Rndm
&
random
);
// Functions for finding datapoints
bool
check
(
double
input
,
vector1d
&
values
,
int
&
identifier
);
void
locate
(
double
input
,
vector1d
&
values
,
vector1d
&
output
,
int
&
identifier
);
// Functions for obtaining the cross section
double
interpolate_1d
(
double
&
input
,
vector1d
&
x
,
vector1d
&
f
);
double
interpolate_2d
(
double
&
pT
,
double
&
rapidity
,
vector1d
&
x
,
vector1d
&
y
,
vector2d
&
z
);
double
obtain_cross_section
(
double
&
pT
,
double
&
rapidity
);
private
:
int
id
;
vector1d
pT_v
;
vector1d
rapidity_v
;
vector2d
cross_section_v
;
};
#endif // Data_analysis_H
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