LHCb Stripping page

Stripping Workflow

Stripping framework

Stripping DST

The stripping DST contains the full DST, plus a MicroDST partition containing the full decay tree of the stripping line selected candidates. It also contains the necessary particle to primary vertex (PV) relations in order to guarantee that the same PV is used to apply further cuts and estimate PV-dependent quantities. If PV re-fitting has been used in the selection, the re-fitted PVs are also saved. The relations point to these.


Writing of DSTs is performed using the DSTWriter pattern. It uses the Stripping Framework behind the scened, and the StrippingConf configurable to provide a list of StrippingStreams. These are passed onto a DSTWriter, which prepares a self-contained GaudiSequencer that can then be passed to DaVinci(). There is one DST per stream, and it contains all the candidates of all the lines composing that stream. By convention, the candidates are placed in a partition '/Event/Strip'. It is possible to configure StrippingConf to run only one stream. It is also possible to use a sub-set of lines for each particular stream. This is achieved through the ActiveStreams and ActiveLines fields of StrippingConf respectively.
from Configurables import SelDSTWriter, DaVinci
from StrippingConf.Configuration import StrippingConf

# import some official Stripping Selections
from StrippingSelections import StreamBmuon, StreamHadron, StreamJpsi, StreamDstar

sc = StrippingConf(Streams = [StreamBmuon.stream,
                  StreamDstar.stream] )

