Difference: LHCbSoftwareTrainingPrinting (1 vs. 57)

Revision 572012-12-12 - JackWimberley

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 32 to 32
 
double m_jPsiMassWin;
  • Create the corresponding .cpp file
emacs src/MyFirstAlgorithm.cpp &
Changed:
<
<
  • In the class constructor, declare a name for the property, initialize it to a default value and document it
declareProperty( "MassWindow", <memberVariable> = <defaultValue>, "Documentation" );
>
>
  • In the class constructor, declare a property with a name by which the C++ variable can be accessed from Python, initialize it to a default value (pick something Gaudi uses units where MeV = 1); and document it
declareProperty( "MassWindow", m_jPsiMassWin = <defaultValue>, "The J/Psi mass window cut" );
 
  • Print the property's value twice, using two different units
Changed:
<
<
info() << "Mass window is " << value << " Units" << endmsg;
>
>
#include "GaudiKernel/SystemOfUnits.h"
...
// The following goes inside the initialize() method
info() << "Mass window: " << m_jPsiMassWin / Gaudi::Units::MeV << " MeV" << endmsg;
info() << "Mass window: " << m_jPsiMassWin / Gaudi::Units::GeV << " GeV" << endmsg;
 
  • Save both files and build a library with them. Recall that the cmt/requirements file sets build configuration choices such as this. There should be, by default, two lines
Changed:
<
<
...
library AnalysisTutorial ../src/*.cpp
...
apply_pattern component_library library=AnalysisTutorial
>
>
...
library AnalysisTutorial ../src/*.cpp
...
apply_pattern component_library library=AnalysisTutorial
 
Changed:
<
<
which set the build rule for the library named AnalysisTutorial and then tell cmt to build this as a component library. Running
>
>
which set the build rule for the library named AnalysisTutorial and then tell cmt to build this as a component library. Running
 
cmt make

in the cmt directory will then build this library.

Line: 76 to 76
 
myAlg.OutputLevel = DEBUG

Try any of the values VERBOSE, DEBUG, INFO, WARNING, ERROR

Changed:
<
<
  • Run two instances of your algorithm, with different values for the cut. Hint:
anAlg = SomeAlg("Alg1") #instantiates class SomeAlg with instance name "Alg1" and assigns it to python variable anAlg
>
>
  • Run two instances of your algorithm, with different values for the cut. You cannot simply create a second variable using the constructor MyFirstAlgorithm(), because then there will be two objects with different Python variable names but referring to C++ class instantiations with the same variable name (by default, MyFirstAlgorithm() makes an instantiation with the name "MyFirstAlgorithm"). Instead,
anAlg = MyFirstAlgorithm("Alg1") #instantiates class MyFirstAlgorithm with instance name "Alg1" and assigns it to python variable anAlg

Then you can add this to the list of algorithms to be run by changing the list of algorithms [myAlg] to [myAlg,anAlg].

 
  • A more detailed discussion of python configurables, including examples for configuring tools, can be found in the TupleToolsAndConfigurables FAQ.

Modify the job behaviour with StatusCode

Revision 562012-12-12 - JackWimberley

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
Changed:
<
<
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
>
>
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
 

LHCb Software Training: Printing and Job options

Added:
>
>
 The purpose of this exercise is to make you familiar with using job options to configure algorithms, and with the methods for printing from within a Gaudi application.

Line: 13 to 14
 These instructions have last been checked against the DaVinci v33r0p1 environment. Please use this version of DaVinci or a more recent version.

Setting up the environment

Added:
>
>
 We will be working in the same environment as the DaVinci tutorial.
Changed:
<
<
>
>
 
setenvDaVinci v33r0p1
  • Check out and configure the Tutorial package
    getpack Tutorial/Analysis v10r4
    cd Tutorial/Analysis
Line: 22 to 25
 

Creating a GaudiAlgorithm, adding a property and printing its value

  • Create a new header file using emacs
Changed:
<
<
emacs src/MyFirstAlgorithm.h &
>
>
emacs src/MyFirstAlgorithm.h &
  Answer " A " to emacs, meaning that you want to create a header file for a (Gaudi)Algorithm. Do not answer "D" for this exercise, DaVinciAlgorithm requires more specialised job options than those we are studying here.
  • Add a member variable to store the property
    double m_jPsiMassWin;
  • Create the corresponding .cpp file
Changed:
<
<
emacs src/MyFirstAlgorithm.cpp &
>
>
emacs src/MyFirstAlgorithm.cpp &
 
  • In the class constructor, declare a name for the property, initialize it to a default value and document it
    declareProperty( "MassWindow", <memberVariable> = <defaultValue>, "Documentation" );
  • Print the property's value twice, using two different units
    info() << "Mass window is " << value << " Units" << endmsg;
Changed:
<
<
  • Save both files and build a library with them
>
>
  • Save both files and build a library with them. Recall that the cmt/requirements file sets build configuration choices such as this. There should be, by default, two lines
...
library AnalysisTutorial ../src/*.cpp
...
apply_pattern component_library library=AnalysisTutorial

which set the build rule for the library named AnalysisTutorial and then tell cmt to build this as a component library. Running

cmt make

in the cmt directory will then build this library.

 

Setting up the job options and running the job

  • Create a job options file
Changed:
<
<
emacs options/myJob.py &
>
>
emacs options/myJob.py &
 
  • Tell python about the Gaudi framework
    from Gaudi.Configuration import *
  • Tell python about your algorithm
    from Configurables import MyFirstAlgorithm
  • Add an instance of your algorithm to the application
Changed:
<
<
myAlg = MyFirstAlgorithm()
ApplicationMgr().TopAlg += [myAlg]
  • Save the file and run the job (see either Exercise 4 or Exercise 6 in part 1 of the tutorial). You should see some printout from your algorithm. If you do not, either your algorithm was not called (check your job options) or you put the printout in the wrong place in the code. Only printout from initialize() will be seen; execute() is not called in this example (why?)
>
>
myAlg = MyFirstAlgorithm()
ApplicationMgr().TopAlg +=[myAlg]
  • Save the file and run the job. Recall the earlier exercises Exercise 4 or Exercise 6 in part 1 of the tutorial. There are two ways of running a job. If you ran "SetupProject DaVinci v33r0p1", then "gaudirun.py" is in your path (you can use the "which" command to check this) and you can directly run
gaudirun.py /path/to/myJob.py

Alternatively, you can run the job through cmt:

cmt run 'gaudirun.py /path/to/myJob.py'

You should see some printout from your algorithm. If you do not, either your algorithm was not called (check your job options) or you put the printout in the wrong place in the code. Only printout from initialize() will be seen; execute() is not called in this example (why?)

 

Modify the job behaviour by changing job options

Added:
>
>
 The following examples illustrate how you can change an algorithm's behaviour by changing the job options, without recompiling. Try the following in turn, rerunning the job each time. No need to recompile!
  • Modify the value of the algorithm's property
Changed:
<
<
from GaudiKernel.SystemOfUnits import GeV, MeV
myAlg.MassWindow  = 1.3 * GeV
>
>
from GaudiKernel.SystemOfUnits import GeV, MeV
myAlg.MassWindow = 1.3 * GeV
 
  • One big advantage of using Python for job options is its syntax and type checking. See what happens with each of the following typing errors:
Changed:
<
<
myAlg = MyFirstAlgorithm()
myAlg.MasssWindow = 1.3 * GeV
myAlg.MassWindow = "some string"
>
>
myAlg = MyFirstAlgorithm()
myAlg.MasssWindow = 1.3 * GeV
myAlg.MassWindow = "some string"
 
  • Change the global output level of the application
    MessageSvc().OutputLevel = DEBUG
Added:
>
>
  Try any of the values VERBOSE, DEBUG, INFO, WARNING, ERROR
  • Change the output level of your algorithm
    myAlg.OutputLevel = DEBUG
Line: 71 to 90
 
    • What is the difference compared to using the warning() and err() MsgStream functions?.
    • What happens if you
      return Error("An error");
Added:
>
>
  from your algorithm?
Added:
>
>
 
    • And if you
      return Error("Another error", StatusCode::SUCCESS);

Revision 552012-12-04 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 84 to 84
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1351148959" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="1792512" user="cattanem" version="15"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1317142315" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.pptx" size="131082" stream="Printing_and_Job_Options.pptx" tmpFilename="/usr/tmp/CGItemp44094" user="cattanem" version="14"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r0"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v28r1p1"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r4"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r0p1"

Revision 542012-10-25 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 82 to 82
  -- MarcoCattaneo - 27-Jan-2010
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1317142290" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.pptx" size="788808" stream="Gaudi_Introduction.pptx" tmpFilename="/usr/tmp/CGItemp43550" user="cattanem" version="14"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1351148959" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="1792512" user="cattanem" version="15"
 
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1317142315" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.pptx" size="131082" stream="Printing_and_Job_Options.pptx" tmpFilename="/usr/tmp/CGItemp44094" user="cattanem" version="14"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r0"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v28r1p1"

Revision 532011-12-02 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 50 to 50
 
  • Modify the value of the algorithm's property
    from GaudiKernel.SystemOfUnits import GeV, MeV
    myAlg.MassWindow  = 1.3 * GeV
  • One big advantage of using Python for job options is its syntax and type checking. See what happens with each of the following typing errors:
Changed:
<
<
myAlg = MyFirstAlgorithm()
myAlg.MassWindow = 1.3 * GeV
myAlg.MassWindow = "some string"
>
>
myAlg = MyFirstAlgorithm()
myAlg.MasssWindow = 1.3 * GeV
myAlg.MassWindow = "some string"
 
  • Change the global output level of the application
    MessageSvc().OutputLevel = DEBUG
    Try any of the values VERBOSE, DEBUG, INFO, WARNING, ERROR

Revision 522011-09-27 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 82 to 82
  -- MarcoCattaneo - 27-Jan-2010
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1301050361" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="1373696" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp11064" user="cattanem" version="13"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1301050382" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="891392" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp11542" user="cattanem" version="13"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1317142290" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.pptx" size="788808" stream="Gaudi_Introduction.pptx" tmpFilename="/usr/tmp/CGItemp43550" user="cattanem" version="14"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1317142315" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.pptx" size="131082" stream="Printing_and_Job_Options.pptx" tmpFilename="/usr/tmp/CGItemp44094" user="cattanem" version="14"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r0"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v28r1p1"

Revision 512011-06-23 - PhilipHunt

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 28 to 28
 
double m_jPsiMassWin;
  • Create the corresponding .cpp file
    emacs src/MyFirstAlgorithm.cpp &
Changed:
<
<
  • Declare a name for the property, initialize it to a default value and document it
>
>
  • In the class constructor, declare a name for the property, initialize it to a default value and document it
 
declareProperty( "MassWindow", <memberVariable> = <defaultValue>, "Documentation" );
  • Print the property's value twice, using two different units
    info() << "Mass window is " << value << " Units" << endmsg;

Revision 502011-03-25 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 82 to 82
  -- MarcoCattaneo - 27-Jan-2010
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1291384729" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="1378304" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp8846" user="cattanem" version="12"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1291384761" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="879616" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp9423" user="cattanem" version="12"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1301050361" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="1373696" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp11064" user="cattanem" version="13"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1301050382" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="891392" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp11542" user="cattanem" version="13"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r0"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v28r1p1"

Revision 492011-03-22 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 84 to 84
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1291384729" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="1378304" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp8846" user="cattanem" version="12"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1291384761" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="879616" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp9423" user="cattanem" version="12"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r7"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r3p2"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r0"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v28r1p1"

Revision 482010-12-03 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 82 to 82
  -- MarcoCattaneo - 27-Jan-2010
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1285929872" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="718336" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp36115" user="cattanem" version="11"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1285929901" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="339456" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp36613" user="cattanem" version="11"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1291384729" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="1378304" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp8846" user="cattanem" version="12"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1291384761" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="879616" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp9423" user="cattanem" version="12"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r7"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r3p2"

Revision 472010-11-30 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 59 to 59
  Try any of the values VERBOSE, DEBUG, INFO, WARNING, ERROR
  • Run two instances of your algorithm, with different values for the cut. Hint:
    anAlg = SomeAlg("Alg1") #instantiates class SomeAlg with instance name "Alg1" and assigns it to python variable anAlg
Added:
>
>
  • A more detailed discussion of python configurables, including examples for configuring tools, can be found in the TupleToolsAndConfigurables FAQ.
 

Modify the job behaviour with StatusCode

  • Look at what happens when you change the initialize() method of your algorithm to
Line: 83 to 84
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1285929872" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="718336" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp36115" user="cattanem" version="11"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1285929901" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="339456" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp36613" user="cattanem" version="11"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r6p1"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r7"
 
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r3p2"

Revision 462010-11-30 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 84 to 84
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1285929872" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="718336" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp36115" user="cattanem" version="11"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1285929901" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="339456" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp36613" user="cattanem" version="11"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r6p1"
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r1"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r3p2"

Revision 452010-10-01 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 81 to 81
  -- MarcoCattaneo - 27-Jan-2010
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1268404642" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="720896" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp13997" user="cattanem" version="10"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1268404660" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="338432" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp14680" user="cattanem" version="10"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1285929872" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="718336" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp36115" user="cattanem" version="11"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1285929901" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="339456" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp36613" user="cattanem" version="11"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r6p1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r1"

Revision 442010-09-28 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 83 to 83
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1268404642" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="720896" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp13997" user="cattanem" version="10"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1268404660" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="338432" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp14680" user="cattanem" version="10"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r3p2"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v25r2"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r6p1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r1"

Revision 432010-03-12 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 81 to 81
  -- MarcoCattaneo - 27-Jan-2010
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1265029679" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="716288" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp56320" user="cattanem" version="9"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1265029710" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="339456" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp56882" user="cattanem" version="9"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1268404642" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="720896" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp13997" user="cattanem" version="10"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1268404660" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="338432" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp14680" user="cattanem" version="10"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r3p2"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v25r2"

Revision 422010-03-12 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 50 to 50
 
  • Modify the value of the algorithm's property
    from GaudiKernel.SystemOfUnits import GeV, MeV
    myAlg.MassWindow  = 1.3 * GeV
  • One big advantage of using Python for job options is its syntax and type checking. See what happens with each of the following typing errors:
Changed:
<
<
myAlg = MyFirstAlgoritm()
myAlg.MasWindow = 1.3 * GeV
myAlg.MassWindow = "some string"
>
>
myAlg = MyFirstAlgorithm()
myAlg.MassWindow = 1.3 * GeV
myAlg.MassWindow = "some string"
 
  • Change the global output level of the application
    MessageSvc().OutputLevel = DEBUG
    Try any of the values VERBOSE, DEBUG, INFO, WARNING, ERROR

Revision 412010-03-11 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 84 to 84
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1265029679" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="716288" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp56320" user="cattanem" version="9"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1265029710" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="339456" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp56882" user="cattanem" version="9"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r3p2"
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v25r1"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v25r2"

Revision 402010-03-02 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 83 to 83
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1265029679" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="716288" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp56320" user="cattanem" version="9"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1265029710" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="339456" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp56882" user="cattanem" version="9"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r3p1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v24r7p2"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r3p2"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v25r1"

Revision 392010-02-01 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 81 to 81
  -- MarcoCattaneo - 27-Jan-2010
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1254758829" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="770048" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp9528" user="cattanem" version="8"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1254758859" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="342016" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp10279" user="cattanem" version="8"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1265029679" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="716288" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp56320" user="cattanem" version="9"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1265029710" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="339456" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp56882" user="cattanem" version="9"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r3p1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v24r7p2"

Revision 382010-01-28 - RobLambert

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->

Revision 372010-01-27 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 79 to 79
 

Further reading

A more extensive introduction to job configuration using Python is available here and here
Changed:
<
<
-- MarcoCattaneo - 2 Dec 2008
>
>
-- MarcoCattaneo - 27-Jan-2010
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1254758829" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="770048" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp9528" user="cattanem" version="8"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1254758859" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="342016" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp10279" user="cattanem" version="8"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r2p1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v24r2p3"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r3p1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v24r7p2"

Revision 362009-10-05 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 81 to 81
  -- MarcoCattaneo - 2 Dec 2008
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1237392251" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="770048" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="7"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1237393577" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="337408" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="7"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1254758829" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="770048" stream="Gaudi_Introduction.ppt" tmpFilename="/usr/tmp/CGItemp9528" user="cattanem" version="8"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1254758859" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="342016" stream="Printing_and_Job_Options.ppt" tmpFilename="/usr/tmp/CGItemp10279" user="cattanem" version="8"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r2p1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v24r2p3"

Revision 352009-10-01 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 83 to 83
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1237392251" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="770048" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="7"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1237393577" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="337408" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="7"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r1p1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v23r1p1"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r2p1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v24r2p3"

Revision 342009-07-03 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 42 to 42
 
  • Tell python about your algorithm
    from Configurables import MyFirstAlgorithm
  • Add an instance of your algorithm to the application
Changed:
<
<
ApplicationMgr().TopAlg += [...]
>
>
myAlg = MyFirstAlgorithm()
ApplicationMgr().TopAlg += [myAlg]
 
  • Save the file and run the job (see either Exercise 4 or Exercise 6 in part 1 of the tutorial). You should see some printout from your algorithm. If you do not, either your algorithm was not called (check your job options) or you put the printout in the wrong place in the code. Only printout from initialize() will be seen; execute() is not called in this example (why?)

Modify the job behaviour by changing job options

The following examples illustrate how you can change an algorithm's behaviour by changing the job options, without recompiling. Try the following in turn, rerunning the job each time. No need to recompile!
  • Modify the value of the algorithm's property
Changed:
<
<
from GaudiKernel.SystemOfUnits import GeV, MeV
MyFirstAlgorithm().MassWindow  = 1.3 * GeV
>
>
from GaudiKernel.SystemOfUnits import GeV, MeV
myAlg.MassWindow  = 1.3 * GeV
 
  • One big advantage of using Python for job options is its syntax and type checking. See what happens with each of the following typing errors:
Changed:
<
<
MyFirstAlgoritm().MassWindow = 1.3 * GeV
MyFirstAlgorithm().MasWindow = 1.3 * GeV
MyFirstAlgorithm().MassWindow = "some string"
>
>
myAlg = MyFirstAlgoritm()
myAlg.MasWindow = 1.3 * GeV
myAlg.MassWindow = "some string"
 
  • Change the global output level of the application
    MessageSvc().OutputLevel = DEBUG
    Try any of the values VERBOSE, DEBUG, INFO, WARNING, ERROR
  • Change the output level of your algorithm
Changed:
<
<
MyFirstAlgorithm().OutputLevel = DEBUG
>
>
myAlg.OutputLevel = DEBUG
  Try any of the values VERBOSE, DEBUG, INFO, WARNING, ERROR
  • Run two instances of your algorithm, with different values for the cut. Hint:
    anAlg = SomeAlg("Alg1") #instantiates class SomeAlg with instance name "Alg1" and assigns it to python variable anAlg

Revision 332009-06-15 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 84 to 84
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1237392251" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="770048" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="7"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1237393577" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="337408" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="7"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r1p1"
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v23r1"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v23r1p1"

Revision 322009-06-10 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 23 to 23
 

Creating a GaudiAlgorithm, adding a property and printing its value

  • Create a new header file using emacs
    emacs src/MyFirstAlgorithm.h &
Changed:
<
<
Answer " A " to emacs, meaning that you want to create a header file for a (Gaudi)Algorithm. Do not answer "D" for this exercise, DaVinciAlgorithm requires more specialised job options than those we are studying here.
>
>
Answer " A " to emacs, meaning that you want to create a header file for a (Gaudi)Algorithm. Do not answer "D" for this exercise, DaVinciAlgorithm requires more specialised job options than those we are studying here.
 
  • Add a member variable to store the property
    double m_jPsiMassWin;
  • Create the corresponding .cpp file
Line: 83 to 83
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1237392251" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="770048" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="7"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1237393577" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="337408" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="7"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v22r1"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r1p1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v23r1"

Revision 312009-03-18 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 20 to 20
 
getpack Tutorial/Analysis v10r4
cd Tutorial/Analysis
This package contains a requirements file already set up for the tutorial, a set of options and solutions for the DaVinci tutorial sessions, and an empty src directory
Changed:
<
<

Creating a DaVinci algorithm, adding a property and printing its value

>
>

Creating a GaudiAlgorithm, adding a property and printing its value

 
  • Create a new header file using emacs
    emacs src/MyFirstAlgorithm.h &
Changed:
<
<
Answer " A " to emacs, meaning that you want to create a header file for a (Gaudi)Algorithm
>
>
Answer " A " to emacs, meaning that you want to create a header file for a (Gaudi)Algorithm. Do not answer "D" for this exercise, DaVinciAlgorithm requires more specialised job options than those we are studying here.
 
  • Add a member variable to store the property
    double m_jPsiMassWin;
  • Create the corresponding .cpp file
Line: 81 to 81
  -- MarcoCattaneo - 2 Dec 2008
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1228234521" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="618496" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="6"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1228234544" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="335872" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="6"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1237392251" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="770048" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="7"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1237393577" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="337408" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="7"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v22r1"

Revision 302009-03-09 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 23 to 23
 

Creating a DaVinci algorithm, adding a property and printing its value

  • Create a new header file using emacs
    emacs src/MyFirstAlgorithm.h &
Changed:
<
<
Answer " A " to emacs, meaning that you want to create a header file for an Algorithm
>
>
Answer " A " to emacs, meaning that you want to create a header file for a (Gaudi)Algorithm
 
  • Add a member variable to store the property
    double m_jPsiMassWin;
  • Create the corresponding .cpp file
Line: 83 to 83
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1228234521" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="618496" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="6"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1228234544" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="335872" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="6"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r7"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r1"
 
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v22r1"

Revision 292009-03-09 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 84 to 84
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1228234521" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="618496" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="6"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1228234544" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="335872" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="6"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r7"
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v21r0"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v22r1"

Revision 282008-12-02 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 18 to 18
 
setenvDaVinci v33r0p1
  • Check out and configure the Tutorial package
    getpack Tutorial/Analysis v10r4
    cd Tutorial/Analysis
Changed:
<
<
This package contains a requirements file already set up for the tutorial, a set of solutions for the DaVinci tutorial sessions, and empty src and options directories
>
>
This package contains a requirements file already set up for the tutorial, a set of options and solutions for the DaVinci tutorial sessions, and an empty src directory
 

Creating a DaVinci algorithm, adding a property and printing its value

  • Create a new header file using emacs
Line: 77 to 77
 It is recommended that all errors are reported using the Warning() or Error() methods, due to the nice feature of printing statistics at the end of the job. It is also good practice that you always print a warning or error before returning StatusCode::FAILURE

Further reading

Changed:
<
<
A more extensive introduction to job configuration using Python is available here
>
>
A more extensive introduction to job configuration using Python is available here and here
 
Changed:
<
<
-- MarcoCattaneo - 17 Sep 2008
>
>
-- MarcoCattaneo - 2 Dec 2008
 
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1221577250" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="618496" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="5"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1221578566" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="336384" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="5"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r4"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v20r1"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1228234521" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="618496" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="6"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1228234544" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="335872" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="6"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r7"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v21r0"

Revision 272008-11-26 - MatthewCharles

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 17 to 17
 
  • Choose the DaVinci environment
    setenvDaVinci v33r0p1
  • Check out and configure the Tutorial package
Changed:
<
<
getpack Tutorial/Analysis v10r4
cd Tutorial/Analysis/v10r4
>
>
getpack Tutorial/Analysis v10r4
cd Tutorial/Analysis
 This package contains a requirements file already set up for the tutorial, a set of solutions for the DaVinci tutorial sessions, and empty src and options directories

Creating a DaVinci algorithm, adding a property and printing its value

Revision 262008-11-10 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 76 to 76
  It is recommended that all errors are reported using the Warning() or Error() methods, due to the nice feature of printing statistics at the end of the job. It is also good practice that you always print a warning or error before returning StatusCode::FAILURE
Added:
>
>

Further reading

A more extensive introduction to job configuration using Python is available here
 -- MarcoCattaneo - 17 Sep 2008

META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1221577250" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="618496" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="5"

Revision 252008-09-17 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 43 to 43
 
from Configurables import MyFirstAlgorithm
  • Add an instance of your algorithm to the application
    ApplicationMgr().TopAlg += [...]
Changed:
<
<
  • Save the file and run the job (see either Exercise 4 or Exercise 6 in part 1 of the tutorial). You should see some printout from your algorithm, either your algorithm was not called (check your job options) or you put the printout in the wrong place in the code. Only printout from initialize() will be seen; execute() is not called in this example (why?)
>
>
  • Save the file and run the job (see either Exercise 4 or Exercise 6 in part 1 of the tutorial). You should see some printout from your algorithm. If you do not, either your algorithm was not called (check your job options) or you put the printout in the wrong place in the code. Only printout from initialize() will be seen; execute() is not called in this example (why?)
 

Modify the job behaviour by changing job options

The following examples illustrate how you can change an algorithm's behaviour by changing the job options, without recompiling. Try the following in turn, rerunning the job each time. No need to recompile!
Line: 76 to 76
  It is recommended that all errors are reported using the Warning() or Error() methods, due to the nice feature of printing statistics at the end of the job. It is also good practice that you always print a warning or error before returning StatusCode::FAILURE
Changed:
<
<
-- MarcoCattaneo - 13 Jun 2008
>
>
-- MarcoCattaneo - 17 Sep 2008
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1221577250" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="618496" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="5"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1221578566" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="336384" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="5"

Revision 242008-09-16 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 78 to 78
  -- MarcoCattaneo - 13 Jun 2008
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1221223477" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="619008" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="4"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1221224903" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="377856" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="4"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1221577250" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="618496" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="5"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1221578566" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="336384" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="5"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r4"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v20r1"

Revision 232008-09-15 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 23 to 23
 

Creating a DaVinci algorithm, adding a property and printing its value

  • Create a new header file using emacs
    emacs src/MyFirstAlgorithm.h &
Changed:
<
<
Answer " D " to emacs, meaning that you want to create a header file for a ( DaVinci) Algorithm
>
>
Answer " A " to emacs, meaning that you want to create a header file for an Algorithm
 
  • Add a member variable to store the property
    double m_jPsiMassWin;
  • Create the corresponding .cpp file

Revision 222008-09-12 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 80 to 80
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1221223477" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="619008" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="4"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1221224903" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="377856" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="4"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r2"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r13"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r4"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v20r1"

Revision 212008-09-12 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 78 to 78
  -- MarcoCattaneo - 13 Jun 2008
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1213968651" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="618496" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="3"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1213968703" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="377856" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="3"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1221223477" name="Gaudi_Introduction.ppt" path="Gaudi_Introduction.ppt" size="619008" stream="Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="4"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1221224903" name="Printing_and_Job_Options.ppt" path="Printing_and_Job_Options.ppt" size="377856" stream="Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="4"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r2"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r13"

Revision 202008-06-20 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 78 to 78
  -- MarcoCattaneo - 13 Jun 2008
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1205220975" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="449536" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="2"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1205228185" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="356864" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="2"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1213968651" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="618496" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="3"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1213968703" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="377856" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="3"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r2"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r13"

Revision 192008-06-17 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 23 to 23
 

Creating a DaVinci algorithm, adding a property and printing its value

  • Create a new header file using emacs
    emacs src/MyFirstAlgorithm.h &
Changed:
<
<
Answer " A " to emacs, meaning that you want to create a header file for a ( Gaudi) Algorithm
>
>
Answer " D " to emacs, meaning that you want to create a header file for a ( DaVinci) Algorithm
 
  • Add a member variable to store the property
    double m_jPsiMassWin;
  • Create the corresponding .cpp file
Line: 43 to 43
 
from Configurables import MyFirstAlgorithm
  • Add an instance of your algorithm to the application
    ApplicationMgr().TopAlg += [...]
Changed:
<
<
>
>
  • Save the file and run the job (see either Exercise 4 or Exercise 6 in part 1 of the tutorial). You should see some printout from your algorithm, either your algorithm was not called (check your job options) or you put the printout in the wrong place in the code. Only printout from initialize() will be seen; execute() is not called in this example (why?)
 

Modify the job behaviour by changing job options

The following examples illustrate how you can change an algorithm's behaviour by changing the job options, without recompiling. Try the following in turn, rerunning the job each time. No need to recompile!
Line: 52 to 52
 
  • One big advantage of using Python for job options is its syntax and type checking. See what happens with each of the following typing errors:
    MyFirstAlgoritm().MassWindow = 1.3 * GeV
    MyFirstAlgorithm().MasWindow = 1.3 * GeV
    MyFirstAlgorithm().MassWindow = "some string"
  • Change the global output level of the application
Changed:
<
<
MessageSvc().OutputLevel = 2
Try any values between 1 and 5
>
>
MessageSvc().OutputLevel = DEBUG
Try any of the values VERBOSE, DEBUG, INFO, WARNING, ERROR
 
  • Change the output level of your algorithm
Changed:
<
<
MyFirstAlgorithm().OutputLevel = 2
Try any values between 1 and 5
>
>
MyFirstAlgorithm().OutputLevel = DEBUG
Try any of the values VERBOSE, DEBUG, INFO, WARNING, ERROR
 
  • Run two instances of your algorithm, with different values for the cut. Hint:
    anAlg = SomeAlg("Alg1") #instantiates class SomeAlg with instance name "Alg1" and assigns it to python variable anAlg

Modify the job behaviour with StatusCode

Changed:
<
<
  • Look at what happens when you change the initialize() and/or execute() methods of your algorithm to
>
>
  • Look at what happens when you change the initialize() method of your algorithm to
 
return StatusCode::FAILURE

The LHCb convention is that algorithms should return StatusCode::FAILURE from initialize() if there is a fatal configuration error which makes it pointless to continue with the job. Algorithms should never return StatusCode::FAILURE from inside the event loop ( execute() method), because this will not just stop processing the current event, but will stop the job. Instead, they should trap the error and take any necessary remedial action. There are ways for algorithms to abort processing of the current event only, but these are beyond the scope of this tutorial; detailed instructions are available here

Revision 182008-06-16 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 39 to 39
 
emacs options/myJob.py &
  • Tell python about the Gaudi framework
    from Gaudi.Configuration import *
Changed:
<
<
  • Add your algorithm
>
>
  • Tell python about your algorithm
    from Configurables import MyFirstAlgorithm
  • Add an instance of your algorithm to the application
 
ApplicationMgr().TopAlg += [...]

Modify the job behaviour by changing job options

Changed:
<
<
The following examples illustrate how you can change an algorithm's behaviour by changing the job options, without recompiling. First, you have to tell python about your component, so you can modify its default properties:
from Configurables import MyFirstAlgorithm
Now try the following in turn, rerunning the job each time. No need to recompile!
>
>
The following examples illustrate how you can change an algorithm's behaviour by changing the job options, without recompiling. Try the following in turn, rerunning the job each time. No need to recompile!
 
  • Modify the value of the algorithm's property
    from GaudiKernel.SystemOfUnits import GeV, MeV
    MyFirstAlgorithm().MassWindow  = 1.3 * GeV
  • One big advantage of using Python for job options is its syntax and type checking. See what happens with each of the following typing errors:

Revision 172008-06-13 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 44 to 44
 

Modify the job behaviour by changing job options

Changed:
<
<
Rerun the job after each of the following modifications. No need to recompile unless you change the .cpp!
  • Reduce the amount of job options printout by putting the following lines in the appropriate places
    #pragma print off
    #pragma print on
>
>
The following examples illustrate how you can change an algorithm's behaviour by changing the job options, without recompiling. First, you have to tell python about your component, so you can modify its default properties:
from Configurables import MyFirstAlgorithm
Now try the following in turn, rerunning the job each time. No need to recompile!
 
  • Modify the value of the algorithm's property
Changed:
<
<
#units "$STDOPTS/units.opts"
<MyAlg>.MassWindow = 1.2*GeV;
>
>
from GaudiKernel.SystemOfUnits import GeV, MeV
MyFirstAlgorithm().MassWindow  = 1.3 * GeV
  • One big advantage of using Python for job options is its syntax and type checking. See what happens with each of the following typing errors:
    MyFirstAlgoritm().MassWindow = 1.3 * GeV
    MyFirstAlgorithm().MasWindow = 1.3 * GeV
    MyFirstAlgorithm().MassWindow = "some string"
 
  • Change the global output level of the application
Changed:
<
<
MessageSvc.OutputLevel = 2;
>
>
MessageSvc().OutputLevel = 2
  Try any values between 1 and 5
  • Change the output level of your algorithm
Changed:
<
<
<MyAlg>.OutputLevel = 2;
>
>
MyFirstAlgorithm().OutputLevel = 2
  Try any values between 1 and 5
Changed:
<
<
  • Run two instances of your algorithm, with different values for the cut. Hint: the TopAlg property has the following format:
    ApplicationMgr.TopAlg += { "<class name>/<instance name>" };
>
>
  • Run two instances of your algorithm, with different values for the cut. Hint:
    anAlg = SomeAlg("Alg1") #instantiates class SomeAlg with instance name "Alg1" and assigns it to python variable anAlg
 

Modify the job behaviour with StatusCode

  • Look at what happens when you change the initialize() and/or execute() methods of your algorithm to
    return StatusCode::FAILURE
Changed:
<
<
The LHCb convention is that algorithms should return StatusCode::FAILURE from initialize() if there is a fatal configuration error which makes it pointless to continue with the job. Algorithms should never return StatusCode::FAILURE from inside the event loop ( execute() method), because this will not just stop processing the current event, but will stop the job. Instead, they should trap the error and take any necessary remedial action.
>
>
The LHCb convention is that algorithms should return StatusCode::FAILURE from initialize() if there is a fatal configuration error which makes it pointless to continue with the job. Algorithms should never return StatusCode::FAILURE from inside the event loop ( execute() method), because this will not just stop processing the current event, but will stop the job. Instead, they should trap the error and take any necessary remedial action. There are ways for algorithms to abort processing of the current event only, but these are beyond the scope of this tutorial; detailed instructions are available here
 
  • Play with the Warning() and Error() methods.
    • What is the difference compared to using the warning() and err() MsgStream functions?.
Line: 74 to 76
  It is recommended that all errors are reported using the Warning() or Error() methods, due to the nice feature of printing statistics at the end of the job. It is also good practice that you always print a warning or error before returning StatusCode::FAILURE
Changed:
<
<
-- MarcoCattaneo - 3 Oct 2007
>
>
-- MarcoCattaneo - 13 Jun 2008
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1205220975" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="449536" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="2"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1205228185" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="356864" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="2"

Revision 162008-06-12 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 37 to 37
 

Setting up the job options and running the job

  • Create a job options file
    emacs options/myJob.py &
Changed:
<
<
  • Add some magic lines to tell python where to find your components
    from Gaudi.Configuration import *          # tell python about Gaudi
    from Configurables import MyFirstAlgorithm # tell python about your components
>
>
  • Tell python about the Gaudi framework
    from Gaudi.Configuration import *
 
  • Add your algorithm
Changed:
<
<
ApplicationMgr().TopAlg +=[...]
>
>
ApplicationMgr().TopAlg += [...]
 

Modify the job behaviour by changing job options

Revision 152008-06-12 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 36 to 36
 

Setting up the job options and running the job

  • Create a job options file
Changed:
<
<
emacs options/myJob.opts &
>
>
emacs options/myJob.py &
  • Add some magic lines to tell python where to find your components
    from Gaudi.Configuration import *          # tell python about Gaudi
    from Configurables import MyFirstAlgorithm # tell python about your components
 
  • Add your algorithm
Changed:
<
<
ApplicationMgr.TopAlg += {...};
>
>
ApplicationMgr().TopAlg +=[...]
 

Modify the job behaviour by changing job options

Line: 76 to 78
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1205220975" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="449536" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="2"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1205228185" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="356864" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="2"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r0"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r11"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r2"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r13"

Revision 142008-03-11 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 76 to 76
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1205220975" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="449536" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="2"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1205228185" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="356864" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="2"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v6r5"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v7r0"
 
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r11"

Revision 132008-03-11 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 46 to 46
 
  • Reduce the amount of job options printout by putting the following lines in the appropriate places
    #pragma print off
    #pragma print on
  • Modify the value of the algorithm's property
Changed:
<
<
<MyAlg>.MassWindow = 1.2*GeV;
>
>
#units "$STDOPTS/units.opts"
<MyAlg>.MassWindow = 1.2*GeV;
 
  • Change the global output level of the application
    MessageSvc.OutputLevel = 2;
    Try any values between 1 and 5
Line: 76 to 76
 
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1205220975" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="449536" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="2"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1205228185" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="356864" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="2"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v6r4"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r5"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v6r5"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r11"

Revision 122008-03-11 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 75 to 75
 -- MarcoCattaneo - 3 Oct 2007

META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1205220975" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="449536" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="2"
Changed:
<
<
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1192461036" moveby="Main.MarcoCattaneo" movedto="LHCb.LHCbSoftwareTrainingPrinting.Printing_and_Job_Options.ppt" movedwhen="1192461532" movefrom="LHCb.LHCbSoftwareTrainingBasics.Printing_and_Job_Options.ppt" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="350208" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="1"
>
>
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1205228185" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="356864" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="2"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v6r4"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r5"

Revision 112008-03-11 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 74 to 74
  -- MarcoCattaneo - 3 Oct 2007
Changed:
<
<
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1192461009" moveby="Main.MarcoCattaneo" movedto="LHCb.LHCbSoftwareTrainingPrinting.Gaudi_Introduction.ppt" movedwhen="1192461494" movefrom="LHCb.LHCbSoftwareTrainingBasics.Gaudi_Introduction.ppt" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="449024" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="1"
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1205220975" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="449536" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="2"
 
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1192461036" moveby="Main.MarcoCattaneo" movedto="LHCb.LHCbSoftwareTrainingPrinting.Printing_and_Job_Options.ppt" movedwhen="1192461532" movefrom="LHCb.LHCbSoftwareTrainingBasics.Printing_and_Job_Options.ppt" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="350208" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="1"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v6r4"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r5"

Revision 102007-11-07 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
Line: 14 to 14
 

Setting up the environment

We will be working in the same environment as the DaVinci tutorial.
Changed:
<
<
  • Choose the DaVinci environment =setenvDaVinci v33r0p1=
  • Check out and configure the Tutorial package =getpack Tutorial/Analysis v10r4
    cd Tutorial/Analysis/v10r4=
>
>
  • Choose the DaVinci environment
    setenvDaVinci v33r0p1
  • Check out and configure the Tutorial package
    getpack Tutorial/Analysis v10r4
    cd Tutorial/Analysis/v10r4
 This package contains a requirements file already set up for the tutorial, a set of solutions for the DaVinci tutorial sessions, and empty src and options directories

Creating a DaVinci algorithm, adding a property and printing its value

Changed:
<
<
  • Create a new header file using emacs emacs src/MyFirstAlgorithm.h &=
    Answer " =A " to emacs, meaning that you want to create a header file for a ( Gaudi) Algorithm
  • Add a member variable to store the property =double m_jPsiMassWin;=
  • Create the corresponding .cpp file =emacs src/MyFirstAlgorithm.cpp &=
  • Declare a name for the property, initialize it to a default value and document it =declareProperty( "MassWindow", <memberVariable> = <defaultValue>, "Documentation" );=
  • Print the property's value twice, using two different units =info() << "Mass window is " << value << " Units" << endmsg;=
>
>
  • Create a new header file using emacs
    emacs src/MyFirstAlgorithm.h &
    Answer " A " to emacs, meaning that you want to create a header file for a ( Gaudi) Algorithm
  • Add a member variable to store the property
    double m_jPsiMassWin;
  • Create the corresponding .cpp file
    emacs src/MyFirstAlgorithm.cpp &
  • Declare a name for the property, initialize it to a default value and document it
    declareProperty( "MassWindow", <memberVariable> = <defaultValue>, "Documentation" );
  • Print the property's value twice, using two different units
    info() << "Mass window is " << value << " Units" << endmsg;
 
  • Save both files and build a library with them

Setting up the job options and running the job

Changed:
<
<
  • Create a job options file =emacs options/myJob.opts &=
>
>
  • Create a job options file
    emacs options/myJob.opts &
 
  • Add your algorithm
Changed:
<
<
|
ApplicationMgr.TopAlg += {...};
>
>
ApplicationMgr.TopAlg += {...};
 

Modify the job behaviour by changing job options

Rerun the job after each of the following modifications. No need to recompile unless you change the .cpp!
Changed:
<
<
  • Reduce the amount of job options printout by putting the following lines in the appropriate places =#pragma print off
    #pragma print on=
* Modify the value of the algorithm's property |
<MyAlg>.MassWindow = 1.2*GeV;
>
>
  • Reduce the amount of job options printout by putting the following lines in the appropriate places
    #pragma print off
    #pragma print on
  • Modify the value of the algorithm's property
    <MyAlg>.MassWindow = 1.2*GeV;
 
  • Change the global output level of the application
Changed:
<
<
|
MessageSvc.OutputLevel = 2;
>
>
MessageSvc.OutputLevel = 2;
 Try any values between 1 and 5
  • Change the output level of your algorithm
Changed:
<
<
|
<MyAlg>.OutputLevel = 2;
>
>
<MyAlg>.OutputLevel = 2;
 Try any values between 1 and 5
  • Run two instances of your algorithm, with different values for the cut. Hint: the TopAlg property has the following format:
Changed:
<
<
|
ApplicationMgr.TopAlg += { "<class name>/<instance name>" };
>
>
ApplicationMgr.TopAlg += { "<class name>/<instance name>" };
 

Modify the job behaviour with StatusCode

Changed:
<
<
  • Look at what happens when you change the initialize() and/or execute() methods of your algorithm to =return StatusCode::FAILURE=
>
>
  • Look at what happens when you change the initialize() and/or execute() methods of your algorithm to
    return StatusCode::FAILURE
  The LHCb convention is that algorithms should return StatusCode::FAILURE from initialize() if there is a fatal configuration error which makes it pointless to continue with the job. Algorithms should never return StatusCode::FAILURE from inside the event loop ( execute() method), because this will not just stop processing the current event, but will stop the job. Instead, they should trap the error and take any necessary remedial action.

  • Play with the Warning() and Error() methods.
    • What is the difference compared to using the warning() and err() MsgStream functions?.
Changed:
<
<
    • What happens if you =return Error("An error");=
      from your algorithm?
    • And if you =return Error("Another error", StatusCode::SUCCESS);=
>
>
    • What happens if you
      return Error("An error");
      from your algorithm?
    • And if you
      return Error("Another error", StatusCode::SUCCESS);
  It is recommended that all errors are reported using the Warning() or Error() methods, due to the nice feature of printing statistics at the end of the job. It is also good practice that you always print a warning or error before returning StatusCode::FAILURE

Revision 92007-10-15 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
Changed:
<
<
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
>
>
<!-- /ActionTrackerPlugin -->
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->
 

LHCb Software Training: Printing and Job options

The purpose of this exercise is to make you familiar with using job options to configure algorithms, and with the methods for printing from within a Gaudi application.
Line: 7 to 6
 

LHCb Software Training: Printing and Job options

The purpose of this exercise is to make you familiar with using job options to configure algorithms, and with the methods for printing from within a Gaudi application.
Deleted:
<
<
 

Prerequisites

Changed:
<
<
The instructions assume that you have already followed part 1 of the LHCb software basics tutorial. You should also have looked at the slides of the "Introduction to Gaudi" last shown at CERN on 1st October 2007: part 1, part 2
>
>
The instructions assume that you have already followed part 1 of the LHCb software basics tutorial. You should also have looked at the slides "Introduction to Gaudi" [ .ppt] and "Printing and job options" [.ppt] attached to this topic. Please feel free to update these slides if you modify them for a future tutorial session.
  These instructions have last been checked against the DaVinci v33r0p1 environment. Please use this version of DaVinci or a more recent version.

Setting up the environment

We will be working in the same environment as the DaVinci tutorial.
Changed:
<
<
  • Choose the DaVinci environment
    setenvDaVinci v33r0p1
  • Check out and configure the Tutorial package
    getpack Tutorial/Analysis v10r4
    cd Tutorial/Analysis/v10r4
>
>
  • Choose the DaVinci environment =setenvDaVinci v33r0p1=
  • Check out and configure the Tutorial package =getpack Tutorial/Analysis v10r4
    cd Tutorial/Analysis/v10r4=
 This package contains a requirements file already set up for the tutorial, a set of solutions for the DaVinci tutorial sessions, and empty src and options directories

Creating a DaVinci algorithm, adding a property and printing its value

Changed:
<
<
  • Create a new header file using emacs
    emacs src/MyFirstAlgorithm.h &
    Answer " A " to emacs, meaning that you want to create a header file for a (Gaudi) Algorithm
  • Add a member variable to store the property
    double m_jPsiMassWin;
  • Create the corresponding .cpp file
    emacs src/MyFirstAlgorithm.cpp &
  • Declare a name for the property, initialize it to a default value and document it
    declareProperty( "MassWindow", <memberVariable> = <defaultValue>, "Documentation" );
  • Print the property's value twice, using two different units
    info() << "Mass window is " << value << " Units" << endmsg;
>
>
  • Create a new header file using emacs emacs src/MyFirstAlgorithm.h &=
    Answer " =A " to emacs, meaning that you want to create a header file for a ( Gaudi) Algorithm
  • Add a member variable to store the property =double m_jPsiMassWin;=
  • Create the corresponding .cpp file =emacs src/MyFirstAlgorithm.cpp &=
  • Declare a name for the property, initialize it to a default value and document it =declareProperty( "MassWindow", <memberVariable> = <defaultValue>, "Documentation" );=
  • Print the property's value twice, using two different units =info() << "Mass window is " << value << " Units" << endmsg;=
 
  • Save both files and build a library with them

Setting up the job options and running the job

Changed:
<
<
  • Create a job options file
    emacs options/myJob.opts &
>
>
  • Create a job options file =emacs options/myJob.opts &=
 
  • Add your algorithm
Changed:
<
<
ApplicationMgr.TopAlg += {...};
>
>
|
ApplicationMgr.TopAlg += {...};
 

Modify the job behaviour by changing job options

Rerun the job after each of the following modifications. No need to recompile unless you change the .cpp!
Changed:
<
<
  • Reduce the amount of job options printout by putting the following lines in the appropriate places
    #pragma print off
    #pragma print on
    * Modify the value of the algorithm's property
    <MyAlg>.MassWindow = 1.2*GeV;
>
>
  • Reduce the amount of job options printout by putting the following lines in the appropriate places =#pragma print off
    #pragma print on=
* Modify the value of the algorithm's property |
<MyAlg>.MassWindow = 1.2*GeV;
 
  • Change the global output level of the application
Changed:
<
<
MessageSvc.OutputLevel = 2;
>
>
|
MessageSvc.OutputLevel = 2;
  Try any values between 1 and 5
  • Change the output level of your algorithm
Changed:
<
<
<MyAlg>.OutputLevel = 2;
>
>
|
<MyAlg>.OutputLevel = 2;
  Try any values between 1 and 5
  • Run two instances of your algorithm, with different values for the cut. Hint: the TopAlg property has the following format:
Changed:
<
<
ApplicationMgr.TopAlg += { "<class name>/<instance name>" };
>
>
|
ApplicationMgr.TopAlg += { "<class name>/<instance name>" };
 

Modify the job behaviour with StatusCode

Changed:
<
<
  • Look at what happens when you change the initialize() and/or execute() methods of your algorithm to
    return StatusCode::FAILURE
>
>
  • Look at what happens when you change the initialize() and/or execute() methods of your algorithm to =return StatusCode::FAILURE=
  The LHCb convention is that algorithms should return StatusCode::FAILURE from initialize() if there is a fatal configuration error which makes it pointless to continue with the job. Algorithms should never return StatusCode::FAILURE from inside the event loop (execute() method), because this will not just stop processing the current event, but will stop the job. Instead, they should trap the error and take any necessary remedial action.

  • Play with the Warning() and Error() methods.
Changed:
<
<
    • What is the difference compared to using the warning() and err() MsgStream functions?.
    • What happens if you
      return Error("An error");
      from your algorithm?
    • And if you
      return Error("Another error", StatusCode::SUCCESS);
>
>
    • What is the difference compared to using the warning() and err() MsgStream functions?.
    • What happens if you =return Error("An error");=
      from your algorithm?
    • And if you =return Error("Another error", StatusCode::SUCCESS);=
  It is recommended that all errors are reported using the Warning() or Error() methods, due to the nice feature of printing statistics at the end of the job. It is also good practice that you always print a warning or error before returning StatusCode::FAILURE

-- MarcoCattaneo - 3 Oct 2007

Added:
>
>
META FILEATTACHMENT attachment="Gaudi_Introduction.ppt" attr="" comment="Slides: %22Introduction to Gaudi%22" date="1192461009" moveby="Main.MarcoCattaneo" movedto="LHCb.LHCbSoftwareTrainingPrinting.Gaudi_Introduction.ppt" movedwhen="1192461494" movefrom="LHCb.LHCbSoftwareTrainingBasics.Gaudi_Introduction.ppt" name="Gaudi_Introduction.ppt" path="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" size="449024" stream="C:\Documents and Settings\cattanem\Desktop\Gaudi_Introduction.ppt" user="Main.MarcoCattaneo" version="1"
META FILEATTACHMENT attachment="Printing_and_Job_Options.ppt" attr="" comment="Slides: %22Printing and job options%22" date="1192461036" moveby="Main.MarcoCattaneo" movedto="LHCb.LHCbSoftwareTrainingPrinting.Printing_and_Job_Options.ppt" movedwhen="1192461532" movefrom="LHCb.LHCbSoftwareTrainingBasics.Printing_and_Job_Options.ppt" name="Printing_and_Job_Options.ppt" path="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" size="350208" stream="C:\Documents and Settings\cattanem\Desktop\Printing_and_Job_Options.ppt" user="Main.MarcoCattaneo" version="1"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v6r4"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r5"

Revision 82007-10-03 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
Line: 30 to 30
 
double m_jPsiMassWin;
  • Create the corresponding .cpp file
    emacs src/MyFirstAlgorithm.cpp &
Changed:
<
<
  • Declare a name for the property and initialize it to a default value
    declareProperty( "MassWindow", <memberVariable> = <defaultValue>);
>
>
  • Declare a name for the property, initialize it to a default value and document it
    declareProperty( "MassWindow", <memberVariable> = <defaultValue>, "Documentation" );
 
  • Print the property's value twice, using two different units
    info() << "Mass window is " << value << " Units" << endmsg;
  • Save both files and build a library with them
Line: 58 to 58
 
  • Run two instances of your algorithm, with different values for the cut. Hint: the TopAlg property has the following format:
    ApplicationMgr.TopAlg += { "<class name>/<instance name>" };
Changed:
<
<
-- MarcoCattaneo - 24 Sep 2007
>
>

Modify the job behaviour with StatusCode

  • Look at what happens when you change the initialize() and/or execute() methods of your algorithm to
    return StatusCode::FAILURE

The LHCb convention is that algorithms should return StatusCode::FAILURE from initialize() if there is a fatal configuration error which makes it pointless to continue with the job. Algorithms should never return StatusCode::FAILURE from inside the event loop (execute() method), because this will not just stop processing the current event, but will stop the job. Instead, they should trap the error and take any necessary remedial action.

  • Play with the Warning() and Error() methods.
    • What is the difference compared to using the warning() and err() MsgStream functions?.
    • What happens if you
      return Error("An error");
      from your algorithm?
    • And if you
      return Error("Another error", StatusCode::SUCCESS);

It is recommended that all errors are reported using the Warning() or Error() methods, due to the nice feature of printing statistics at the end of the job. It is also good practice that you always print a warning or error before returning StatusCode::FAILURE

-- MarcoCattaneo - 3 Oct 2007

 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v6r4"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r5"

Revision 72007-09-27 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
Line: 61 to 61
 -- MarcoCattaneo - 24 Sep 2007

META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v6r4"
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r4"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r5"

Revision 62007-09-27 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
Line: 10 to 10
 

Prerequisites

Changed:
<
<
The instructions assume that you have already followed part 1 of the LHCb software basics tutorial.
>
>
The instructions assume that you have already followed part 1 of the LHCb software basics tutorial. You should also have looked at the slides of the "Introduction to Gaudi" last shown at CERN on 1st October 2007: part 1, part 2
  These instructions have last been checked against the DaVinci v33r0p1 environment. Please use this version of DaVinci or a more recent version.

Revision 52007-09-24 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
Line: 24 to 24
 

Creating a DaVinci algorithm, adding a property and printing its value

  • Create a new header file using emacs
Changed:
<
<
emacs src/TutorialAlgorithm.h &
We will be working with DaVinci, so you should answer "=D=" to emacs, this creates a header file for a DVAlgorithm
>
>
emacs src/MyFirstAlgorithm.h &
Answer " A " to emacs, meaning that you want to create a header file for a (Gaudi) Algorithm
 
  • Add a member variable to store the property
    double m_jPsiMassWin;
  • Create the corresponding .cpp file
Changed:
<
<
emacs src/TutorialAlgorithm.cpp &
>
>
emacs src/MyFirstAlgorithm.cpp &
 
  • Declare a name for the property and initialize it to a default value
    declareProperty( "MassWindow", <memberVariable> = <defaultValue>);
  • Print the property's value twice, using two different units
Line: 39 to 39
 

Setting up the job options and running the job

  • Create a job options file
    emacs options/myJob.opts &
Deleted:
<
<
  • Add the default DaVinci configuration
    #include "$DAVINCIROOT/options/DaVinciCommon.opts"
 
  • Add your algorithm
    ApplicationMgr.TopAlg += {...};
  • Save the file and run the job (see either Exercise 4 or Exercise 6 in part 1 of the tutorial)

Revision 42007-09-24 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
Line: 62 to 62
  -- MarcoCattaneo - 24 Sep 2007
Changed:
<
<
META PREFERENCE name="TUTORAILVERSION" title="TUTORAILVERSION" type="Set" value="v6r4"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v6r4"
 
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r4"

Revision 32007-09-24 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
Line: 62 to 62
  -- MarcoCattaneo - 24 Sep 2007
Changed:
<
<
META PREFERENCE name="GAUDIVERSION" title="GAUDIVERSION" type="Set" value="v19r4"
>
>
META PREFERENCE name="TUTORAILVERSION" title="TUTORAILVERSION" type="Set" value="v6r4"
 
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r4"

Revision 22007-09-24 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
Changed:
<
<
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: GAUDIVERSION and DAVINCIVERSION -->
>
>
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: TUTORIALVERSION and DAVINCIVERSION -->
 
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->

LHCb Software Training: Printing and Job options

Changed:
<
<
This hands on tutorial should be followed by all newcomers to the LHCb software environment. It covers the following topics:
>
>
The purpose of this exercise is to make you familiar with using job options to configure algorithms, and with the methods for printing from within a Gaudi application.
 

Prerequisites

Changed:
<
<
The instructions assume that you have already followed part 1 of the LHCb software basics tutorial.

These instructions have last been checked against the DaVinci v33r0p1 (and Gaudi %GAUDIVERSION%) environment. Please use this version of DaVinci or a more recent version.

>
>
The instructions assume that you have already followed part 1 of the LHCb software basics tutorial.
 
Added:
>
>
These instructions have last been checked against the DaVinci v33r0p1 environment. Please use this version of DaVinci or a more recent version.
 
Added:
>
>

Setting up the environment

We will be working in the same environment as the DaVinci tutorial.
  • Choose the DaVinci environment
    setenvDaVinci v33r0p1
  • Check out and configure the Tutorial package
    getpack Tutorial/Analysis v10r4
    cd Tutorial/Analysis/v10r4
This package contains a requirements file already set up for the tutorial, a set of solutions for the DaVinci tutorial sessions, and empty src and options directories

Creating a DaVinci algorithm, adding a property and printing its value

  • Create a new header file using emacs
    emacs src/TutorialAlgorithm.h &
    We will be working with DaVinci, so you should answer "=D=" to emacs, this creates a header file for a DVAlgorithm
  • Add a member variable to store the property
    double m_jPsiMassWin;
  • Create the corresponding .cpp file
    emacs src/TutorialAlgorithm.cpp &
  • Declare a name for the property and initialize it to a default value
    declareProperty( "MassWindow", <memberVariable> = <defaultValue>);
  • Print the property's value twice, using two different units
    info() << "Mass window is " << value << " Units" << endmsg;
  • Save both files and build a library with them

Setting up the job options and running the job

  • Create a job options file
    emacs options/myJob.opts &
  • Add the default DaVinci configuration
    #include "$DAVINCIROOT/options/DaVinciCommon.opts"
  • Add your algorithm
    ApplicationMgr.TopAlg += {...};
  • Save the file and run the job (see either Exercise 4 or Exercise 6 in part 1 of the tutorial)

Modify the job behaviour by changing job options

Rerun the job after each of the following modifications. No need to recompile unless you change the .cpp!
  • Reduce the amount of job options printout by putting the following lines in the appropriate places
    #pragma print off
    #pragma print on
    * Modify the value of the algorithm's property
    <MyAlg>.MassWindow = 1.2*GeV;
  • Change the global output level of the application
    MessageSvc.OutputLevel = 2;
    Try any values between 1 and 5
  • Change the output level of your algorithm
    <MyAlg>.OutputLevel = 2;
    Try any values between 1 and 5
  • Run two instances of your algorithm, with different values for the cut. Hint: the TopAlg property has the following format:
    ApplicationMgr.TopAlg += { "<class name>/<instance name>" };
  -- MarcoCattaneo - 24 Sep 2007 \ No newline at end of file
Added:
>
>
META PREFERENCE name="GAUDIVERSION" title="GAUDIVERSION" type="Set" value="v19r4"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v19r4"

Revision 12007-09-24 - MarcoCattaneo

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="LHCbSoftwareTutorials"
<!-- Note to editors of this page: The following TWiki Variables are defined for this page: GAUDIVERSION and DAVINCIVERSION -->
<!-- They correspond to the last version for which these instructions have been verified, and should be consistent with each other -->
<!-- To change their value, exit edit and go to "More topic actions" -> "Edit settings" -->

LHCb Software Training: Printing and Job options

This hands on tutorial should be followed by all newcomers to the LHCb software environment. It covers the following topics:

Prerequisites

The instructions assume that you have already followed part 1 of the LHCb software basics tutorial.

These instructions have last been checked against the DaVinci v33r0p1 (and Gaudi %GAUDIVERSION%) environment. Please use this version of DaVinci or a more recent version.

-- MarcoCattaneo - 24 Sep 2007

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback