Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25,417 changes: 12,830 additions & 12,587 deletions Documentation/Bindings/bindings_Kassiopeia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 15 additions & 3 deletions Documentation/Bindings/bindings_full.md

Large diffs are not rendered by default.

54 changes: 49 additions & 5 deletions Documentation/Bindings/bindings_full.rst

Large diffs are not rendered by default.

6,974 changes: 3,505 additions & 3,469 deletions Documentation/Bindings/bindings_full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions Documentation/Bindings/bindings_full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2152,6 +2152,7 @@
<theta_cosine
angle_max="(double)"
angle_min="(double)"
direction="(string)"
mode="(string)"
name="(string)"
>
Expand Down Expand Up @@ -2315,6 +2316,7 @@
<theta_cosine
angle_max="(double)"
angle_min="(double)"
direction="(string)"
mode="(string)"
name="(string)"
>
Expand Down Expand Up @@ -2479,6 +2481,7 @@
<theta_cosine
angle_max="(double)"
angle_min="(double)"
direction="(string)"
mode="(string)"
name="(string)"
>
Expand Down Expand Up @@ -4194,6 +4197,7 @@
<theta_cosine
angle_max="(double)"
angle_min="(double)"
direction="(string)"
mode="(string)"
name="(string)"
>
Expand Down Expand Up @@ -4348,6 +4352,7 @@
<theta_cosine
angle_max="(double)"
angle_min="(double)"
direction="(string)"
mode="(string)"
name="(string)"
>
Expand Down Expand Up @@ -4701,6 +4706,7 @@
<ksgen_value_angle_cosine
angle_max="(double)"
angle_min="(double)"
direction="(string)"
mode="(string)"
name="(string)"
>
Expand Down Expand Up @@ -5022,6 +5028,14 @@
>
</ksint_calculator_ion>

<ksint_calculator_mott
name="(string)"
nucleus="(string)"
theta_max="(double)"
theta_min="(double)"
>
</ksint_calculator_mott>

<ksint_decay
calculator="(string)"
calculators="(string)"
Expand Down Expand Up @@ -5298,6 +5312,14 @@
>
</calculator_kess>

<calculator_mott
name="(string)"
nucleus="(string)"
theta_max="(double)"
theta_min="(double)"
>
</calculator_mott>

<density_constant
density="(double)"
name="(string)"
Expand Down Expand Up @@ -5355,6 +5377,16 @@
>
</ksint_surface_multiplication>

<ksint_surface_scattering
name="(string)"
scat_loss_fraction="(double)"
scat_probability="(double)"
sec_electron_mean_energy="(double)"
sec_electron_probability="(double)"
side="(string)"
>
</ksint_surface_scattering>

<ksint_surface_specular
name="(string)"
probability="(double)"
Expand Down
350 changes: 190 additions & 160 deletions Documentation/Bindings/bindings_full_examples.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Kassiopeia/Bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ set( BINDINGS_HEADER_FILES
Interactions/Include/KSIntSurfaceSpecularBuilder.h
Interactions/Include/KSIntSurfaceUCNBuilder.h
Interactions/Include/KSIntSurfaceDiffuseBuilder.h
Interactions/Include/KSIntSurfaceScatteringBuilder.h
Interactions/Include/KSIntSurfaceMultiplicationBuilder.h
Interactions/Include/KSIntSurfaceSpinFlipBuilder.h
Interactions/Include/KESSSurfaceInteractionBuilder.h
Expand Down Expand Up @@ -357,6 +358,7 @@ set( BINDINGS_SOURCE_FILES
Interactions/Source/KSIntSurfaceSpecularBuilder.cxx
Interactions/Source/KSIntSurfaceUCNBuilder.cxx
Interactions/Source/KSIntSurfaceDiffuseBuilder.cxx
Interactions/Source/KSIntSurfaceScatteringBuilder.cxx
Interactions/Source/KSIntSurfaceMultiplicationBuilder.cxx
Interactions/Source/KSIntSurfaceSpinFlipBuilder.cxx
Interactions/Source/KESSSurfaceInteractionBuilder.cxx
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//////////////////////////////////////////////////////////////////////////
// Routine to simulate scattering of an electron on a surface with a given
// probability for backscattering of the electron and a given probability
// for production of a secondary electron from the surface.
//////////////////////////////////////////////////////////////////////////
#ifndef Kassiopeia_KSIntSurfaceScatteringBuilder_h_
#define Kassiopeia_KSIntSurfaceScatteringBuilder_h_

#include "KComplexElement.hh"
#include "KSIntSurfaceScattering.h"

using namespace Kassiopeia;
namespace katrin
{
typedef KComplexElement<KSIntSurfaceScattering> KSIntSurfaceScatteringBuilder;

template<> inline bool KSIntSurfaceScatteringBuilder::AddAttribute(KContainer* aContainer)
{
if (aContainer->GetName() == "name") {
aContainer->CopyTo(fObject, &KNamed::SetName);
return true;
}
if (aContainer->GetName() == "sec_electron_probability") {
aContainer->CopyTo(fObject, &KSIntSurfaceScattering::SetSecElectronProbability);
return true;
}
if (aContainer->GetName() == "sec_electron_mean_energy") {
aContainer->CopyTo(fObject, &KSIntSurfaceScattering::SetSecElectronMeanEnergy);
return true;
}
if (aContainer->GetName() == "scat_probability") {
aContainer->CopyTo(fObject, &KSIntSurfaceScattering::SetScatProbability);
return true;
}
if (aContainer->GetName() == "scat_loss_fraction") {
aContainer->CopyTo(fObject, &KSIntSurfaceScattering::SetScatLossFraction);
return true;
}
if (aContainer->GetName() == "side") {
aContainer->CopyTo(fObject, &KSIntSurfaceScattering::SetSide);
return true;
}
return false;
}
} // namespace katrin

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//////////////////////////////////////////////////////////////////////////
// Routine to simulate scattering of an electron on a surface with a given
// probability for backscattering of the electron and a given probability
// for production of a secondary electron from the surface.
//////////////////////////////////////////////////////////////////////////
#include "KSIntSurfaceScatteringBuilder.h"

#include "KSRootBuilder.h"

using namespace Kassiopeia;
using namespace std;

namespace katrin
{
template<> KSIntSurfaceScatteringBuilder::~KComplexElement() = default;

STATICINT sKSIntSurfaceScatteringStructure = KSIntSurfaceScatteringBuilder::Attribute<std::string>("name") +
KSIntSurfaceScatteringBuilder::Attribute<double>("sec_electron_probability") +
KSIntSurfaceScatteringBuilder::Attribute<double>("sec_electron_mean_energy") +
KSIntSurfaceScatteringBuilder::Attribute<double>("scat_probability") +
KSIntSurfaceScatteringBuilder::Attribute<double>("scat_loss_fraction") +
KSIntSurfaceScatteringBuilder::Attribute<std::string>("side");

STATICINT sKSIntSurfaceScatteringElement = KSRootBuilder::ComplexElement<KSIntSurfaceScattering>("ksint_surface_scattering");
} // namespace katrin
2 changes: 2 additions & 0 deletions Kassiopeia/Interactions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ set( INTERACTIONS_HEADER_BASENAMES
KSIntSurfaceSpecular.h
KSIntSurfaceUCN.h
KSIntSurfaceDiffuse.h
KSIntSurfaceScattering.h
KSIntSurfaceMultiplication.h

KSIntSurfaceSpinFlip.h
Expand Down Expand Up @@ -84,6 +85,7 @@ set( INTERACTIONS_SOURCE_BASENAMES
KSIntSurfaceSpecular.cxx
KSIntSurfaceUCN.cxx
KSIntSurfaceDiffuse.cxx
KSIntSurfaceScattering.cxx
KSIntSurfaceMultiplication.cxx

KSIntSurfaceSpinFlip.cxx
Expand Down
83 changes: 83 additions & 0 deletions Kassiopeia/Interactions/Include/KSIntSurfaceScattering.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
//////////////////////////////////////////////////////////////////////////
// Routine to simulate scattering of an electron on a surface with a given
// probability for backscattering of the electron and a given probability
// for production of a secondary electron from the surface.
//////////////////////////////////////////////////////////////////////////
#ifndef Kassiopeia_KSIntSurfaceScattering_h_
#define Kassiopeia_KSIntSurfaceScattering_h_

#include "KField.h"
#include "KSInteractionsMessage.h"
#include "KSSurfaceInteraction.h"
#include "KThreeVector.hh"

Comment thread
richeldichel marked this conversation as resolved.
#include <string>
namespace Kassiopeia
{

class KSStep;

enum class KSIntSurfaceScatteringSide
{
Both,
Top,
Bottom
};

class KSIntSurfaceScattering : public KSComponentTemplate<KSIntSurfaceScattering, KSSurfaceInteraction>
{
public:
KSIntSurfaceScattering();
KSIntSurfaceScattering(const KSIntSurfaceScattering& aCopy);
KSIntSurfaceScattering* Clone() const override;
~KSIntSurfaceScattering() override;

public:
void ExecuteInteraction(const KSParticle& anInitialParticle,
KSParticle& aFinalParticle,
KSParticleQueue& aSecondaries) override;
void CreateSecondaryElectron(const KSParticle& anInitialParticle,
KSParticle& aFinalParticle,
KSParticleQueue& aSecondaries);
void ExecuteReflection(const KSParticle& anInitialParticle,
KSParticle& aFinalParticle,
KSParticleQueue& aSecondaries);
katrin::KThreeVector GetReflectionDirection(const KSParticle& anInitialParticle,
const double tSinTheta,
const double tCosTheta,
const double tAzimuthalAngle);

void SetSide(std::string side_name)
{
if (side_name == "both") {
fSide = KSIntSurfaceScatteringSide::Both;
return;
}

if (side_name == "top") {
fSide = KSIntSurfaceScatteringSide::Top;
return;
}

if (side_name == "bottom") {
fSide = KSIntSurfaceScatteringSide::Bottom;
return;
}

intmsg(eError) << "surface diffuse interaction named <" << GetName()
<< "> does not understand side <" << side_name
<< ">. Valid sides are: both, top, bottom." << eom;
return;
}

public:
K_SET_GET(double, ScatProbability)
K_SET_GET(double, ScatLossFraction)
K_SET_GET(double, SecElectronProbability)
K_SET_GET(double, SecElectronMeanEnergy)
K_SET_GET(KSIntSurfaceScatteringSide, Side)
};

} // namespace Kassiopeia

#endif
Loading
Loading