Swimming Tutorial: Swimming the Trigger


This tutorial is focussed on running a job to swim the trigger on Stripping17 data.

The tutorial is structured as a series of exercises of increasing complexity. By the end of the tutorial you should know how to obtain LHCb Event Model objects from the transient event store (TES), how to make histograms, how to create and use LHCb-specific Gaud tools, how to use relations tables associating Particles to MCParticles or Vertices. tables. You may also build on what you learnt earlier by either using your own Bs->Jpsi Phi selection, or re-using one of those used in the stripping, to write a MicroDST and analyse it. Depending on your knowledge of python, you may also experiment with making reasonably complex calculations using the contents of the (Micro)DST with your own pure python functions.


A working knowledge of the LHCb software and persistent formats is required, if lacking, have a look at the DaVinci tutorial. Due to the change in persistency format, special patch releases for Moore are required to swim stripping 17 data. These releases are being prepared and can be recognised by their version ending in gX. The first of these releases are available on afs and the grid: Moore v12r6p1g3 and Moore v12r8g2.

Working environment

We will be working with Moore v12r6p1g3 on lxplus.
SetupProject --build-env Moore v12r6p1g3
getpack Phys/Swimming v2r2
getpack AppConfig r130406
cd Phys/Swimming/example 

Input data

Some input data is required. Because the input data needs to be split by TCK and therefore by Moore version, find the list of TCKs which is appropriate for the available patched Moore version.
SetupProject Moore v12r6p1g3
Now fire up the bookkeeping, select some Stripping17 data and filter by TCK before saving the PFNs.
Make sure you know where your candidates are located on the DST, to check, use for example the dst explorer:
SetupProject Bender v18r2
dst-explorer YourDst.dst 

Configuring for swimming the trigger

  • Start from SwimTriggerB2JpsiX.py in Phys/Swimming
  • Set the correct CondDB and DDDB tags (see table below).
  • Set the trigger lines you want to swim (the Decision at the end of the name is mandatory).
  • Set the location of your offline candidates; don't include /Particles
  • Choose an appropriate single candidate selection method (random or first)
  • Use Oracle if needed
  • For the tutorial set the EvtMax to 25

Swimming the trigger

gaudirun.py $APPCONFIGOPTS/EnableCustomMainLoop.py SwimTrigger.py YourData.py

Moore version table

Swimming Tutorial: Saving the Turning Points

Once a DST with turning points on it has been created, they can be saved with a special DecayTreeTuple tool called TupleToolSwimmingInfo

Working environment

We will be working with DaVinci v29r1 on lxplus.
SetupProject  --build-env DaVinci v29r1
getpack Phys/DecayTreeTuple r130060
getpack Phys/Swimming v2r2
cd Phys/Swimming/example 

Configuring DecayTreeTuple

  • Start from DecayTreeTuple.py in Phys/Swimming/example
  • Set the correct path to the candidates
  • mDST = False
  • Set input file
  • In case of a decay where the charge conjugated decay is not the same decay, take care to configure the branch for daughter information to apply to both charged states.


Database tags run in the pit.

start run - end run CondDB tag DDDB tag Moore version
89333 - 90899 head-20110331 head-20110302 Moore_v12r5
91631 - 92316 head-20110512 head-20110302 Moore_v12r6p1
92317 - 94012 head-20110524 head-20110302 Moore_v12r6p1
94169 - 94386 head-20110622-Reco10 head-20110302 Moore_v12r6p1
95929 - 101011 head-20110622 head-20110302 Moore_v12r8
101012 - 101067 head-20110622 head-20110302 Moore_v12r9p1
101092 - 101121 head-20110722 head-20110722 Moore_v12r9p1
101122 - 104486 head-20110901 head-20110722 Moore_v12r9p1

Moore patch version per TCK

TCK Moore version Run Numbers
0x360032 v12r3
0x480032 v12r4
0x4A0033 v12r4
0x5A0032 v12r5
0x5B0032 v12r5
0x5D0033 v12r5
0x700034 v12r6p1
0x710035 v12r6p1
0x740036 v12r6p1
0x6D0032 v12r6p1 91631 - 91658, 91919 - 92906
0x730035 v12r6p1 92929 - 94386
0x760037 v12r8 95929 - 100256
0x790037 v12r9p1 101373 - 101761
0x790038 v12r9p1 101762 - 104414

-- RoelAaij - 03-Nov-2011

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r7 - 2013-08-27 - VladimirGligorov
    • 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-2023 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