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

...

The org.lcsim framework and the WIRED4 event display are not tied to each other, instead there is code in org.lcsim which converts the event into intermediate HepRep objects.

If You Don't Like To Read Long Docs

Let's go through the example of how to put a list of Hep3Vectors into the event and transform it to a list of HepRep object that can be displayed by WIRED. The full code is in the class org.lcsim.util.heprep.Hep3VectorConverter

...

We just have to make sure there is a line to register a new instance of the class we just wrote. As you can see, it's already there.
That's all there is to it. If you want to know more about the inner workings, read on, reader.

If You Have To Read Longer Docs

Let's go through the code step by step:
The basic skeleton looks like this:

...

is used to communicate between org.lcsim objects and its HepRep representations. For each type of element you want to display, you will have to create a HepRepType. The name can be the name of the collection in the EventHeader (as is the case in the example) or any string you want. Please make sure it is unique.
We then add some properties to the representation. A complete list of available options and parameters is posted elsewhere.
Finally, for each element in the list of org.lcsim objects (Hep3Vector in this case) we create a HepRepInstance object. It inherits its properties from the HepRepType it belongs to, but you can overwrite the properties. You might, for example want to assign certain colors to different instances, grouping them by momentum, parent, distance, or whatever you can think of. Now that we have created a HepRepInstance, we want to draw it. In order to do that we need to create one (or more) HepRepPoint}}s instances. In this example, where we draw the {{Hep3Vector as a point, one HepRepPoint is sufficient, but there may be cases where you want to create a more complex representation that requires more points to draw.
Please have a look at the classes in the package org.lcsim.util.heprep for further inspiration.

References