diff --git a/DaVinciTests/tests/options/dtfdict.py b/DaVinciTests/tests/options/dtfdict.py deleted file mode 100644 index f3e6132eb3c7cd4bcef16f816fa485c766bf1784..0000000000000000000000000000000000000000 --- a/DaVinciTests/tests/options/dtfdict.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python -############################################################################### -# (c) Copyright 2000-2021 CERN for the benefit of the LHCb Collaboration # -# # -# This software is distributed under the terms of the GNU General Public # -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # -# # -# In applying this licence, CERN does not waive the privileges and immunities # -# granted to it by virtue of its status as an Intergovernmental Organization # -# or submit itself to any jurisdiction. # -############################################################################### -""" -Test of the DFTDict module -""" - -from __future__ import print_function -__author__ = "Davide Fazzini davide.fazzini@cern.ch" - -from Configurables import GaudiSequencer -from Configurables import DaVinci - -from DecayTreeTuple.Configuration import * - -from Configurables import FilterDesktop - -from PhysSelPython.Wrappers import Selection -from PhysSelPython.Wrappers import SelectionSequence -from PhysSelPython.Wrappers import DataOnDemand - -from Configurables import TupleToolDecayTreeFitter -from Configurables import LoKi__Hybrid__DictOfFunctors, LoKi__Hybrid__Dict2Tuple -from Configurables import LoKi__Hybrid__DTFDict as DTFDict -from Configurables import CondDB - - -def get_selection_sequence(name): - """Get the selection from stripping stream""" - - alg = FilterDesktop('SelFilterFor{}B2D'.format(name)) - alg.Code = 'ALL' - reqSels = [ - DataOnDemand(Location='/Phys/BetaSBd2JpsiKstarDetachedLine/Particles') - ] - sel = Selection('Sel' + name, Algorithm=alg, RequiredSelections=reqSels) - - return SelectionSequence('SelSeq' + name, TopSelection=sel) - - -#################### - -# some options -DaVinci().EvtMax = -1 # Number of events -DaVinci().PrintFreq = 10 # Events to skip -DaVinci().DataType = "Upgrade" # Must be given -DaVinci().Simulation = True -DaVinci().InputType = 'LDST' -DaVinci().Lumi = False -CondDB().Upgrade = True -DaVinci().CondDBtag = "sim-20171127-vc-md100" -DaVinci().DDDBtag = "dddb-20171126" - -#for MDST -DaVinci(StrippingStream='AllStreams', InputType='LDST') - -DaVinci().EvtMax = 1000 -DaVinci().TupleFile = 'test_DFTDict.root' - -# define the sequence -seq = GaudiSequencer('MyBd2KstMuMuDTTupleSeq') - -sel = get_selection_sequence('Bd2JpsiKstarSel') -seq.Members += [sel.sequence()] -tuple_input = sel.outputLocation() - -print("sequence test: passed") - -# make a tuple -tpl = DecayTreeTuple("Bd2JpsiKstar") -tpl.Inputs = [tuple_input] - -tpl.ToolList = ['TupleToolKinematic'] -tpl.Decay = "[B0 -> ^(J/psi(1S) -> ^mu+ ^mu-) ^(K*(892)0 -> ^K+ ^pi-)]CC" - -# add a branch -tpl.addBranches({"B0": "[B0 -> J/psi(1S) K*(892)0]CC"}) - -tpl.B0.ToolList = ["TupleToolDecayTreeFitter/Cons"] # fit with mass constraint -tpl.B0.addTool(TupleToolDecayTreeFitter("Cons")) - -DictTuple = tpl.B0.addTupleTool(LoKi__Hybrid__Dict2Tuple, "DTFTuple") - -DictTuple.addTool(DTFDict, "Cons") -DictTuple.Source = "LoKi::Hybrid::DTFDict/Cons" -DictTuple.NumVar = 100 - -DictTuple.Cons.constrainToOriginVertex = True -DictTuple.Cons.daughtersToConstrain = ["J/psi(1S)", "K*(892)0"] - -DictTuple.Cons.Substitutions = { - 'J/psi(1S) -> ^mu+ mu-': 'e+', - 'J/psi(1S) -> mu+ ^mu-': 'e-', -} - -print("LoKi__Hybrid__Dict2Tuple test: passed") - -# Add LoKiFunctors to the tool chain, -# these functors will be applied to the refitted decay tree -# they act as a source to the DTFDict -DictTuple.Cons.addTool(LoKi__Hybrid__DictOfFunctors, "dict") -DictTuple.Cons.Source = "LoKi::Hybrid::DictOfFunctors/dict" - -DictTuple.Cons.dict.Variables = { - "Cons_PE": "E", - "Cons_PX": "PX", - "Cons_PY": "PY", - "Cons_PZ": "PZ", -} - -print("LoKi__Hybrid__DictOfFunctors test: passed") - -# add the tuple to the main sequence -seq.Members += [tpl] - -DaVinci().appendToMainSequence([seq]) diff --git a/DaVinciTests/tests/qmtest/dtfdict.qms/test_dtfdict.qmt b/DaVinciTests/tests/qmtest/dtfdict.qms/test_dtfdict.qmt deleted file mode 100644 index 8a28edb4bdc8f256a60bbd62fd52986b34031051..0000000000000000000000000000000000000000 --- a/DaVinciTests/tests/qmtest/dtfdict.qms/test_dtfdict.qmt +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" ?> -<!-- - (c) Copyright 2000-2021 CERN for the benefit of the LHCb Collaboration - - This software is distributed under the terms of the GNU General Public - Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". - - In applying this licence, CERN does not waive the privileges and immunities - granted to it by virtue of its status as an Intergovernmental Organization - or submit itself to any jurisdiction. ---> -<!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> -<extension class="GaudiTest.GaudiExeTest" kind="test"> - <argument name="program"><text>gaudirun.py</text></argument> - <argument name="args"><set> - <text>../options/dtfdict.py</text> - <text>--option</text> - <text>from PRConfig import TestFileDB; from Configurables import DaVinci; TestFileDB.test_file_db['Upgrade_Bd2KstarMuMu'].run(configurable=DaVinci())</text> - </set></argument> - <argument name="validator"><text> -countErrorLines({"FATAL":0, "ERROR":0}) - </text></argument> -</extension> diff --git a/Phys/DaVinci/options/DaVinci-Example.py b/Phys/DaVinci/options/DaVinci-Example.py deleted file mode 100644 index d7db07dea16bc38631d9883fa89a750531cf8f71..0000000000000000000000000000000000000000 --- a/Phys/DaVinci/options/DaVinci-Example.py +++ /dev/null @@ -1,133 +0,0 @@ -############################################################################### -# (c) Copyright 2000-2020 CERN for the benefit of the LHCb Collaboration # -# # -# This software is distributed under the terms of the GNU General Public # -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # -# # -# In applying this licence, CERN does not waive the privileges and immunities # -# granted to it by virtue of its status as an Intergovernmental Organization # -# or submit itself to any jurisdiction. # -# # -############################################################################### -# -# Simple DaVinci example job running on K*mumu data and filling an nTuple -# -# syntax -# ./run gaudirun.py DaVinci-Example.py options/DaVinciTestData.py -# -# @author P. Koppenburg based on previous versions -# -## -from Gaudi.Configuration import MessageSvc -from Gaudi.Configuration import INFO -from Configurables import DaVinci, CombineParticles -from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence -# from StandardParticles import StdLooseMuons -from Configurables import DecayTreeTuple, TupleToolMCTruth, TupleToolEventInfo, MCTupleToolHierarchy - -from Configurables import TimingAuditor, SequencerTimerTool -TimingAuditor().addTool(SequencerTimerTool, name="TIMER") -TimingAuditor().TIMER.NameSize = 60 - -MessageSvc().Format = "% F%80W%S%7W%R%T %0W%M" - -DaVinci().EvtMax = -1 -DaVinci().TupleFile = 'DVNtuple.root' -#DaVinci().HistogramFile = 'DVHistos.root' - -#from PhysConf.Selections import AutomaticData -StdLooseMuons = AutomaticData('Phys/StdLooseMuons/Particles') - -name = "TwoBody" - -TwoBodyComb = CombineParticles( - "TwoBodyComb", - #Preambulo=["from LoKiPhysMC.decorators import *","from LoKiPhysMC.functions import mcMatch"], - DecayDescriptors=['J/psi(1S) -> mu+ mu-', '[J/psi(1S) -> mu+ mu+]cc'], - CombinationCut="(ADOCACHI2CUT(30, ''))", - MotherCut="(BPVVDCHI2() > 30) & (VFASPF(VCHI2/VDOF) < 10)", - DaughtersCuts={ - #'mu+': '(MIPCHI2DV(PRIMARY)>9) & (PROBNNmu>0.2) & (PT > 0*GeV) & (TRGHOSTPROB<0.25)', - #'mu-': '(MIPCHI2DV(PRIMARY)>9) & (PROBNNmu>0.2) & (PT > 0*GeV) & (TRGHOSTPROB<0.25)'} - 'mu+': '(MIPCHI2DV(PRIMARY)>9) & (PT > 0*GeV) & (TRGHOSTPROB<0.25)', - 'mu-': '(MIPCHI2DV(PRIMARY)>9) & (PT > 0*GeV) & (TRGHOSTPROB<0.25)' - }) -TwoBodySel = Selection( - "TwoBodySel", Algorithm=TwoBodyComb, RequiredSelections=[StdLooseMuons]) - -TwoBodySeq = SelectionSequence("Seq" + name, TopSelection=TwoBodySel) - -tuple1 = DecayTreeTuple("TwoBody") -tuple1.TupleName = "TwoBody" -tuple1.NTupleDir = "" - -ToolList = ['TupleToolMCTruth', 'TupleToolEventInfo'] - -tuple1.ToolList = ToolList - -tuple1.addBranches({ - "TwoBody": "J/psi(1S)", - "Track1": "J/psi(1S) -> ^[mu+]CC [mu-]CC", - "Track2": "J/psi(1S) -> [mu+]CC ^[mu-]CC", -}) - -tuple1.TwoBody.addTool(TupleToolEventInfo) - -tuple1.addTool(TupleToolMCTruth) -tuple1.TupleToolMCTruth.OutputLevel = INFO -tuple1.TupleToolMCTruth.ToolList = ["MCTupleToolHierarchy"] -tuple1.TupleToolMCTruth.addTool(MCTupleToolHierarchy) -tuple1.TupleToolMCTruth.MCTupleToolHierarchy.OutputLevel = INFO -tuple1.addTool(TupleToolMCTruth) - -LoKi_TwoBody = tuple1.TwoBody.addTupleTool( - "LoKi::Hybrid::TupleTool/LoKi_TwoBody") -LoKi_TwoBody.Preambulo.append("from LoKiPhysMC.decorators import *") -LoKi_TwoBody.Preambulo.append("from LoKiPhysMC.functions import mcMatch") - -LoKi_TwoBody.Variables = { - 'Mcorr': - "BPVCORRM()", - 'M': - "M", - 'P': - "P", - 'PT': - "PT", - 'ETA': - "ETA", - 'MINIPCHI2': - "MIPCHI2DV(PRIMARY)", - 'DIRA_OWNPV': - "BPVDIRA()", - 'FDCHI2_OWNPV': - "BPVVDCHI2()", - 'ENDVERTEX_CHI2': - "VFASPF(VCHI2/VDOF)", - 'DOCAMAX': - "PFUNA(ADOCAMAX(''))", - 'FromSameB': - "switch( mcMatch('([ (Beauty) --> [X+]CC [X-]CC ... ]CC) ') , 1 , 0)", -} - -LoKi_one = tuple1.Track1.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_one") -LoKi_one.Preambulo.append("from LoKiPhysMC.decorators import *") -LoKi_one.Preambulo.append("from LoKiPhysMC.functions import mcMatch") -LoKi_one.Variables = { - 'ID': "ID", - 'P': "P", - 'PT': "PT", - 'ETA': "ETA", - 'MINIPCHI2': "MIPCHI2DV(PRIMARY)", - 'TRCHI2DOF': "TRCHI2DOF", - 'TRGHOSTPROB': "TRGHOSTPROB", - 'FromB': "switch( mcMatch('([ (Beauty) --> X+ ... ]CC) ') , 1 , 0)", -} - -LoKi_two = tuple1.Track2.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_two") -LoKi_two.Preambulo = LoKi_one.Preambulo -LoKi_two.Variables = LoKi_one.Variables - -tuple1.Decay = "J/psi(1S) -> ^[mu+]CC ^[mu-]CC" -tuple1.Inputs = [TwoBodySeq.outputLocation()] -DaVinci().appendToMainSequence([TwoBodySeq, tuple1])