IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue 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
Air Shower Physics
corsika
Commits
dbe0f238
Commit
dbe0f238
authored
4 years ago
by
Maximilian Reininghaus
Committed by
Felix Riehn
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added further checks in testCOMboost
parent
839ffa38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!234
WIP: Initial example of python as script language from C++
,
!204
Resolve "boost & coordinate system in process::sibyll::Interaction"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/Utilities/testCOMBoost.cc
+37
-28
37 additions, 28 deletions
Framework/Utilities/testCOMBoost.cc
with
37 additions
and
28 deletions
Framework/Utilities/testCOMBoost.cc
+
37
−
28
View file @
dbe0f238
...
...
@@ -35,6 +35,8 @@ auto const energy = [](HEPMassType m, Vector<hepmomentum_d> const& p) {
return
sqrt
(
m
*
m
+
p
.
squaredNorm
());
};
auto
const
momentum
=
[](
HEPEnergyType
E
,
HEPMassType
m
)
{
return
sqrt
(
E
*
E
-
m
*
m
);
};
// helper function for mandelstam-s
auto
const
s
=
[](
HEPEnergyType
E
,
QuantityVector
<
hepmomentum_d
>
const
&
p
)
{
return
E
*
E
-
p
.
squaredNorm
();
...
...
@@ -54,7 +56,7 @@ TEST_CASE("boosts") {
// define projectile kinematics in lab frame
HEPMassType
const
projectileMass
=
1.
_GeV
;
Vector
<
hepmomentum_d
>
pProjectileLab
{
rootCS
,
{
0
_GeV
,
1
_P
eV
,
0
_GeV
}};
Vector
<
hepmomentum_d
>
pProjectileLab
{
rootCS
,
{
0
_GeV
,
20
_G
eV
,
0
_GeV
}};
HEPEnergyType
const
eProjectileLab
=
energy
(
projectileMass
,
pProjectileLab
);
const
FourVector
PprojLab
(
eProjectileLab
,
pProjectileLab
);
...
...
@@ -101,18 +103,26 @@ TEST_CASE("boosts") {
// define projectile kinematics in lab frame
HEPMassType
const
projectileMass
=
1
_GeV
;
Vector
<
hepmomentum_d
>
pProjectileLab
{
rootCS
,
{
0
_GeV
,
0
_
P
eV
,
-
1
_P
eV
}};
Vector
<
hepmomentum_d
>
pProjectileLab
{
rootCS
,
{
0
_GeV
,
0
_
G
eV
,
-
20
_G
eV
}};
HEPEnergyType
const
eProjectileLab
=
energy
(
projectileMass
,
pProjectileLab
);
const
FourVector
PprojLab
(
eProjectileLab
,
pProjectileLab
);
auto
const
sqrt_s_lab
=
sqrt
(
s
(
eProjectileLab
+
targetMass
,
pProjectileLab
.
GetComponents
(
rootCS
)));
// define boost to com frame
COMBoost
boost
(
PprojLab
,
targetMass
);
// boost projecticle
auto
const
PprojCoM
=
boost
.
toCoM
(
PprojLab
);
auto
const
a
=
PprojCoM
.
GetSpaceLikeComponents
().
GetComponents
(
boost
.
GetRotatedCS
());
CHECK
(
a
.
GetX
()
/
1
_GeV
==
Approx
(
0
));
CHECK
(
a
.
GetY
()
/
1
_GeV
==
Approx
(
0
));
CHECK
(
a
.
GetZ
()
/
(
momentum
(
sqrt_s_lab
/
2
,
projectileMass
))
==
Approx
(
1
));
// boost target
auto
const
PtargCoM
=
boost
.
toCoM
(
FourVector
(
targetMass
,
pTargetLab
));
CHECK
(
PtargCoM
.
GetTimeLikeComponent
()
/
sqrt_s_lab
==
Approx
(
.5
));
// sum of momenta in CoM, should be 0
auto
const
sumPCoM
=
...
...
@@ -183,31 +193,30 @@ TEST_CASE("boosts") {
PprojCoM
.
GetSpaceLikeComponents
()
+
PtargCoM
.
GetSpaceLikeComponents
();
CHECK
(
sumPCoM
.
norm
()
/
P0
==
Approx
(
0
).
margin
(
absMargin
));
// MAKE RELATIVE CHECK
}
}
SECTION
(
"rest frame"
)
{
HEPMassType
const
projectileMass
=
1
_GeV
;
HEPMomentumType
const
P0
=
1
_TeV
;
Vector
<
hepmomentum_d
>
pProjectileLab
{
rootCS
,
{
0
_GeV
,
P0
,
0
_GeV
}};
HEPEnergyType
const
eProjectileLab
=
energy
(
projectileMass
,
pProjectileLab
);
const
FourVector
PprojLab
(
eProjectileLab
,
pProjectileLab
);
COMBoost
boostRest
(
pProjectileLab
,
projectileMass
);
auto
const
&
csPrime
=
boostRest
.
GetRotatedCS
();
FourVector
const
rest4Mom
=
boostRest
.
toCoM
(
PprojLab
);
CHECK
(
rest4Mom
.
GetTimeLikeComponent
()
/
1
_GeV
==
Approx
(
projectileMass
/
1
_GeV
));
CHECK
(
rest4Mom
.
GetSpaceLikeComponents
().
norm
()
/
1
_GeV
==
Approx
(
0
).
margin
(
absMargin
));
FourVector
const
a
{
0
_eV
,
Vector
{
csPrime
,
0
_eV
,
5
_GeV
,
0
_eV
}};
FourVector
const
b
{
0
_eV
,
Vector
{
rootCS
,
3
_GeV
,
0
_eV
,
0
_eV
}};
auto
const
aLab
=
boostRest
.
fromCoM
(
a
);
auto
const
bLab
=
boostRest
.
fromCoM
(
b
);
CHECK
(
aLab
.
GetNorm
()
/
a
.
GetNorm
()
==
Approx
(
1
));
CHECK
(
aLab
.
GetSpaceLikeComponents
().
GetComponents
(
csPrime
)[
1
].
magnitude
()
==
Approx
((
5
_GeV
).
magnitude
()));
CHECK
(
bLab
.
GetSpaceLikeComponents
().
GetComponents
(
rootCS
)[
0
].
magnitude
()
==
Approx
((
3
_GeV
).
magnitude
()));
}
TEST_CASE
(
"rest frame"
)
{
HEPMassType
const
projectileMass
=
1
_GeV
;
HEPMomentumType
const
P0
=
1
_TeV
;
Vector
<
hepmomentum_d
>
pProjectileLab
{
rootCS
,
{
0
_GeV
,
P0
,
0
_GeV
}};
HEPEnergyType
const
eProjectileLab
=
energy
(
projectileMass
,
pProjectileLab
);
const
FourVector
PprojLab
(
eProjectileLab
,
pProjectileLab
);
COMBoost
boostRest
(
pProjectileLab
,
projectileMass
);
auto
const
&
csPrime
=
boostRest
.
GetRotatedCS
();
FourVector
const
rest4Mom
=
boostRest
.
toCoM
(
PprojLab
);
CHECK
(
rest4Mom
.
GetTimeLikeComponent
()
/
1
_GeV
==
Approx
(
projectileMass
/
1
_GeV
));
CHECK
(
rest4Mom
.
GetSpaceLikeComponents
().
norm
()
/
1
_GeV
==
Approx
(
0
).
margin
(
absMargin
));
FourVector
const
a
{
0
_eV
,
Vector
{
csPrime
,
0
_eV
,
5
_GeV
,
0
_eV
}};
FourVector
const
b
{
0
_eV
,
Vector
{
rootCS
,
3
_GeV
,
0
_eV
,
0
_eV
}};
auto
const
aLab
=
boostRest
.
fromCoM
(
a
);
auto
const
bLab
=
boostRest
.
fromCoM
(
b
);
CHECK
(
aLab
.
GetNorm
()
/
a
.
GetNorm
()
==
Approx
(
1
));
CHECK
(
aLab
.
GetSpaceLikeComponents
().
GetComponents
(
csPrime
)[
1
].
magnitude
()
==
Approx
((
5
_GeV
).
magnitude
()));
CHECK
(
bLab
.
GetSpaceLikeComponents
().
GetComponents
(
rootCS
)[
0
].
magnitude
()
==
Approx
((
3
_GeV
).
magnitude
()));
}
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