Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

constant specifies the name of the (sub)collection to retrieve, so that we get back a list of objects (rather than a list of collections, e.g. a list of lists).

Now that we have a list of particles in this event, some plots can be filled.

This line fills a plot called "nTracks" with the number of particles in the event.

No Format

aida.cloud1D("nTracks").fill(particles.size());

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.