TWiki> LHCb Web>LHCbComputing>DaVinci>StrippingLines (revision 33)EditAttachPDF

Stripping framework



The current stripping framework is based on the code of Hlt2Lines and follows its concept.

Stripping framework consists of two packages belonging to the ANALYSIS project. Phys/StrippingConf contains definitions of python objects and C++ configurable. The actual selections and DaVinci jobs are contained in Phys/StrippingSelections.

Contrary to Hlt2Lines framework, no objects for shared particles definitions are created. It is expected that the states from CommonParticles will be used in the stripping.

Writing stripping selections

Selections are kept under Phys/StrippingSelections/python/StrippingSelections/. To add a new selection line, the python module with the StrippingLine constructor should be placed in this directory (with the name starting with Stripping). Possible ways of writing the selection are:

  • Using plain Gaudi classes

  • Using StrippingMember

Examples are given below. In addition, the new selection has to be appended to any of the existing streams (or a new stream has to be created). Note that since DaVinci v24r4, the stream name is not a property of StrippingLine.

Since DaVinci v24r4, selections have been moved from options/ to python/. Therefore, do not forget to "cmt make" every time you change your selection!

Wrapping Selection object in StrippingLine

An existing Selection object can be used directly to create a StrippingLine. In the code below, Jpsi is a Selection. For details on how to build such an object, see the Particle Selection Framework page.

line = StrippingLine('JpsiInclusiveLine'
                    , prescale = 1.
                    , algos = [ Jpsi ] )

This will create a line with Jpsi 's algorithm and all the ones required by it. Only one Selection should be used for any given StrippingLine.

Wrapping offline selection sequencer in StrippingLine

A GaudiSequencer containing an old-style selection can be integrated directly into the stripping framework by using it to build a StrippingLine instance. In the following example, B2DhFilterSequence is a GaudiSequencer that has already been created:

