OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
#include <CollimatorPhysics.hh>
Public Member Functions | |
CollimatorPhysics (const std::string &name, ElementBase *element, std::string &mat, bool enableRutherford) | |
~CollimatorPhysics () | |
void | apply (PartBunchBase< double, 3 > *bunch, const std::pair< Vector_t, double > &boundingSphere, size_t numParticlesInSimulation=0) |
virtual const std::string | getType () const |
void | print (Inform &os) |
bool | stillActive () |
bool | stillAlive (PartBunchBase< double, 3 > *bunch) |
double | getTime () |
std::string | getName () |
size_t | getParticlesInMat () |
unsigned | getRediffused () |
unsigned int | getNumEntered () |
void | computeInteraction () |
virtual bool | computeEnergyLoss (Vector_t &P, const double deltat, bool includeFluctuations=true) const |
![]() | |
ParticleMatterInteractionHandler (std::string name, ElementBase *elref) | |
virtual | ~ParticleMatterInteractionHandler () |
void | setFlagAllParticlesIn (bool p) |
bool | getFlagAllParticlesIn () const |
void | updateElement (ElementBase *newref) |
ElementBase * | getElement () |
Private Member Functions | |
void | configureMaterialParameters () |
The material of the collimator. More... | |
void | computeCoulombScattering (Vector_t &R, Vector_t &P, double dt) |
void | applyRotation (Vector_t &P, Vector_t &R, double xplane, double thetacou) |
void | applyRandomRotation (Vector_t &P, double theta0) |
void | copyFromBunch (PartBunchBase< double, 3 > *bunch, const std::pair< Vector_t, double > &boundingSphere) |
void | addBackToBunch (PartBunchBase< double, 3 > *bunch) |
void | applyNonDKS (PartBunchBase< double, 3 > *bunch, const std::pair< Vector_t, double > &boundingSphere, size_t numParticlesInSimulation) |
void | deleteParticleFromLocalVector () |
void | calcStat (double Eng) |
void | gatherStatistics () |
void | push () |
void | resetTimeStep () |
void | setTimeStepForLeavingParticles () |
Private Attributes | |
double | T_m |
double | dT_m |
gsl_rng * | rGen_m |
std::string | material_m |
std::unique_ptr< InsideTester > | hitTester_m |
ElementBase::ElementType | collshape_m |
std::string | collshapeStr_m |
double | Z_m |
double | A_m |
double | rho_m |
double | X0_m |
double | I_m |
double | A2_c |
double | A3_c |
double | A4_c |
double | A5_c |
unsigned int | bunchToMatStat_m |
unsigned int | stoppedPartStat_m |
unsigned int | rediffusedStat_m |
unsigned int | totalPartsInMat_m |
double | Eavg_m |
double | Emax_m |
double | Emin_m |
std::vector< PART > | locParts_m |
std::unique_ptr< LossDataSink > | lossDs_m |
bool | enableRutherford_m |
IpplTimings::TimerRef | DegraderApplyTimer_m |
IpplTimings::TimerRef | DegraderLoopTimer_m |
IpplTimings::TimerRef | DegraderDestroyTimer_m |
Additional Inherited Members | |
![]() | |
ElementBase * | element_ref_m |
bool | allParticleInMat_m |
if all particles are in matter stay inside the particle matter interaction More... | |
Definition at line 79 of file CollimatorPhysics.hh.
CollimatorPhysics::CollimatorPhysics | ( | const std::string & | name, |
ElementBase * | element, | ||
std::string & | mat, | ||
bool | enableRutherford | ||
) |
Definition at line 78 of file CollimatorPhysics.cpp.
References Options::asciidump, ElementBase::CCOLLIMATOR, collshape_m, configureMaterialParameters(), ElementBase::DEGRADER, DegraderApplyTimer_m, DegraderDestroyTimer_m, DegraderLoopTimer_m, IpplInfo::DKSEnabled, ParticleMatterInteractionHandler::element_ref_m, ElementBase::FLEXIBLECOLLIMATOR, getName(), IpplTimings::getTimer(), ElementBase::getType(), hitTester_m, lossDs_m, IpplInfo::myNode(), rGen_m, and Options::seed.
CollimatorPhysics::~CollimatorPhysics | ( | ) |
Definition at line 163 of file CollimatorPhysics.cpp.
References IpplInfo::DKSEnabled, locParts_m, lossDs_m, and rGen_m.
|
private |
Definition at line 466 of file CollimatorPhysics.cpp.
References PartBunchBase< T, Dim >::Bf, PartBunchBase< T, Dim >::Bin, PartBunchBase< T, Dim >::createWithID(), deleteParticleFromLocalVector(), PartBunchBase< T, Dim >::dt, dT_m, PartBunchBase< T, Dim >::Ef, ParticleMatterInteractionHandler::element_ref_m, ElementBase::getElementLength(), PartBunchBase< T, Dim >::getLocalNum(), locParts_m, PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::Q, Attrib::Distribution::R, PartBunchBase< T, Dim >::R, and rediffusedStat_m.
Referenced by applyNonDKS().
|
virtual |
Implements ParticleMatterInteractionHandler.
Definition at line 196 of file CollimatorPhysics.cpp.
References applyNonDKS(), bunchToMatStat_m, collshape_m, ElementBase::DEGRADER, DegraderApplyTimer_m, IpplInfo::DKSEnabled, dT_m, Eavg_m, Emax_m, Emin_m, PartBunchBase< T, Dim >::getdT(), PartBunchBase< T, Dim >::getT(), rediffusedStat_m, IpplTimings::startTimer(), stoppedPartStat_m, IpplTimings::stopTimer(), T_m, and totalPartsInMat_m.
|
private |
Definition at line 235 of file CollimatorPhysics.cpp.
References addBackToBunch(), ParticleMatterInteractionHandler::allParticleInMat_m, computeInteraction(), copyFromBunch(), DegraderLoopTimer_m, dT_m, gatherStatistics(), push(), rediffusedStat_m, resetTimeStep(), setTimeStepForLeavingParticles(), IpplTimings::startTimer(), IpplTimings::stopTimer(), T_m, and totalPartsInMat_m.
Referenced by apply().
|
private |
Definition at line 394 of file CollimatorPhysics.cpp.
References abs(), atan(), cos(), cross(), dot(), euclidean_norm(), rGen_m, sin(), sqrt(), Physics::two_pi, Attrib::Distribution::W, and X.
Referenced by computeCoulombScattering().
|
private |
Definition at line 378 of file CollimatorPhysics.cpp.
References atan2(), cos(), fmod(), Attrib::Distribution::R, sin(), and Physics::two_pi.
Referenced by computeCoulombScattering().
|
inlineprivate |
Definition at line 215 of file CollimatorPhysics.hh.
Coulomb Scattering: Including Multiple Coulomb Scattering and large angle Rutherford Scattering. Using the distribution given in Classical Electrodynamics, by J. D. Jackson.
Definition at line 419 of file CollimatorPhysics.cpp.
References abs(), applyRandomRotation(), applyRotation(), Physics::c, cos(), enableRutherford_m, euclidean_norm(), log(), Physics::m_p, Physics::pi, pow(), rGen_m, CoordinateSystemTrafo::rotateFrom(), CoordinateSystemTrafo::rotateTo(), sin(), sqrt(), CoordinateSystemTrafo::transformFrom(), Physics::two_pi, X0_m, and Physics::z_p.
Referenced by computeInteraction().
|
virtual |
Energy Loss: using the Bethe-Bloch equation. Energy straggling: For relatively thick absorbers such that the number of collisions is large, the energy loss distribution is shown to be Gaussian in form. See Particle Physics Booklet, chapter 'Passage of particles through matter' or Review of Particle Physics, DOI: 10.1103/PhysRevD.86.010001, page 329 ff
Implements ParticleMatterInteractionHandler.
Definition at line 318 of file CollimatorPhysics.cpp.
References A2_c, A3_c, A4_c, A5_c, A_m, Physics::amu, Physics::Avo, Physics::c, Physics::e, euclidean_norm(), Util::getGamma(), I_m, K, log(), Physics::m_e, Physics::m_p, Physics::pi, pow(), Physics::r_e, rGen_m, rho_m, sqrt(), Z_m, and Physics::z_p.
Referenced by computeInteraction().
void CollimatorPhysics::computeInteraction | ( | ) |
Definition at line 272 of file CollimatorPhysics.cpp.
References computeCoulombScattering(), computeEnergyLoss(), deleteParticleFromLocalVector(), hitTester_m, locParts_m, lossDs_m, and stoppedPartStat_m.
Referenced by applyNonDKS().
|
private |
The material of the collimator.
Definition at line 182 of file CollimatorPhysics.cpp.
References Physics::Material::A2, A2_c, Physics::Material::A3, A3_c, Physics::Material::A4, A4_c, Physics::Material::A5, A5_c, A_m, Physics::Material::getMaterial(), I_m, material_m, rho_m, X0_m, and Z_m.
Referenced by CollimatorPhysics().
|
private |
Definition at line 512 of file CollimatorPhysics.cpp.
References PartBunchBase< T, Dim >::Bf, PART::Bfincol, PartBunchBase< T, Dim >::Bin, PART::Binincol, bunchToMatStat_m, Physics::c, DegraderDestroyTimer_m, PartBunchBase< T, Dim >::destroy(), PartBunchBase< T, Dim >::dt, dT_m, PART::DTincol, PartBunchBase< T, Dim >::Ef, PART::Efincol, ParticleMatterInteractionHandler::element_ref_m, ElementBase::getElementLength(), Util::getGamma(), PartBunchBase< T, Dim >::getLocalNum(), PartBunchBase< T, Dim >::getMinimumNumberOfParticlesPerCore(), hitTester_m, PartBunchBase< T, Dim >::ID, PART::IDincol, PART::label, PART::localID, locParts_m, ne(), PartBunchBase< T, Dim >::P, PAssert_GE, PAssert_LE, PartBunchBase< T, Dim >::performDestroy(), PART::Pincol, PartBunchBase< T, Dim >::Q, PART::Qincol, PartBunchBase< T, Dim >::R, PART::Rincol, IpplTimings::startTimer(), and IpplTimings::stopTimer().
Referenced by applyNonDKS().
|
private |
Definition at line 641 of file CollimatorPhysics.cpp.
References Eavg_m, Emax_m, Emin_m, and locParts_m.
Referenced by addBackToBunch(), and computeInteraction().
|
private |
Definition at line 715 of file CollimatorPhysics.cpp.
References allreduce(), bunchToMatStat_m, collshape_m, ElementBase::DEGRADER, IpplInfo::DKSEnabled, locParts_m, rediffusedStat_m, stoppedPartStat_m, and totalPartsInMat_m.
Referenced by applyNonDKS().
|
virtual |
Implements ParticleMatterInteractionHandler.
Definition at line 176 of file CollimatorPhysics.cpp.
References ParticleMatterInteractionHandler::element_ref_m, and ElementBase::getName().
Referenced by CollimatorPhysics().
|
inlinevirtual |
Implements ParticleMatterInteractionHandler.
Definition at line 239 of file CollimatorPhysics.hh.
References bunchToMatStat_m.
|
inlinevirtual |
Implements ParticleMatterInteractionHandler.
Definition at line 229 of file CollimatorPhysics.hh.
References totalPartsInMat_m.
|
inlinevirtual |
Implements ParticleMatterInteractionHandler.
Definition at line 234 of file CollimatorPhysics.hh.
References rediffusedStat_m.
|
inlinevirtual |
Implements ParticleMatterInteractionHandler.
Definition at line 224 of file CollimatorPhysics.hh.
References T_m.
|
inlinevirtual |
Implements ParticleMatterInteractionHandler.
Definition at line 244 of file CollimatorPhysics.hh.
|
virtual |
Implements ParticleMatterInteractionHandler.
Definition at line 579 of file CollimatorPhysics.cpp.
References bunchToMatStat_m, ParticleMatterInteractionHandler::element_ref_m, endl(), Inform::flags(), ElementBase::getName(), level2(), material_m, rediffusedStat_m, stoppedPartStat_m, OPALTimer::Timer::time(), Util::toStringWithThousandSep(), and totalPartsInMat_m.
|
private |
Definition at line 666 of file CollimatorPhysics.cpp.
References Physics::c, dT_m, Util::getGamma(), and locParts_m.
Referenced by applyNonDKS().
|
private |
Definition at line 706 of file CollimatorPhysics.cpp.
References dT_m, and locParts_m.
Referenced by applyNonDKS().
|
private |
Definition at line 682 of file CollimatorPhysics.cpp.
References Physics::c, dT_m, ParticleMatterInteractionHandler::element_ref_m, ElementBase::getElementLength(), Util::getGamma(), locParts_m, PAssert_GE, PAssert_LE, and Attrib::Distribution::R.
Referenced by applyNonDKS().
|
virtual |
Implements ParticleMatterInteractionHandler.
Definition at line 602 of file CollimatorPhysics.cpp.
References totalPartsInMat_m.
|
virtual |
Implements ParticleMatterInteractionHandler.
Definition at line 606 of file CollimatorPhysics.cpp.
References collshape_m, matheval::detail::math::deg(), ElementBase::DEGRADER, IpplInfo::DKSEnabled, ParticleMatterInteractionHandler::element_ref_m, PartBunchBase< T, Dim >::get_origin(), Degrader::getDimensions(), and totalPartsInMat_m.
|
private |
Definition at line 169 of file CollimatorPhysics.hh.
Referenced by computeEnergyLoss(), and configureMaterialParameters().
|
private |
Definition at line 170 of file CollimatorPhysics.hh.
Referenced by computeEnergyLoss(), and configureMaterialParameters().
|
private |
Definition at line 171 of file CollimatorPhysics.hh.
Referenced by computeEnergyLoss(), and configureMaterialParameters().
|
private |
Definition at line 172 of file CollimatorPhysics.hh.
Referenced by computeEnergyLoss(), and configureMaterialParameters().
|
private |
Definition at line 164 of file CollimatorPhysics.hh.
Referenced by computeEnergyLoss(), and configureMaterialParameters().
|
private |
Definition at line 175 of file CollimatorPhysics.hh.
Referenced by apply(), copyFromBunch(), gatherStatistics(), getNumEntered(), and print().
|
private |
Definition at line 159 of file CollimatorPhysics.hh.
Referenced by apply(), CollimatorPhysics(), gatherStatistics(), and stillAlive().
|
private |
Definition at line 160 of file CollimatorPhysics.hh.
|
private |
Definition at line 209 of file CollimatorPhysics.hh.
Referenced by apply(), and CollimatorPhysics().
|
private |
Definition at line 211 of file CollimatorPhysics.hh.
Referenced by CollimatorPhysics(), and copyFromBunch().
|
private |
Definition at line 210 of file CollimatorPhysics.hh.
Referenced by applyNonDKS(), and CollimatorPhysics().
|
private |
Definition at line 153 of file CollimatorPhysics.hh.
Referenced by addBackToBunch(), apply(), applyNonDKS(), copyFromBunch(), push(), resetTimeStep(), and setTimeStepForLeavingParticles().
|
private |
Definition at line 184 of file CollimatorPhysics.hh.
Referenced by apply(), calcStat(), and deleteParticleFromLocalVector().
|
private |
Definition at line 185 of file CollimatorPhysics.hh.
Referenced by apply(), calcStat(), and deleteParticleFromLocalVector().
|
private |
Definition at line 186 of file CollimatorPhysics.hh.
Referenced by apply(), calcStat(), and deleteParticleFromLocalVector().
|
private |
Definition at line 192 of file CollimatorPhysics.hh.
Referenced by computeCoulombScattering().
|
private |
Definition at line 158 of file CollimatorPhysics.hh.
Referenced by CollimatorPhysics(), computeInteraction(), and copyFromBunch().
|
private |
Definition at line 167 of file CollimatorPhysics.hh.
Referenced by computeEnergyLoss(), and configureMaterialParameters().
|
private |
Definition at line 188 of file CollimatorPhysics.hh.
Referenced by addBackToBunch(), computeInteraction(), copyFromBunch(), deleteParticleFromLocalVector(), gatherStatistics(), push(), resetTimeStep(), setTimeStepForLeavingParticles(), and ~CollimatorPhysics().
|
private |
Definition at line 190 of file CollimatorPhysics.hh.
Referenced by CollimatorPhysics(), computeInteraction(), and ~CollimatorPhysics().
|
private |
Definition at line 157 of file CollimatorPhysics.hh.
Referenced by configureMaterialParameters(), and print().
|
private |
Definition at line 179 of file CollimatorPhysics.hh.
Referenced by addBackToBunch(), apply(), applyNonDKS(), gatherStatistics(), getRediffused(), and print().
|
private |
Definition at line 155 of file CollimatorPhysics.hh.
Referenced by applyRandomRotation(), CollimatorPhysics(), computeCoulombScattering(), computeEnergyLoss(), and ~CollimatorPhysics().
|
private |
Definition at line 165 of file CollimatorPhysics.hh.
Referenced by computeEnergyLoss(), and configureMaterialParameters().
|
private |
Definition at line 177 of file CollimatorPhysics.hh.
Referenced by apply(), computeInteraction(), gatherStatistics(), and print().
|
private |
Definition at line 152 of file CollimatorPhysics.hh.
Referenced by apply(), applyNonDKS(), and getTime().
|
private |
Definition at line 181 of file CollimatorPhysics.hh.
Referenced by apply(), applyNonDKS(), gatherStatistics(), getParticlesInMat(), print(), stillActive(), and stillAlive().
|
private |
Definition at line 166 of file CollimatorPhysics.hh.
Referenced by computeCoulombScattering(), and configureMaterialParameters().
|
private |
Definition at line 163 of file CollimatorPhysics.hh.
Referenced by computeEnergyLoss(), and configureMaterialParameters().