Exemplo n.º 1
0
    tup.ToolList = [
        "MCTupleToolHierarchy",
        "MCTupleToolKinematic",
        "LoKi::Hybrid::MCTupleTool/LoKi_Photos"  # doesn't work with DaVinci v36r6
    ]
    tup.addTool(TupleToolMCTruth, name="TruthTool")
    tup.addTool(TupleToolMCBackgroundInfo, name="BackgroundInfo")
    tup.ToolList += ["TupleToolMCTruth/TruthTool"]
    tup.ToolList += ["TupleToolMCBackgroundInfo/BackgroundInfo"]

if OUTPUTLEVEL == DEBUG:
    from Configurables import PrintMCTree, PrintMCDecayTreeTool
    mctree = PrintMCTree("PrintTrue")
    mctree.addTool(PrintMCDecayTreeTool)
    mctree.PrintMCDecayTreeTool.Information = "Name M P Px Py Pz Pt Vx Vy Vz"
    mctree.ParticleNames = ["B+", "B-"]
    mctree.Depth = 3  # down to the K and mu

#########################################################################################################
# Now set up the DecayTreeTuples for the reconstructed particles
#########################################################################################################
tupletools = []
tupletools.append("TupleToolPrimaries")
tupletools.append("TupleToolKinematic")
tupletools.append("TupleToolGeometry")
tupletools.append("TupleToolTrackInfo")
tupletools.append("TupleToolPid")
tupletools.append("TupleToolRecoStats")
tupletools.append("TupleToolEventInfo")
triglist = [
    "L0PhysicsDecision", "L0MuonDecision", "L0DiMuonDecision",
Exemplo n.º 2
0
    tup.addTool(LoKi_Photos)
    tup.ToolList  = [ "MCTupleToolHierarchy"
            , "MCTupleToolKinematic"
            , "LoKi::Hybrid::MCTupleTool/LoKi_Photos" # doesn't work with DaVinci v36r6
            ]
    tup.addTool(TupleToolMCTruth, name = "TruthTool")
    tup.addTool(TupleToolMCBackgroundInfo, name = "BackgroundInfo")
    tup.ToolList += ["TupleToolMCTruth/TruthTool"]
    tup.ToolList += ["TupleToolMCBackgroundInfo/BackgroundInfo"]

if OUTPUTLEVEL == DEBUG:
    from Configurables import PrintMCTree, PrintMCDecayTreeTool
    mctree = PrintMCTree("PrintTrue")
    mctree.addTool( PrintMCDecayTreeTool )
    mctree.PrintMCDecayTreeTool.Information = "Name M P Px Py Pz Pt Vx Vy Vz"
    mctree.ParticleNames = [ "B+", "B-" ]
    mctree.Depth = 3  # down to the K and mu

#########################################################################################################
# Now set up the DecayTreeTuples for the reconstructed particles
#########################################################################################################
tupletools = []
tupletools.append("TupleToolPrimaries")
tupletools.append("TupleToolKinematic")
tupletools.append("TupleToolGeometry")
tupletools.append("TupleToolTrackInfo")
tupletools.append("TupleToolPid")
tupletools.append("TupleToolRecoStats")
tupletools.append("TupleToolEventInfo")
triglist = [
     "L0PhysicsDecision"
Exemplo n.º 3
0
        del algs[b]

    dod.AlgMap = algs

    from Configurables import EventClockSvc, CondDB 
    EventClockSvc ( EventTimeDecoder = "FakeEventTime" )
    CondDB  ( IgnoreHeartBeat = True )

appendPostConfigAction( doIt)
mctl=[  'MCTupleToolHierarchy', 'MCTupleToolKinematic', 'MCTupleToolPrimaries']
#mctl=[  'MCTupleToolKinematic']
mct.ToolList=mctl 
#mctB.ToolList=mctl 

printMC = PrintMCTree()
printMC.ParticleNames = ["Lambda_c+","Lambda_c~-"]
printMC.ParticleNames = ["D0","D~0"]
printMC.ParticleNames = ["Xi_cc++","Xi_cc~--"]
printMC.ParticleNames = ["B0","B~0"]
printMC.ParticleNames = ["B+","B-"]




########################################################################
from Configurables import DaVinci
DaVinci().EvtMax = -1
#DaVinci().PrintFreq = 1
#DaVinci().SkipEvents = 4                       # Events to skip
DaVinci().DataType = "2018"
DaVinci().Simulation   =  True
Exemplo n.º 4
0
    DaVinci().appendToMainSequence( [ eventNodeKiller, sc.sequence() ] )

    # MC Tuples
    addMCTuple('phi2KsKs', '[phi(1020) -> ^(KS0 -> ^pi+ ^pi-) ^(KS0 -> ^pi+ ^pi-)]CC')
    addMCTuple('phi2KsKl', '[phi(1020) -> ^(KS0 -> ^pi+ ^pi-) ^(KL0 -> ^pi+ ^pi-)]CC')
    addMCTuple('Ds_phi2KsKl', '[D_s+ -> ^(phi(1020) -> ^(KS0 -> ^pi+ ^pi-) ^(KS0 -> ^pi+ ^pi-)) ^pi+]CC')
    if 'minbias' in dataSample.name:
        addMCTuple('phi2KK', '[phi(1020) -> ^K- ^K-]CC')
        # addMCTuple('KsKs', '[(KS0 -> ^pi+ ^pi-)cc && (KS0 -> ^pi+ ^pi-)cc]')
        addMCTuple('Ks', '[KS0 -> ^pi+ ^pi-]CC')

    from Configurables import PrintMCTree, PrintMCDecayTreeTool
    mctree = PrintMCTree("PrintTruePhi")
    mctree.addTool(PrintMCDecayTreeTool, name = "PrintMC")
    mctree.PrintMC.Information = "Name"
    mctree.ParticleNames = [ "phi(1020)", 'KS0' ]
    mctree.Depth = 2
   
    
###########################################################

for strLine in [Phi2KsKs_line]:
    strLine.select()
    strLine.makeTuple()

    DaVinci().appendToMainSequence( [ strLine.sequence.sequence() ])


DaVinci().HistogramFile = "DVHistos.root"
DaVinci().TupleFile = dataSample.outputNtupleName
Exemplo n.º 5
0
    # MC Tuples
    addMCTuple("phi2KsKs", "[phi(1020) -> ^(KS0 -> ^pi+ ^pi-) ^(KS0 -> ^pi+ ^pi-)]CC")
    addMCTuple("phi2KsKl", "[phi(1020) -> ^(KS0 -> ^pi+ ^pi-) ^(KL0 -> ^pi+ ^pi-)]CC")
    # if 'minbias' in dataSample.name:
    #     addMCTuple('phi2KK', '[phi(1020) -> ^K+ ^K-]CC')
    #     addMCTuple('phi2K0K0', '[phi(1020) -> ^KS0 ^KL0]CC')
    #     # addMCTuple('KsKs', '[(KS0 -> ^pi+ ^pi-)cc && (KS0 -> ^pi+ ^pi-)cc]')
    #     addMCTuple('Ks', '[KS0 -> ^pi+ ^pi-]CC')

    from Configurables import PrintMCTree, PrintMCDecayTreeTool

    mctree = PrintMCTree("PrintTruePhi")
    mctree.addTool(PrintMCDecayTreeTool, name="PrintMC")
    mctree.PrintMC.Information = "Name"
    mctree.ParticleNames = ["phi(1020)", "KS0"]
    mctree.Depth = 2


###########################################################

for strLine in [Phi2KsKs_line]:
    strLine.select()
    strLine.makeTuple()

    DaVinci().appendToMainSequence([strLine.sequence.sequence()])


DaVinci().HistogramFile = "DVHistos.root"
DaVinci().TupleFile = dataSample.outputNtupleName
Exemplo n.º 6
0
tuple.Ks2.addTool(LoKi_Ks2)

MCTruth = TupleToolMCTruth() 
MCTruth.ToolList = ["MCTupleToolKinematic",
	 	"MCTupleToolHierarchy"]
tuple.addTool(MCTruth)

mctuple = MCDecayTreeTuple()
mctuple.Decay = '[phi(1020) -> ^(KS0 => ^pi+ ^pi-) ^(KS0 => ^pi+ ^pi-)]CC' 
mctuple.ToolList += [ "MCTupleToolKinematic",
			"MCTupleToolHierarchy",
			"MCTupleToolReconstructed",
			#"MCTupleToolDalitz",
			"MCTupleToolAngles"
 ]

from Configurables import PrintMCTree, PrintMCDecayTreeTool
mctree = PrintMCTree("PrintTruePhi")
mctree.addTool(PrintMCDecayTreeTool, name = "PrintMC")
mctree.PrintMC.Information = "Name"
mctree.ParticleNames = [ "phi(1020)" ]
mctree.Depth = 2

#EvtTypeSvc().EvtTypesFile="/afs/cern.ch/user/j/jrharris/ParticleTable.txt"
tuple.TupleName = "Phi2KsKs"
mctuple.TupleName = "Phi2KsKs"
#######################################################################
#######################################################################
DaVinci().appendToMainSequence( [ sc.sequence() ] )
DaVinci().UserAlgorithms = [ mctuple, tuple]
Exemplo n.º 7
0
# For a quick and dirty check, you don't need to edit anything below here.
##########################################################################

# Create an MC DTT containing any candidates matching the decay descriptor
mctuple = MCDecayTreeTuple("MCDecayTreeTuple")
mctuple.Decay = decay
mctuple.ToolList = ["MCTupleToolHierarchy", "LoKi::Hybrid::MCTupleTool/LoKi_Photos"]
# Add a 'number of photons' branch
# mctuple.addTupleTool("MCTupleToolReconstructed").Associate = False
# mctuple.MCTupleToolReconstructed.FillPID = False
mctuple.addTupleTool("MCTupleToolKinematic").Verbose = True
mctuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Photos").Variables = {"nPhotos": "MCNINTREE(('gamma' == MCABSID))"}
mctuple.addTupleTool("MCTupleToolP2VV").Calculator = "MCBs2JpsiPhiAngleCalculator"

# Print the decay tree for any particle in decay_heads
printMC = PrintMCTree()
printMC.ParticleNames = decay_heads

# Name of the .xgen file produced by Gauss
EventSelector().Input = ["DATAFILE='{0}' TYP='POOL_ROOTTREE' Opt='READ'".format(datafile) for datafile in datafiles]

# Configure DaVinci
DaVinci().PrintFreq = 10000
DaVinci().TupleFile = "/Disk/speyside8/lhcb/gcowan1/generation/Bs2JpsiPhi/DVntuple.root"
DaVinci().Simulation = True
DaVinci().Lumi = False
DaVinci().DataType = str(year)
# DaVinci().UserAlgorithms = [printMC, mctuple]
DaVinci().UserAlgorithms = [mctuple]
Exemplo n.º 8
0
mctuple = MCDecayTreeTuple("MCDecayTreeTuple")
mctuple.Decay = decay
mctuple.ToolList = [
    "MCTupleToolHierarchy",
    "LoKi::Hybrid::MCTupleTool/LoKi_Photos"
]
# Add a 'number of photons' branch
#mctuple.addTupleTool("MCTupleToolReconstructed").Associate = False
#mctuple.MCTupleToolReconstructed.FillPID = False
mctuple.addTupleTool("MCTupleToolKinematic").Verbose = True
mctuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Photos").Variables = {
    "nPhotos": "MCNINTREE(('gamma' == MCABSID))"
}
mctuple.addTupleTool("MCTupleToolP2VV").Calculator = 'MCBs2JpsiPhiAngleCalculator'

# Print the decay tree for any particle in decay_heads
printMC = PrintMCTree()
printMC.ParticleNames = decay_heads

# Name of the .xgen file produced by Gauss
EventSelector().Input = ["DATAFILE='{0}' TYP='POOL_ROOTTREE' Opt='READ'".format(datafile) for datafile in datafiles]

# Configure DaVinci
DaVinci().PrintFreq = 10000
DaVinci().TupleFile = "/Disk/speyside8/lhcb/gcowan1/generation/Bs2JpsiPhi/DVntuple.root"
DaVinci().Simulation = True
DaVinci().Lumi = False
DaVinci().DataType = str(year)
#DaVinci().UserAlgorithms = [printMC, mctuple]
DaVinci().UserAlgorithms = [mctuple]
Exemplo n.º 9
0
#
# @author Patrick Koppenburg
# @date 2009-02-04
#
########################################################################
from Gaudi.Configuration import *
from Configurables import DaVinci
##############################################################################
#
# Print the J/psi
#
from Configurables import PrintDecayTree, PrintHeader, PrintMCTree
pJpsi = PrintDecayTree('PrintJpsi')
pJpsi.Inputs = ["MyJpsi"]
pMC = PrintMCTree()
pMC.ParticleNames = ['J/psi(1S)']
#
ph = PrintHeader()
#
from Configurables import DecayTreeTuple
tuple = DecayTreeTuple("Tuple")
tuple.Inputs = ["MyJpsi"]
tuple.ToolList += [
    "TupleToolMCBackgroundInfo", "TupleToolMCTruth", "TupleToolKinematic"
]
tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-"

##############################################################################
#
#
##############################################################################
Exemplo n.º 10
0
mctuple.ToolList = [ "MCTupleToolHierarchy"
                                          , "MCTupleToolKinematic"
                                          , "LoKi::Hybrid::MCTupleTool/LoKi_Photos"
                                          ]

mctuple.addTool(MCTupleToolKinematic())
mctuple.MCTupleToolKinematic.Verbose=True

# LoKi variables
LoKi_Photos = LoKi__Hybrid__MCTupleTool("LoKi_Photos")
LoKi_Photos.Variables = {
    "nPhotos"  : "MCNINTREE ( ('gamma'==MCABSID) )"
        }
mctuple.addTool(LoKi_Photos)

pMC = PrintMCTree()
pMC.ParticleNames = [ DecayHeader ]

DaVinci().TupleFile  = 'tupleProduction-'+EventType+'.root' 
DaVinci().EvtMax     = -1
DaVinci().Simulation = True 
DaVinci().Lumi       = False
DaVinci().InputType  = "DST" 
DaVinci().DataType   = "2012" 
DaVinci().UserAlgorithms = [ pMC, mctuple ]

EventSelector().Input = [  
"DATAFILE='Gauss-%s.xgen'  TYP='POOL_ROOTTREE' Opt='READ'"%EventType
]

Exemplo n.º 11
0
mcTuple = MCDecayTreeTuple("MCTuple")
mcTuple.Decay = "( [ [B0]nos => ^( J/psi(1S) => ^mu+ ^mu- ) ^( KS0 => ^pi+ ^pi- ) ]CC ) || ( [ [B0]os -> ^( J/psi(1S) => ^mu+ ^mu- ) ^( KS0 => ^pi+ ^pi- ) ]CC )"
mcTuple.ToolList = [
    "MCTupleToolKinematic", "TupleToolEventInfo", "MCTupleToolReconstructed"
]
from Configurables import MCTupleToolReconstructed, MCReconstructed
#ToolSvc().addTool(MCReconstructed)
#ToolSvc().MCReconstructed.OutputLevel = 1

#mcTuple.OutputLevel = 1

from Configurables import PrintMCTree

pmc = PrintMCTree()
pmc.ParticleNames = ["B0", "B~0"]
########################################################################
#
# DaVinci
#
from Configurables import DaVinci

DaVinci().EvtMax = 100
DaVinci().SkipEvents = 0
DaVinci().DataType = "2010"
DaVinci().Simulation = True
#DaVinci().CondDBtag = 'MC09-20100827-vc-md100'
DaVinci().TupleFile = "DecayTreeTuple.root"  # Ntuple
DaVinci().MoniSequence = [tuple, evtTuple, mcTuple]  # , pmc ]
DaVinci().appendToMainSequence([sc.sequence()])
Exemplo n.º 12
0
#
from Configurables import PrintDecayTree, PrintDecayTreeTool
tree = PrintDecayTree("PrintFoundBs")
tree.Inputs = [SeqBs2JpsiPhi.outputLocation()]
tree.addTool(PrintDecayTreeTool, name="PrintDecay")
tree.PrintDecay.Information = "Name M P Px Py Pz Pt chi2"
DaVinci().MoniSequence = [tree]  # The monitoring stuff
#######################################################################
#
# Print  Print All True Bs (only on MC)
#
from Configurables import PrintMCTree, PrintMCDecayTreeTool
mctree = PrintMCTree("PrintTrueBs")
mctree.addTool(PrintMCDecayTreeTool)
mctree.PrintMCDecayTreeTool.Information = "Name M P Px Py Pz Pt chi2"
mctree.ParticleNames = ["B_s0", "B_s~0"]
mctree.Depth = 2  # down to the K and mu
DaVinci().MoniSequence += [mctree]  # The monitoring stuff
#######################################################################
#
# Configure the application
#
DaVinci().UserAlgorithms = [seq]  # The selection sequence
DaVinci().HistogramFile = "DVHistos_5.root"  # Histogram file
DaVinci().EvtMax = 1000  # Number of events
DaVinci().DataType = "2012"  #
DaVinci().Simulation = True
#
# Add our own stuff
#
DaVinci().UserAlgorithms = [seq]
Exemplo n.º 13
0
                        MaxCandidates = 2000,
                        AcceptBadEvents = False,
                        BadEventSelection = filterBadEvents )

    DaVinci().appendToMainSequence( [ eventNodeKiller, sc.sequence() ] )

    # MC Tuples
    addMCTuple('JPsi2KsKs', '[J/psi(1S) -> ^(KS0 -> ^pi+ ^pi-) ^(KS0 -> ^pi+ ^pi-)]CC')
    addMCTuple('JPsi2KsKl', '[J/psi(1S) -> ^(KS0 -> ^pi+ ^pi-) ^(KL0 -> ^pi+ ^pi-)]CC')


    from Configurables import PrintMCTree, PrintMCDecayTreeTool
    mctree = PrintMCTree("PrintTrueJPsi")
    mctree.addTool(PrintMCDecayTreeTool, name = "PrintMC")
    mctree.PrintMC.Information = "Name"
    mctree.ParticleNames = [ "J/psi(1S)", 'KS0' ]
    mctree.Depth = 2
   
    
###########################################################

for strLine in [JPsi2KsKs_line]:
    strLine.select()
    strLine.makeTuple()

    DaVinci().appendToMainSequence( [ strLine.sequence.sequence() ])


DaVinci().HistogramFile = "HistogramFile.root"
DaVinci().TupleFile = dataSample.outputNtupleName