D0 GROUP LEVEL3
ONLINE LESSONS

Gustaaf Brooijmans
Fermilab, MS # 357
Tel: +1 (630) 840 4269
Last Update:
12/07/99
by Gustaaf Brooijmans

Episode X
L3PhysicsResults Classes

by Gustaaf Brooijmans

If you're going to write a physicsTool - i.e. a level 3 tool that identifies physics objects like electrons, muons,
etc.- then this episode's for you (but all others are too)!

For many reasons, among which writing out the level 3 results and the need for a standard method to compute relational values like invariant mass, the results from physicsTools need to be "stored" in a uniform way. We have therefore developed the L3PhysicsResults base class, which contains the objects each physics object should have.  The results class for a specific physicsTool should inherit from L3PhysicsResults, as has been done for example in L3TauPhysicsResults (which can be found in package l3fTauTools - versions v00-02-04 and higher).

The main class of your physics tool, by the way, will inherit from the templated class physicsTool<T> (in package l3ftoolbase), where class T is your specific L3xxxPhysicsResults (substitute your object type for xxx).  See for example L3TauHadronic in package l3fTauTools.

Attributes:

L3PhysicsResults contains the following attributes: These are common to all the results classes.  In addition to that, each L3xxxPhysicsResults class has specific attributes like trackparameters, energy fraction in various calorimeter parts, etc.  It is important that these attributes are persistent (see the episode on d0om), since these classes will be written out.

Methods:

L3PhysicsResults logically contains the following methods: where the last method is virtual to allow dynamic_casts from L3PhysicsResults to its subclasses.

When you create your L3xxxPhysicsResults subclass,  you will have to provide methods returning the values of your class' specific attributes, as well as the default constructor and a constructor from a pointer to a class of the same type.  You also have to provide an ostream operator and a Set(L3PhysData * ) method to fill the results.   We have chosen to pass a pointer to L3Physdata to minimize the number of arguments, as well as allowing to exploit polymorphism in the Set method in L3ToolResults (see below).  (Note: you need to implement a class L3xxxData which inherits from L3PhysData and contains the attributes specific to your object).

Now, aside from the fact that your tool's main class inherits from physicsTool<L3xxxPhysicsResults>, how is your tool supposed to interact with the results classes?  This functionality is provided by the templated L3ToolResults<L3xxxPhysicsResults>class.

L3ToolResults:

One of the attributes of your main class should be an L3ToolResults<L3xxxPhysicsResults> * , which should be created in your tool's MakeMe() method (i.e. MakeMe() should contain a line
_toolResults = new L3ToolResults<L3xxxPhysicsResults>(); ).  When your tool finds a candidate, it fills the candidate's parameters in the data structure, and uses the method
L3ToolResults<T>::Set(L3xxxData * data) to fill the results into an L3xxxPhysicsResults (see for example the L3TauHadronic::fill_candidate method in L3Tauhadronic).  The L3xxxPhysicsResults class goes into your own tool's package.

Basically that's it.  If you follow these few prescriptions, you don't have to worry about anything related to transmitting your results anymore.

Summarizing:

You have to:


As always, if you have problems, questions or comments, feel free to contact me.


GB  7-Dec-99
 
Main Page Next Episode