######################################################################## from Gaudi.Configuration import * from Configurables import DecayTreeTuple, PhysDesktop from Configurables import CombineParticles, FilterDesktop from Configurables import TupleToolTrigger, BackgroundCategory, TupleToolTISTOS from Configurables import DaVinci,HltSelReportsDecoder,HltVertexReportsDecoder,HltDecReportsDecoder from Configurables import CombineParticles, PhysDesktop from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand # # MC matching # matchkaonFromD0 = "(mcMatch('[D0 -> ^K- pi+]CC'))" matchpionFromD0 = "(mcMatch('[D0 -> K- ^pi+]CC'))" matchkaonFromKst = "(mcMatch('[K*(892)0 -> ^K+ pi-]CC'))" matchpionFromKst = "(mcMatch('[K*(892)0 -> K+ ^pi-]CC'))" matchD0 = "(mcMatch('Beauty => ^D0 K*(892)~0'))" matchD0bar = "(mcMatch('Beauty => ^D~0 K*(892)0'))" matchKst = "(mcMatch('Beauty => D~0 ^K*(892)0'))" matchKstbar = "(mcMatch('Beauty => D0 ^K*(892)~0'))" # # Create selection sequence # _pions = DataOnDemand(Location='Phys/StdNoPIDsPions') _kaons = DataOnDemand(Location='Phys/StdNoPIDsKaons') _d2hh = CombineParticles("d2hh") _d2hh.DecayDescriptor = "[D0 -> K- pi+]cc" _d2hh.DaughtersCuts = { "K-" : matchkaonFromD0 , "pi+" : matchpionFromD0 } _d2hh.MotherCut = "(VFASPF(VCHI2/VDOF)<100)" _d2hh.Preambulo = [ "from LoKiPhysMC.decorators import *", "from PartProp.Nodes import CC" ] SelD2hh = Selection( "SelD2hh", Algorithm= _d2hh, RequiredSelections=[_pions,_kaons] ) _kst2hh = CombineParticles("kst2hh") _kst2hh.DecayDescriptor = "[K*(892)0 -> K+ pi-]cc" _kst2hh.DaughtersCuts = { "K-" : matchkaonFromKst , "pi+" : matchpionFromKst } _kst2hh.MotherCut = "(VFASPF(VCHI2/VDOF)<100)" _kst2hh.Preambulo = [ "from LoKiPhysMC.decorators import *", "from PartProp.Nodes import CC" ] SelKst2hh = Selection( "SelKst2hh", Algorithm= _kst2hh, RequiredSelections=[_pions,_kaons] ) _b2dkst = CombineParticles("b2dkst") _b2dkst.DecayDescriptor = "[B0 -> D~0 K*(892)0]cc" _b2dkst.DaughtersCuts = { "D0" : "("+matchD0+" | "+matchD0bar+")" , "K*(892)0" : "("+matchKst+" | "+matchKstbar+")" } _b2dkst.MotherCut = "(VFASPF(VCHI2/VDOF)<100)" _b2dkst.Preambulo = [ "from LoKiPhysMC.decorators import *", "from PartProp.Nodes import CC" ] SelB2D0Kst = Selection( "SelB2D0Kst", Algorithm = _b2dkst, RequiredSelections=[SelD2hh,SelKst2hh] ) SeqB2D0Kst = SelectionSequence('SeqB2D0Kst',TopSelection = SelB2D0Kst) # # Make the tuple for validation # B2D0Kst_FromMC_Tree = DecayTreeTuple("B2D0Kst_FromMC_Tree") B2D0Kst_FromMC_Tree.InputLocations = ["/Event/Phys/B2D0Kstar"] B2D0Kst_FromMC_Tree.Decay = "[[B0]cc => (^D~0 => ^K+ ^pi-) (^K*(892)0 => ^K+ ^pi-)]cc" B2D0Kst_FromMC_Tree.ToolList = ["TupleToolKinematic", "TupleToolPid", "TupleToolGeometry", "TupleToolPrimaries", "TupleToolTrackInfo", "TupleToolPropertime"] B2D0Kst_FromMC_Tree.UseLabXSyntax = True B2D0Kst_FromMC_Tree.RevertToPositiveID = False # # Write DST # from Configurables import SelDSTWriter, DaVinci dstWriter = SelDSTWriter("B2D0Kst_FromMC_Writer", SelectionSequences = [SeqB2D0Kst], #OutputFileSuffix = '/castor/cern.ch/user/c/cmthomas/OfflineDSTsForTriggerOptimization/OffReco_B2D0Kst_MC2010') OutputFileSuffix = '/tmp/edsmith/B02D0Kst_MC2010magdown11164011') # # Configure DaVinci # from Configurables import DaVinci DaVinci().EvtMax = -1 # Number of events DaVinci().SkipEvents = 0 # Events to skip DaVinci().PrintFreq = 1000 DaVinci().DataType = "2010" # Default is "DC06" DaVinci().Simulation = True DaVinci().HistogramFile = "dummy_histos.root" # Histogram file DaVinci().TupleFile = "dummy_tuple.root" # Ntuple DaVinci().UserAlgorithms = [SeqB2D0Kst.sequence(),B2D0Kst_FromMC_Tree,dstWriter.sequence()] #DaVinci().UserAlgorithms = [SeqB2D0Kst.sequence(),dstWriter.sequence()] DaVinci().RedoMCLinks = True DaVinci().EnableUnpack = True DaVinci().CondDBtag = "sim-20100831-vc-mu100" DaVinci().DDDBtag = "head-20100119" DaVinci().MainOptions = '/afs/cern.ch/user/e/edsmith/B2D0Kst0/data/PFNs/MC_2010_Sim3Reco3_11164011magdown_pfn.py' # Use the CondDB to get the right database tags from Configurables import CondDB CondDB(UseOracle = False, DisableLFC = True, IgnoreHeartBeat = True)