First commit, not including the most of the Codes/ folder
This commit is contained in:
parent
0a3026985e
commit
94acfa56a1
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# Ignore files created when compiling
|
||||
|
||||
*.d
|
||||
*.so
|
||||
*.pcm
|
||||
*.pyc
|
||||
|
||||
|
||||
|
||||
# BUT keep these files
|
||||
|
||||
# !filetokeep.so
|
54
Code/EventGenerator/Gauss-Job_StandAlone.py
Executable file
54
Code/EventGenerator/Gauss-Job_StandAlone.py
Executable file
@ -0,0 +1,54 @@
|
||||
#
|
||||
# Options specific for a given job
|
||||
# ie. setting of random number seed and name of output files
|
||||
#
|
||||
|
||||
event_type = "12113100" #SigMC
|
||||
#event_type = "12143401" #RefMC
|
||||
#event_type = "12113446" #PHSP
|
||||
|
||||
from Gauss.Configuration import *
|
||||
importOptions("$APPCONFIGOPTS/Gauss/Beam6500GeV-md100-2017-nu1.6.py")
|
||||
importOptions("$DECFILESROOT/options/"+event_type+".py")
|
||||
importOptions("$LBPYTHIA8ROOT/options/Pythia8.py")
|
||||
|
||||
|
||||
#--Generator phase, set random numbers
|
||||
GaussGen = GenInit("GaussGen")
|
||||
GaussGen.FirstEventNumber = 1
|
||||
GaussGen.RunNumber = 1234
|
||||
|
||||
#--Number of events
|
||||
LHCbApp().EvtMax = 100000
|
||||
LHCbApp().DDDBtag = 'dddb-20170721-3'
|
||||
LHCbApp().CondDBtag = 'sim-20170721-2-vc-md100'
|
||||
LHCbApp().OutputLevel = WARNING
|
||||
MessageSvc().OutputLevel = WARNING
|
||||
|
||||
#Gauss().OutputType = 'NONE'
|
||||
#Gauss().Histograms = 'NONE'
|
||||
#--Set name of output files for given job (uncomment the lines)
|
||||
# Note that if you do not set it Gauss will make a name based on event type,
|
||||
# number of events and the date
|
||||
#idFile = 'GaussTest'
|
||||
#HistogramPersistencySvc().OutputFile = idFile+'-histos.root'
|
||||
#
|
||||
#OutputStream("GaussTape").Output = "DATAFILE='PFN:%s.sim' TYP='POOL_ROOTTREE' OPT='RECREATE'"%idFile
|
||||
|
||||
#GenMonitor = GaudiSequencer( "GenMonitor" )
|
||||
#SimMonitor = GaudiSequencer( "SimMonitor" )
|
||||
#GenMonitor.Members += [ "GaussMonitor::CheckLifeTimeHepMC/HepMCLifeTime" ]
|
||||
#SimMonitor.Members += [ "GaussMonitor::CheckLifeTimeMC/MCLifeTime" ]
|
||||
|
||||
gtos = GenerationToSimulation()
|
||||
gtos.SkipGeant = True
|
||||
gs = GaudiSequencer("GenMonitor")
|
||||
MCTruthStream = OutputStream("MCTruthStream")
|
||||
MCTruthStream.ItemList += [ "/Event/Gen#1", "/Event/Gen/HepMCEvents#1", "/Event/MC#1", "/Event/MC/Header#1", "/Event/MC/Particles#1", "/Event/MC/Vertices#1" ]
|
||||
MCTruthStream.Output = "DATAFILE='MCTruth.sim' TYP='POOL_ROOTTREE' OPT='RECREATE'"
|
||||
gs.Members += [ SimInit(), gtos, MCTruthStream ]
|
||||
|
||||
Gauss().Phases = ["Generator"]
|
||||
#Gauss().Phases = ["Generator","GenToMCTree"]
|
||||
Gauss().OutputType = 'NONE'
|
||||
Gauss().Histograms = 'NONE'
|
14
Code/EventGenerator/JobStandAloneKSpiSignalMC.py
Normal file
14
Code/EventGenerator/JobStandAloneKSpiSignalMC.py
Normal file
@ -0,0 +1,14 @@
|
||||
#Event Type: 12115102
|
||||
from Configurables import Generation
|
||||
Generation().EventType = 12115102
|
||||
from Configurables import StandAloneDecayTool
|
||||
Generation().SampleGenerationTool = "StandAloneDecayTool";
|
||||
Generation().addTool( StandAloneDecayTool )
|
||||
Generation().StandAloneDecayTool.ProductionTool = "PythiaProduction";
|
||||
|
||||
from Configurables import ToolSvc
|
||||
from Configurables import EvtGenDecay
|
||||
|
||||
ToolSvc().addTool( EvtGenDecay )
|
||||
ToolSvc().EvtGenDecay.UserDecayFile ="$DECFILESROOT/dkfiles/Bu_Kstmumu,KSpi=DecProdCut.dec"
|
||||
Generation().StandAloneDecayTool.SignalPIDList = [ 521,-521 ]
|
14
Code/EventGenerator/JobStandAloneKSpiTightCut.py
Normal file
14
Code/EventGenerator/JobStandAloneKSpiTightCut.py
Normal file
@ -0,0 +1,14 @@
|
||||
#Event Type: 12115178
|
||||
from Configurables import Generation
|
||||
Generation().EventType = 12115179
|
||||
from Configurables import StandAloneDecayTool
|
||||
Generation().SampleGenerationTool = "StandAloneDecayTool";
|
||||
Generation().addTool( StandAloneDecayTool )
|
||||
Generation().StandAloneDecayTool.ProductionTool = "PythiaProduction";
|
||||
|
||||
from Configurables import ToolSvc
|
||||
from Configurables import EvtGenDecay
|
||||
|
||||
ToolSvc().addTool( EvtGenDecay )
|
||||
ToolSvc().EvtGenDecay.UserDecayFile ="$DECFILESROOT/dkfiles/Bu_Kstmumu,KSpi=PHSP,flatq2,DecProdCut,TightCut.dec"#Bu_Kstmumu\,KSpi\=PHSP\,flatq2\,DecProdCut\,MomCut.dec
|
||||
Generation().StandAloneDecayTool.SignalPIDList = [ 521,-521 ]
|
14
Code/EventGenerator/JobStandAlone_KpPi0_PHSPMC.py
Normal file
14
Code/EventGenerator/JobStandAlone_KpPi0_PHSPMC.py
Normal file
@ -0,0 +1,14 @@
|
||||
#Event Type: 12115102
|
||||
from Configurables import Generation
|
||||
Generation().EventType = 12113446
|
||||
#from Configurables import StandAloneDecayTool
|
||||
Generation().SampleGenerationTool = "StandAloneDecayTool";
|
||||
Generation().addTool( StandAloneDecayTool )
|
||||
Generation().StandAloneDecayTool.ProductionTool = "PythiaProduction";
|
||||
|
||||
from Configurables import ToolSvc
|
||||
from Configurables import EvtGenDecay
|
||||
|
||||
ToolSvc().addTool( EvtGenDecay )
|
||||
ToolSvc().EvtGenDecay.UserDecayFile ="$DECFILESROOT/dkfiles/Bu_Kstmumu,Kpi0=PHSP,flatq2,DecProdCut,TightCut.dec"
|
||||
Generation().StandAloneDecayTool.SignalPIDList = [ 521,-521 ]
|
14
Code/EventGenerator/JobStandAlone_KpPi0_ReferenceMC.py
Normal file
14
Code/EventGenerator/JobStandAlone_KpPi0_ReferenceMC.py
Normal file
@ -0,0 +1,14 @@
|
||||
#Event Type: 12115102
|
||||
from Configurables import Generation
|
||||
Generation().EventType = 12143401
|
||||
#from Configurables import StandAloneDecayTool
|
||||
#Generation().SampleGenerationTool = "StandAloneDecayTool";
|
||||
#Generation().addTool( StandAloneDecayTool )
|
||||
#Generation().StandAloneDecayTool.ProductionTool = "PythiaProduction";
|
||||
|
||||
from Configurables import ToolSvc
|
||||
from Configurables import EvtGenDecay
|
||||
|
||||
ToolSvc().addTool( EvtGenDecay )
|
||||
ToolSvc().EvtGenDecay.UserDecayFile ="$DECFILESROOT/dkfiles/Bu_JpsiKst,mm,Kpi0=DecProdCut.dec"
|
||||
#Generation().StandAloneDecayTool.SignalPIDList = [ 521,-521 ]
|
14
Code/EventGenerator/JobStandAlone_KpPi0_SignalMC.py
Normal file
14
Code/EventGenerator/JobStandAlone_KpPi0_SignalMC.py
Normal file
@ -0,0 +1,14 @@
|
||||
#Event Type: 12115102
|
||||
from Configurables import Generation
|
||||
Generation().EventType = 12113100
|
||||
from Configurables import StandAloneDecayTool
|
||||
Generation().SampleGenerationTool = "StandAloneDecayTool";
|
||||
Generation().addTool( StandAloneDecayTool )
|
||||
Generation().StandAloneDecayTool.ProductionTool = "PythiaProduction";
|
||||
|
||||
from Configurables import ToolSvc
|
||||
from Configurables import EvtGenDecay
|
||||
|
||||
ToolSvc().addTool( EvtGenDecay )
|
||||
ToolSvc().EvtGenDecay.UserDecayFile ="$DECFILESROOT/dkfiles/Bu_Kstmumu,Kpi0=DecProdCut.dec"
|
||||
Generation().StandAloneDecayTool.SignalPIDList = [ 521,-521 ]
|
82
Code/EventGenerator/getTupleFromGauss.py
Normal file
82
Code/EventGenerator/getTupleFromGauss.py
Normal file
@ -0,0 +1,82 @@
|
||||
from Configurables import (
|
||||
DaVinci,
|
||||
EventSelector,
|
||||
PrintMCTree,
|
||||
MCDecayTreeTuple,
|
||||
TupleToolMCTruth
|
||||
)
|
||||
from DecayTreeTuple.Configuration import *
|
||||
|
||||
"""Configure the variables below with:
|
||||
decay: Decay you want to inspect, using 'newer' LoKi decay descriptor syntax,
|
||||
decay_heads: Particles you'd like to see the decay tree of,
|
||||
datafile: Where the file created by the Gauss generation phase is, and
|
||||
year: What year the MC is simulating.
|
||||
"""
|
||||
|
||||
# Select correct MC sample
|
||||
RefChan = False
|
||||
PHSP = True
|
||||
|
||||
# https://twiki.cern.ch/twiki/bin/view/LHCb/FAQ/LoKiNewDecayFinders
|
||||
decay = "[B+ => ^(K*(892)+ => ^K+ ^(pi0=> ^gamma ^gamma)) ^mu- ^mu+]CC"
|
||||
if (RefChan): decay = "[B+ => ^(K*(892)+ => ^K+ ^(pi0=> ^gamma ^gamma)) ^(J/psi(1S) => ^mu- ^mu+)]CC"
|
||||
decay_heads = ["B+", "B-"]
|
||||
|
||||
#Path to datafile
|
||||
datafile = "/afs/cern.ch/work/r/rekopecn/public/B_2_KstarMuMu/EvtGen/GaussDev_v49r12/MCTruth.sim"
|
||||
if (RefChan): datafile =datafile.replace(".sim","_RefChan.sim",1)
|
||||
if (PHSP): datafile =datafile.replace(".sim","_PHSP.sim",1)
|
||||
|
||||
year = 2017
|
||||
|
||||
# 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
|
||||
|
||||
# Name of the .xgen file produced by Gauss
|
||||
EventSelector().Input = ["DATAFILE='{0}' TYP='POOL_ROOTTREE' Opt='READ'".format(datafile)]
|
||||
|
||||
# Configure DaVinci
|
||||
DaVinci().TupleFile =datafile.replace(".sim","_orig.root",1)
|
||||
DaVinci().HistogramFile = "DVntuple_histo.root"
|
||||
DaVinci().Simulation = True
|
||||
DaVinci().Lumi = False
|
||||
DaVinci().DataType = str(year)
|
||||
DaVinci().UserAlgorithms = [mctuple]
|
||||
|
||||
def doIt():
|
||||
"""
|
||||
specific post-config action for (x)GEN-files
|
||||
"""
|
||||
extension = "xgen"
|
||||
ext = extension.upper()
|
||||
|
||||
from Configurables import DataOnDemandSvc
|
||||
dod = DataOnDemandSvc ()
|
||||
from copy import deepcopy
|
||||
algs = deepcopy ( dod.AlgMap )
|
||||
bad = set()
|
||||
for key in algs :
|
||||
if 0 <= key.find ( 'Rec' ) : bad.add ( key )
|
||||
elif 0 <= key.find ( 'Raw' ) : bad.add ( key )
|
||||
elif 0 <= key.find ( 'DAQ' ) : bad.add ( key )
|
||||
elif 0 <= key.find ( 'Trigger' ) : bad.add ( key )
|
||||
elif 0 <= key.find ( 'Phys' ) : bad.add ( key )
|
||||
elif 0 <= key.find ( 'Prev/' ) : bad.add ( key )
|
||||
elif 0 <= key.find ( 'Next/' ) : bad.add ( key )
|
||||
elif 0 <= key.find ( '/MC/' ) and 'GEN' == ext : bad.add ( key )
|
||||
|
||||
for b in bad :
|
||||
del algs[b]
|
||||
|
||||
dod.AlgMap = algs
|
||||
|
||||
from Configurables import EventClockSvc, CondDB
|
||||
EventClockSvc ( EventTimeDecoder = "FakeEventTime" )
|
||||
CondDB ( IgnoreHeartBeat = True )
|
||||
|
||||
appendPostConfigAction( doIt )
|
217
Code/Extract_functions_with_parameters.py
Normal file
217
Code/Extract_functions_with_parameters.py
Normal file
@ -0,0 +1,217 @@
|
||||
import sys
|
||||
import re
|
||||
#First argument is the filename
|
||||
fileName = sys.argv[1]
|
||||
|
||||
|
||||
def stopLoopLinesClass(line):
|
||||
if ("public" in line): return True
|
||||
if ("private" in line): return True
|
||||
if ("(" in line): return True
|
||||
if (")" in line): return True
|
||||
if ("}" in line): return True
|
||||
return False
|
||||
|
||||
def FormatClasses(class_full):
|
||||
class_full = re.split("\n",class_full)
|
||||
|
||||
name = class_full[0].replace("class ","")[0:-1]
|
||||
public_vars = []
|
||||
private_vars = []
|
||||
functions = []
|
||||
|
||||
for idx,line in enumerate(class_full[1:]):
|
||||
line = line[4:] #Remove the indent
|
||||
if (line.startswith(" ")): continue
|
||||
if (line.startswith("public:") or line.startswith("ic:")):
|
||||
idx = idx+1
|
||||
while (not stopLoopLinesClass(class_full[idx+1])):
|
||||
public_vars.append(class_full[idx+1].lstrip())
|
||||
idx = idx+1
|
||||
if (line.startswith("private:") or line.startswith("te:")):
|
||||
idx = idx+1
|
||||
while (not stopLoopLinesClass(class_full[idx+1])):
|
||||
private_vars.append(class_full[idx].lstrip())
|
||||
idx = idx+1
|
||||
if ("(" in line):
|
||||
tmp = line
|
||||
if (")" not in line):
|
||||
while (")" not in class_full[idx]):
|
||||
tmp = tmp + class_full[idx].strip()
|
||||
idx = idx+1
|
||||
tmp = tmp + class_full[idx].strip()
|
||||
functions.append(tmp)
|
||||
|
||||
return name, public_vars, private_vars, functions
|
||||
|
||||
|
||||
def isPythonFile(fileName):
|
||||
if (fileName.endswith(".py")):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def ReadFile(fileName): #Returns the read lines and an integer, that is true when the file if a python file
|
||||
with open(fileName) as f:
|
||||
lines = f.readlines()
|
||||
return lines
|
||||
|
||||
def AddCommentWithLink(functionName, isPython):
|
||||
#Strip the data type from the title and add ()
|
||||
functionTitle = functionName
|
||||
if (not isPython): functionTitle = functionTitle[functionTitle.rfind(' '):]
|
||||
# Now parse the name to create the link
|
||||
functionLink = functionName
|
||||
for symbol in [" ","::"]:
|
||||
functionLink = functionLink.replace(symbol,"-")
|
||||
for symbol in ["(",")","\*","*"]:
|
||||
functionLink = functionLink.replace(symbol,"-")
|
||||
#Print the reference as it would be used in text
|
||||
return ("[comment]: # (["+functionTitle.strip()+"()](#" + functionLink.lower()+ "))")
|
||||
|
||||
def ReadCpp(lines):
|
||||
globals_list = []
|
||||
function_list = []
|
||||
classes_list = []
|
||||
|
||||
|
||||
for idx,line in enumerate(lines):
|
||||
if (line.startswith(" ")): continue
|
||||
if (line.startswith("}")): continue
|
||||
if (line.startswith("//")): continue
|
||||
if (line.startswith("#")): continue
|
||||
if (line.startswith("using")): continue
|
||||
if (line.startswith("class")):
|
||||
tmp = ""
|
||||
while ("};" not in lines[idx]):
|
||||
tmp = tmp + lines[idx]
|
||||
idx = idx+1
|
||||
tmp = tmp + lines[idx].strip()
|
||||
classes_list.append(tmp)
|
||||
if (line.startswith("struct")):
|
||||
tmp = ""
|
||||
while ("}" not in lines[idx]):
|
||||
tmp = tmp + lines[idx]
|
||||
idx = idx+1
|
||||
tmp = tmp + lines[idx].strip()
|
||||
classes_list.append(tmp)
|
||||
|
||||
if (line.isspace()): continue
|
||||
if ("(" not in line): globals_list.append(line.strip())
|
||||
elif (")" not in line):
|
||||
tmp = ""
|
||||
while (")" not in lines[idx]):
|
||||
tmp = tmp + lines[idx].strip()
|
||||
idx = idx+1
|
||||
tmp = tmp + lines[idx].strip()
|
||||
function_list.append(tmp)
|
||||
else: function_list.append(line.strip())
|
||||
|
||||
for cl in classes_list: FormatClasses(cl)
|
||||
|
||||
globals = []
|
||||
for glob in globals_list:
|
||||
glob = glob.replace(";","")
|
||||
for tmp in glob.split(','): globals.append(tmp.lstrip())
|
||||
|
||||
print("\n\n## Global variables:\n")
|
||||
for tmp in globals: print("* "+tmp)
|
||||
|
||||
print("\n\n# Classes")
|
||||
|
||||
for cl in classes_list:
|
||||
name, pub, priv, funcs = FormatClasses(cl)
|
||||
print ("### "+name)
|
||||
print ("* **Private members:**")
|
||||
for p in priv:
|
||||
print(" * "+ p.replace(";",""))
|
||||
print ("* **Public members:**")
|
||||
for p in pub:
|
||||
print(" * "+ p.replace(";",""))
|
||||
print ("* **Functions:**")
|
||||
for f in funcs:
|
||||
f = f.replace("){","")
|
||||
f = f.replace(") {","")
|
||||
f = f.replace("*","\*")
|
||||
funcs = f.split("(")
|
||||
funcs[1] = funcs[1].split(',')
|
||||
if (len(funcs[1])>0) and (funcs[1][0].strip()!=""):
|
||||
print(" * **"+funcs[0]+"()**\n")
|
||||
print (AddCommentWithLink(funcs[0],False))
|
||||
print(" * **Parameters**")
|
||||
for params in funcs[1]:
|
||||
print(" * "+params.lstrip())
|
||||
print(" * **Return**")
|
||||
elif ("~" in funcs[0]): print(" * **"+funcs[0]+"()** // destructor")
|
||||
else: print(" * **"+funcs[0]+"()** // constructor")
|
||||
|
||||
print("\n\n\n# Functions")
|
||||
functions = []
|
||||
for funcs in function_list:
|
||||
funcs = funcs.replace("){","")
|
||||
funcs = funcs.replace(") {","")
|
||||
funcs = funcs.replace("*","\*")
|
||||
functions = funcs.split("(")
|
||||
functions[1] = functions[1].split(',')
|
||||
print("### "+functions[0]+"()")
|
||||
print(AddCommentWithLink(functions[0],False)+"\n")
|
||||
print("* **Parameters**")
|
||||
for params in functions[1]:
|
||||
print(" * "+params.lstrip())
|
||||
if ("void " not in functions[0]): print("* **Return**\n")
|
||||
else: print("\n")
|
||||
return
|
||||
|
||||
|
||||
def ReadPython(lines):
|
||||
globals_list = []
|
||||
function_list = []
|
||||
classes_list = []
|
||||
|
||||
for idx,line in enumerate(lines):
|
||||
if (line.startswith(" ")): continue
|
||||
if (line.startswith("#")): continue #Remove comments
|
||||
if (line.startswith("import")): continue
|
||||
if (line == "\n"): continue #Remove empty lines
|
||||
if (line.startswith("def")):
|
||||
line = line.replace(":","")
|
||||
if (")" not in line):
|
||||
tmp = ""
|
||||
while (")" not in lines[idx]):
|
||||
tmp = tmp + lines[idx].strip()
|
||||
idx = idx+1
|
||||
tmp = tmp + lines[idx].strip()
|
||||
function_list.append(tmp)
|
||||
else: function_list.append(line.strip())
|
||||
else:
|
||||
globals_list.append(line.strip())
|
||||
|
||||
|
||||
|
||||
print("\n\n## Global variables:\n")
|
||||
for tmp in globals_list: print("* "+tmp)
|
||||
|
||||
|
||||
print("\n\n\n# Functions")
|
||||
functions = []
|
||||
for funcs in function_list:
|
||||
funcs = funcs.replace(")","")
|
||||
funcs = funcs.replace("def ","")
|
||||
funcs = funcs.replace("*","\*")
|
||||
functions = funcs.split("(")
|
||||
functions[1] = functions[1].split(',')
|
||||
print("### "+functions[0]+"()\n")
|
||||
print(AddCommentWithLink(functions[0],True)+"\n")
|
||||
print("* **Parameters**")
|
||||
for params in functions[1]:
|
||||
print(" * "+params.lstrip())
|
||||
print("* **Return**\n")
|
||||
return
|
||||
|
||||
|
||||
##### The main run
|
||||
|
||||
if (isPythonFile(fileName)):
|
||||
ReadPython(ReadFile(fileName))
|
||||
else :
|
||||
ReadCpp(ReadFile(fileName))
|
13
Code/Ganga/CondDB_info/11114001.out
Normal file
13
Code/Ganga/CondDB_info/11114001.out
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
('/MC/2011/Beam3500GeV-2011-MagUp-Nu2-Pythia8/Sim08e/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/11114001/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-mu100', 32, 506402, 38001)
|
||||
('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-Pythia8/Sim08e/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/11114001/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-md100', 31, 525851, 38003)
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08b/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/11114001/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-mu100', 19, 260000, 30535)
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08b/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/11114001/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-md100', 18, 257748, 30541)
|
||||
|
||||
('/MC/2015/Beam6500GeV-2015-MagDown-Nu1.6-25ns-Pythia8/Sim09c/Trig0x411400a2/Reco15a/Turbo02/Stripping24r1NoPrescalingFlagged/11114001/ALLSTREAMS.DST', 'dddb-20170721-3', 'sim-20161124-vc-md100', 204, 502704, 70002)
|
||||
('/MC/2015/Beam6500GeV-2015-MagUp-Nu1.6-25ns-Pythia8/Sim09c/Trig0x411400a2/Reco15a/Turbo02/Stripping24r1NoPrescalingFlagged/11114001/ALLSTREAMS.DST', 'dddb-20170721-3', 'sim-20161124-vc-mu100', 203, 503254, 70016)
|
||||
|
||||
('/MC/2016/Beam6500GeV-2016-MagUp-Nu1.6-25ns-Pythia8/Sim09b/Trig0x6138160F/Reco16/Turbo03/Stripping26NoPrescalingFlagged/11114001/ALLSTREAMS.DST', 'dddb-20150724', 'sim-20161124-2-vc-mu100', 56, 707852, 56295)
|
||||
('/MC/2016/Beam6500GeV-2016-MagDown-Nu1.6-25ns-Pythia8/Sim09b/Trig0x6138160F/Reco16/Turbo03/Stripping26NoPrescalingFlagged/11114001/ALLSTREAMS.DST', 'dddb-20150724', 'sim-20161124-2-vc-md100', 52, 657410, 56297)
|
||||
|
40
Code/Ganga/CondDB_info/11144001.out
Normal file
40
Code/Ganga/CondDB_info/11144001.out
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
|
||||
('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-Pythia8/Sim08b/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'Sim08-20130503', 'Sim08-20130503-vc-md100', 31, 510250, 30572)
|
||||
('/MC/2011/Beam3500GeV-2011-MagUp-Nu2-Pythia8/Sim08b/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'Sim08-20130503', 'Sim08-20130503-vc-mu100', 32, 505999, 30578)
|
||||
|
||||
('/MC/2011/Beam3500GeV-2011-MagUp-Nu2-Pythia8/Sim08f/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-mu100', 185, 3076566, 42096)
|
||||
('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-Pythia8/Sim08f/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-md100', 185, 3081998, 42098)
|
||||
|
||||
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08a/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-md100', 34, 507999, 24782)
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08a/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-mu100', 33, 511997, 24784)
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08c/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20130929-1', 'sim-20130522-1-vc-md100', 96, 1508496, 32285)
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08c/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20130929-1', 'sim-20130522-1-vc-mu100', 90, 1505995, 32287)
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08f/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20130929-1', 'sim-20130522-1-vc-mu100', 214, 4425822, 42092)
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08f/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20130929-1', 'sim-20130522-1-vc-md100', 216, 4435958, 42094)
|
||||
|
||||
|
||||
|
||||
('/MC/2015/Beam6500GeV-2015-MagDown-Nu1.6-25ns-Pythia8/Sim09c/Trig0x411400a2/Reco15a/Turbo02/Stripping24r1NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20170721-3', 'sim-20161124-vc-md100', 202, 501887, 70004)
|
||||
('/MC/2015/Beam6500GeV-2015-MagUp-Nu1.6-25ns-Pythia8/Sim09c/Trig0x411400a2/Reco15a/Turbo02/Stripping24r1NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20170721-3', 'sim-20161124-vc-mu100', 202, 502444, 70012)
|
||||
|
||||
('/MC/2015/Beam6500GeV-2015-MagDown-Nu1.6-25ns-Pythia8/Sim09c/Trig0x411400a2/Reco15a/Turbo02/Stripping24r1NoPrescalingFlagged/11144001/ALLSTREAMS.MDST', 'dddb-20170721-3', 'sim-20161124-vc-md100', 395, 1003236, 75398)
|
||||
('/MC/2015/Beam6500GeV-2015-MagUp-Nu1.6-25ns-Pythia8/Sim09c/Trig0x411400a2/Reco15a/Turbo02/Stripping24r1NoPrescalingFlagged/11144001/ALLSTREAMS.MDST', 'dddb-20170721-3', 'sim-20161124-vc-mu100', 396, 1001066, 75400)
|
||||
|
||||
('/MC/2015/Beam6500GeV-2015-MagUp-Nu1.6-25ns-Pythia8/Sim09c/Trig0x411400a2/Reco15a/Turbo02/Stripping24r1NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20170721-3', 'sim-20161124-vc-mu100', 203, 504950, 76060)
|
||||
('/MC/2015/Beam6500GeV-2015-MagDown-Nu1.6-25ns-Pythia8/Sim09c/Trig0x411400a2/Reco15a/Turbo02/Stripping24r1NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20170721-3', 'sim-20161124-vc-md100', 198, 501188, 76062)
|
||||
|
||||
|
||||
|
||||
('/MC/2016/Beam6500GeV-2016-MagDown-Nu1.6-25ns-Pythia8/Sim09c/Trig0x6138160F/Reco16/Turbo03/Stripping28r1NoPrescalingFlagged/11144001/ALLSTREAMS.MDST', 'dddb-20170721-3', 'sim-20170721-2-vc-md100', 2967, 7495109, 75394)
|
||||
('/MC/2016/Beam6500GeV-2016-MagUp-Nu1.6-25ns-Pythia8/Sim09c/Trig0x6138160F/Reco16/Turbo03/Stripping28r1NoPrescalingFlagged/11144001/ALLSTREAMS.MDST', 'dddb-20170721-3', 'sim-20170721-2-vc-mu100', 3171, 8028918, 75396)
|
||||
|
||||
('/MC/2016/Beam6500GeV-2016-MagUp-Nu1.6-25ns-Pythia8/Sim09b/Trig0x6138160F/Reco16/Turbo03/Stripping26NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20150724', 'sim-20161124-2-vc-mu100', 56, 697263, 56291)
|
||||
('/MC/2016/Beam6500GeV-2016-MagDown-Nu1.6-25ns-Pythia8/Sim09b/Trig0x6138160F/Reco16/Turbo03/Stripping26NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20150724', 'sim-20161124-2-vc-md100', 59, 736790, 56299)
|
||||
|
||||
('/MC/2016/Beam6500GeV-2016-MagUp-Nu1.6-25ns-Pythia8/Sim09b/Trig0x6138160F/Reco16/Turbo03/Stripping26NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20150724', 'sim-20161124-2-vc-mu100', 199, 500274, 62841)
|
||||
('/MC/2016/Beam6500GeV-2016-MagDown-Nu1.6-25ns-Pythia8/Sim09b/Trig0x6138160F/Reco16/Turbo03/Stripping26NoPrescalingFlagged/11144001/ALLSTREAMS.DST', 'dddb-20150724', 'sim-20161124-2-vc-md100', 206, 515280, 62849)
|
11
Code/Ganga/CondDB_info/12113445.out
Normal file
11
Code/Ganga/CondDB_info/12113445.out
Normal file
@ -0,0 +1,11 @@
|
||||
('/MC/2016/Beam6500GeV-2016-MagDown-Nu1.6-25ns-Pythia8/Sim09c/Trig0x6138160F/Reco16/Turbo03/Stripping28Filtered/12113445/B2XMUMU.STRIP.MDST', 'dddb-20170721-3', 'sim-20170721-2-vc-md100', 8, 214587, 67137)
|
||||
('/MC/2016/Beam6500GeV-2016-MagUp-Nu1.6-25ns-Pythia8/Sim09c/Trig0x6138160F/Reco16/Turbo03/Stripping28Filtered/12113445/B2XMUMU.STRIP.MDST', 'dddb-20170721-3', 'sim-20170721-2-vc-mu100', 8, 216923, 67143)
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim09b/Trig0x409f0045/Reco14c/Stripping21Filtered/12113445/B2XMUMU.STRIP.DST', 'dddb-20150928', 'sim-20160321-2-vc-md100', 17, 175028, 67579)
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim09b/Trig0x409f0045/Reco14c/Stripping21Filtered/12113445/B2XMUMU.STRIP.DST', 'dddb-20150928', 'sim-20160321-2-vc-mu100', 20, 203760, 67667)
|
||||
|
||||
('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-Pythia8/Sim09b/Trig0x40760037/Reco14c/Stripping21r1Filtered/12113445/B2XMUMU.STRIP.DST', 'dddb-20160318-1', 'sim-20160614-1-vc-md100', 10, 94529, 67814)
|
||||
('/MC/2011/Beam3500GeV-2011-MagUp-Nu2-Pythia8/Sim09b/Trig0x40760037/Reco14c/Stripping21r1Filtered/12113445/B2XMUMU.STRIP.DST', 'dddb-20160318-1', 'sim-20160614-1-vc-mu100', 9, 91600, 67820)
|
||||
|
||||
('/MC/2015/Beam6500GeV-2015-MagDown-Nu1.6-25ns-Pythia8/Sim09b/Trig0x411400a2/Reco15a/Turbo02/Stripping24Filtered/12113445/B2XMUMU.STRIP.MDST', 'dddb-20150724', 'sim-20161124-vc-md100', 7, 76712, 68400)
|
||||
('/MC/2015/Beam6500GeV-2015-MagUp-Nu1.6-25ns-Pythia8/Sim09b/Trig0x411400a2/Reco15a/Turbo02/Stripping24Filtered/12113445/B2XMUMU.STRIP.MDST', 'dddb-20150724', 'sim-20161124-vc-mu100', 6, 72037, 68403)
|
17
Code/Ganga/CondDB_info/12115178.out
Normal file
17
Code/Ganga/CondDB_info/12115178.out
Normal file
@ -0,0 +1,17 @@
|
||||
('/MC/2016/Beam6500GeV-2016-MagDown-Nu1.6-25ns-Pythia8/Sim09c/Trig0x6138160F/Reco16/Turbo03/Stripping28Filtered/12115178/B2XMUMU.STRIP.MDST', 'dddb-20170721-3', 'sim-20170721-2-vc-md100', 8, 220235, 67134)
|
||||
('/MC/2016/Beam6500GeV-2016-MagUp-Nu1.6-25ns-Pythia8/Sim09c/Trig0x6138160F/Reco16/Turbo03/Stripping28Filtered/12115178/B2XMUMU.STRIP.MDST', 'dddb-20170721-3', 'sim-20170721-2-vc-mu100', 8, 220078, 67140)
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim09b/Trig0x409f0045/Reco14c/Stripping21Filtered/12115178/B2XMUMU.STRIP.DST', 'dddb-20150928', 'sim-20160321-2-vc-md100', 19, 193415, 67576)
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim09b/Trig0x409f0045/Reco14c/Stripping21Filtered/12115178/B2XMUMU.STRIP.DST', 'dddb-20150928', 'sim-20160321-2-vc-mu100', 13, 185240, 67664)
|
||||
|
||||
('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-Pythia8/Sim09b/Trig0x40760037/Reco14c/Stripping21r1Filtered/12115178/B2XMUMU.STRIP.DST', 'dddb-20160318-1', 'sim-20160614-1-vc-md100', 11, 106817, 67811)
|
||||
('/MC/2011/Beam3500GeV-2011-MagUp-Nu2-Pythia8/Sim09b/Trig0x40760037/Reco14c/Stripping21r1Filtered/12115178/B2XMUMU.STRIP.DST', 'dddb-20160318-1', 'sim-20160614-1-vc-mu100', 9, 101420, 67817)
|
||||
|
||||
('/MC/2015/Beam6500GeV-2015-MagDown-Nu1.6-25ns-Pythia8/Sim09b/Trig0x411400a2/Reco15a/Turbo02/Stripping24Filtered/12115178/B2XMUMU.STRIP.MDST', 'dddb-20150724', 'sim-20161124-vc-md100', 8, 49633, 68118)
|
||||
('/MC/2015/Beam6500GeV-2015-MagUp-Nu1.6-25ns-Pythia8/Sim09b/Trig0x411400a2/Reco15a/Turbo02/Stripping24Filtered/12115178/B2XMUMU.STRIP.MDST', 'dddb-20150724', 'sim-20161124-vc-mu100', 8, 49499, 68121)
|
||||
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim09c/Trig0x4097003d/Reco14c/Stripping21NoPrescalingFlagged/12115178/B2XMUMU.STRIP.DST', 'dddb-20170721-2', 'sim-20160321-2-vc-mu100', 1, 14261, 75999)
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim09c/Trig0x4097003d/Reco14c/Stripping21NoPrescalingFlagged/12115178/B2XMUMU.STRIP.DST', 'dddb-20170721-2', 'sim-20160321-2-vc-md100', 10, 53638, 76002)
|
||||
|
20
Code/Ganga/CondDB_info/12143401.out
Normal file
20
Code/Ganga/CondDB_info/12143401.out
Normal file
@ -0,0 +1,20 @@
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08a/Digi13/Trig0x409f0045/Reco14/Stripping20NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-md100', 66, 1016495, 24334)
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08a/Digi13/Trig0x409f0045/Reco14/Stripping20NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-mu100', 68, 1011494, 24336)
|
||||
|
||||
('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-Pythia8/Sim08e/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-md100', 31, 505626, 35713)
|
||||
('/MC/2011/Beam3500GeV-2011-MagUp-Nu2-Pythia8/Sim08e/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-mu100', 30, 521811, 36008)
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08e/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20130929-1', 'sim-20130522-1-vc-md100', 106, 2107119, 37896)
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08e/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20130929-1', 'sim-20130522-1-vc-mu100', 104, 2101731, 37898)
|
||||
|
||||
('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-Pythia8/Sim08e/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-md100', 64, 1000643, 38211)
|
||||
('/MC/2011/Beam3500GeV-2011-MagUp-Nu2-Pythia8/Sim08e/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-mu100', 63, 1022157, 38213)
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08g/Digi13/Trig0x409f0045/Reco14a/Stripping21NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20130929-1', 'sim-20130522-1-vc-mu100', 28, 506406, 43277)
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08g/Digi13/Trig0x409f0045/Reco14a/Stripping21NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20130929-1', 'sim-20130522-1-vc-md100', 25, 519292, 43279)
|
||||
|
||||
('/MC/2011/Beam3500GeV-2011-MagUp-Nu2-Pythia8/Sim09a/Trig0x40760037/Reco14c/Stripping21r1NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20160318-1', 'sim-20160614-1-vc-mu100', 99, 1007920, 54086)
|
||||
('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-Pythia8/Sim09a/Trig0x40760037/Reco14c/Stripping21r1NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20160318-1', 'sim-20160614-1-vc-md100', 102, 1011831, 54094)
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim09a/Trig0x409f0045/Reco14c/Stripping21NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20150928', 'sim-20160321-2-vc-mu100', 87, 1000278, 54104)
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim09a/Trig0x409f0045/Reco14c/Stripping21NoPrescalingFlagged/12143401/ALLSTREAMS.DST', 'dddb-20150928', 'sim-20160321-2-vc-md100', 81, 1003888, 54108)
|
6
Code/Ganga/CondDB_info/12145101.out
Normal file
6
Code/Ganga/CondDB_info/12145101.out
Normal file
@ -0,0 +1,6 @@
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08a/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12145101/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-mu100', 11, 132499, 29548)
|
||||
|
||||
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08a/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12145101/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-md100', 14, 244999, 29556)
|
||||
|
0
Code/Ganga/CondDB_info/12145102.out
Normal file
0
Code/Ganga/CondDB_info/12145102.out
Normal file
5
Code/Ganga/CondDB_info/12245000.out
Normal file
5
Code/Ganga/CondDB_info/12245000.out
Normal file
@ -0,0 +1,5 @@
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08a/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12245000/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-mu100', 19, 265250, 26676)
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08a/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12245000/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-md100', 20, 250249, 26684)
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia6/Sim08a/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12245000/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-mu100', 18, 265249, 26688)
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia6/Sim08a/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12245000/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-md100', 17, 251747, 26696)
|
||||
|
5
Code/Ganga/CondDB_info/12435001.out
Normal file
5
Code/Ganga/CondDB_info/12435001.out
Normal file
@ -0,0 +1,5 @@
|
||||
('/MC/2011/Beam3500GeV-2011-MagUp-Nu2-Pythia8/Sim08e/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/12435001/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-mu100', 57, 1027740, 35956)
|
||||
('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-Pythia8/Sim08e/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/12435001/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-md100', 58, 1038809, 35964)
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08e/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12435001/ALLSTREAMS.DST', 'dddb-20130929-1', 'sim-20130522-1-vc-mu100', 117, 2008883, 35976)
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08e/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12435001/ALLSTREAMS.DST', 'dddb-20130929-1', 'sim-20130522-1-vc-md100', 117, 2003930, 35982)
|
15
Code/Ganga/CondDB_info/12442001.out
Normal file
15
Code/Ganga/CondDB_info/12442001.out
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
('/MC/2012/Beam4000GeV-2012-MagDown-Nu2.5-Pythia8/Sim08a/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12442001/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-md100', 148, 2504990, 30122)
|
||||
('/MC/2012/Beam4000GeV-2012-MagUp-Nu2.5-Pythia8/Sim08a/Digi13/Trig0x409f0045/Reco14a/Stripping20NoPrescalingFlagged/12442001/ALLSTREAMS.DST', 'Sim08-20130503-1', 'Sim08-20130503-1-vc-mu100', 150, 2535488, 30124)
|
||||
|
||||
('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-Pythia8/Sim08c/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/12442001/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-md100', 132, 2508491, 31970)
|
||||
('/MC/2011/Beam3500GeV-2011-MagUp-Nu2-Pythia8/Sim08c/Digi13/Trig0x40760037/Reco14a/Stripping20r1NoPrescalingFlagged/12442001/ALLSTREAMS.DST', 'dddb-20130929', 'sim-20130522-vc-mu100', 132, 2514495, 31972)
|
||||
|
||||
('/MC/Dev/Beam6500GeV-Jun2015-MagDown-Nu1.6-25ns-Pythia8/Sim09Dev03/Trig0x410700a1/Reco15/Turbo01a/Stripping23r1NoPrescalingFlagged/12442001/ALLSTREAMS.DST', 'dddb-20150724', 'sim-20150813-vc-md100', 97, 1307031, 49351)
|
||||
('/MC/Dev/Beam6500GeV-Jun2015-MagUp-Nu1.6-25ns-Pythia8/Sim09Dev03/Trig0x410700a1/Reco15/Turbo01a/Stripping23r1NoPrescalingFlagged/12442001/ALLSTREAMS.DST', 'dddb-20150724', 'sim-20150813-vc-mu100', 101, 1399448, 49359)
|
||||
|
||||
('/MC/Dev/Beam6500GeV-Jun2015-MagDown-Nu1.6-25ns-Pythia8/Sim09Dev03/Trig0x410700a1/Reco15/Turbo01a/Stripping23r1NoPrescalingFlagged/12442001/ALLSTREAMS.MDST', 'dddb-20150724', 'sim-20150813-vc-md100', 79, 1063805, 49506)
|
||||
('/MC/Dev/Beam6500GeV-Jun2015-MagUp-Nu1.6-25ns-Pythia8/Sim09Dev03/Trig0x410700a1/Reco15/Turbo01a/Stripping23r1NoPrescalingFlagged/12442001/ALLSTREAMS.MDST', 'dddb-20150724', 'sim-20150813-vc-mu100', 81, 1121189, 49512)
|
||||
|
||||
('/MC/2016/Beam6500GeV-2016-MagDown-Nu1.6-25ns-Pythia8/Sim09b/Trig0x6138160F/Reco16/Turbo03/Stripping26NoPrescalingFlagged/12442001/ALLSTREAMS.DST', 'dddb-20150724', 'sim-20161124-2-vc-md100', 406, 5090001, 56657)
|
||||
('/MC/2016/Beam6500GeV-2016-MagUp-Nu1.6-25ns-Pythia8/Sim09b/Trig0x6138160F/Reco16/Turbo03/Stripping26NoPrescalingFlagged/12442001/ALLSTREAMS.DST', 'dddb-20150724', 'sim-20161124-2-vc-mu100', 483, 6055765, 56663)
|
19
Code/Ganga/LocationList/getJobList.py
Normal file
19
Code/Ganga/LocationList/getJobList.py
Normal file
@ -0,0 +1,19 @@
|
||||
from Ganga.GPI import jobs
|
||||
def getJobList(job,sub_list=None):
|
||||
if isinstance (job, int) :
|
||||
job = jobs(job)
|
||||
|
||||
# check if job has subjobs
|
||||
jobList = []
|
||||
if len(job.subjobs)>0:
|
||||
if type(sub_list) is list:
|
||||
jobList = []
|
||||
for sj in sub_list:
|
||||
jobList += job.subjobs.select(sj,sj,status="completed")
|
||||
else:
|
||||
jobList = job.subjobs.select(status="completed")
|
||||
else:
|
||||
if job.status=="completed":
|
||||
jobList = [job]
|
||||
return job,jobList
|
||||
|
129
Code/Ganga/LocationList/jobloader_GetLocationList.sh
Executable file
129
Code/Ganga/LocationList/jobloader_GetLocationList.sh
Executable file
@ -0,0 +1,129 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# #first initialize connection to Dirac by using:
|
||||
# lhcb-proxy-init
|
||||
|
||||
PathToGangaFolder='/afs/cern.ch/user/r/rekopecn/gangadir/workspace/rekopecn/LocalXML'
|
||||
NameTagForOutputFiles='B2Kstmumu'
|
||||
#NameTagForOutputFiles='B2KstJpsi'
|
||||
NameOfRootfileInGangaOutput=''
|
||||
|
||||
E_NO_ARGS=65
|
||||
if [ $# -eq 5 ] # Must have five command-line args to demo script.
|
||||
then
|
||||
channel=$1
|
||||
job=$2
|
||||
year=$3
|
||||
magnet=$4
|
||||
datatype=$5
|
||||
echo "Collecting $NameTagForOutputFiles for $year$magnet"
|
||||
else
|
||||
echo "Please invoke this script with one or more command-line arguments in the following format:"
|
||||
echo "./jobloader.sh CHANNEL JOB_ID YEAR MAGNET DATATYPE"
|
||||
exit $E_NO_ARGS
|
||||
fi
|
||||
|
||||
if [ -e data ]
|
||||
then
|
||||
echo "folder data/ found!"
|
||||
else
|
||||
echo "creating folder data/"
|
||||
mkdir data
|
||||
fi
|
||||
|
||||
if [ -e data/$datatype ]
|
||||
then
|
||||
echo "folder data/$datatype found!"
|
||||
else
|
||||
echo "creating folder data/$datatype"
|
||||
mkdir data/$datatype
|
||||
fi
|
||||
|
||||
|
||||
if [ -e data/$datatype/$channel ]
|
||||
then
|
||||
echo "folder data/$datatype/$channel found!"
|
||||
else
|
||||
echo "creating folder data/$datatype/$channel"
|
||||
mkdir data/$datatype/$channel
|
||||
fi
|
||||
|
||||
if [ -e data/$datatype/$channel/$year$magnet ]
|
||||
then
|
||||
echo "folder data/$datatype/$channel/$year$magnet found!"
|
||||
else
|
||||
echo "creating folder data/$datatype/$channel/$year$magnet"
|
||||
mkdir data/$datatype/$channel/$year$magnet
|
||||
fi
|
||||
|
||||
maxNumberOfSubjobs=0
|
||||
if [ "$datatype" = "data" ];
|
||||
then
|
||||
maxNumberOfSubjobs=150
|
||||
echo "maxNumberOfSubjobs= $maxNumberOfSubjobs"
|
||||
fi
|
||||
|
||||
if [ "$datatype" = "MC" ];
|
||||
then
|
||||
maxNumberOfSubjobs=25
|
||||
echo "maxNumberOfSubjobs= $maxNumberOfSubjobs"
|
||||
fi
|
||||
|
||||
if [ "$datatype" = "MCref" ];
|
||||
then
|
||||
maxNumberOfSubjobs=15
|
||||
echo "maxNumberOfSubjobs= $maxNumberOfSubjobs"
|
||||
fi
|
||||
|
||||
if [ "$datatype" = "PHSP" ];
|
||||
then
|
||||
maxNumberOfSubjobs=15
|
||||
echo "maxNumberOfSubjobs= $maxNumberOfSubjobs"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$datatype" = "MCB0" ];
|
||||
then
|
||||
maxNumberOfSubjobs=15
|
||||
echo "maxNumberOfSubjobs= $maxNumberOfSubjobs"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$datatype" = "MCK1" ];
|
||||
then
|
||||
maxNumberOfSubjobs=15
|
||||
echo "maxNumberOfSubjobs= $maxNumberOfSubjobs"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$datatype" = "MCInc" ];
|
||||
then
|
||||
maxNumberOfSubjobs=15
|
||||
echo "maxNumberOfSubjobs= $maxNumberOfSubjobs"
|
||||
fi
|
||||
|
||||
|
||||
echo "Collecting $NameTagForOutputFiles for $datatype and $channel, $year$magnet location ..."
|
||||
counter=0
|
||||
prefix="root->"
|
||||
apperfix=":::"
|
||||
|
||||
while [ $counter -lt $maxNumberOfSubjobs ]
|
||||
do
|
||||
outfile=$year$magnet\_$NameTagForOutputFiles\_$counter.root
|
||||
|
||||
if [ -e $PathToGangaFolder/$job/$counter/output/\_\_postprocesslocations\_\_ ]
|
||||
then
|
||||
while read line
|
||||
do
|
||||
line="${line#*$prefix}"
|
||||
line="${line%%$apperfix*}"
|
||||
NameOfRootfileInGangaOutput="${line##*/}"
|
||||
echo "$datatype $channel $year $magnet $counter $line" >> "ListOfLocations.out"
|
||||
NameOfRootfileInGangaOutput="${line##*/}"
|
||||
done < $PathToGangaFolder/$job/$counter/output/\_\_postprocesslocations\_\_
|
||||
#else echo "file $PathToGangaFolder/$counter/\_\_postprocesslocations\_\_ not found!"
|
||||
fi
|
||||
let counter=$counter+1
|
||||
done
|
||||
echo "Finished downloading $datatype/$channel/$year$magnet."
|
136
Code/Ganga/LocationList/load_jobs.txt
Normal file
136
Code/Ganga/LocationList/load_jobs.txt
Normal file
@ -0,0 +1,136 @@
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% MC %
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 951 2011 Down MC
|
||||
./jobloader_GetLocationList.sh KshortPiplus 952 2012 Down MC
|
||||
./jobloader_GetLocationList.sh KshortPiplus 953 2015 Down MC
|
||||
./jobloader_GetLocationList.sh KshortPiplus 954 2016 Down MC
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 955 2011 Up MC
|
||||
./jobloader_GetLocationList.sh KshortPiplus 956 2012 Up MC
|
||||
./jobloader_GetLocationList.sh KshortPiplus 957 2015 Up MC
|
||||
./jobloader_GetLocationList.sh KshortPiplus 958 2016 Up MC
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1410 2017 Down MC
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1411 2017 Up MC
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1419 2018 Down MC
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1453 2018 Up MC
|
||||
|
||||
|
||||
|
||||
./jobloader_GetLocationList.sh KplusPi0 1055 2011 Down MC
|
||||
./jobloader_GetLocationList.sh KplusPi0 1056 2012 Down MC
|
||||
./jobloader_GetLocationList.sh KplusPi0 1579 2015 Down MC
|
||||
./jobloader_GetLocationList.sh KplusPi0 1575 2016 Down MC
|
||||
|
||||
./jobloader_GetLocationList.sh KplusPi0 1057 2011 Up MC
|
||||
./jobloader_GetLocationList.sh KplusPi0 1058 2012 Up MC
|
||||
./jobloader_GetLocationList.sh KplusPi0 1578 2015 Up MC
|
||||
./jobloader_GetLocationList.sh KplusPi0 1584 2016 Up MC
|
||||
|
||||
./jobloader_GetLocationList.sh KplusPi0 1412 2017 Down MC
|
||||
./jobloader_GetLocationList.sh KplusPi0 1413 2017 Up MC
|
||||
|
||||
./jobloader_GetLocationList.sh KplusPi0 1563 2018 Down MC
|
||||
./jobloader_GetLocationList.sh KplusPi0 1564 2018 Up MC
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% PHSP %
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1444 2011 Down PHSP
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1447 2011 Up PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1448 2011 Down PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1449 2011 Up PHSP
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1442 2012 Down PHSP
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1445 2012 Up PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1432 2012 Down PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1433 2012 Up PHSP
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1443 2013 Down PHSP
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1446 2013 Up PHSP
|
||||
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1546 2015 Down PHSP
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1547 2015 Up PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1548 2015 Down PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1549 2015 Up PHSP
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1486 2016 Down PHSP
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1489 2016 Up PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1493 2016 Down PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1496 2016 Up PHSP
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1487 2017 Down PHSP
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1490 2017 Up PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1494 2017 Down PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1497 2017 Up PHSP
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1499 2018 Down PHSP
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1500 2018 Up PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1495 2018 Down PHSP
|
||||
./jobloader_GetLocationList.sh KplusPi0 1498 2018 Up PHSP
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Ref MC %
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1097 2011 Down MCref
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1098 2012 Down MCref
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 978 2011 Up MCref
|
||||
./jobloader_GetLocationList.sh KshortPiplus 979 2012 Up MCref
|
||||
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1556 2016 Down MCref
|
||||
./jobloader_GetLocationList.sh KshortPiplus 1557 2016 Up MCref
|
||||
|
||||
|
||||
./jobloader_GetLocationList.sh KplusPi0 1071 2011 Down MCref
|
||||
./jobloader_GetLocationList.sh KplusPi0 1072 2012 Down MCref
|
||||
./jobloader_GetLocationList.sh KplusPi0 1511 2015 Down MCref
|
||||
./jobloader_GetLocationList.sh KplusPi0 1512 2016 Down MCref
|
||||
|
||||
|
||||
./jobloader_GetLocationList.sh KplusPi0 1073 2011 Up MCref
|
||||
./jobloader_GetLocationList.sh KplusPi0 1074 2012 Up MCref
|
||||
./jobloader_GetLocationList.sh KplusPi0 1513 2015 Up MCref
|
||||
./jobloader_GetLocationList.sh KplusPi0 1514 2016 Up MCref
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Data %
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
./jobloader_GetLocationList.sh KplusPi0 1059 2011 Down data
|
||||
./jobloader_GetLocationList.sh KplusPi0 1060 2012 Down data
|
||||
./jobloader_GetLocationList.sh KplusPi0 1533 2015 Down data
|
||||
./jobloader_GetLocationList.sh KplusPi0 1524 2016 Down data
|
||||
./jobloader_GetLocationList.sh KplusPi0 1403 2017 Down data
|
||||
./jobloader_GetLocationList.sh KplusPi0 1552 2018 Down data
|
||||
|
||||
./jobloader_GetLocationList.sh KplusPi0 1063 2011 Up data
|
||||
./jobloader_GetLocationList.sh KplusPi0 1064 2012 Up data
|
||||
./jobloader_GetLocationList.sh KplusPi0 1525 2015 Up data
|
||||
./jobloader_GetLocationList.sh KplusPi0 1532 2016 Up data
|
||||
./jobloader_GetLocationList.sh KplusPi0 1405 2017 Up data
|
||||
./jobloader_GetLocationList.sh KplusPi0 1553 2018 Up data
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% TMP %
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
./jobloader_GetLocationList.sh KplusPi0 1579 2015 Down MC
|
||||
./jobloader_GetLocationList.sh KplusPi0 1575 2016 Down MC
|
||||
|
||||
./jobloader_GetLocationList.sh KplusPi0 1578 2015 Up MC
|
||||
./jobloader_GetLocationList.sh KplusPi0 1584 2016 Up MC
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2011"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2011MagDown.root"
|
||||
dv.CondDBtag = "sim-20130522-vc-md100"
|
||||
dv.DDDBtag = "dddb-20130929"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2011"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2011MagDown.root"
|
||||
dv.CondDBtag = "sim-20130522-vc-md100"
|
||||
dv.DDDBtag = "dddb-20130929"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2011"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2011MagUp.root"
|
||||
dv.CondDBtag = "sim-20130522-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20130929"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2011"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2011MagUp.root"
|
||||
dv.CondDBtag = "sim-20130522-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20130929"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2012MagDown.root"
|
||||
dv.CondDBtag = "sim-20130522-1-vc-md100"
|
||||
dv.DDDBtag = "dddb-20130929-1"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2012MagDown.root"
|
||||
dv.CondDBtag = "sim-20130522-1-vc-md100"
|
||||
dv.DDDBtag = "dddb-20130929-1"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2012MagUp.root"
|
||||
dv.CondDBtag = "sim-20130522-1-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20130929-1"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2012MagUp.root"
|
||||
dv.CondDBtag = "sim-20130522-1-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20130929-1"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = True
|
||||
data = False
|
||||
down = True
|
||||
year = "2015"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2015MagDown.root"
|
||||
dv.CondDBtag = "sim-20161124-vc-md100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = True
|
||||
data = False
|
||||
down = True
|
||||
year = "2015"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2015MagDown.root"
|
||||
dv.CondDBtag = "sim-20161124-vc-md100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = True
|
||||
data = False
|
||||
down = False
|
||||
year = "2015"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2015MagUp.root"
|
||||
dv.CondDBtag = "sim-20161124-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = True
|
||||
data = False
|
||||
down = False
|
||||
year = "2015"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2015MagUp.root"
|
||||
dv.CondDBtag = "sim-20161124-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = True
|
||||
data = False
|
||||
down = True
|
||||
year = "2016"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2016MagDown.root"
|
||||
dv.CondDBtag = "sim-20170721-2-vc-md100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = True
|
||||
data = False
|
||||
down = True
|
||||
year = "2016"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2016MagDown.root"
|
||||
dv.CondDBtag = "sim-20170721-2-vc-md100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = True
|
||||
data = False
|
||||
down = False
|
||||
year = "2016"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2016MagUp.root"
|
||||
dv.CondDBtag = "sim-20170721-2-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = True
|
||||
data = False
|
||||
down = False
|
||||
year = "2016"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstJpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstJpsi_2016MagUp.root"
|
||||
dv.CondDBtag = "sim-20170721-2-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2011"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2011MagDown.root"
|
||||
dv.CondDBtag = "sim-20130522-vc-md100"
|
||||
dv.DDDBtag = "dddb-20130929"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2011"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2011MagDown.root"
|
||||
dv.CondDBtag = "sim-20130522-vc-md100"
|
||||
dv.DDDBtag = "dddb-20130929"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2011"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2011MagUp.root"
|
||||
dv.CondDBtag = "sim-20130522-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20130929"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2011"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2011MagUp.root"
|
||||
dv.CondDBtag = "sim-20130522-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20130929"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2012MagDown.root"
|
||||
dv.CondDBtag = "Sim08-20130503-1-vc-md100"
|
||||
dv.DDDBtag = "Sim08-20130503-1"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2012MagDown.root"
|
||||
dv.CondDBtag = "Sim08-20130503-1-vc-md100"
|
||||
dv.DDDBtag = "Sim08-20130503-1"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2012MagUp.root"
|
||||
dv.CondDBtag = "Sim08-20130503-1-vc-mu100"
|
||||
dv.DDDBtag = "Sim08-20130503-1"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2012MagUp.root"
|
||||
dv.CondDBtag = "Sim08-20130503-1-vc-mu100"
|
||||
dv.DDDBtag = "Sim08-20130503-1"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2015"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2015MagDown.root"
|
||||
dv.CondDBtag = "sim-20161124-vc-md100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2015"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2015MagDown.root"
|
||||
dv.CondDBtag = "sim-20161124-vc-md100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2015"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2015MagUp.root"
|
||||
dv.CondDBtag = "sim-20161124-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2015"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2015MagUp.root"
|
||||
dv.CondDBtag = "sim-20161124-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20170721-3"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2016"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2016MagDown.root"
|
||||
dv.CondDBtag = "sim-20161124-2-vc-md100"
|
||||
dv.DDDBtag = "dddb-20150724"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2016"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2016MagDown.root"
|
||||
dv.CondDBtag = "sim-20161124-2-vc-md100"
|
||||
dv.DDDBtag = "dddb-20150724"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2016"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2016MagUp.root"
|
||||
dv.CondDBtag = "sim-20161124-2-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20150724"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2016"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "B0toKstMuMu"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "B0toKstMuMu_2016MagUp.root"
|
||||
dv.CondDBtag = "sim-20161124-2-vc-mu100"
|
||||
dv.DDDBtag = "dddb-20150724"
|
344
Code/Ganga/OptionFiles/Backgrounds/BasicOptfile.py
Executable file
344
Code/Ganga/OptionFiles/Backgrounds/BasicOptfile.py
Executable file
@ -0,0 +1,344 @@
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "BtoK1Jpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "BtoK1Jpsi_2012MagDown.root"
|
||||
dv.CondDBtag = "Sim08-20130503-1-vc-md100"
|
||||
dv.DDDBtag = "Sim08-20130503-1"
|
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = True
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "BtoK1Jpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "BtoK1Jpsi_2012MagDown.root"
|
||||
dv.CondDBtag = "Sim08-20130503-1-vc-md100"
|
||||
dv.DDDBtag = "Sim08-20130503-1"
|
363
Code/Ganga/OptionFiles/Backgrounds/BtoK1Jpsi/2012MagUp_Kplus.py
Normal file
363
Code/Ganga/OptionFiles/Backgrounds/BtoK1Jpsi/2012MagUp_Kplus.py
Normal file
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "BtoK1Jpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = False
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = True
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "BtoK1Jpsi_2012MagUp.root"
|
||||
dv.CondDBtag = "Sim08-20130503-1-vc-mu100"
|
||||
dv.DDDBtag = "Sim08-20130503-1"
|
363
Code/Ganga/OptionFiles/Backgrounds/BtoK1Jpsi/2012MagUp_Kshort.py
Normal file
363
Code/Ganga/OptionFiles/Backgrounds/BtoK1Jpsi/2012MagUp_Kshort.py
Normal file
@ -0,0 +1,363 @@
|
||||
############# Global settings
|
||||
runFilters = False
|
||||
MDST = False
|
||||
data = False
|
||||
down = False
|
||||
year = "2012"
|
||||
stream = "AllStreams"
|
||||
line = "B2XMuMu_Line"
|
||||
|
||||
channel = "BtoK1Jpsi"
|
||||
|
||||
#subdecay chains
|
||||
KShortPiPlus = True
|
||||
KplusPi0Merged = False
|
||||
KplusPi0Resolved = False
|
||||
from Gaudi.Configuration import *
|
||||
|
||||
from Configurables import DaVinci
|
||||
from Configurables import FilterDesktop, GaudiSequencer
|
||||
from Configurables import CombineParticles
|
||||
from Configurables import TupleToolP2VV, MCTupleToolP2VV
|
||||
|
||||
|
||||
#---------- Debugging tools----------#
|
||||
#MessageSvc().OutputLevel = VERBOSE
|
||||
#MessageSvc().OutputLevel = DEBUG
|
||||
#MessageSvc().Format = "% F%100W%S%7W%R%T %0W%M"
|
||||
|
||||
#Run1 or Run2
|
||||
#DST or MDST?
|
||||
Run1 = True
|
||||
if (year == "2011" or year == "2012"):
|
||||
Run1 = True
|
||||
elif (year == "2015" or year == "2016"):
|
||||
Run1 = False
|
||||
else:
|
||||
print "[WARNING]\tWrong year input!\n"
|
||||
|
||||
#MC Truthmatching fix for run 1 (obsolete)
|
||||
#if (not data and Run1):
|
||||
# from Configurables import PhysConf
|
||||
# PhysConf().CaloReProcessing=True
|
||||
|
||||
#triggerlines
|
||||
if (Run1):
|
||||
print "[INFO]\tTriggerlines for Run 1 added!\n"
|
||||
triggerlines = [
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackAllL0Decision",
|
||||
"Hlt1TrackAllL0TightDecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2CharmHadD2HHHHDecision",
|
||||
"Hlt2CharmHadD2HHHHWideMassDecision",
|
||||
"Hlt2IncPhiDecision",
|
||||
"Hlt2ExpressDs2PhiPiDecision",
|
||||
"Hlt2Topo2BodySimpleDecision",
|
||||
"Hlt2Topo3BodySimpleDecision",
|
||||
"Hlt2Topo2BodyBBDTDecision",
|
||||
"Hlt2Topo3BodyBBDTDecision",
|
||||
"Hlt2TopoMu2BodyBBDTDecision",
|
||||
"Hlt2TopoMu3BodyBBDTDecision",
|
||||
"Hlt2TopoE2BodyBBDTDecision",
|
||||
"Hlt2TopoE3BodyBBDTDecision",
|
||||
"Hlt2RadiativeTopoTrackTOSDecision",
|
||||
"Hlt2RadiativeTopoPhotonL0Decision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
else:
|
||||
print "[INFO]\tTriggerlines for Run 2 added!\n"
|
||||
triggerlines = [
|
||||
|
||||
#l0
|
||||
"L0HadronDecision",
|
||||
"L0MuonDecision",
|
||||
"L0DiMuonDecision",
|
||||
#"L0GlobalDecision",
|
||||
|
||||
#hlt1
|
||||
"Hlt1TrackMuonDecision",
|
||||
"Hlt1DiMuonHighMassDecision",
|
||||
"Hlt1DiMuonLowMassDecision",
|
||||
"Hlt1TrackMVADecision",
|
||||
"Hlt1TwoTrackMVADecision",
|
||||
"Hlt1L0AnyDecision",
|
||||
"Hlt1MBNoBiasDecision",
|
||||
"Hlt1GlobalDecision",
|
||||
|
||||
#hlt2
|
||||
"Hlt2Topo2BodyDecision",
|
||||
"Hlt2Topo3BodyDecision",
|
||||
"Hlt2TopoMu2BodyDecision",
|
||||
"Hlt2TopoMu3BodyDecision",
|
||||
"Hlt2TopoMuMu2BodyDecision",
|
||||
"Hlt2TopoMuMu3BodyDecision",
|
||||
"Hlt2SingleMuonDecision",
|
||||
"Hlt2SingleMuonHighPTDecision",
|
||||
"Hlt2SingleMuonLowPTDecision",
|
||||
"Hlt2DiMuonDetachedDecision",
|
||||
"Hlt2DiMuonDetachedHeavyDecision"]
|
||||
|
||||
############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
|
||||
#from Configurables import LoKi__HDRFilter as StripFilter
|
||||
#stripFilter = StripFilter( "stripPassFilter",\
|
||||
# Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
|
||||
# Location= "/Event/Strip/Phys/DecReports")
|
||||
|
||||
############# DecayTreeTuple
|
||||
from DecayTreeTuple.Configuration import *
|
||||
from Configurables import TupleToolTISTOS
|
||||
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
|
||||
from Configurables import PrintDecayTree, PrintDecayTreeTool
|
||||
|
||||
############# MCDecayTreeTuple
|
||||
from Configurables import MCDecayTreeTuple
|
||||
from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
|
||||
#Fix Truthmatching
|
||||
from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
|
||||
|
||||
##subpid stuff
|
||||
#from Configurables import SubPIDMMFilter
|
||||
from Configurables import SubstitutePID ,BTaggingTool
|
||||
from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
|
||||
from Configurables import LoKi__Hybrid__TupleTool
|
||||
|
||||
|
||||
##########################################
|
||||
###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
|
||||
##########################################
|
||||
### AND/OR ###
|
||||
##########################################################
|
||||
###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
|
||||
##########################################################
|
||||
|
||||
#This is probably a very stupid idea but python should be okay with it
|
||||
b2KstmumuTupleList= []
|
||||
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
|
||||
b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if (MDST):
|
||||
b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
|
||||
b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
|
||||
else:
|
||||
b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
|
||||
|
||||
#decay descriptor
|
||||
b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[0].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
|
||||
b2KstmumuTupleList[1].addBranches({
|
||||
"B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
|
||||
"K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
|
||||
"J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
|
||||
"mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
|
||||
"mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
|
||||
})
|
||||
|
||||
|
||||
#add tools
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.ToolList = ["TupleToolKinematic",
|
||||
"TupleToolPrimaries",
|
||||
"TupleToolEventInfo",
|
||||
"TupleToolTrackInfo",
|
||||
"TupleToolRecoStats",
|
||||
"TupleToolAngles",
|
||||
"TupleToolPid",
|
||||
"TupleToolPhotonInfo"]
|
||||
|
||||
#add MCtools
|
||||
if not (data):
|
||||
b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
|
||||
b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
|
||||
b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
|
||||
"TupleToolMCBackgroundInfo"]
|
||||
#Adding Angle Calculator
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
|
||||
b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
|
||||
b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
|
||||
|
||||
if ( (channel == "BtoXJpsi" and not Run1) or (channel == "B0toKstMuMu" and not Run1) ):
|
||||
from Configurables import Calo2MCTool
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTuple.addTool(Calo2MCTool,name="Calo2MCTool")
|
||||
b2KstmumuTuple.Calo2MCTool.Hypo2Cluster=True
|
||||
|
||||
#add tools to branches
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
|
||||
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
|
||||
b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
|
||||
|
||||
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.B_plus.Geo.Verbose = True
|
||||
b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
|
||||
|
||||
#Adding Angle Calculator
|
||||
TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
|
||||
TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
|
||||
b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
|
||||
b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
|
||||
|
||||
b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.J_psi.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_minus.Geo.Verbose = True
|
||||
b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTuple.mu_plus.Geo.Verbose = True
|
||||
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].K_short.Geo.Verbose = True
|
||||
b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
|
||||
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
|
||||
b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
|
||||
|
||||
### DST isolation info tools ###
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
if not( MDST ):
|
||||
b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
|
||||
b2KstmumuTuple.TrackIso.Verbose = True
|
||||
b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
|
||||
|
||||
b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
|
||||
|
||||
#decay tree fitter (DTF)
|
||||
b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
|
||||
b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
|
||||
b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
|
||||
b2KstmumuTuple.B_plus.DTF.Verbose = True
|
||||
|
||||
#Add mass constraints
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
|
||||
|
||||
#LoKi tools
|
||||
ConeIsoInfo = 'ConeIsoInfo'
|
||||
VtxIsoInfo = 'VtxIsoInfo'
|
||||
if (not Run1 and not MDST):
|
||||
if ( (channel == "BtoXJpsi") or (channel == "B0toKstMuMu")):
|
||||
ConeIsoInfo = 'ConeIsoInfoBDT'
|
||||
ConeIsoInfo = 'VtxIsoInfoBDT'
|
||||
|
||||
|
||||
if ( MDST ) :
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
|
||||
LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
|
||||
"PHI" : "PHI" ,
|
||||
"DOCA1" : "DOCA(1,2)" ,
|
||||
"CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEANGLE', -1.)",
|
||||
"CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEMULT', -1.)",
|
||||
'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPTASYM', -1.)",
|
||||
'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPT', -1.)",
|
||||
'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEP', -1.)",
|
||||
'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEPASYM', -1.)",
|
||||
'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAETA', -1.)",
|
||||
'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + ConeIsoInfo + "', 'CONEDELTAPHI', -1.)",
|
||||
'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISONUMVTX', -1.)",
|
||||
'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2ONETRACK', -1.)",
|
||||
'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSONETRACK', -1.)",
|
||||
'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2TWOTRACK', -1.)",
|
||||
'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/" + VtxIsoInfo + "', 'VTXISODCHI2MASSTWOTRACK', -1.)"
|
||||
};
|
||||
|
||||
#trigger config
|
||||
for b2KstmumuTuple in b2KstmumuTupleList:
|
||||
b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
|
||||
b2KstmumuTT.TriggerList = triggerlines
|
||||
b2KstmumuTT.FillL0 = True
|
||||
b2KstmumuTT.FillHlt1 = True
|
||||
b2KstmumuTT.FillHlt2 = True
|
||||
b2KstmumuTT.Verbose = True
|
||||
b2KstmumuTT.VerboseL0 = True
|
||||
b2KstmumuTT.VerboseHlt1 = True
|
||||
b2KstmumuTT.VerboseHlt2 = True
|
||||
|
||||
###########################
|
||||
##Main sequence
|
||||
###########################
|
||||
|
||||
b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
|
||||
if (KShortPiPlus):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
|
||||
if (KplusPi0Resolved):
|
||||
b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
|
||||
b2KstmumuSeq.ModeOR = True
|
||||
b2KstmumuSeq.ShortCircuit = False
|
||||
|
||||
###########################
|
||||
##DaVinci configurations
|
||||
###########################
|
||||
|
||||
dv = DaVinci()
|
||||
|
||||
#dv.EventPreFilters = [stripFilter]
|
||||
dv.UserAlgorithms += [b2KstmumuSeq]
|
||||
|
||||
if(MDST):
|
||||
dv.InputType = "MDST"
|
||||
else:
|
||||
dv.InputType = "DST"
|
||||
|
||||
|
||||
dv.RootInTES = "/Event/{0}".format(stream)
|
||||
dv.DataType = year
|
||||
dv.Simulation = not data
|
||||
dv.Lumi = True
|
||||
#dv.VerboseMessages = True
|
||||
#dv.SkipEvents = 0
|
||||
dv.PrintFreq = 1000
|
||||
dv.EvtMax = -1
|
||||
dv.TupleFile = "BtoK1Jpsi_2012MagUp.root"
|
||||
dv.CondDBtag = "Sim08-20130503-1-vc-mu100"
|
||||
dv.DDDBtag = "Sim08-20130503-1"
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user