Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For convenience, the cloud1D method of the AIDA object will create the "nTracks" plot if it doesn't already exist. Otherwise, the existing plot will be filled.

The MCParticles List is a generic Java collection, so its size is conveniently available using the size() method.

To fill some plots with data from individual particles, the Driver loops over the list using Java's "foreach" construct.

No Format

for (MCParticle particle : particles)

This means that the body of the loop can do processing on each particle in particles using the particle variable.

Next, three plots are filled with data from the particle.

No Format

aida.cloud1D("energy").fill(particle.getEnergy());
aida.cloud1D("cosTheta").fill(VecOp.cosTheta(particle.getMomentum()));
aida.cloud1D("phi").fill(VecOp.phi(particle.getMomentum()));

The first line plots the particle's energy. The second two characterize the particle's momentum/direction by using the cosTheta and phi vector operations on the momentum value
retrieved from the particle.

Info
titleMCParticle Interface

Refer to the MCParticle JavaDoc for a complete list of all the methods available in this interface. MCParticle inherits some of its functionality from its parent interface, Particle.