Test a stripping line (work in progress)

Setup the environment

Before you can test a stripping line you need to set up the environment. In order to do that, create a directory in your user area on lxplus where you can work freely and setup DaVinci as follows (XX and YY are placeholders for the correct version of DaVinci to be used for testing which will be announced at the beginning of every campaign by the stripping coordinators)

[acontu@lxplus0050 ~]$ mkdir MyWorkingArea
[acontu@lxplus0050 ~]$ cd MyWorkingArea
[acontu@lxplus0050 MyWorkingArea ]$ lb-dev DaVinci vXXrYY
[acontu@lxplus0050 MyWorkingArea ]$ cd DaVinciDev _vXXrYY

Getpack the head version of Phys/StrippingSelections

From the directory DaVinciDev _vXXrYY we ended up in the step before we can now getpack the head version of Phys/StrippingSelections and then compile everything (if you need head versions of other packages line TMVAWeights for lines using MVA discriminators you can getpack them in the same way)

[acontu@lxplus0050 DaVinciDev _vXXrYY]$ getpack Phys/StrippingSelections head
[acontu@lxplus0050 DaVinciDev _vXXrYY]$ make
Now you can modify the content of StrippingSelections by adding or modifying a line; every time you do it, the package has to be recompiled:
[acontu@lxplus0050 DaVinciDev _vXXrYY]$ make purge
[acontu@lxplus0050 DaVinciDev _vXXrYY]$ make

Add a new line

If you are modifying an existing line you can skip this part. The lines in StrippingSelections are organised in WGs. Suppose we want to add the module StrippingMyCharmDecay.py to the lines of the Charm WG. We need to copy StrippingMyCharmDecay.py to the Phys/StrippingSelections/python/StrippingSelections/StrippingCharm/ directory

[acontu@lxplus0050 DaVinciDev _vXXrYY]$ cp <path_of_your_file>/StrippingMyCharmDecay.py Phys/StrippingSelections/python/StrippingSelections/StrippingCharm/
Since this is a new line, it has to be added to Phys/StrippingSelections/python/StrippingSelections/StrippingCharm/__init__.py in the, open the init.py file with your favourite editor and add your line to the end of the "_selections" list at the beginning of the file (omit the .py extension)
_selections = [ "StrippingSomeCharm","StrippingSomeOtherCharm", "StrippingMyCharmDecay"]
Now you are ready to recompile StrippingSelections, so as usual do
[acontu@lxplus0050 DaVinciDev _vXXrYY]$ make purge
[acontu@lxplus0050 DaVinciDev _vXXrYY]$ make
If you get compilation errors or a warning due to your line please fix it and then recompile. If get an error/warning NOT due to your line, please inform the stripping coordinators

Modify an existing line

To modify a an existing module is sufficient to apply the changes using your favourite and then compile again

[acontu@lxplus0050 DaVinciDev _vXXrYY]$ make purge
[acontu@lxplus0050 DaVinciDev _vXXrYY]$ make

Testing a stripping module

To set up the correct environment variables, issue the command

[acontu@lxplus0050 DaVinciDev _vXXrYY]$ ./run bash
This will bring you to a new bash shell with the correct environment settings (e.g. you will be able to use gaudirun.py) The test scripts for users can be found under $STRIPPINGSELECTIONSROOT/tests/users. Although the set of scripts to test will be shortly expanded, at the moment there is only one called TestMyStrippingLine.py. To test your line by simply editing the file to set the variable 'confname' with the value of the key 'NAME' in your default_config (or directly the key identifying your specific configuration as explained here). So if the name of your configuration is "MyCharmLines" you have simply to set
At this point you can finally test your line by doing, from any location
[acontu@lxplus0050 ~]$ gaudirun.py $STRIPPINGSELECTIONSROOT/tests/users/TestMyStrippingLine.py
The output of the script will be the usual print of StrippingReport with retention and timing of your lines. In addition, the output DST and/or micro-DST will be produced according to the settings you specified in the default_config (MDST.DST included). The TES location at which your lines are saved together with all related info and flavour tagging info (if requested) are the same as the stripping that will eventually run in production so that you can run your ntuple-maker script on these DSTs to check that all the information is stored correctly. If for some reason you are unhappy with the configuration or implementation of your lines, just go back issuing the command
[acontu@lxplus0050 ~]$ exit
This will bring you to the original bash session where you can apply your modifications, recompile and start again testing as in explained in this section


Please do not import anything explicitly from the StrippingSelections package, which is used for development. In production the LineBuilders are copied into StrippingArchive to freeze them. Explicit imports from StrippingSelections break this scheme and may cause your line to crash if there are differences with what is put in the StrippingArchive and what is in StrippingSelections.

Before I commit my stripping line

Once you have successfully tested your line inform your WG group liaison about the results of the testing and ask for permission to commit to svn. For new lines, please inform also the coordinators before committing the new code.

Committing a new or newly modified StrippingLine

Pre-requisite: being a member of lhcb-svn-writers mailing list

You must commit only into head and it is recommended that you check out a clean version

  • getpack Phys/StrippingSelections head
  • cd Phys/StrippingSelections

  • Copy your new or newly modified stripping file(s) in python/StrippingSelections/Stripping<working_group>

  • vim python/StrippingSelections/Stripping<working_group>/__init__.py accordingly

  • svn add python/StrippingSelections/Stripping<working_group>/<your_files>

  • Update doc/release.notes using the same format as previous entries

  • svn status (check that release.notes and __init__.py are updated and your file(s) is added)
  • svn commit (with a commit message of what you updated the release notes with, it van be done via svn commit -m "some short text")

Updating Tag Collector


  • Nightlies can be found here.

-- AndreaContu - 2015-03-02

Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r9 - 2016-09-07 - RicardoVazquezGomez
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

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