Skip to content
Snippets Groups Projects
Commit 096ec2c5 authored by Patrick Koppenburg's avatar Patrick Koppenburg :leaves:
Browse files

Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/DaVinci/-/jobs/12211447
parent da47e5ef
No related branches found
No related tags found
1 merge request!1103Draft: Add AnalysisHelpers to DaVinci Stack
Showing
with 50 additions and 274 deletions
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# (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". #
......
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# (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". #
......@@ -8,11 +9,14 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
########################################################################
#
# Options for a typical DaVinci job reading DSTs with saved candidates.
# DVTestPrintDecay.py
#
# Options for a typical DaVinci job reading DSTs
#
# @author Patrick Koppenburg
# @date 2009-02-04
# @date 2021-02-18
#
########################################################################
from Gaudi.Configuration import *
......@@ -21,33 +25,32 @@ from Configurables import DaVinci
#
# Print the J/psis
#
from Configurables import PrintDecayTree, PrintHeader, FilterDesktop
DaVinci().UserAlgorithms = [PrintHeader()]
MassRanges = [[3000, 3087], [3088, 3100], [3100, 4000]]
for i in MassRanges:
ln = str(i[0])
hn = str(i[1])
name = ln + "_" + hn
location = "/Event/SeqJpsi_" + name + "/Phys/SelJpsi_" + name
pJpsi = PrintDecayTree('PrintJpsi_' + name, Inputs=[location])
DaVinci().UserAlgorithms += [pJpsi]
f = FilterDesktop(
'Filter_' + name, Inputs=[location], Code="(MIPCHI2DV(PRIMARY) > 2)")
DaVinci().UserAlgorithms += [f]
from PhysSelPython.Wrappers import Selection, DataOnDemand, SelectionSequence
location = 'Phys/StdLooseJpsi2MuMu/Particles'
MyLooseJpsi = DataOnDemand(Location=location)
from Configurables import PrintDecayTree, PrintHeader
DaVinci().UserAlgorithms = [
PrintHeader(), PrintDecayTree('PrintJpsi', Input=location)
]
##############################################################################
#
#
##############################################################################
DaVinci().EvtMax = -1
DaVinci().EvtMax = 100
DaVinci().PrintFreq = 1
DaVinci().DataType = "2010"
DaVinci().DataType = "Upgrade"
DaVinci().Simulation = True
DaVinci().Input = [
"DATAFILE='PFN:$DAVINCITESTSROOT/tests/qmtest/Sel.SeqJpsi_3088_3100.dst' TYP='POOL_ROOTTREE' OPT='READ'",
"DATAFILE='PFN:$DAVINCITESTSROOT/tests/qmtest/Sel.SeqJpsi_3100_4000.dst' TYP='POOL_ROOTTREE' OPT='READ'",
"DATAFILE='PFN:$DAVINCITESTSROOT/tests/qmtest/Sel.SeqJpsi_3000_3087.dst' TYP='POOL_ROOTTREE' OPT='READ'"
]
########################################################################
MessageSvc().Format = "% F%60W%S%7W%R%T %0W%M"
MessageSvc().Format = "% F%40W%S%7W%R%T %0W%M"
#-- GAUDI jobOptions generated on Mon Jan 17 17:13:58 2011
#-- Contains event types :
#-- 13144006 - 1 files - 10000 events - 4.13 GBytes
# MC 2010 Beam3500GeV-VeloClosed-MagDown-Nu3
# bs->Jpsi, Phi
from PRConfig import TestFileDB
TestFileDB.test_file_db["Upgrade_Bd2KstarMuMu"].run()
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# (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". #
......
###############################################################################
# (c) Copyright 2000-2018 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. #
###############################################################################
from Gaudi.Configuration import *
from Configurables import DaVinci
# Number of events etc.
DaVinci().EvtMax = 1000
DaVinci().PrintFreq = 10
#DaVinci().SkipEvents = 17100
# Temporary. Force a particular CondDB tag
#from Configurables import LHCbApp
#LHCbApp().DDDBtag="head-20120413"
#LHCbApp().CondDBtag="cond-20131028"
###############################################################################
# (c) Copyright 2000-2018 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. #
###############################################################################
from Configurables import ApplicationMgr
ApplicationMgr().Environment['LOKI_DISABLE_CACHE'] = '1'
###############################################################################
# (c) Copyright 2000-2018 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. #
###############################################################################
from Configurables import ApplicationMgr
ApplicationMgr().Environment['LOKI_DISABLE_PYTHON'] = '1'
###############################################################################
# (c) Copyright 2000-2018 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. #
###############################################################################
from Configurables import PhysConf
PhysConf().CaloReProcessing = True
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# (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". #
......@@ -10,8 +10,8 @@
###############################################################################
from Gaudi.Configuration import *
ApplicationMgr().ExtSvc + [ "AuditorSvc" ]
AuditorSvc().Auditors += [ "FPEAuditor" ]
ApplicationMgr().ExtSvc + ["AuditorSvc"]
AuditorSvc().Auditors += ["FPEAuditor"]
#from Configurables import FPEAuditor
#FPEAuditor().TrapOn = [ "DivByZero", "Overflow", "Underflow" ]
#FPEAuditor().ActivateAt = ["Execute"]
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# (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". #
......@@ -16,13 +16,13 @@ from Configurables import DaVinci, PhysConf
from Configurables import CondDB
########################################################################
DaVinci().EvtMax = 100 # Number of events
DaVinci().PrintFreq = 10 # Events to skip
DaVinci().DataType = "Upgrade" # Must be given
DaVinci().EvtMax = 100 # 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
CondDB().Upgrade = True
DaVinci().CondDBtag = "sim-20171127-vc-md100"
DaVinci().DDDBtag = "dddb-20171126"
......@@ -31,7 +31,9 @@ DaVinci().HistogramFile = "dst-annpid.root"
########################################################################
from Configurables import ANNGlobalPID__ChargedProtoANNPIDMoni
DaVinci().UserAlgorithms += [ ANNGlobalPID__ChargedProtoANNPIDMoni("ANNPIDMoni") ]
DaVinci().UserAlgorithms += [
ANNGlobalPID__ChargedProtoANNPIDMoni("ANNPIDMoni")
]
########################################################################
......
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# (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". #
......@@ -16,13 +16,13 @@ from Configurables import DaVinci, PhysConf
from Configurables import CondDB
########################################################################
DaVinci().EvtMax = 100 # Number of events
DaVinci().PrintFreq = 10 # Events to skip
DaVinci().DataType = "Upgrade" # Must be given
DaVinci().EvtMax = 100 # 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
CondDB().Upgrade = True
DaVinci().CondDBtag = "sim-20171127-vc-md100"
DaVinci().DDDBtag = "dddb-20171126"
......@@ -31,7 +31,7 @@ DaVinci().HistogramFile = "dst-unpacking.root"
########################################################################
from Configurables import TrackMonitor
DaVinci().UserAlgorithms += [ TrackMonitor() ]
DaVinci().UserAlgorithms += [TrackMonitor()]
########################################################################
......
###############################################################################
# (c) Copyright 2000-2018 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. #
###############################################################################
"""
@ Created by R. LAmbert
@ date 2009-11-20
Mu selection for tests
Long track muons with PT > 1 GeV
"""
__author__ = 'R. Lambert'
__date__ = 'November 2009'
import GaudiKernel.SystemOfUnits as Units
from Gaudi.Configuration import *
from Configurables import FilterDesktop, DaVinci
from PhysSelPython.Wrappers import Selection, DataOnDemand, SelectionSequence
from StandardParticles import StdLooseMuons as MyStdMuons
MuForTests = FilterDesktop("_bachelorMu")
MuForTests.Code = "((ISLONG) & (PT > 250.*MeV))"
SelMuForTests = Selection(
"BachelorMuForTests",
Algorithm=MuForTests,
RequiredSelections=[MyStdMuons])
from Configurables import CheckPV
checkPV = CheckPV('TestCheckPV')
TestSequence = SelectionSequence(
"TestSeq", TopSelection=SelMuForTests, EventPreSelector=[checkPV])
dv = DaVinci()
DaVinci().UserAlgorithms = [TestSequence.sequence()]
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# (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". #
......
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# (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". #
......
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# (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". #
......
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# (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". #
......
###############################################################################
# (c) Copyright 2000-2018 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. #
###############################################################################
"""Check ntuples made from Turbo MC input for correct truth-matching."""
from __future__ import print_function
import sys
import ROOT
tree_branches = {
'TupleDstToD0pi_D0ToKpi': (['Dst', 'D0'], ['D0_K', 'D0_pi', 'Dst_pi']),
'TupleLcTopKpi': (['Lc'], ['Lc_p', 'Lc_K', 'Lc_pi']),
'TupleScToLcpi_LcTopKpi': (['Sc', 'Lc'], ['Lc_p', 'Lc_K', 'Lc_pi', 'Sc_pi'])
}
fname = sys.argv[-2]
tname = sys.argv[-1]
assert fname.endswith('.root'), 'Expected a ROOT file as input, got: ' + fname
assert tname in tree_branches, 'Cannot handle given tree, got: ' + tname
print('Looking at file {0!r}, tree {1!r}'.format(fname, tname))
composites, children = tree_branches[tname]
f = ROOT.TFile(fname)
t = f.Get('{0}/DecayTree'.format(tname))
assert t.GetEntries() > 0, 'Expected non-zero number of entries'
print('Found {0} entries'.format(t.GetEntries()))
# If the truth-matching fails, we'd see BKGCAT == 60 for all entries
for p in composites:
condition = '{0}_BKGCAT < 20'.format(p)
assert t.GetEntries(condition) > 0, \
'Expected non-zero number of entries with {0}'.format(condition)
print('OK: {0!r}'.format(condition))
# If the truth-matching fails, we'd see TRUEID == 0 for all entries
for p in composites + children:
condition = '{0}_TRUEID != 0'.format(p)
assert t.GetEntries(condition) > 0, \
'Expected non-zero number of entries with {0}'.format(condition)
print('OK: {0!r}'.format(condition))
f.Close()
###############################################################################
# (c) Copyright 2000-2018 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. #
###############################################################################
from Gaudi.Configuration import *
from Configurables import LHCbApp, CondDB, DDDBConf
dataType="2010"
DDDBConf(DataType=dataType)
CondDB(IgnoreHeartBeat=True)
if "UseLatestTags" in CondDB().__slots__:
CondDB().UseLatestTags=[dataType, True]
else:
CondDB().useLatestTags(DataType=dataType, OnlyGlobalTags=True)
###############################################################################
# (c) Copyright 2000-2018 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. #
###############################################################################
from Gaudi.Configuration import *
from Configurables import LHCbApp, CondDB, DDDBConf
dataType="2010"
DDDBConf(DataType=dataType)
CondDB(IgnoreHeartBeat=True)
if "UseLatestTags" in CondDB().__slots__:
CondDB().UseLatestTags=[dataType]
else:
CondDB().useLatestTags(DataType=dataType, OnlyGlobalTags=False)
###############################################################################
# (c) Copyright 2000-2018 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. #
###############################################################################
from PRConfig import TestFileDB
from Configurables import DaVinci
TestFileDB.test_file_db["2012_DaVinciTests.stripping.test_express_appconfig"].run(configurable=DaVinci())
###############################################################################
# (c) Copyright 2000-2018 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. #
###############################################################################
from Gaudi.Configuration import *
from Configurables import InputCopyStream
InputCopyStream().Output = "DATAFILE='PFN:DaVinci-Merged-2010.dst' TYP='POOL_ROOTTREE' OPT='REC'"
ApplicationMgr().EvtMax = -1
from Configurables import RecordStream
FileRecords = RecordStream("FileRecords")
FileRecords.Output = "DATAFILE='PFN:DaVinci-Merged-2010.dst' TYP='POOL_ROOTTREE' OPT='REC'"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment