Algorithm

Contents

Contact Name

George Irwin.

Overview

Algorithms are invoked by JobModule::Reco steps in the Job Path to fill the reconstruction Candidate output objects which are persisted after each Reco Job step.

See The Algorithm and Candidate Packages

User Interface

See the CandDigit discussion for material about invoking an Algorithm in a Job Path.

Database Access

not directly applicable.

Configuring & Running

Each Algorithm invocation is identified by two names, the Algorithm class name and an arbitrary name for the particular set of "AlgConfig" configuration parameters applicable for that invocation, or for an entire job if all invocations use the same AlgConfig set. The basic AlgConfig set for a given Algorithm class is usually named "default".

There is an official way to define the configuration set and there are various historical ways of doing it that are being superceded by the official way. Here the official way is described. The SR reconstruction packages, in particular, have not yet been converted to the official method of AlgConfig parameter setting.

At minimum, there should be a "default" set of AlgConfig parameters for each Algorithm class. These should be defined in a ROOT macro file which is found in the ROOT macro search path. For Minos, the ROOT macro search path includes:

The AlgConfig sets in
$SRT_PRIVATE_CONTEXT/macros
supercede AlgConfig sets of the same name in
$SRT_PUBLIC_CONTEXT/macros

Job scripts and Algorithms obtain a given AlgConfig object, by specifying the pair of names that identify it:

  AlgFactory &af = AlgFactory::GetInstance();
  AlgHandle ah = af.GetAlgHandle("AlgDeMuxDigitList", "default");
  AlgConfig &acd = ah.GetAlgConfig();
The first time a particular unknown AlgConfig is requested, the ROOT macro-search mechanism looks in the ROOT macro-search path for a file with the name "DBtxt_AlgDeMuxDigitList_default.C". Its configuration parameter values are used to initialize the particular AlgConfig instance, which is then "registered" with the AlgFactory for subsequent user check-outs.

The file itself has the following form:

void DBtxt_AlgDeMuxDigitList_default(void)
{
// This file must be named "DBtxt_AlgDeMuxDigitList_default.C"
// to set the "default" parameters for Algorithm "AlgDeMuxDigitList".
// This file can become a DB cascader override "text file" when
// the default AlgConfig tables appear in the offline database

// Get the AlgConfig object
   AlgFactory &af = AlgFactory::GetInstance();
   AlgHandle ah = af.GetAlgHandle("AlgDeMuxDigitList", "default");
   AlgConfig &acd = ah.GetAlgConfig();

// Set the AlgConfig parameters
   acd.UnLockValues();
   acd.Set("DeMuxAlgorithm", "AlgDeMuxCosmics");
   acd.Set("DeMuxAlgConfig", "default");
   acd.Set("NormalizeWeights", 1); // Normalize weights to 1 if non-zero
   acd.Set("TrimHyps", 1);    // Drop "0" weights if neg., or keep top N
   
   acd.LockValues();
   acd.LockKeys();
}
Because this is a ROOT macro (in C++), one can calculate dependent AlgConfig parameters from other parameters within the same DBtxt... file. This is not handled properly when the AlgConfig parameters are set from a JobModule (as in some SR packages), instead of from a self-consistent DBtxt... ROOT macro.

The CandDigit discussion shows how to modify the pre-set AlgConfig parameters from a user Job script.

Further Links


George Irwin Last Modified: $Date: 2004/10/13 12:04:03 $