Simple Example : \(Z^0\) → \(\mu^{+}\mu^{-}\)¶
LbEnv Setup
Before testing this example, it is necessary to source LbEnv as it is shown in the section Setting CVMFS.
The following example builds a DecayTree for the decay \(Z^0\) → \(\mu^{+}\mu^{-}\) with data directly obtained from the Open Data portal! In this case, we are using part of the data in the ElectroWeak stream from 2011. Specifically, this subset can be found in the json file at the bottom of the page.
Follow the steps below to run the simple example:
-
Download the simple-example.py. The contents of this file are shown below:
from Configurables import DecayTreeTuple from Configurables import DaVinci from DecayTreeTuple.Configuration import * from GaudiConf import IOHelper # Add a prefilter to make the process faster flters = LoKi_Filters (STRIP_Code = "HLT_PASS_RE('StrippingZ02MuMuLineDecision')") DaVinci().EventPreFilters = flters.filters('Filters') # Stream and stripping line we want to use stream = 'EW' line = 'Z02MuMuLine' # Tuple name inside output root file dtt = DecayTreeTuple('TupleZ02MuMuLine') # Directory inside the DST file where the candidates are located. Is this directory structure specified in DIRAC? dtt.Inputs = ['/Event/{0}/Phys/{1}/Particles'.format(stream,line)] dtt.Decay = 'Z0 -> mu+ mu-' # Configure DaVinci DaVinci().UserAlgorithms += [dtt] DaVinci().InputType = 'DST' # Name of the output file DaVinci().TupleFile = 'DVntuple_opt2.root' DaVinci().PrintFreq = 1000 DaVinci().DataType = '2011' DaVinci().Simulation = False # Only ask for luminosity information when not using simulated data DaVinci().Lumi = not DaVinci().Simulation DaVinci().EvtMax = -1 IOHelper().inputFiles([ 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000008_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000022_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000043_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000044_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000064_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000078_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000092_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000106_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000120_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000134_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000148_1.ew.dst', 'root://eospublic.cern.ch//eos/opendata/lhcb/Collision11/EW/LHCb_2011_Beam3500GeV_VeloClosed_MagDown_RealData_Reco14_Stripping21r1_EW_DST/00041840/0000/00041840_00000162_1.ew.dst' ], clear=True)
-
In the same terminal that you initiated CVMFS and sourced LbEnv, run:
lb-run DaVinci/v45r8 gaudirun.py simple-example.py