Bi or MultiNomial Bunch Distribution

Issue #316 new
Laurie Nevay created an issue

Proposed adding of a binomial distribution. This in some sense should be relatively simple. To add a new bunch distribution you need to add:

  • A bunch distribution class that inherits BDSBunch that overrides BDSParticleCoordsFull BDSBunch::GetNextParticleLocal(). It optionally can override SetOptions() to pull and check parameters from the parser beam instance.
  • Any new variables you want for the beam command to parser/beamBase.h beamBase.cc and beam.cc
  • Add the name of the bunch to the enum class BDSBunchType.hh and BDSBunchType.cc - this is how it will be recognised in the parser’s beam, distrType="mybunchname";.
  • Add a case in the switch statement in BDSBunchFactory to instantiation the right class for the given type.

I’m happy to do the boilerplate / structure bits in a branch of BDSIM if you (Jochem, Malek) will implement the contents of the class that generates the coordinates.

CLHEP has clhep-2.4.5.1/Random/Random/RandBinomial.h for a 1D binomial distribution. If you want uncorrelated this is fine, but more likely you would want a proper correlated distribution. I can’t see any such multinomial distribution in CLHEP. If you need a correlated one, I believe you could adapt the MultiGauss one and use a similar method (clhep-2.4.5.1/RandomObjects/src/RandMultiGauss.cc).

Comments (0)

  1. Log in to comment