|
|
|
JobCModules
|
|
Notes and Further References
To run loon you need a job macro that specifies what is to be done.
The macro
$MINOS_TUTORIAL_MACROS/loon_reco_job.Cis a typical example. The next tutorial, Writing ROOT Macros will go into more detail on the overall construction of these macros and how the JobControl package is used to assemble the job, so here we will gloss over this area and concentrate on the information that you need to provide.
The macro is broadly divided into the following phases:-
Loading a package is performed by sending a message directly to ROOT
e.g.:-
gSystem->Load("libDeMux");
This tells ROOT to load the DeMux library.
JobCModules used as the basis of the main
event loop. A path is assembled by sending messages to the JobControl
package e.g.:-
jc.Path.Create("Reco",
"NoiseFilterModule::Ana "
"RecordSetupModule::Get "
...
"FitTrackSRListModule::Reco "
"EventSRListModule::Reco "
"RecordSetupModule::Reco "
"Output::Put"); jc.Path.Create("Reco",....);
This tells the JobControl package to create a JobCPath
from a series of JobCModules.
jc.Msg.SetLevel("Dbi","Info");
sets the DatabaseInterface package messages to Info level.
jc.Path("Reco").Mod("DigitListModule").Set("ListsToMake=1");
Configures the DigitListModule JobCModule, and
acd.Set("DeMuxAlgConfig", "default");
acd.Set("NormalizeWeights", 1); // Normalize weights to 1 if non-zero
tunes an individual Algorithm.
JobCModule and Algorithm configuration is the most complicated part of
the macro and will be dealt with in more detail below.
E.g.:-
jc.Path("Reco").Run(200);
//Job Report
jc.Path("Reco").Report();
//Get Message Statistics
jc.Msg.Stats();
This tells a JobCPath to run itself and give a report. Then the
MessageService is instructed to give message statistics..
JobCModules and Algorithms
could be configured and this has lead to confusion in the past so
there is now a policy on this
matter. Unfortunately much of the code predates this policy and only
some has been brought into line so far
Algorithms are the objects that actually carry out reconstruction and
analysis tasks. In general Algorithms have one or more tunable
parameter. A complete, named, set is stored in an AlgConfig. Every
Algorithm comes ready to run, with one or more AlgConfigs. If there
is only one, it's name is "default", but if more than one, none will
be so named. A job user can decide which AlgConfig is used and can
even fine tune the individual parameters in the selected AlgConfig.
This is done by operating on the Registry from which the AlgConfig
inherits.
JobCModules (which all inherit from JobCModule) into
a path to be executed in an event loop. JobCModules deploy Algorithms
and select which parts of the event object structure they operate on.
JobCModules are configurable and all have a default configuration so
can operate "out of the box". As with Algorithms, the user can fine
tune the JobCModule's parameters, normally via the Set(...) method.
JobCModules that adhere to our policy allow the user to change the
Algorithm it uses and the AlgConfig that Algorithm gets configured
with. It may also allow the user to control other aspects such as
which parts of the event object structure it is to operate on but
must not tinker with individual parameters of the Algorithm's
AlgConfig.
The following lines show how the "SR" reconstruction chain
configure the Algorithms they use for FD cosmics:-
//Configure Reconstruction Software for Far Det Cosmics data .
jc.Path("Reco").Mod("SliceSRListModule").Set("SliceListAlgConfig=FarCosmic");
jc.Path("Reco").Mod("ClusterSRListModule").Set("ClusterListAlgConfig=FarCosmic");
jc.Path("Reco").Mod("ShowerSRListModule").Set("ShowerListAlgConfig=FarCosmic");
jc.Path("Reco").Mod("TrackSRListModule").Set("TrackListAlgConfig=FarCosmic");
jc.Path("Reco").Mod("FitTrackSRListModule").Set("FitTrackListAlgConfig=FarCosmic");
jc.Path("Reco").Mod("EventSRListModule").Set("EventListAlgConfig=FarCosmic");
JobCModule that produces CandXxx objects:-
Algorithm is named AlgXxx.
JobCModule is named XxxModule.
JobCModule parameters that control the
Algorithm it uses and the AlgConfig it is
configured with are named XxxAlgorithm and
XxxAlgConfig respectively.
JobCModule
parameters, for example SliceSRListAlgConfig becomes
SliceListAlgConfig.
AltSliceListModule becomes AltModuleSliceList.
AlgConfig. Given that a user can also directly
do this, it's not hard to understand why this is banned.
Algorithm can directly
manipulate their AlgConfigs, as shown by the following code:-
// Get the AlgFactory
AlgFactory &af = AlgFactory::GetInstance();
// AlgDeMuxDigitList AlgConfig parameters
AlgHandle ah = af.GetAlgHandle("AlgDeMuxDigitList", "default");
AlgConfig &acd = ah.GetAlgConfig();
acd.UnLockValues();
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();
JobCModule or
Algorithm?
For JobCModules:-
JobCModule in the
doxygen code at FNAL
and check it's DefaultConfig method. This will tell you the names of
all it's parameters and their default values. You can then use the
Set method (inherited from JobCModule) to change any of these.
For Algorithms
JobCModule uses them and then looking them up in
WebDocs
Algorithm in the
doxygen code at FNAL
but this time look at the RunAlg(...) method and read through the code
to see how they use the AlgConfig they have been passed.
See Configuration of JobCModules and Algorithms for the overall policy on the configuration.
For JobControl see the JobControl section of User Manual at Fnal .
For examples of other macros which we use in production, see the $SRT_PUBLIC_CONTEXT/Production directory tree.
See the following sections for configuring individual packages.
Algorithm Parameters sections.
In this tutorial you will see how a script, called a ROOT macro and also called a job macro, is used to configure the off-line reconstruction job loon. Take a look and see if you can understand the macro by referring to the notes above.
Once the job ROOT macro has been assembled the loon job can be launched
for example:-
loon -qb $MINOS_TUTORIAL_MACROS/loon_reco_job.C $MINOS_TUTORIAL_DATA/F00018143_0000.mdaq.root
See the overview Running the Standard Jobs for more details
about launch the loon job.
This script has been used for production work, so it's a realistic example and not
something trivial for a tutorial! Study the macro and see if you can identify
every line as one of the types listed above.
Make a local copy of $MINOS_TUTORIAL_MACROS/loon_reco_job.C and try making the following changes and rerunning the job:-
| Contact: Nick West <n.west1@physics.ox.ac.uk> |
| Security, Privacy, Legal |
|