line = StrippingLine('B2Dh'
               , prescale = 1
               , algos = [ B2DhFilterSequence ]

This will create a line corresponding to B2DhFilterSequence selection, and add it to the list of lines.

StrippingLine constructor arguments

The following options can be specified for a StrippingLine:

algos = [Alg1, Alg2]
List of algorithms to run for this line. The algorithms can be CombineParticles, FilterDesktop, SelectionSequence or Selection=instances,      or =StrippingMembers (see below).

prescale = 1
postscale = 1
Prescale and postscale factors. Prescaler and postscaler are run before and after the list of algorithms, respectively.

checkPV = False
Turns off checking of the existence of primary vertex in the event before running the sequence of algorithms. By default, checkPV=True.

Using StrippingMember

Using StrippingMember instead of common algorithm allows to clone StrippingLine in the same way as in Hlt2Line. This could be useful to handle e.g. signal and prescaled sidebands.

combine = CombineParticles("Bd2KstarMuMuCombine")

   filter = StrippingMember (FilterDesktop
                   , "Filter"
                   , InputLocations = ["Bd2KstarMuMuCombine"]
                   , Code = "{Some filter code}"

   line1 = StrippingLine('B2DPi_signal'
                   , prescale = 1
                   , algos = [ combine, filter ]

   line2 = line1.clone('B2Dpi_sideband'
                    , prescale = 0.2
                    , FilterDesktopFilter = { "Code" : "{Some looser filter code}" }

In the above example, CombineParticles will run only once, while two FilterDesktop instances will be created. This allows to modify one of the selection lines without affecting the other.

Testing that additions or modifications do not break the standard stripping

If any modifications or additions have been made to the StrippingSelections module, it is mandatory to check that these do not break the instantiation of the stripping. This can be achieved by running the QMTests, after setting the DaVinci environment and building the package. From Phys/StrippingSelections/cmt:
cmt qmtest_run

Running stripping job

Configuring the stripping: StrippingConf options

The object StrippingConf takes care about configuration of the stripping job:

from StrippingConf.Configuration import StrippingConf
This object creates and holds a list of StrippingStreams and contains member functions to access sequencers, output locations and selection names needed to be passed to DaVinci and DST writers. It is simple to configure, and new streams can be defined and added to it. Here, we construct a StrippingConf with four official stripping selections:
from Gaudi.Configuration import *
from StrippingConf.Configuration import StrippingConf

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

sc = StrippingConf(Streams = [,
        ] )
It is also possible to add streams to an existing StrippingConf instance, using either the appendStream or the appendStreams method.
from StrippingSelections import StreamLambda, StreamBelectron
sc.appendStream( )
sc.appendStream( )

Note that since DaVinci v24r4, StrippingConf does not configure DaVinci to write ETC or DST files internally, this is done in job options. Once the StrippingConf is ready, it can be used to simply run a job, write an ETC, or write some stripping DSTs, as the following examples show.

ETC output

This example of ETC output job is from Phys/StrippingSelections/tests/ It assumes that a StrippingConf sc has been instantiated and configured as shown above.

from Configurables import EventTuple, TupleToolSelResults

tag = EventTuple("TagCreator")
tag.EvtColsProduce = True
tag.ToolList = [ "TupleToolEventInfo", "TupleToolRecoStats", "TupleToolSelResults"  ]

tag.TupleToolSelResults.Selections = sc.selections()  # Add the list of stripping selections to TagCreator

from Configurables import DaVinci

DaVinci().appendToMainSequence( [ sc.sequence() ] )   # Append the stripping selection sequence to DaVinci
DaVinci().appendToMainSequence( [ tag ] )             # Append the TagCreator to DaVinci
DaVinci().EvtMax = 1000                        # Number of events
DaVinci().ETCFile = "etc.root"                 # ETC file name

importOptions("$STRIPPINGSELECTIONSROOT/tests/")     # Data file

DST output

The StrippingConf object and streams are configured in the same way as for ETC writing. After that, one has to configure SelDSTWriter and pass it to DaVinci:

dstWriter = SelDSTWriter("MyDSTWriter",
        SelectionSequences = sc.activeStreams(),
        OutputPrefix = 'Strip',
        OutputFileSuffix = '000000'

DaVinci().EvtMax = 1000                         # Number of events
DaVinci().UserAlgorithms = [ dstWriter.sequence() ]

Testing single streams or lines

The above jobs use all streams available in sc. To test individual selections, one can create the test stream, e.g. to test only the StrippingB2Dh line, one can do:

from StrippingConf.StrippingStream import StrippingStream
from StrippingSelections import StrippingB2Dh

stream = StrippingStream("Test")

stream.appendLines( [ StrippingB2Dh.line ] ) 

from StrippingConf.Configuration import StrippingConf

sc = StrippingConf(Streams=[stream] )


Monitoring algorithm

An algorithm to monitor the selection results called StrippingReport is available. It can provide the following information:
  • Selection results in each event
  • Summary of selection results (number of selected events, accept rate and average multiplicity) every N events.
  • Summary of selection results in the end of the job.
  • List of noisy selections (with the accept rate above certain threshold) and non-responding selections (that select zero events)

The algorithm has to be initialised with the list of selection names, e.g. for all configured lines:

from Configurables import StrippingReport
sr = StrippingReport(Selections = sc.selections());
and added to the end of the list of DaVinci algorithms:
DaVinci().appendToMainSequence( [ sr ] )
The following properties are available:
  • OnlyPositive (default: True) - show only the selections with at least one event accepted.
  • EveryEvent (default: False) - show selection results for every event
  • ReportFrequency (default: 100) - number of events between selection summaries during the job execution
  • PrintNonResponding (default: True) - list non-responding selections (the ones that select zero events) at the end of the job
  • PrintHot (default: True) - list "hot" selections (with accept rate above threshold defined in HotThreshold) at the end of the job
  • HotThreshold (default: 0.5) - accept rate threshold for "hot" selections.

List of streams

Name Description
Bhadron B decays with purely hadronic final states
Dimuon B decays with muon pair in final state
Dielectron B decays with electron-positron pair in final state
Charm Charmed selections (both neutral and charged)
Semileptonic B and charm decays with one muon required
EW Electroweak selections (W, Z decays, Drell-Yan processes)
MiniBias Minimum bias, no bias and pass-through selections
Radiative Radiative selections (B decays with one photon required)
Calibration Calibration selections (Lambda, Jpsi to mumu and ee without PID)
DiPhotonDiMuon gg -> gg mumu selection for luminosity measurement

List of implemented StrippingLines

Name Stream Process Responsible Notes
B2Charged2Body Bhadron Angelo Carbonne
B2DX Bhadron J. Nardulli, V. Gligorov
B2DXSignal Bhadron J. Nardulli, V. Gligorov
B2D3H Bhadron S. Blusk
B2D3HSignal Bhadron S. Blusk
Bs2PhiPhiLine Bhadron S. Schleich Conf
Bs2PhiPhiWideLine Bhadron S. Schleich Conf
Bu2D0K_D02KSPiPi_KSLL Bhadron S. Haines Conf
Bu2D0K_D02KSPiPi_KSDD Bhadron S. Haines Conf
Bu2D0h_D02KShh_KSLL Bhadron S. Haines Conf
Bu2D0h_D02KShh_KSDD Bhadron S. Haines Conf
Bu2hhhLine Bhadron J. Miranda, A. Gomes
Bu2hhhLine_1e4 Bhadron J. Miranda, A. Gomes
Topological2BodyLine Bhadron V. Gligorov
Topological3BodyLine Bhadron V. Gligorov
BsKst0Kst0Line Bhadron C. Rodriguez Conf
Bs2Kst0Kst0LooseLine Bhadron C. Rodriguez Conf
JpsiNoPID Calibration S. Furcas, G. Lanfranchi, M. Palutan, A. Sarti
JpsiFromBNoPID Calibration S. Furcas, G. Lanfranchi, M. Palutan, A. Sarti
LambdaDDNoPID Calibration S. Furcas, G. Lanfranchi, M. Palutan, A. Sarti
LambdaLLNoPID Calibration S. Furcas, G. Lanfranchi, M. Palutan, A. Sarti
InclPhiLine Calibration A. Powell, S. Schleich
StripD2PPP_A_NoPID_Bkg Charm M. Charles
StripD2PPP_B_NoPID_Bkg Charm M. Charles
StripD2PPP_A_NoPID_Sig Charm M. Charles
StripD2PPP_B_NoPID_Sig Charm M. Charles
StripD2KPP_A_NoPID_Bkg Charm M. Charles
StripD2KPP_B_NoPID_Bkg Charm M. Charles
StripD2KPP_A_LoosePID_Bkg Charm M. Charles
StripD2KPP_B_LoosePID_Bkg Charm M. Charles
StripD2KPP_A_NoPID_Sig Charm M. Charles
StripD2KPP_B_NoPID_Sig Charm M. Charles
StripD2KPP_A_LoosePID_Sig Charm M. Charles
StripD2KPP_B_LoosePID_Sig Charm M. Charles
StripD2KKP_B_NoPID_Bkg Charm M. Charles
StripD2KKP_A_LoosePID_Bkg Charm M. Charles
StripD2KKP_B_LoosePID_Bkg Charm M. Charles
StripD2KKP_B_NoPID_Sig Charm M. Charles
StripD2KKP_A_LoosePID_Sig Charm M. Charles
StripD2KKP_B_LoosePID_Sig Charm M. Charles
StripD2KKK_A_LoosePID_Bkg Charm M. Charles
StripD2KKK_B_LoosePID_Bkg Charm M. Charles
StripD2KKK_A_LoosePID_Sig Charm M. Charles
StripD2KKK_B_LoosePID_Sig Charm M. Charles
StripD2HHH Charm M. Charles
DstarD2KSPiPi_KSLL Charm M. Charles
DstarD2KSKPi_KSLL Charm M. Charles
DstarD2KSKK_KSLL Charm M. Charles
DstarD2KSPiPi_KSDD Charm M. Charles
DstarD2KSKPi_KSDD Charm M. Charles
DstarD2KSKK_KSDD Charm M. Charles
DstarD2KSPiPi_KSLL_SB Charm M. Charles
DstarD2KSKPi_KSLL_SB Charm M. Charles
DstarD2KSKK_KSLL_SB Charm M. Charles
DstarD2KSPiPi_KSDD_SB Charm M. Charles
DstarD2KSKPi_KSDD_SB Charm M. Charles
DstarD2KSKK_KSDD_SB Charm M. Charles
DstarD2KSPiPi_KSLLRobust Charm M. Charles
DstarD2KSKPi_KSLLRobust Charm M. Charles
DstarD2KSKK_KSLLRobust Charm M. Charles
DstarD2KSPiPi_KSDDRobust Charm M. Charles
DstarD2KSKPi_KSDDRobust Charm M. Charles
DstarD2KSKK_KSDDRobust Charm M. Charles
DstarD2KSPiPi_KSLLRobust_SB Charm M. Charles
DstarD2KSKPi_KSLLRobust_SB Charm M. Charles
DstarD2KSKK_KSLLRobust_SB Charm M. Charles
DstarD2KSPiPi_KSDDRobust_SB Charm M. Charles
DstarD2KSKPi_KSDDRobust_SB Charm M. Charles
DstarD2KSKK_KSDDRobust_SB Charm M. Charles
DstarWithD02MuMu Charm W. Bonivento, F. Dettori
DstarWithD0PiPiForDstarWithD02MuMu Charm W. Bonivento, F. Dettori
Dstar_D2KPiPi0RS_Line Charm A. Contu
Dstar_D2KPiPi0WS_Line Charm A. Contu
D2hhNoPIDLine Charm M. Gersabeck
StripDstarPromptWithD02RSKPiLine Charm P. Xing, P. Spradlin Conf
StripDstarPromptWithD02WSKPiLine Charm P. Xing, P. Spradlin Conf
StripDstarPromptWithD02KKLine Charm P. Xing, P. Spradlin Conf
StripDstarPromptWithD02PiPiLine Charm P. Xing, P. Spradlin Conf
Bd2eeKstar Dielectron M.-H. Schune
Bu2eeK Dielectron P. Koppenburg Conf
DiMuonIncLine Dimuon G. Lanfranchi, A. Sarti Conf
DiMuonIncLooseLine Dimuon G. Lanfranchi, A. Sarti Conf
Bs2JpsiPhiLine Dimuon G. Cowan Conf
Bs2JpsiPhiLooseLine Dimuon G. Cowan Conf
Bs2JpsiPhiPrescaledLine Dimuon G. Cowan, J. Palacios
Bs2JpsiPhiDetachedLine Dimuon J. Palacios
Bd2JpsiKS_KSLL_Line Dimuon F. Rodrigues
Bd2JpsiKS_KSDD_Line Dimuon F. Rodrigues
Bd2JpsiKstarLine Dimuon G. Cowan Conf
Bd2JpsiKstarLooseLine Dimuon G. Cowan Conf
Bd2JpsiKstDetLine Dimuon D. Martinez Santos
Bd2JpsiKstDetRobustLine Dimuon D. Martinez Santos
Bd2KstarMuMu_ForNominal_Low Dimuon P. Koppenburg, R. Lambert, M. Patel Conf
Bd2KstarMuMu_ForNominal_Med Dimuon P. Koppenburg, R. Lambert, M. Patel Conf
Bd2KstarMuMu_ForNominal_High Dimuon P. Koppenburg, R. Lambert, M. Patel Conf
Bd2KstarMuMu_Early_Signal Dimuon P. Koppenburg, R. Lambert, M. Patel Conf
Bd2KstarMuMu_Early_SameSign Dimuon P. Koppenburg, R. Lambert, M. Patel Conf
Bd2KstarMuMu_Early_WideKstar Dimuon P. Koppenburg, R. Lambert, M. Patel Conf
Bd2KstarMuMu_Early_NoMuID Dimuon P. Koppenburg, R. Lambert, M. Patel Conf
Bd2KstarMuMu_Early_eMu Dimuon P. Koppenburg, R. Lambert, M. Patel Conf
Bs2Jpsif0Line Dimuon L. Zhang Conf
Bs2Jpsif0LooseLine Dimuon L. Zhang Conf
Bs2JpsiPhiBiasedLine Dimuon B. Khanji, O. Leroy
Bu2JpsiKLine Dimuon G. Cowan Conf
Bu2JpsiKLooseLine Dimuon G. Cowan Conf
Bu2JpsiKDetLine Dimuon D. Martinez Santos
Bu2JpsiKDetRobustLine Dimuon D. Martinez Santos
Bu2MuMuK Dimuon P. Koppenburg Conf
Bc2JpsiMuX Dimuon J. He Conf
Bc2JpsiH Dimuon J. He Conf
Bc2JpsiHDetached Dimuon J. He Conf
Bd2DstarMuNuLine Semileptonic G. Cowan, M. Calvi
Bd2DstarMuNuLooseLine Semileptonic G. Cowan, M. Calvi Conf
Bs2DMuXLine Semileptonic K. Vervink
b2DMuX Semileptonic L. Zhang
b2DMuXRB Semileptonic L. Zhang
Bs2PhiGamma Radiative F. Soomro Conf
Bs2PhiGammaWideBMass Radiative F. Soomro Conf
Bs2PhiGammaLooseDira Radiative F. Soomro Conf
Bd2KstGamma Radiative F. Soomro Conf
Bd2KstGammaWideBMass Radiative F. Soomro Conf
Bd2KstGammaLooseDira Radiative F. Soomro Conf
Bd2KstGammaWideKstMassBd Radiative F. Soomro Conf
Z02MuMu EW J. Keaveney
W2Mu EW J. Keaveney
DY2MuMu1 EW J. Keaveney
DY2MuMu2 EW J. Keaveney
DY2MuMu3 EW J. Keaveney
DY2MuMu4 EW J. Keaveney
Z02ee EW J. Keaveney
DY2ee1 EW J. Keaveney
DY2ee2 EW J. Keaveney
DY2ee3 EW J. Keaveney
DY2ee4 EW J. Keaveney
DisplVertices EW Neal Gauvin, M. Kucharczyk
PP2PPMuMu DiPhotonDiMuon J. Keaveney, D. Moran

To do list for StrippingLines

  • Stripping decision report in DST
  • Configuration support
  • Machinery to update python dictionaries within StrippingLine.

-- JuanPalacios - 26-Feb-2010

Edit | Attach | Watch | Print version | History: r37 | r35 < r34 < r33 < r32 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r33 - 2010-07-28 - unknown
    • 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-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback