-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Phase2_PbPb_CMSSW_14_1_X
- Loading branch information
Showing
23 changed files
with
280 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
MagneticField/ParametrizedEngine/interface/ParabolicParametrizedMagneticField.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
Description: Utility function to calculate the Magnetic Field on the GPU. The Vec3 argument of the functions must support access to its components via (), note that e.g. Eigen::Matrix provides such an interface. | ||
*/ | ||
|
||
#ifndef MagneticField_ParametrizedEngine_interface_ParabolicParametrizedMagneticField_h | ||
#define MagneticField_ParametrizedEngine_interface_ParabolicParametrizedMagneticField_h | ||
|
||
namespace magneticFieldParabolicPortable { | ||
|
||
struct Parameters { | ||
// These parameters are the best fit of 3.8T to the OAEParametrizedMagneticField parametrization. | ||
// See MagneticField/ParametrizedEngine/src/ParabolicParametrizedMagneticField.cc | ||
static constexpr float c1 = 3.8114; | ||
static constexpr float b0 = -3.94991e-06; | ||
static constexpr float b1 = 7.53701e-06; | ||
static constexpr float a = 2.43878e-11; | ||
static constexpr float max_radius2 = 13225.f; // tracker radius | ||
static constexpr float max_z = 280.f; // tracker z | ||
}; | ||
|
||
template <typename Vec3> | ||
constexpr float Kr(Vec3 const& vec) { | ||
return Parameters::a * (vec(0) * vec(0) + vec(1) * vec(1)) + 1.f; | ||
} | ||
|
||
template <typename Vec3> | ||
constexpr float B0Z(Vec3 const& vec) { | ||
return Parameters::b0 * vec(2) * vec(2) + Parameters::b1 * vec(2) + Parameters::c1; | ||
} | ||
|
||
template <typename Vec3> | ||
constexpr bool isValid(Vec3 const& vec) { | ||
return ((vec(0) * vec(0) + vec(1) * vec(1)) < Parameters::max_radius2 && fabs(vec(2)) < Parameters::max_z); | ||
} | ||
|
||
template <typename Vec3> | ||
constexpr float magneticFieldAtPoint(Vec3 const& vec) { | ||
if (isValid(vec)) { | ||
return B0Z(vec) * Kr(vec); | ||
} else { | ||
return 0; | ||
} | ||
} | ||
|
||
} // namespace magneticFieldParabolicPortable | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<bin file="alpaka/testParabolicParametrizedMagneticField.dev.cc"> | ||
<use name="alpaka"/> | ||
<use name="eigen"/> | ||
<use name="DataFormats/GeometryVector"/> | ||
<use name="FWCore/Utilities"/> | ||
<use name="HeterogeneousCore/AlpakaInterface"/> | ||
<use name="MagneticField/ParametrizedEngine" source_only="1"/> | ||
<flags ALPAKA_BACKENDS="1"/> | ||
</bin> |
Oops, something went wrong.