Difference: HowToWriteaDST (1 vs. 2)

Revision 22010-12-10 - EdmundSmith

 
META TOPICPARENT name="HowTos"
Deleted:
<
<
########################################################################
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 = '/tmp/edsmith/B02D0Kst_MC2010magdown11164011') #actually a prefix, will be followed by ".SeqB2D0Kst.dst"

#
# 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 = '<DATA>.py' #here you put the data you want to make a dst from

# Use the CondDB to get the right database tags
from Configurables import CondDB
CondDB(UseOracle = False, DisableLFC = True, IgnoreHeartBeat = True)

 -- EdmundSmith - 2010-12-09
Added:
>
>

META FILEATTACHMENT attachment="B2D0Kst-D2Kpi.py.txt" attr="" comment="DST writing script." date="1291982122" name="B2D0Kst-D2Kpi.py.txt" path="B2D0Kst-D2Kpi.py" size="4685" stream="B2D0Kst-D2Kpi.py" tmpFilename="/usr/tmp/CGItemp8325" user="EdmundSmith" version="1"
 

Revision 12010-12-09 - EdmundSmith

 
META TOPICPARENT name="HowTos"
########################################################################
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 = '/tmp/edsmith/B02D0Kst_MC2010magdown11164011') #actually a prefix, will be followed by ".SeqB2D0Kst.dst"

#
# 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 = '<DATA>.py' #here you put the data you want to make a dst from

# Use the CondDB to get the right database tags
from Configurables import CondDB
CondDB(UseOracle = False, DisableLFC = True, IgnoreHeartBeat = True)

-- EdmundSmith - 2010-12-09

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback