Difference: PrivateTCK (16 vs. 17)

Revision 172016-04-28 - MikaVesterinen

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"

How to create HLT TCKs

Changed:
<
<

Creating split HLT1 and HLT2 TCKs for 2016

HLT piquets should follow this set of instructions for production TCKs for 2016 datataking

Producing a dataset with at least one accepted event per HLT line

This step is not normally needed, as the existing dataset should be sufficient. Please consult with one of the HLT experts if in doubt.

There is a script in Hlt/HltPiquetScripts which does this. scripts/Moore_Hlt1Hlt2_MakeDataForTCK_Parallel.py This script runs Moore with a configurable number of parallel processes. It keeps track of which lines have fired, and only writes out an accepted event if it is the first time for any of the lines. It is slightly more efficient though, since it doesn't actually require that the line fires -- only that the next to last algorithm has been executed. First step is to make sure that we have suitable input data. The process is most efficient if we start from a mix of raw data from the different streams. E.g,.

<!-- SyntaxHighlightingPlugin -->
nsls /castor/cern.ch/grid/lhcb/data/2015/RAW/TURCAL/LHCb/COLLISION15/164699/ | head -n 5
<!-- end SyntaxHighlightingPlugin -->
Then copy the data to /scratch/hlt/make_tcks on the online system. From the online system do
<!-- SyntaxHighlightingPlugin -->
getpack Hlt/HltPiquetScripts
<!-- end SyntaxHighlightingPlugin -->
You probably want to do this in a screen session:
<!-- SyntaxHighlightingPlugin -->
lb-run Moore v25r1 python Hlt/HltPiquetScripts/scripts/Moore_Hlt1Hlt2_MakeDataForTCK_Parallel.py 2>&1 | tee log
<!-- end SyntaxHighlightingPlugin -->
There will be an .mdf and .log file for each Moore process, and they will be filled in real time.

Creating and testing split HLT TCKs.

Before you begin, you should have an appropriate hex key for the new TCKs. You can e.g. use the latest (use SetupMoore --list-versions) released Moore (v25r2 in this example) with TCKsh to find out:

<!-- SyntaxHighlightingPlugin -->
lb-run Moore v25r2 TCKsh
>>> listConfigurations()
.... ....
MOORE_v25r2
    Calibration_VeloMicroBias
      0x11301715 : b95ffa736bfc93d10bae16e76a3a6c96 : Prescale = 1
    Physics_pp_May2016
      0x11291600 : 8eed26d4c1e458200a7bb0ff69deeaf3 : Hlt1, Physics_pp_May2016, 0x1600
      0x21291600 : c3269de2a6f7e0bd687a82af0879778d : Hlt2, Physics_pp_May2016, 0x1600
<!-- end SyntaxHighlightingPlugin -->
Now if we want to make a new set of TCKs with the 0x1600 L0 TCK, we would use the keys 0x112a1600 and 0x212a1600. (For more details on the TCKsh functions, see this page.)

Now you are ready to create and test the TCKs. First, create the Moore environment. If you need to check out versions of packages that are different from the Moore release, then you will need to do an lb-dev. The following is an example with Moore v25r2.

<!-- SyntaxHighlightingPlugin -->
lb-dev Moore v25r2
cd MooreDev_v25r2
# getpack XYZ if needed
make purge
make -j 8 install
<!-- end SyntaxHighlightingPlugin -->
If you don't need any package updates, then, in the following you could replace all "./run" with "lb-run Moore v25r2"
>
>
This page describes the pre-2016 procedure to make a single HLT1+HLT2 TCK. For datataking in 2016 onwards, we have split HLT1 and HLT2 TCKs. HLT piquets should go to these instructions for producing split TCKs for 2016 datataking
 
Changed:
<
<
The scripts to create and test the Hlt TCKs live in the Hlt/Moore package under tests/options/TCK/ You can see them e.g. with
<!-- SyntaxHighlightingPlugin -->
./run ls '$MOOREROOT/tests/options/TCK'
<!-- end SyntaxHighlightingPlugin -->
CreateTCK1.py  CreateTCK2.py  CreateTCKEntry.py  RedoL0.py  TCKOptions.py  TestTCK1.py  TestTCK2.py 
You will need to edit these scripts, so copy them locally
<!-- SyntaxHighlightingPlugin -->
cp `./run echo '$MOOREROOT'`/tests/options/TCK/* .  ## for some reason I can't just do ./run cp '$MOOREROOT/tests/options/TCK/*' .
<!-- end SyntaxHighlightingPlugin -->
ways check the following items in TCKOptions.py
  • Do you have the correct ThresholdSettings?
  • Do you have the correct L0TCK?
  • Your proposed new TCK numbers are correct
  • The config label for the TCKs are sensible and meaningful

First we need to prepare the input data. The starting point is a small sample of real data events which is selected such that all HLT lines get to their next to last algorithm. It is currently at

 /eos/lhcb/wg/HLT/2016CommissioningDatasets/OneAcceptedPerLine_v25r1_Physics_pp_May2016_190416 
Now, we need to process these data with the correct L0 TCK (0x1600 in this example).

You can run it with

<!-- SyntaxHighlightingPlugin -->
./run gaudirun.py RedoL0.py 2>&1 | tee RedoL0.log
<!-- end SyntaxHighlightingPlugin -->
It should produce a file RedoL0.mdf, which will be the input to the next step.

The next step is to use the output .mdf from RedoL0.py to create the HLT configuration using CreateTCK1.py. You need to make sure that the script points at the correct input data

<!-- SyntaxHighlightingPlugin -->
IOHelper('MDF').inputFiles(['PFN:RedoL0.mdf']) 
<!-- end SyntaxHighlightingPlugin -->
Also pay particular attention to Moore().ThresholdSettings, Moore().ConfigLabel and the L0TCK. Now you should be ready to run
<!-- SyntaxHighlightingPlugin -->
./run gaudirun.py CreateTCK1.py TCKOptions.py 2>&1 | tee CreateTCK1.log
<!-- end SyntaxHighlightingPlugin -->
This should create a directory TCKData containing a file, config.cdb If there is an issue with this, or any subsequent step, it is safest to delete the config.cdb file, fix the problems and start again. Pay attention and report all ERRORs and any WARNINGs that you are unsure of to the corresponding JIRA task. Now you need to map the configuration to a TCK number. You need to get the id from the log file, e.g. like this
<!-- SyntaxHighlightingPlugin -->
ID=`cat CreateTCK1.log | grep HltGenConfig | grep "top id for this config" | cut -d ":" -f 2 | xargs`
<!-- end SyntaxHighlightingPlugin -->
And then feed this ID to the CreateTCKEntry.py script, together with the your proposed TCK number (see above).
<!-- SyntaxHighlightingPlugin -->
./run python CreateTCKEntry.py ${ID} 0x112a1600 2>&1 | tee CreateTCKEntry1.log
<!-- end SyntaxHighlightingPlugin -->
The next step is to test that we can actually run from this TCK. Have a look at TestTCK1.py, and check that the input data is the same as in CreateTCK1.py. The following will run Moore in Split="Hlt1" with your newly
<!-- SyntaxHighlightingPlugin -->
./run gaudirun.py TestTCK1.py TCKOptions.py 2>&1 | tee TestTCK1.log
<!-- end SyntaxHighlightingPlugin -->
This should produce an output .mdf file called TestTCK1.mdf. We can use this file as input to produce the Hlt2 TCK. Take a look at CreateTCK2.py, CreateTCKEntry.py and TestTCK2.py, and make sure that the settings are correct. In particular:
  • CreateTCK2.py and TestTCK2.py should take TestTCK1.mdf as their input data
  • CreateTCK2.py should set the appropriate L0TCK and the ConfigLabel for the TCK should be sensible.
Now you should be able to run the remaining steps in one go
<!-- SyntaxHighlightingPlugin -->
./run gaudirun.py CreateTCK2.py TCKOptions.py 2>&1 | tee CreateTCK2.log
ID=`cat CreateTCK2.log | grep HltGenConfig | grep "top id for this config" | cut -d ":" -f 2 | xargs`
TCK2=0x212F1600
CreateTCKEntry.py ${ID} ${TCK2} 2>&1 | tee CreateTCKEntry2.log
./run gaudirun.py TestTCK2.py TCKOptions.py 2>&1 | tee TestTCK2.log
<!-- end SyntaxHighlightingPlugin -->
Once you are comfortable with all of the above, you can of course wrap all the steps in one script, in case you need to redo the procedure, e.g. to pick up some package updates or other changes.

We could now add the new TCKs to the config.cdb in the TCK/HltTCK package, but first, we should

  • Share and discuss the log files, and warnings, errors etc... with the experts
  • Diffs with previous TCKs should be circulated for review by the trigger WG liaisons

Finally, you will want to copy these TCKs into the config.cdb in the TCK/HltTCK package. Here is an example. Checkout the head of TCK/HltTCK

<!-- SyntaxHighlightingPlugin -->
# copy_TCK.py
from TCKUtils.utils import *
source_cas = ConfigAccessSvc("ConfigAccessSvcSource", File = 'TCKData/config.cdb') ## copy the new entries from here
target_cas = ConfigAccessSvc("ConfigAccessSvcTarget", File = 'TCK/HltTCK/config.cdb', Mode = 'ReadWrite') ## into here

# either of these would work
for source in ("0x*12a1600"):
#for source in (0x112a1600,0x212a1600):
    glob = 'TCK/0x%08x' % source if type(source) == int else "TCK/" + source
    copy(source = source_cas, target = target_cas, glob = glob)
<!-- end SyntaxHighlightingPlugin -->
Run like this (currently need to use the nightly since we need some features in TCKUtils that are newer than Moore v25r2). Or you could getpack Hlt/TCKUtils head and rebuild, and then just use ./run.
<!-- SyntaxHighlightingPlugin -->
lb-run --nightly lhcb-head TUE Moore HEAD python copy_TCK.py
<!-- end SyntaxHighlightingPlugin -->

Creating unsplit HLT TCKS prior to 2016

HLT piquets should go to the instructions for producing split TCKs for 2016 datataking
>
>
 

Creating a private TCK

To keep this tutorial simple and complete a separate config.tar file is used to store the private TCK, but the same steps apply when using config.tar from the TCK/HltTCK package.
 
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