|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
#include <DistributionMoments.h>

Public Member Functions | |
| DistributionMoments () | |
| void | setContainerState (std::weak_ptr< BunchStateHandler::ContainerState > containerState) |
| void | setEnergyReferenceMass (double referenceMassGeV, bool rescaleToReference=true) |
| bool | getRescaleEnergyToReference () const |
| double | getEnergyReferenceMassGeV () const |
| void | compute (const std::vector< OpalParticle >::const_iterator &, const std::vector< OpalParticle >::const_iterator &) |
| void | computeMoments (ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type Rview, ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type Pview, ippl::ParticleAttrib< double >::view_type Mview, size_t Np, size_t Nlocal) |
| void | computeMinMaxPosition (ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type Rview, size_t Nlcoal) |
| void | computeMeanKineticEnergy () |
| void | computeDebyeLength (ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type Pview, size_t Np, size_t Nlocal, double density) |
| void | computePlasmaParameter (double) |
| Vector_t< double, 3 > | getMeanPosition () const |
| Vector_t< double, 3 > | getStandardDeviationPosition () const |
| Vector_t< double, 3 > | getMeanMomentum () const |
| Vector_t< double, 3 > | getStandardDeviationMomentum () const |
| Vector_t< double, 3 > | getNormalizedEmittance () const |
| Vector_t< double, 3 > | getGeometricEmittance () const |
| Vector_t< double, 3 > | getStandardDeviationRP () const |
| Vector_t< double, 3 > | getHalo () const |
| Vector_t< double, 3 > | getMinPosition () const |
| Vector_t< double, 3 > | getMaxPosition () const |
| Vector_t< double, 3 > | getMaxR () const |
| Vector_t< double, 3 > | get68Percentile () const |
| Vector_t< double, 3 > | get95Percentile () const |
| Vector_t< double, 3 > | get99Percentile () const |
| Vector_t< double, 3 > | get99_99Percentile () const |
| Vector_t< double, 3 > | getNormalizedEmittance68Percentile () const |
| Vector_t< double, 3 > | getNormalizedEmittance95Percentile () const |
| Vector_t< double, 3 > | getNormalizedEmittance99Percentile () const |
| Vector_t< double, 3 > | getNormalizedEmittance99_99Percentile () const |
| double | getMeanTime () const |
| double | getStdTime () const |
| double | getMeanGamma () const |
| double | getMeanGammaZ () const |
| double | getMeanKineticEnergy () const |
| double | getTemperature () const |
| double | getDebyeLength () const |
| double | getPlasmaParameter () const |
| double | getStdKineticEnergy () const |
| double | getDx () const |
| double | getDDx () const |
| double | getDy () const |
| double | getDDy () const |
| Vector_t< double, 6 > | getMeans () const |
| Vector_t< double, 6 > | getCentroid () const |
| matrix6x6_t | getMoments6x6 () const |
| double | getTotalCharge () const |
| double | getTotalMass () const |
| double | getTotalNumParticles () const |
| void | computeMeans (ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type Rview, ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type Pview, ippl::ParticleAttrib< double >::view_type Mview, size_t Np, size_t Nlocal) |
Private Types | |
| using | iterator_t = std::vector< Vector_t< double, 2 > >::const_iterator |
Private Member Functions | |
| bool | isParticleExcluded (const OpalParticle &) const |
| template<class InputIt > | |
| void | computePercentiles (const InputIt &, const InputIt &) |
| std::pair< double, iterator_t > | determinePercentilesDetail (const iterator_t &begin, const iterator_t &end, const std::vector< int > &globalAccumulatedHistogram, const std::vector< int > &localAccumulatedHistogram, unsigned int dimension, int numRequiredParticles) const |
| double | computeNormalizedEmittance (const iterator_t &begin, const iterator_t &end) const |
| void | fillMembers (std::vector< double > &) |
| void | reset () |
| void | resetPlasmaParameters () |
Static Private Attributes | |
| static const double | percentileOneSigmaNormalDist_m = std::erf(1 / sqrt(2)) |
| static const double | percentileTwoSigmasNormalDist_m = std::erf(2 / sqrt(2)) |
| static const double | percentileThreeSigmasNormalDist_m = std::erf(3 / sqrt(2)) |
| static const double | percentileFourSigmasNormalDist_m = std::erf(4 / sqrt(2)) |
Definition at line 39 of file DistributionMoments.h.
|
private |
Definition at line 132 of file DistributionMoments.h.
| DistributionMoments::DistributionMoments | ( | ) |
Definition at line 33 of file DistributionMoments.cpp.
References moments_m, notCentMoments_m, reset(), and resetPlasmaParameters().

| void DistributionMoments::compute | ( | const std::vector< OpalParticle >::const_iterator & | , |
| const std::vector< OpalParticle >::const_iterator & | |||
| ) |
Definition at line 301 of file DistributionMoments.cpp.
| void DistributionMoments::computeDebyeLength | ( | ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type | Pview, |
| size_t | Np, | ||
| size_t | Nlocal, | ||
| double | density | ||
| ) |
Definition at line 547 of file DistributionMoments.cpp.
References Physics::c, computePlasmaParameter(), SumArray< N >::data, debyeLength_m, Dim, dot(), Physics::epsilon_0, Units::eV2kg, Units::GeV2eV, Physics::m_e, Physics::q_e, resetPlasmaParameters(), and temperature_m.
Referenced by ParticleContainer< T, Dim >::computeDebyeLength().

| void DistributionMoments::computeMeanKineticEnergy | ( | ) |
Definition at line 538 of file DistributionMoments.cpp.
| void DistributionMoments::computeMeans | ( | ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type | Rview, |
| ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type | Pview, | ||
| ippl::ParticleAttrib< double >::view_type | Mview, | ||
| size_t | Np, | ||
| size_t | Nlocal | ||
| ) |
Definition at line 43 of file DistributionMoments.cpp.
References centroid_m, SumArray< N >::data, Dim, dot(), Units::GeV2MeV, meanGamma_m, meanGammaZ_m, meanKineticEnergy_m, meanP_m, meanR_m, means_m, referenceMassGeV_m, and rescaleToReference_m.
Referenced by computeMoments().

| void DistributionMoments::computeMinMaxPosition | ( | ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type | Rview, |
| size_t | Nlcoal | ||
| ) |
Definition at line 257 of file DistributionMoments.cpp.
References MaxArray< N >::data, MinArray< N >::data, Dim, maxR_m, and minR_m.
Referenced by ParticleContainer< T, Dim >::computeMinMaxR().
| void DistributionMoments::computeMoments | ( | ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type | Rview, |
| ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type | Pview, | ||
| ippl::ParticleAttrib< double >::view_type | Mview, | ||
| size_t | Np, | ||
| size_t | Nlocal | ||
| ) |
Definition at line 118 of file DistributionMoments.cpp.
References centroid_m, computeMeans(), containerState_m, SumMatrix6x6::data, Dim, dot(), geometricEps_m, Units::GeV2MeV, halo_m, Options::haloShift, meanGamma_m, meanKineticEnergy_m, meanP_m, meanR_m, moments_m, normalizedEps_m, notCentMoments_m, referenceMassGeV_m, rescaleToReference_m, reset(), stdKineticEnergy_m, stdP_m, stdR_m, and stdRP_m.
Referenced by TEST_F(), and ParticleContainer< T, Dim >::updateMoments().

|
private |
Definition at line 494 of file DistributionMoments.cpp.
Referenced by computePercentiles().
|
private |
Definition at line 309 of file DistributionMoments.cpp.
References computeNormalizedEmittance(), Options::computePercentiles, determinePercentilesDetail(), gsl_histogram_alloc(), gsl_histogram_free(), gsl_histogram_increment(), gsl_histogram_set_ranges_uniform(), maxR_m, meanR_m, minR_m, ninetyFivePercentile_m, ninetyNine_NinetyNinePercentile_m, ninetyNinePercentile_m, normalizedEps68Percentile_m, normalizedEps95Percentile_m, normalizedEps99_99Percentile_m, normalizedEps99Percentile_m, percentileFourSigmasNormalDist_m, percentileOneSigmaNormalDist_m, percentileThreeSigmasNormalDist_m, percentileTwoSigmasNormalDist_m, sixtyEightPercentile_m, and totalNumParticles_m.

| void DistributionMoments::computePlasmaParameter | ( | double | density | ) |
Definition at line 600 of file DistributionMoments.cpp.
References debyeLength_m, Physics::pi, and plasmaParameter_m.
Referenced by computeDebyeLength().
|
private |
Computes the percentile and the range of all local particles that are contained therein. In a first step the container globalAccumulatedHistogram is looped through until accumulated histogram value exceeds the required number of particles. The percentile then is between the boundaries of the last histogram bin before the loop stopped. Then all particle coordinates that are between the boundaries of this bin are communicated acros all nodes and sorted. The exact percentile is then determined by counting the n smallest coordinates such that the total number of partiles results is equal to 'numRequiredParticles'. In accordance with matlab (?) the percentile is the midpoint between the last particle within the percentile and tje first particle outside. Finally each node determines which of its particles are contained in the percentile.
To determine the histogram, the coordinates should not be used directly. Instead, the absolute value of the difference between a coordinate and the mean, |x - <x>|, should be used so that the percentile values are similar to the standard deviation.
| begin | begin of a container containing the one dimensional phase space of all local particles. |
| end | end of the container. |
| globalAccumulatedHistogram | container with partial sum of histogram values of position coordinates summed up across all nodes. The first value should be 0. |
| localAccumulatedHistogram | container with partial sum of histogram values of position coordinates of all local particles. The first value should be 0. |
| dimension | dimension of the one dimensional phase space. |
| numRequiredParticles | number of particles that are contained in the requested percentile. Is determined by the total number of particles and the percentile. |
Definition at line 438 of file DistributionMoments.cpp.
References meanR_m.
Referenced by computePercentiles().
|
private |
Definition at line 533 of file DistributionMoments.cpp.
|
inline |
Definition at line 263 of file DistributionMoments.h.
References sixtyEightPercentile_m.
|
inline |
Definition at line 271 of file DistributionMoments.h.
References ninetyFivePercentile_m.
|
inline |
Definition at line 287 of file DistributionMoments.h.
References ninetyNine_NinetyNinePercentile_m.
|
inline |
Definition at line 279 of file DistributionMoments.h.
References ninetyNinePercentile_m.
|
inline |
Definition at line 251 of file DistributionMoments.h.
References centroid_m.
Referenced by ParticleContainer< T, Dim >::getCentroid().
|
inline |
Definition at line 245 of file DistributionMoments.h.
References moments_m.
Referenced by ParticleContainer< T, Dim >::getDDx(), and TEST_F().
|
inline |
Definition at line 249 of file DistributionMoments.h.
References moments_m.
Referenced by ParticleContainer< T, Dim >::getDDy(), and TEST_F().
|
inline |
Definition at line 238 of file DistributionMoments.h.
References debyeLength_m.
Referenced by ParticleContainer< T, Dim >::computeDebyeLength(), and ParticleContainer< T, Dim >::getDebyeLength().
|
inline |
Definition at line 243 of file DistributionMoments.h.
References moments_m.
Referenced by ParticleContainer< T, Dim >::getDx(), and TEST_F().
|
inline |
Definition at line 247 of file DistributionMoments.h.
References moments_m.
Referenced by ParticleContainer< T, Dim >::getDy(), and TEST_F().
|
inline |
Definition at line 61 of file DistributionMoments.h.
References referenceMassGeV_m.
|
inline |
Definition at line 212 of file DistributionMoments.h.
References geometricEps_m.
Referenced by ParticleContainer< T, Dim >::getGeometricEmit(), and TEST_F().
|
inline |
Definition at line 218 of file DistributionMoments.h.
References halo_m.
|
inline |
Definition at line 222 of file DistributionMoments.h.
References maxR_m.
Referenced by ParticleContainer< T, Dim >::getMaxR().
|
inline |
Definition at line 295 of file DistributionMoments.h.
|
inline |
Definition at line 228 of file DistributionMoments.h.
References meanGamma_m.
Referenced by TEST_F().
|
inline |
Definition at line 230 of file DistributionMoments.h.
References meanGammaZ_m.
Referenced by ParticleContainer< T, Dim >::getMeanGammaZ(), and TEST_F().
|
inline |
Definition at line 232 of file DistributionMoments.h.
References meanKineticEnergy_m.
Referenced by ParticleContainer< T, Dim >::getMeanKineticEnergy(), and TEST_F().
|
inline |
Definition at line 202 of file DistributionMoments.h.
References meanP_m.
Referenced by ParticleContainer< T, Dim >::getMeanP(), and TEST_F().
|
inline |
Definition at line 196 of file DistributionMoments.h.
References meanR_m.
Referenced by ParticleContainer< T, Dim >::getMeanR(), and TEST_F().
|
inline |
Definition at line 253 of file DistributionMoments.h.
References means_m.
Referenced by ParticleContainer< T, Dim >::getMeans().
|
inline |
Definition at line 224 of file DistributionMoments.h.
References meanTime_m.
|
inline |
Definition at line 220 of file DistributionMoments.h.
References minR_m.
Referenced by ParticleContainer< T, Dim >::getMinR().
|
inline |
Definition at line 255 of file DistributionMoments.h.
References moments_m.
Referenced by ParticleContainer< T, Dim >::getCovMatrix().
|
inline |
Definition at line 208 of file DistributionMoments.h.
References normalizedEps_m.
Referenced by ParticleContainer< T, Dim >::getNormEmit(), and TEST_F().
|
inline |
Definition at line 267 of file DistributionMoments.h.
References normalizedEps68Percentile_m.
|
inline |
Definition at line 275 of file DistributionMoments.h.
References normalizedEps95Percentile_m.
|
inline |
Definition at line 291 of file DistributionMoments.h.
References normalizedEps99_99Percentile_m.
|
inline |
Definition at line 283 of file DistributionMoments.h.
References normalizedEps99Percentile_m.
|
inline |
Definition at line 239 of file DistributionMoments.h.
References plasmaParameter_m.
Referenced by ParticleContainer< T, Dim >::getPlasmaParameter().
|
inline |
Definition at line 60 of file DistributionMoments.h.
References rescaleToReference_m.
|
inline |
Definition at line 204 of file DistributionMoments.h.
References stdP_m.
Referenced by ParticleContainer< T, Dim >::getRmsP(), and TEST_F().
|
inline |
Definition at line 198 of file DistributionMoments.h.
References stdR_m.
Referenced by ParticleContainer< T, Dim >::getRmsR(), and TEST_F().
|
inline |
Definition at line 216 of file DistributionMoments.h.
References stdRP_m.
Referenced by ParticleContainer< T, Dim >::getRmsRP().
|
inline |
Definition at line 241 of file DistributionMoments.h.
References stdKineticEnergy_m.
Referenced by ParticleContainer< T, Dim >::getStdKineticEnergy(), and TEST_F().
|
inline |
Definition at line 226 of file DistributionMoments.h.
References stdTime_m.
|
inline |
Definition at line 235 of file DistributionMoments.h.
References Physics::c, Units::eV2kg, Physics::kB, and temperature_m.
Referenced by ParticleContainer< T, Dim >::getTemperature().
|
inline |
Definition at line 257 of file DistributionMoments.h.
References totalCharge_m.
|
inline |
Definition at line 259 of file DistributionMoments.h.
References totalMass_m.
|
inline |
Definition at line 261 of file DistributionMoments.h.
References totalNumParticles_m.
|
private |
Definition at line 640 of file DistributionMoments.cpp.
|
private |
Definition at line 606 of file DistributionMoments.cpp.
References centroid_m, geometricEps_m, halo_m, meanKineticEnergy_m, meanP_m, meanR_m, ninetyFivePercentile_m, ninetyNine_NinetyNinePercentile_m, ninetyNinePercentile_m, normalizedEps68Percentile_m, normalizedEps95Percentile_m, normalizedEps99_99Percentile_m, normalizedEps99Percentile_m, normalizedEps_m, sixtyEightPercentile_m, stdKineticEnergy_m, stdP_m, stdR_m, stdRP_m, totalCharge_m, totalMass_m, and totalNumParticles_m.
Referenced by computeMoments(), and DistributionMoments().
|
private |
Definition at line 634 of file DistributionMoments.cpp.
References debyeLength_m, plasmaParameter_m, and temperature_m.
Referenced by computeDebyeLength(), and DistributionMoments().
|
inline |
Bind this instance to the per-container slot it should query and update. Stored as a weak_ptr: ParticleContainer is the sole strong owner of the slot, so DistributionMoments observes but never extends its lifetime. Implicitly converts from the caller's shared_ptr.
Definition at line 47 of file DistributionMoments.h.
References containerState_m.
Referenced by ParticleContainer< T, Dim >::setBunchStateHandler(), and TEST_F().
|
inline |
Configure whether kinetic-energy moments use a reference particle mass (instead of per-particle M).
| referenceMassGeV | Reference particle mass in GeV. |
| rescaleToReference | If true, mean/std kinetic energy are computed using referenceMassGeV. |
Definition at line 56 of file DistributionMoments.h.
References referenceMassGeV_m, and rescaleToReference_m.
Referenced by ParticleContainer< T, Dim >::setEnergyReferenceMass().
|
private |
Definition at line 181 of file DistributionMoments.h.
Referenced by computeMeans(), computeMoments(), getCentroid(), and reset().
|
private |
Definition at line 146 of file DistributionMoments.h.
Referenced by computeMoments(), and setContainerState().
|
private |
Definition at line 171 of file DistributionMoments.h.
Referenced by computeDebyeLength(), computePlasmaParameter(), getDebyeLength(), and resetPlasmaParameters().
|
private |
Definition at line 154 of file DistributionMoments.h.
Referenced by computeMoments(), getGeometricEmittance(), and reset().
|
private |
Definition at line 155 of file DistributionMoments.h.
Referenced by computeMoments(), getHalo(), and reset().
|
private |
Definition at line 156 of file DistributionMoments.h.
Referenced by computeMinMaxPosition(), computePercentiles(), getMaxPosition(), and getMaxR().
|
private |
Definition at line 174 of file DistributionMoments.h.
Referenced by computeMeans(), computeMoments(), and getMeanGamma().
|
private |
Definition at line 175 of file DistributionMoments.h.
Referenced by computeMeans(), and getMeanGammaZ().
|
private |
Definition at line 169 of file DistributionMoments.h.
Referenced by computeMeans(), computeMoments(), getMeanKineticEnergy(), and reset().
|
private |
Definition at line 149 of file DistributionMoments.h.
Referenced by computeMeans(), computeMoments(), getMeanMomentum(), and reset().
|
private |
Definition at line 148 of file DistributionMoments.h.
Referenced by computeMeans(), computeMoments(), computePercentiles(), determinePercentilesDetail(), getMeanPosition(), and reset().
|
private |
Definition at line 182 of file DistributionMoments.h.
Referenced by computeMeans(), and getMeans().
|
private |
Definition at line 167 of file DistributionMoments.h.
Referenced by getMeanTime().
|
private |
Definition at line 157 of file DistributionMoments.h.
Referenced by computeMinMaxPosition(), computePercentiles(), getMaxR(), and getMinPosition().
|
private |
Definition at line 183 of file DistributionMoments.h.
Referenced by computeMoments(), DistributionMoments(), getDDx(), getDDy(), getDx(), getDy(), and getMoments6x6().
|
private |
Definition at line 160 of file DistributionMoments.h.
Referenced by computePercentiles(), get95Percentile(), and reset().
|
private |
Definition at line 164 of file DistributionMoments.h.
Referenced by computePercentiles(), get99_99Percentile(), and reset().
|
private |
Definition at line 162 of file DistributionMoments.h.
Referenced by computePercentiles(), get99Percentile(), and reset().
|
private |
Definition at line 159 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance68Percentile(), and reset().
|
private |
Definition at line 161 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance95Percentile(), and reset().
|
private |
Definition at line 165 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance99_99Percentile(), and reset().
|
private |
Definition at line 163 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance99Percentile(), and reset().
|
private |
Definition at line 153 of file DistributionMoments.h.
Referenced by computeMoments(), getNormalizedEmittance(), and reset().
|
private |
Definition at line 184 of file DistributionMoments.h.
Referenced by computeMoments(), and DistributionMoments().
|
staticprivate |
Definition at line 193 of file DistributionMoments.h.
Referenced by computePercentiles().
|
staticprivate |
Definition at line 190 of file DistributionMoments.h.
Referenced by computePercentiles().
|
staticprivate |
Definition at line 192 of file DistributionMoments.h.
Referenced by computePercentiles().
|
staticprivate |
Definition at line 191 of file DistributionMoments.h.
Referenced by computePercentiles().
|
private |
Definition at line 172 of file DistributionMoments.h.
Referenced by computePlasmaParameter(), getPlasmaParameter(), and resetPlasmaParameters().
|
private |
Definition at line 179 of file DistributionMoments.h.
Referenced by computeMeans(), computeMoments(), getEnergyReferenceMassGeV(), and setEnergyReferenceMass().
|
private |
Definition at line 178 of file DistributionMoments.h.
Referenced by computeMeans(), computeMoments(), getRescaleEnergyToReference(), and setEnergyReferenceMass().
|
private |
Definition at line 158 of file DistributionMoments.h.
Referenced by computePercentiles(), get68Percentile(), and reset().
|
private |
Definition at line 173 of file DistributionMoments.h.
Referenced by computeMoments(), getStdKineticEnergy(), and reset().
|
private |
Definition at line 151 of file DistributionMoments.h.
Referenced by computeMoments(), getStandardDeviationMomentum(), and reset().
|
private |
Definition at line 150 of file DistributionMoments.h.
Referenced by computeMoments(), getStandardDeviationPosition(), and reset().
|
private |
Definition at line 152 of file DistributionMoments.h.
Referenced by computeMoments(), getStandardDeviationRP(), and reset().
|
private |
Definition at line 168 of file DistributionMoments.h.
Referenced by getStdTime().
|
private |
Definition at line 170 of file DistributionMoments.h.
Referenced by computeDebyeLength(), getTemperature(), and resetPlasmaParameters().
|
private |
Definition at line 186 of file DistributionMoments.h.
Referenced by getTotalCharge(), and reset().
|
private |
Definition at line 187 of file DistributionMoments.h.
Referenced by getTotalMass(), and reset().
|
private |
Definition at line 188 of file DistributionMoments.h.
Referenced by computePercentiles(), getTotalNumParticles(), and reset().