Classifiers

Introduction

A classifier is a class that contains a method that receives a G4Step or a G4Track and returns a different index (an integer) depending on some given criteria. In other words it classifies the step or track and returns the index of its classification. These classes are unique to GAMOS, as Geant4 does not provide this functionality.

Classifiers can act on user actions or scorers. If one or several classifiers are set to act on a user action, it is up to the concrete user action to determine which use it makes of them, or to ignore them. The most common use of classifiers by user actions is to produce a different histogram or table for each classification index. For details on classifiers acting on scorers see the section on Scorers.

The use of user actions and scorers together with classifiers is a powerful means to obtain very detailed information on the simulation through simple user commands. See the tutorial in section Histograms and scorers for more details on this.

Several classifiers need some extra parameters (see list of classifiers below) that control their behaviour. To use these classifiers they have to be declared first with the following command

/gamos/classifier CLASSIFIER_NAME CLASSIFIER_CLASS PARAMETER_1 PARAMETER_2 ...

where CLASSIFIER_NAME is the new name you want to give to a classifier to attach it to a user action or to a scorer, CLASSIFIER_CLASS is the name of the classifier class, and PARAMETER_1 PARAMETER_2 ... are the values of the parameters that the classifier needs. Those classifiers that do not need any parameter, can be assigned directly to a user action or a scorer without giving them a new name: the name will be the one of the classifier class.

To attach one classifier to a user action you put its name after the user action name in the command line that selects it

/gamos/userAction USER_ACTION CLASSIFIER_NAME

or you can use a classifier to act on a scorer with the command

/gamos/scoring/assignClassifier2Scorer CLASSIFIER_NAME SCORER_NAME

If you want to use more than one classifier for a user action or a scorer, you have to use the classifer GmCompoundClassifier (see below).

Each classifier has a method, GetIndexName(G4int index), that returns a different name for each index value. If a classifier does not implement this method, the one in the base class returns the index number converted to a string. This method is used by user actions and scorers to add the index number to the name of the histograms, tables or scores.

Classifiers are plug-in's, so that a user an create her/his own classifier and select it with a user command. To learn how to do this, see the instructions in the section Creating your plug-in, using the GmClassifierFactory, or the Histograms and scorers tutorial.

The following classifiers are currently implemented in GAMOS:

Filters are plug-in's, so that a user can create her/his own filter and select it with a user command. To learn how to do this, see the instructions in the section Creating your plug-in, using the GmClassifierFactory.