dstWriter = SelDSTWriter("StripMC09DSTWriter",
                         SelectionSequences = sc.activeStreams(),
                         OutputPrefix = 'Strip',
                         OutputFileSuffix = 'Test'
dv = DaVinci()
dv.DataType = "MC09"                   # Default is "MC09"
dv.UserAlgorithms = [ dstWriter.sequence() ]

This example will only run the 'JpsiInclusive' line of the 'Jpsi' stream. The result will be Test.Jpsi.dst. For more details, see the relevant Stripping Framework section


Since the stripping DST contains a full DST as well as the candidate's full decay tree, it is very easy to run an analysis on top of it. All that is required is that the full TES location of the particles is specified t the relevant algorithms. However, since the stripping lines within a stream are run in OR mode, it is unavoidable that there will be events with no candidates in the desired location, and no container of secondary vertices. This catches the PhysDesktop out, so to protect agains these cases it is necessary to use Phys/DaVinciTools v19r2p1. The problem will be fixed in the DaVinci v24r4 release.

Run a selection on top of the stripping candidates

In the example below, we run J/Psi filter on top of the candidates saved to a DST written using only the 'JpsiInclusive' line of the the 'Jpsi' stream. For this, we use elements from the Particle Selection Framework to build SelectionSequence.
# get classes to build the SelectionSequence
from PhysSelPython.Wrappers import DataOnDemand, Selection, SelectionSequence
# Get the J/Psi candidates from the DST.
# Treat particles already on the DST as data-on-demand, but give the full path.
JpsiSel = DataOnDemand(name = 'DOD_Bs',
                       Location = "/Event/Strip/Phys/StrippingJpsiInclusiveCombine")
# Filter the J/Psi. Replace 'ALL' by some cuts.
from Configurables import FilterDesktop
_jpsiFilter = FilterDesktop('jpsiFilter', Code = 'ALL')

# make a Selection
JpsiFilterSel = Selection(name = 'JpsiFilterSel',
                          Algorithm = _jpsiFilter,
                          RequiredSelections = [JpsiSel] )

# build the SelectionSequence
JpsiSeq = SelectionSequence('SeqJpsi',
                            TopSelection = JpsiFilterSel)

# Configure DaVinci
dv.HistogramFile = "DVHistos_Strip.root"
dv.UserAlgorithms = [JpsiSeq.sequence()] # pass the GaudiSequencer to DaVinci()
dv.Input   = ["DATAFILE='PFN:/castor/cern.ch/user/j/jpalac/StripDST/MC09/DaVinci
_v24r3p1/Sel.Jpsi.dst'  TYP='POOL_ROOTTREE' OPT='READ'" ]
We can add some histograms, as shown in DaVinci Tutorial 4:
from Configurables import LoKi__Hybrid__PlotTool as PlotTool

_jpsiFilter.HistoProduce = True
_jpsiFilter.addTool( PlotTool("InputPlots") )
_jpsiFilter.InputPlots.Histos = { "P/1000"  : ('momentum',0,150) ,
                                  "PT/1000" : ('pt_%1%',0,5,750) ,
                                  "M"       : ('mass in MeV_%1%_%2%_%3%',2.8*Uni
ts.GeV,3.2*Units.GeV) }
_jpsiFilter.addTool( PlotTool("OutputPlots") )
_jpsiFilter.OutputPlots.Histos = { "P/1000"  : ('momentum',0,150) ,
                                   "PT/1000" : ('pt_%1%',0,5,750) ,
                                   "M"       : ('mass in MeV_%1%_%2%_%3%',2.8*Un
its.GeV,3.2*Units.GeV) }

The selection part of the example could've been put in a python module to make a selection, as explained in the Particle Selection framework and DaVinci Tutorial 4 pages. This example will be available as DaVinci/options/DaVinci-ReadStripDST.py from DaVinci v24r4 onwards.

Make a DecayTreeTuple using the stripping candidates

from Gaudi.Configuration import *
from Configurables import  DaVinci, DecayTreeTuple, TupleToolTrigger

from Configurables import HltDecReportsDecoder, HltSelReportsDecoder, HltVertexReportsDecoder
DataOnDemandSvc().AlgMap["Hlt/DecReports"] = HltDecReportsDecoder(OutputLevel = 4)
DataOnDemandSvc().AlgMap["Hlt/SelReports"] = HltSelReportsDecoder(OutputLevel = 4)
DataOnDemandSvc().AlgMap["Hlt/VertexReports"] = HltVertexReportsDecoder( OutputLevel = 4)

tuple = DecayTreeTuple('MyTuple')
tuple.InputLocations = [ "/Event/Strip/Phys/Bd2DstarMu" ]
tuple.ToolList +=  [  "TupleToolGeometry"
                    , "TupleToolKinematic"
                    , "TupleToolPrimaries"
                    , "TupleToolEventInfo"
                    , "TupleToolTrackInfo"
                    , "TupleToolPid"
                    , "TupleToolTrigger"
tuple.Decay = "[B~0 -> (^D*(2010)+ -> (^D0 -> ^K- ^pi+) ^pi+) ^mu-]cc"
tuple.Branches = {
     "muon"  : "[B~0]cc  -> [(D*(2010)+ -> (D0 -> K- pi+) pi+) ^mu-]cc" 
    ,"Dstar" : "[B~0]cc  -> [(^D*(2010)+ -> (D0 -> K- pi+)  pi+) mu-]cc" 
    ,"slpi"  : "[B~0]cc  -> [(D*(2010)+  -> (D0 -> K- pi+) ^pi+) mu-]cc" 
    ,"D0"    : "[B~0]cc  -> [(D*(2010)+  -> (^D0 -> K- pi+) pi+) mu-]cc" 
    ,"pion"  : "[B~0]cc  -> [(D*(2010)+  -> (D0 -> K- ^pi+) pi+) mu-]cc" 
    ,"kaon"  : "[B~0]cc  -> [(D*(2010)+  -> (D0 -> ^K- pi+) pi+) mu-]cc" 
    ,"Bd"    : "[B~0]cc : [B~0 -> (D*(2010)+ -> (D0 -> K- pi+) pi+)  mu-]cc" 

tuple.TupleToolTrigger.VerboseL0 = True
tuple.TupleToolTrigger.VerboseHlt1 = True
tuple.TupleToolTrigger.VerboseHlt2 = True

# DaVinci settings
from Configurables import DaVinci
DaVinci().EvtMax = -1
DaVinci().PrintFreq = 100
DaVinci().DataType = "MC09"
DaVinci().UserAlgorithms = [ tuple ]
DaVinci().TupleFile = "StripTuple.root"
DaVinci().Input   = [ .... ]

Finding TES locations of stripping candidates

In the examples above, one has to know the location of the candidate particles in the DST. It is possible to query StrippingConf to get the locations for a given configuration. In standard python,

from StrippingConf.Configuration import StrippingConf

# import some official Stripping Selections
from StrippingSelections import StreamBmuon, StreamHadron, StreamJpsi, StreamDstar

sc = StrippingConf(Streams = [StreamBmuon.stream,
                  StreamDstar.stream] )

streams = sc.activeStreams()
lines = sc.activeLines()
for stream in streams :
   print stream.name(), "\t", stream.outputLocations()
for line in lines :
   print line.name(), "\t", line.outputLocation()

If we follow the convention that candidates are written to '/Event/Strip' then we can see how to get the location for each line's candidates.

MicroDST framework

Particle Selections Framework

Finding information in the bookkeeping

The situation is still not satisfactory. Some hooks are missing, but you can work your way through... Suppose you use the bookeeping GUI to look at the second stripping (MC09-Stripping01) that was run on the MB. You care about the JPSI.DST stream.

What version of which application was run on

You need the production ID. This is part of the LFN (a directory). In that case 5614. Now go to the Production monitor web page and search for production 5614. Click on a file and select "Show Details". This will give you the details of the whole production workflow. I read:
Merge Production 5614 for event type 30000000 has following parameters:

Production priority: 9
BK Config Name Version: MC MC09
BK Processing Pass Name: MC09-Stripping02
CondDB Tag: sim-20090402-vc-md100
DDDB Tag: MC09-20090602

====> DaVinci v24r4 Step0
  DaVinci Option Files:
  ExtraPackages: AppConfig.v3r20
====> Brunel v34r7 Step1
  Brunel Option Files:
  ExtraPackages: AppConfig.v2r9p1
====> DaVinci v24r4 Step2
  DaVinci Option Files:
  ExtraPackages: AppConfig.v3r20
====> LHCb v28r0 Step3
  LHCb Option Files:
BK Input Data Query:
    EventType = 30000000
    FileType = JPSI.DST
    ProductionID = 5600

BK Browsing Paths:

-- JuanPalacios - 09-Oct-2009 -- PatrickSKoppenburg - 20-Nov-2009

This topic: LHCb > LHCbStripping
Topic revision: r10 - 2009-11-20 - PatrickSKoppenburg
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