From 3d4abd82fd81424dcbc4cf9674b360de0928b250 Mon Sep 17 00:00:00 2001 From: razhang <razhang razhang@cern.ch> Date: Wed, 20 Nov 2024 02:41:27 +0100 Subject: [PATCH 1/4] Btof1285 ananlysis data production --- Btof1285/davinci_Data_2011.py | 216 ++++++++++++++++++++++++++++++++++ Btof1285/davinci_Data_2012.py | 216 ++++++++++++++++++++++++++++++++++ Btof1285/davinci_Data_2015.py | 216 ++++++++++++++++++++++++++++++++++ Btof1285/davinci_Data_2016.py | 216 ++++++++++++++++++++++++++++++++++ Btof1285/davinci_Data_2017.py | 216 ++++++++++++++++++++++++++++++++++ Btof1285/davinci_Data_2018.py | 216 ++++++++++++++++++++++++++++++++++ Btof1285/info.yaml | 82 +++++++++++++ 7 files changed, 1378 insertions(+) create mode 100755 Btof1285/davinci_Data_2011.py create mode 100755 Btof1285/davinci_Data_2012.py create mode 100755 Btof1285/davinci_Data_2015.py create mode 100755 Btof1285/davinci_Data_2016.py create mode 100755 Btof1285/davinci_Data_2017.py create mode 100755 Btof1285/davinci_Data_2018.py create mode 100644 Btof1285/info.yaml diff --git a/Btof1285/davinci_Data_2011.py b/Btof1285/davinci_Data_2011.py new file mode 100755 index 0000000000..95d22bf328 --- /dev/null +++ b/Btof1285/davinci_Data_2011.py @@ -0,0 +1,216 @@ +import GaudiKernel.SystemOfUnits as Units +from GaudiConfUtils import ConfigurableGenerators +from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles +from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand +from DecayTreeTuple.Configuration import * +from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass +from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool +from Configurables import GaudiSequencer, PrintDecayTree +from MVADictHelpers import * +#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' +outTag = '' +line = 'Buto5h_K4pi_exclLine' +doMC = False +data_type = '2011' +if doMC: + stream_loc = 'AllStreams' + evt_type = '12205011' +else: + stream_loc = 'Bhadron' + +from Configurables import FilterInTrees +from PhysSelPython.Wrappers import Selection, DataOnDemand +from PhysConf.Selections import CombineSelection + +if doMC: + Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') + Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') +else: + #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) + tesLoc = 'Phys/{0}/Particles'.format(line) + kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") + kaons_from_B_sel = Selection("kaons_from_B_sel", + Algorithm=kaons_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") + pions_from_B_sel = Selection("pions_from_B_sel", + Algorithm=pions_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + Kaons = kaons_from_B_sel + Pions = pions_from_B_sel + + +XX1 = CombineParticles('D0', + DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", + CombinationCut="(AM > 100.0*MeV)", + DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' + }, + MotherCut='(PT > 100.0*MeV)') +XX1_sel = Selection('XX1_sel', + Algorithm=XX1, + RequiredSelections=[Pions]) + + +B_sel = CombineSelection( + 'Sel_B', + [XX1_sel,Kaons], + DecayDescriptor='[B+ -> f_1(1285) K+]cc', + CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', + DaughtersCuts ={ + 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, + MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' +) + +#-------------------- +#-------------------- + +decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" +branches={ + "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", + "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", + "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", + "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", + } +tl = ["TupleToolKinematic", + "TupleToolPropertime", + "TupleToolPid", + "TupleToolTrackInfo", + "TupleToolPrimaries", + "TupleToolEventInfo", + "TupleToolTrackInfo", + "TupleToolRecoStats", + "TupleToolGeometry", + "TupleToolTISTOS", + "TupleToolL0Data", + "TupleToolL0Calo"] + +from PhysConf.Selections import TupleSelection +myTuple = TupleSelection( +'myTuple', +[B_sel], +Decay=decaydesc, +Branches=branches, +ToolList=tl, +) + +tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] +myTuple.B.addTupleTool("TupleToolTISTOS") +myTuple.B.TupleToolTISTOS.Verbose = True +myTuple.B.TupleToolTISTOS.TriggerList = tg_list + +if doMC: + myTuple.ToolList += ['TupleToolMCBackgroundInfo'] + myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] + myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] + + +from Configurables import TupleToolDecay +for particle in list(branches.keys()): + myTuple.addTool(TupleToolDecay, name=particle) +myTuple.ReFitPVs = True + + +from Configurables import TupleToolDecayTreeFitter +MassFit = TupleToolDecayTreeFitter("MassFit") +MassFit.constrainToOriginVertex = True +MassFit.Verbose = True +MassFit.UpdateDaughters = True +myTuple.B.addTool(MassFit) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] + +Dres = TupleToolDecayTreeFitter("Dres") +Dres.constrainToOriginVertex = True +Dres.UpdateDaughters = True +Dres.Verbose = True +myTuple.B.addTool(Dres) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] +myTuple.B.Dres.Substitutions={ +'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', +'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' +} + + +if doMC: + from Configurables import TupleToolMCTruth + MCTruth = TupleToolMCTruth('Truth') + MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] + mct = MCDecayTreeTuple('truth') + if evt_type == '12205011': + mct1 = MCDecayTreeTuple('No_reso') + mct2 = MCDecayTreeTuple('f_1') + mct3 = MCDecayTreeTuple('f_2') + mct4 = MCDecayTreeTuple('f_0') + mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" + mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165011': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165021': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" + if evt_type == '12105011': + mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct.Branches = { + "B" : "[B+]CC" + } + mct.ToolList=['MCTupleToolHierarchy', + 'MCTupleToolKinematic', + 'MCTupleToolPrimaries'] +if doMC: + from Configurables import TrackSmearState as SMEAR + smear = SMEAR( 'Smear' ) + DaVinci().UserAlgorithms = [ smear ] +if not doMC: + from Configurables import TrackScaleState as SCALER + scaler = SCALER( 'Scaler' ) + DaVinci().UserAlgorithms = [ scaler ] +if doMC: + DaVinci().appendToMainSequence([mct]) + if evt_type == '12205011': + DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) + +from Configurables import CheckPV +checkpv = CheckPV() +DaVinci().UserAlgorithms += [checkpv] +DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] +DaVinci().DataType = data_type +if not doMC: + from Configurables import CondDB + CondDB( LatestGlobalTagByDataType = data_type ) +DaVinci().Simulation = True if doMC else False +#-------------------- +#-------------------- +DaVinci().EvtMax = -1 # Number of events +#DaVinci().EvtMax = 2000 # Number of events +DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) +if doMC: + DaVinci().InputType = 'DST' +else: + DaVinci().InputType = 'MDST' +DaVinci().PrintFreq = 1000 +DaVinci().SkipEvents = 0 # Events to skip +DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file +DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 + +if not doMC: + from PhysConf.Filters import LoKi_Filters + fltrs = LoKi_Filters ( + STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" + ) + DaVinci().EventPreFilters = fltrs.filters('Filters') + + +from GaudiConf import IOHelper + +# Use the local input data +IOHelper().inputFiles([ + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' +], clear=True) diff --git a/Btof1285/davinci_Data_2012.py b/Btof1285/davinci_Data_2012.py new file mode 100755 index 0000000000..a09f863316 --- /dev/null +++ b/Btof1285/davinci_Data_2012.py @@ -0,0 +1,216 @@ +import GaudiKernel.SystemOfUnits as Units +from GaudiConfUtils import ConfigurableGenerators +from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles +from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand +from DecayTreeTuple.Configuration import * +from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass +from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool +from Configurables import GaudiSequencer, PrintDecayTree +from MVADictHelpers import * +#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' +outTag = '' +line = 'Buto5h_K4pi_exclLine' +doMC = False +data_type = '2012' +if doMC: + stream_loc = 'AllStreams' + evt_type = '12205011' +else: + stream_loc = 'Bhadron' + +from Configurables import FilterInTrees +from PhysSelPython.Wrappers import Selection, DataOnDemand +from PhysConf.Selections import CombineSelection + +if doMC: + Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') + Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') +else: + #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) + tesLoc = 'Phys/{0}/Particles'.format(line) + kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") + kaons_from_B_sel = Selection("kaons_from_B_sel", + Algorithm=kaons_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") + pions_from_B_sel = Selection("pions_from_B_sel", + Algorithm=pions_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + Kaons = kaons_from_B_sel + Pions = pions_from_B_sel + + +XX1 = CombineParticles('D0', + DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", + CombinationCut="(AM > 100.0*MeV)", + DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' + }, + MotherCut='(PT > 100.0*MeV)') +XX1_sel = Selection('XX1_sel', + Algorithm=XX1, + RequiredSelections=[Pions]) + + +B_sel = CombineSelection( + 'Sel_B', + [XX1_sel,Kaons], + DecayDescriptor='[B+ -> f_1(1285) K+]cc', + CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', + DaughtersCuts ={ + 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, + MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' +) + +#-------------------- +#-------------------- + +decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" +branches={ + "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", + "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", + "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", + "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", + } +tl = ["TupleToolKinematic", + "TupleToolPropertime", + "TupleToolPid", + "TupleToolTrackInfo", + "TupleToolPrimaries", + "TupleToolEventInfo", + "TupleToolTrackInfo", + "TupleToolRecoStats", + "TupleToolGeometry", + "TupleToolTISTOS", + "TupleToolL0Data", + "TupleToolL0Calo"] + +from PhysConf.Selections import TupleSelection +myTuple = TupleSelection( +'myTuple', +[B_sel], +Decay=decaydesc, +Branches=branches, +ToolList=tl, +) + +tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] +myTuple.B.addTupleTool("TupleToolTISTOS") +myTuple.B.TupleToolTISTOS.Verbose = True +myTuple.B.TupleToolTISTOS.TriggerList = tg_list + +if doMC: + myTuple.ToolList += ['TupleToolMCBackgroundInfo'] + myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] + myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] + + +from Configurables import TupleToolDecay +for particle in list(branches.keys()): + myTuple.addTool(TupleToolDecay, name=particle) +myTuple.ReFitPVs = True + + +from Configurables import TupleToolDecayTreeFitter +MassFit = TupleToolDecayTreeFitter("MassFit") +MassFit.constrainToOriginVertex = True +MassFit.Verbose = True +MassFit.UpdateDaughters = True +myTuple.B.addTool(MassFit) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] + +Dres = TupleToolDecayTreeFitter("Dres") +Dres.constrainToOriginVertex = True +Dres.UpdateDaughters = True +Dres.Verbose = True +myTuple.B.addTool(Dres) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] +myTuple.B.Dres.Substitutions={ +'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', +'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' +} + + +if doMC: + from Configurables import TupleToolMCTruth + MCTruth = TupleToolMCTruth('Truth') + MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] + mct = MCDecayTreeTuple('truth') + if evt_type == '12205011': + mct1 = MCDecayTreeTuple('No_reso') + mct2 = MCDecayTreeTuple('f_1') + mct3 = MCDecayTreeTuple('f_2') + mct4 = MCDecayTreeTuple('f_0') + mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" + mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165011': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165021': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" + if evt_type == '12105011': + mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct.Branches = { + "B" : "[B+]CC" + } + mct.ToolList=['MCTupleToolHierarchy', + 'MCTupleToolKinematic', + 'MCTupleToolPrimaries'] +if doMC: + from Configurables import TrackSmearState as SMEAR + smear = SMEAR( 'Smear' ) + DaVinci().UserAlgorithms = [ smear ] +if not doMC: + from Configurables import TrackScaleState as SCALER + scaler = SCALER( 'Scaler' ) + DaVinci().UserAlgorithms = [ scaler ] +if doMC: + DaVinci().appendToMainSequence([mct]) + if evt_type == '12205011': + DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) + +from Configurables import CheckPV +checkpv = CheckPV() +DaVinci().UserAlgorithms += [checkpv] +DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] +DaVinci().DataType = data_type +if not doMC: + from Configurables import CondDB + CondDB( LatestGlobalTagByDataType = data_type ) +DaVinci().Simulation = True if doMC else False +#-------------------- +#-------------------- +DaVinci().EvtMax = -1 # Number of events +#DaVinci().EvtMax = 2000 # Number of events +DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) +if doMC: + DaVinci().InputType = 'DST' +else: + DaVinci().InputType = 'MDST' +DaVinci().PrintFreq = 1000 +DaVinci().SkipEvents = 0 # Events to skip +DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file +DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 + +if not doMC: + from PhysConf.Filters import LoKi_Filters + fltrs = LoKi_Filters ( + STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" + ) + DaVinci().EventPreFilters = fltrs.filters('Filters') + + +from GaudiConf import IOHelper + +# Use the local input data +IOHelper().inputFiles([ + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' +], clear=True) diff --git a/Btof1285/davinci_Data_2015.py b/Btof1285/davinci_Data_2015.py new file mode 100755 index 0000000000..be9c1d6711 --- /dev/null +++ b/Btof1285/davinci_Data_2015.py @@ -0,0 +1,216 @@ +import GaudiKernel.SystemOfUnits as Units +from GaudiConfUtils import ConfigurableGenerators +from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles +from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand +from DecayTreeTuple.Configuration import * +from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass +from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool +from Configurables import GaudiSequencer, PrintDecayTree +from MVADictHelpers import * +#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' +outTag = '' +line = 'Buto5h_K4pi_exclLine' +doMC = False +data_type = '2015' +if doMC: + stream_loc = 'AllStreams' + evt_type = '12205011' +else: + stream_loc = 'Bhadron' + +from Configurables import FilterInTrees +from PhysSelPython.Wrappers import Selection, DataOnDemand +from PhysConf.Selections import CombineSelection + +if doMC: + Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') + Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') +else: + #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) + tesLoc = 'Phys/{0}/Particles'.format(line) + kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") + kaons_from_B_sel = Selection("kaons_from_B_sel", + Algorithm=kaons_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") + pions_from_B_sel = Selection("pions_from_B_sel", + Algorithm=pions_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + Kaons = kaons_from_B_sel + Pions = pions_from_B_sel + + +XX1 = CombineParticles('D0', + DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", + CombinationCut="(AM > 100.0*MeV)", + DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' + }, + MotherCut='(PT > 100.0*MeV)') +XX1_sel = Selection('XX1_sel', + Algorithm=XX1, + RequiredSelections=[Pions]) + + +B_sel = CombineSelection( + 'Sel_B', + [XX1_sel,Kaons], + DecayDescriptor='[B+ -> f_1(1285) K+]cc', + CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', + DaughtersCuts ={ + 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, + MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' +) + +#-------------------- +#-------------------- + +decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" +branches={ + "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", + "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", + "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", + "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", + } +tl = ["TupleToolKinematic", + "TupleToolPropertime", + "TupleToolPid", + "TupleToolTrackInfo", + "TupleToolPrimaries", + "TupleToolEventInfo", + "TupleToolTrackInfo", + "TupleToolRecoStats", + "TupleToolGeometry", + "TupleToolTISTOS", + "TupleToolL0Data", + "TupleToolL0Calo"] + +from PhysConf.Selections import TupleSelection +myTuple = TupleSelection( +'myTuple', +[B_sel], +Decay=decaydesc, +Branches=branches, +ToolList=tl, +) + +tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] +myTuple.B.addTupleTool("TupleToolTISTOS") +myTuple.B.TupleToolTISTOS.Verbose = True +myTuple.B.TupleToolTISTOS.TriggerList = tg_list + +if doMC: + myTuple.ToolList += ['TupleToolMCBackgroundInfo'] + myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] + myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] + + +from Configurables import TupleToolDecay +for particle in list(branches.keys()): + myTuple.addTool(TupleToolDecay, name=particle) +myTuple.ReFitPVs = True + + +from Configurables import TupleToolDecayTreeFitter +MassFit = TupleToolDecayTreeFitter("MassFit") +MassFit.constrainToOriginVertex = True +MassFit.Verbose = True +MassFit.UpdateDaughters = True +myTuple.B.addTool(MassFit) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] + +Dres = TupleToolDecayTreeFitter("Dres") +Dres.constrainToOriginVertex = True +Dres.UpdateDaughters = True +Dres.Verbose = True +myTuple.B.addTool(Dres) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] +myTuple.B.Dres.Substitutions={ +'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', +'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' +} + + +if doMC: + from Configurables import TupleToolMCTruth + MCTruth = TupleToolMCTruth('Truth') + MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] + mct = MCDecayTreeTuple('truth') + if evt_type == '12205011': + mct1 = MCDecayTreeTuple('No_reso') + mct2 = MCDecayTreeTuple('f_1') + mct3 = MCDecayTreeTuple('f_2') + mct4 = MCDecayTreeTuple('f_0') + mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" + mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165011': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165021': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" + if evt_type == '12105011': + mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct.Branches = { + "B" : "[B+]CC" + } + mct.ToolList=['MCTupleToolHierarchy', + 'MCTupleToolKinematic', + 'MCTupleToolPrimaries'] +if doMC: + from Configurables import TrackSmearState as SMEAR + smear = SMEAR( 'Smear' ) + DaVinci().UserAlgorithms = [ smear ] +if not doMC: + from Configurables import TrackScaleState as SCALER + scaler = SCALER( 'Scaler' ) + DaVinci().UserAlgorithms = [ scaler ] +if doMC: + DaVinci().appendToMainSequence([mct]) + if evt_type == '12205011': + DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) + +from Configurables import CheckPV +checkpv = CheckPV() +DaVinci().UserAlgorithms += [checkpv] +DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] +DaVinci().DataType = data_type +if not doMC: + from Configurables import CondDB + CondDB( LatestGlobalTagByDataType = data_type ) +DaVinci().Simulation = True if doMC else False +#-------------------- +#-------------------- +DaVinci().EvtMax = -1 # Number of events +#DaVinci().EvtMax = 2000 # Number of events +DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) +if doMC: + DaVinci().InputType = 'DST' +else: + DaVinci().InputType = 'MDST' +DaVinci().PrintFreq = 1000 +DaVinci().SkipEvents = 0 # Events to skip +DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file +DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 + +if not doMC: + from PhysConf.Filters import LoKi_Filters + fltrs = LoKi_Filters ( + STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" + ) + DaVinci().EventPreFilters = fltrs.filters('Filters') + + +from GaudiConf import IOHelper + +# Use the local input data +IOHelper().inputFiles([ + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' +], clear=True) diff --git a/Btof1285/davinci_Data_2016.py b/Btof1285/davinci_Data_2016.py new file mode 100755 index 0000000000..091e040441 --- /dev/null +++ b/Btof1285/davinci_Data_2016.py @@ -0,0 +1,216 @@ +import GaudiKernel.SystemOfUnits as Units +from GaudiConfUtils import ConfigurableGenerators +from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles +from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand +from DecayTreeTuple.Configuration import * +from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass +from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool +from Configurables import GaudiSequencer, PrintDecayTree +from MVADictHelpers import * +#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' +outTag = '' +line = 'Buto5h_K4pi_exclLine' +doMC = False +data_type = '2016' +if doMC: + stream_loc = 'AllStreams' + evt_type = '12205011' +else: + stream_loc = 'Bhadron' + +from Configurables import FilterInTrees +from PhysSelPython.Wrappers import Selection, DataOnDemand +from PhysConf.Selections import CombineSelection + +if doMC: + Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') + Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') +else: + #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) + tesLoc = 'Phys/{0}/Particles'.format(line) + kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") + kaons_from_B_sel = Selection("kaons_from_B_sel", + Algorithm=kaons_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") + pions_from_B_sel = Selection("pions_from_B_sel", + Algorithm=pions_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + Kaons = kaons_from_B_sel + Pions = pions_from_B_sel + + +XX1 = CombineParticles('D0', + DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", + CombinationCut="(AM > 100.0*MeV)", + DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' + }, + MotherCut='(PT > 100.0*MeV)') +XX1_sel = Selection('XX1_sel', + Algorithm=XX1, + RequiredSelections=[Pions]) + + +B_sel = CombineSelection( + 'Sel_B', + [XX1_sel,Kaons], + DecayDescriptor='[B+ -> f_1(1285) K+]cc', + CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', + DaughtersCuts ={ + 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, + MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' +) + +#-------------------- +#-------------------- + +decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" +branches={ + "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", + "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", + "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", + "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", + } +tl = ["TupleToolKinematic", + "TupleToolPropertime", + "TupleToolPid", + "TupleToolTrackInfo", + "TupleToolPrimaries", + "TupleToolEventInfo", + "TupleToolTrackInfo", + "TupleToolRecoStats", + "TupleToolGeometry", + "TupleToolTISTOS", + "TupleToolL0Data", + "TupleToolL0Calo"] + +from PhysConf.Selections import TupleSelection +myTuple = TupleSelection( +'myTuple', +[B_sel], +Decay=decaydesc, +Branches=branches, +ToolList=tl, +) + +tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] +myTuple.B.addTupleTool("TupleToolTISTOS") +myTuple.B.TupleToolTISTOS.Verbose = True +myTuple.B.TupleToolTISTOS.TriggerList = tg_list + +if doMC: + myTuple.ToolList += ['TupleToolMCBackgroundInfo'] + myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] + myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] + + +from Configurables import TupleToolDecay +for particle in list(branches.keys()): + myTuple.addTool(TupleToolDecay, name=particle) +myTuple.ReFitPVs = True + + +from Configurables import TupleToolDecayTreeFitter +MassFit = TupleToolDecayTreeFitter("MassFit") +MassFit.constrainToOriginVertex = True +MassFit.Verbose = True +MassFit.UpdateDaughters = True +myTuple.B.addTool(MassFit) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] + +Dres = TupleToolDecayTreeFitter("Dres") +Dres.constrainToOriginVertex = True +Dres.UpdateDaughters = True +Dres.Verbose = True +myTuple.B.addTool(Dres) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] +myTuple.B.Dres.Substitutions={ +'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', +'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' +} + + +if doMC: + from Configurables import TupleToolMCTruth + MCTruth = TupleToolMCTruth('Truth') + MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] + mct = MCDecayTreeTuple('truth') + if evt_type == '12205011': + mct1 = MCDecayTreeTuple('No_reso') + mct2 = MCDecayTreeTuple('f_1') + mct3 = MCDecayTreeTuple('f_2') + mct4 = MCDecayTreeTuple('f_0') + mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" + mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165011': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165021': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" + if evt_type == '12105011': + mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct.Branches = { + "B" : "[B+]CC" + } + mct.ToolList=['MCTupleToolHierarchy', + 'MCTupleToolKinematic', + 'MCTupleToolPrimaries'] +if doMC: + from Configurables import TrackSmearState as SMEAR + smear = SMEAR( 'Smear' ) + DaVinci().UserAlgorithms = [ smear ] +if not doMC: + from Configurables import TrackScaleState as SCALER + scaler = SCALER( 'Scaler' ) + DaVinci().UserAlgorithms = [ scaler ] +if doMC: + DaVinci().appendToMainSequence([mct]) + if evt_type == '12205011': + DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) + +from Configurables import CheckPV +checkpv = CheckPV() +DaVinci().UserAlgorithms += [checkpv] +DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] +DaVinci().DataType = data_type +if not doMC: + from Configurables import CondDB + CondDB( LatestGlobalTagByDataType = data_type ) +DaVinci().Simulation = True if doMC else False +#-------------------- +#-------------------- +DaVinci().EvtMax = -1 # Number of events +#DaVinci().EvtMax = 2000 # Number of events +DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) +if doMC: + DaVinci().InputType = 'DST' +else: + DaVinci().InputType = 'MDST' +DaVinci().PrintFreq = 1000 +DaVinci().SkipEvents = 0 # Events to skip +DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file +DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 + +if not doMC: + from PhysConf.Filters import LoKi_Filters + fltrs = LoKi_Filters ( + STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" + ) + DaVinci().EventPreFilters = fltrs.filters('Filters') + + +from GaudiConf import IOHelper + +# Use the local input data +IOHelper().inputFiles([ + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' +], clear=True) diff --git a/Btof1285/davinci_Data_2017.py b/Btof1285/davinci_Data_2017.py new file mode 100755 index 0000000000..7a98b131b8 --- /dev/null +++ b/Btof1285/davinci_Data_2017.py @@ -0,0 +1,216 @@ +import GaudiKernel.SystemOfUnits as Units +from GaudiConfUtils import ConfigurableGenerators +from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles +from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand +from DecayTreeTuple.Configuration import * +from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass +from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool +from Configurables import GaudiSequencer, PrintDecayTree +from MVADictHelpers import * +#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' +outTag = '' +line = 'Buto5h_K4pi_exclLine' +doMC = False +data_type = '2017' +if doMC: + stream_loc = 'AllStreams' + evt_type = '12205011' +else: + stream_loc = 'Bhadron' + +from Configurables import FilterInTrees +from PhysSelPython.Wrappers import Selection, DataOnDemand +from PhysConf.Selections import CombineSelection + +if doMC: + Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') + Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') +else: + #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) + tesLoc = 'Phys/{0}/Particles'.format(line) + kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") + kaons_from_B_sel = Selection("kaons_from_B_sel", + Algorithm=kaons_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") + pions_from_B_sel = Selection("pions_from_B_sel", + Algorithm=pions_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + Kaons = kaons_from_B_sel + Pions = pions_from_B_sel + + +XX1 = CombineParticles('D0', + DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", + CombinationCut="(AM > 100.0*MeV)", + DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' + }, + MotherCut='(PT > 100.0*MeV)') +XX1_sel = Selection('XX1_sel', + Algorithm=XX1, + RequiredSelections=[Pions]) + + +B_sel = CombineSelection( + 'Sel_B', + [XX1_sel,Kaons], + DecayDescriptor='[B+ -> f_1(1285) K+]cc', + CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', + DaughtersCuts ={ + 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, + MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' +) + +#-------------------- +#-------------------- + +decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" +branches={ + "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", + "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", + "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", + "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", + } +tl = ["TupleToolKinematic", + "TupleToolPropertime", + "TupleToolPid", + "TupleToolTrackInfo", + "TupleToolPrimaries", + "TupleToolEventInfo", + "TupleToolTrackInfo", + "TupleToolRecoStats", + "TupleToolGeometry", + "TupleToolTISTOS", + "TupleToolL0Data", + "TupleToolL0Calo"] + +from PhysConf.Selections import TupleSelection +myTuple = TupleSelection( +'myTuple', +[B_sel], +Decay=decaydesc, +Branches=branches, +ToolList=tl, +) + +tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] +myTuple.B.addTupleTool("TupleToolTISTOS") +myTuple.B.TupleToolTISTOS.Verbose = True +myTuple.B.TupleToolTISTOS.TriggerList = tg_list + +if doMC: + myTuple.ToolList += ['TupleToolMCBackgroundInfo'] + myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] + myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] + + +from Configurables import TupleToolDecay +for particle in list(branches.keys()): + myTuple.addTool(TupleToolDecay, name=particle) +myTuple.ReFitPVs = True + + +from Configurables import TupleToolDecayTreeFitter +MassFit = TupleToolDecayTreeFitter("MassFit") +MassFit.constrainToOriginVertex = True +MassFit.Verbose = True +MassFit.UpdateDaughters = True +myTuple.B.addTool(MassFit) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] + +Dres = TupleToolDecayTreeFitter("Dres") +Dres.constrainToOriginVertex = True +Dres.UpdateDaughters = True +Dres.Verbose = True +myTuple.B.addTool(Dres) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] +myTuple.B.Dres.Substitutions={ +'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', +'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' +} + + +if doMC: + from Configurables import TupleToolMCTruth + MCTruth = TupleToolMCTruth('Truth') + MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] + mct = MCDecayTreeTuple('truth') + if evt_type == '12205011': + mct1 = MCDecayTreeTuple('No_reso') + mct2 = MCDecayTreeTuple('f_1') + mct3 = MCDecayTreeTuple('f_2') + mct4 = MCDecayTreeTuple('f_0') + mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" + mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165011': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165021': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" + if evt_type == '12105011': + mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct.Branches = { + "B" : "[B+]CC" + } + mct.ToolList=['MCTupleToolHierarchy', + 'MCTupleToolKinematic', + 'MCTupleToolPrimaries'] +if doMC: + from Configurables import TrackSmearState as SMEAR + smear = SMEAR( 'Smear' ) + DaVinci().UserAlgorithms = [ smear ] +if not doMC: + from Configurables import TrackScaleState as SCALER + scaler = SCALER( 'Scaler' ) + DaVinci().UserAlgorithms = [ scaler ] +if doMC: + DaVinci().appendToMainSequence([mct]) + if evt_type == '12205011': + DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) + +from Configurables import CheckPV +checkpv = CheckPV() +DaVinci().UserAlgorithms += [checkpv] +DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] +DaVinci().DataType = data_type +if not doMC: + from Configurables import CondDB + CondDB( LatestGlobalTagByDataType = data_type ) +DaVinci().Simulation = True if doMC else False +#-------------------- +#-------------------- +DaVinci().EvtMax = -1 # Number of events +#DaVinci().EvtMax = 2000 # Number of events +DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) +if doMC: + DaVinci().InputType = 'DST' +else: + DaVinci().InputType = 'MDST' +DaVinci().PrintFreq = 1000 +DaVinci().SkipEvents = 0 # Events to skip +DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file +DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 + +if not doMC: + from PhysConf.Filters import LoKi_Filters + fltrs = LoKi_Filters ( + STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" + ) + DaVinci().EventPreFilters = fltrs.filters('Filters') + + +from GaudiConf import IOHelper + +# Use the local input data +IOHelper().inputFiles([ + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' +], clear=True) diff --git a/Btof1285/davinci_Data_2018.py b/Btof1285/davinci_Data_2018.py new file mode 100755 index 0000000000..a84a6bc89f --- /dev/null +++ b/Btof1285/davinci_Data_2018.py @@ -0,0 +1,216 @@ +import GaudiKernel.SystemOfUnits as Units +from GaudiConfUtils import ConfigurableGenerators +from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles +from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand +from DecayTreeTuple.Configuration import * +from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass +from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool +from Configurables import GaudiSequencer, PrintDecayTree +from MVADictHelpers import * +#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' +outTag = '' +line = 'Buto5h_K4pi_exclLine' +doMC = False +data_type = '2018' +if doMC: + stream_loc = 'AllStreams' + evt_type = '12205011' +else: + stream_loc = 'Bhadron' + +from Configurables import FilterInTrees +from PhysSelPython.Wrappers import Selection, DataOnDemand +from PhysConf.Selections import CombineSelection + +if doMC: + Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') + Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') +else: + #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) + tesLoc = 'Phys/{0}/Particles'.format(line) + kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") + kaons_from_B_sel = Selection("kaons_from_B_sel", + Algorithm=kaons_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") + pions_from_B_sel = Selection("pions_from_B_sel", + Algorithm=pions_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + Kaons = kaons_from_B_sel + Pions = pions_from_B_sel + + +XX1 = CombineParticles('D0', + DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", + CombinationCut="(AM > 100.0*MeV)", + DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' + }, + MotherCut='(PT > 100.0*MeV)') +XX1_sel = Selection('XX1_sel', + Algorithm=XX1, + RequiredSelections=[Pions]) + + +B_sel = CombineSelection( + 'Sel_B', + [XX1_sel,Kaons], + DecayDescriptor='[B+ -> f_1(1285) K+]cc', + CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', + DaughtersCuts ={ + 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, + MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' +) + +#-------------------- +#-------------------- + +decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" +branches={ + "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", + "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", + "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", + "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", + } +tl = ["TupleToolKinematic", + "TupleToolPropertime", + "TupleToolPid", + "TupleToolTrackInfo", + "TupleToolPrimaries", + "TupleToolEventInfo", + "TupleToolTrackInfo", + "TupleToolRecoStats", + "TupleToolGeometry", + "TupleToolTISTOS", + "TupleToolL0Data", + "TupleToolL0Calo"] + +from PhysConf.Selections import TupleSelection +myTuple = TupleSelection( +'myTuple', +[B_sel], +Decay=decaydesc, +Branches=branches, +ToolList=tl, +) + +tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] +myTuple.B.addTupleTool("TupleToolTISTOS") +myTuple.B.TupleToolTISTOS.Verbose = True +myTuple.B.TupleToolTISTOS.TriggerList = tg_list + +if doMC: + myTuple.ToolList += ['TupleToolMCBackgroundInfo'] + myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] + myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] + + +from Configurables import TupleToolDecay +for particle in list(branches.keys()): + myTuple.addTool(TupleToolDecay, name=particle) +myTuple.ReFitPVs = True + + +from Configurables import TupleToolDecayTreeFitter +MassFit = TupleToolDecayTreeFitter("MassFit") +MassFit.constrainToOriginVertex = True +MassFit.Verbose = True +MassFit.UpdateDaughters = True +myTuple.B.addTool(MassFit) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] + +Dres = TupleToolDecayTreeFitter("Dres") +Dres.constrainToOriginVertex = True +Dres.UpdateDaughters = True +Dres.Verbose = True +myTuple.B.addTool(Dres) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] +myTuple.B.Dres.Substitutions={ +'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', +'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' +} + + +if doMC: + from Configurables import TupleToolMCTruth + MCTruth = TupleToolMCTruth('Truth') + MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] + mct = MCDecayTreeTuple('truth') + if evt_type == '12205011': + mct1 = MCDecayTreeTuple('No_reso') + mct2 = MCDecayTreeTuple('f_1') + mct3 = MCDecayTreeTuple('f_2') + mct4 = MCDecayTreeTuple('f_0') + mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" + mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165011': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165021': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" + if evt_type == '12105011': + mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct.Branches = { + "B" : "[B+]CC" + } + mct.ToolList=['MCTupleToolHierarchy', + 'MCTupleToolKinematic', + 'MCTupleToolPrimaries'] +if doMC: + from Configurables import TrackSmearState as SMEAR + smear = SMEAR( 'Smear' ) + DaVinci().UserAlgorithms = [ smear ] +if not doMC: + from Configurables import TrackScaleState as SCALER + scaler = SCALER( 'Scaler' ) + DaVinci().UserAlgorithms = [ scaler ] +if doMC: + DaVinci().appendToMainSequence([mct]) + if evt_type == '12205011': + DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) + +from Configurables import CheckPV +checkpv = CheckPV() +DaVinci().UserAlgorithms += [checkpv] +DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] +DaVinci().DataType = data_type +if not doMC: + from Configurables import CondDB + CondDB( LatestGlobalTagByDataType = data_type ) +DaVinci().Simulation = True if doMC else False +#-------------------- +#-------------------- +DaVinci().EvtMax = -1 # Number of events +#DaVinci().EvtMax = 2000 # Number of events +DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) +if doMC: + DaVinci().InputType = 'DST' +else: + DaVinci().InputType = 'MDST' +DaVinci().PrintFreq = 1000 +DaVinci().SkipEvents = 0 # Events to skip +DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file +DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 + +if not doMC: + from PhysConf.Filters import LoKi_Filters + fltrs = LoKi_Filters ( + STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" + ) + DaVinci().EventPreFilters = fltrs.filters('Filters') + + +from GaudiConf import IOHelper + +# Use the local input data +IOHelper().inputFiles([ + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' +], clear=True) diff --git a/Btof1285/info.yaml b/Btof1285/info.yaml new file mode 100644 index 0000000000..b847c0d877 --- /dev/null +++ b/Btof1285/info.yaml @@ -0,0 +1,82 @@ +defaults: + application: DaVinci/v45r8 + wg: BnoC + automatically_configure: yes + inform: + - razhang@cern.ch + - dzhangg@cern.ch + output: Tuple_data1_X.root + +2011_MagDown: + input: + bk_query: /LHCb/Collision11/Beam3500GeV-VeloClosed-MagDown/Real Data/Reco14/Stripping21r1/90000000/BHADRON.MDST + options: + - davinci_Data_2011.py + +2011_MagUp: + input: + bk_query: /LHCb/Collision11/Beam3500GeV-VeloClosed-MagUp/Real Data/Reco14/Stripping21r1/90000000/BHADRON.MDST + options: + - davinci_Data_2011.py + +2012_MagDown: + input: + bk_query: /LHCb/Collision12/Beam4000GeV-VeloClosed-MagDown/Real Data/Reco14/Stripping21/90000000/BHADRON.MDST + options: + - davinci_Data_2012.py + +2012_MagUp: + input: + bk_query: /LHCb/Collision12/Beam4000GeV-VeloClosed-MagUp/Real Data/Reco14/Stripping21/90000000/BHADRON.MDST + options: + - davinci_Data_2012.py + + +2015_MagDown: + input: + bk_query: /LHCb/Collision15/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco15a/Stripping24r2/90000000/BHADRON.MDST + options: + - davinci_Data_2015.py + +2015_MagUp: + input: + bk_query: /LHCb/Collision15/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco15a/Stripping24r2/90000000/BHADRON.MDST + options: + - davinci_Data_2015.py + +2016_MagUp: + input: + bk_query: /LHCb/Collision16/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco16/Stripping28r2/90000000/BHADRON.MDST + options: + - davinci_Data_2016.py + + +2016_MagDown: + input: + bk_query: /LHCb/Collision16/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco16/Stripping28r2/90000000/BHADRON.MDST + options: + - davinci_Data_2016.py + +2017_MagUp: + input: + bk_query: /LHCb/Collision17/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco17/Stripping29r2/90000000/BHADRON.MDST + options: + - davinci_Data_2017.py + +2017_MagDown: + input: + bk_query: /LHCb/Collision17/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco17/Stripping29r2/90000000/BHADRON.MDST + options: + - davinci_Data_2017.py + +2018_MagUp: + input: + bk_query: /LHCb/Collision18/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco18/Stripping34/90000000/BHADRON.MDST + options: + - davinci_Data_2018.py + +2018_MagDown: + input: + bk_query: /LHCb/Collision18/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco18/Stripping34/90000000/BHADRON.MDST + options: + - davinci_Data_2018.py -- GitLab From 46862e33f2261d4740b1275096be86ac07f0b380 Mon Sep 17 00:00:00 2001 From: razhang <razhang razhang@cern.ch> Date: Mon, 25 Nov 2024 03:41:43 +0100 Subject: [PATCH 2/4] merge davinci --- Btof1285/davinci_Data_Btof1285.py | 216 ++++++++++++++++++++++++++++++ Btof1285/info.yaml | 24 ++-- 2 files changed, 228 insertions(+), 12 deletions(-) create mode 100755 Btof1285/davinci_Data_Btof1285.py diff --git a/Btof1285/davinci_Data_Btof1285.py b/Btof1285/davinci_Data_Btof1285.py new file mode 100755 index 0000000000..95d22bf328 --- /dev/null +++ b/Btof1285/davinci_Data_Btof1285.py @@ -0,0 +1,216 @@ +import GaudiKernel.SystemOfUnits as Units +from GaudiConfUtils import ConfigurableGenerators +from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles +from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand +from DecayTreeTuple.Configuration import * +from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass +from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool +from Configurables import GaudiSequencer, PrintDecayTree +from MVADictHelpers import * +#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' +outTag = '' +line = 'Buto5h_K4pi_exclLine' +doMC = False +data_type = '2011' +if doMC: + stream_loc = 'AllStreams' + evt_type = '12205011' +else: + stream_loc = 'Bhadron' + +from Configurables import FilterInTrees +from PhysSelPython.Wrappers import Selection, DataOnDemand +from PhysConf.Selections import CombineSelection + +if doMC: + Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') + Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') +else: + #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) + tesLoc = 'Phys/{0}/Particles'.format(line) + kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") + kaons_from_B_sel = Selection("kaons_from_B_sel", + Algorithm=kaons_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") + pions_from_B_sel = Selection("pions_from_B_sel", + Algorithm=pions_from_B, + RequiredSelections=[DataOnDemand(Location=tesLoc)]) + Kaons = kaons_from_B_sel + Pions = pions_from_B_sel + + +XX1 = CombineParticles('D0', + DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", + CombinationCut="(AM > 100.0*MeV)", + DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' + }, + MotherCut='(PT > 100.0*MeV)') +XX1_sel = Selection('XX1_sel', + Algorithm=XX1, + RequiredSelections=[Pions]) + + +B_sel = CombineSelection( + 'Sel_B', + [XX1_sel,Kaons], + DecayDescriptor='[B+ -> f_1(1285) K+]cc', + CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', + DaughtersCuts ={ + 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', + 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, + MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' +) + +#-------------------- +#-------------------- + +decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" +branches={ + "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", + "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", + "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", + "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", + "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", + } +tl = ["TupleToolKinematic", + "TupleToolPropertime", + "TupleToolPid", + "TupleToolTrackInfo", + "TupleToolPrimaries", + "TupleToolEventInfo", + "TupleToolTrackInfo", + "TupleToolRecoStats", + "TupleToolGeometry", + "TupleToolTISTOS", + "TupleToolL0Data", + "TupleToolL0Calo"] + +from PhysConf.Selections import TupleSelection +myTuple = TupleSelection( +'myTuple', +[B_sel], +Decay=decaydesc, +Branches=branches, +ToolList=tl, +) + +tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] +myTuple.B.addTupleTool("TupleToolTISTOS") +myTuple.B.TupleToolTISTOS.Verbose = True +myTuple.B.TupleToolTISTOS.TriggerList = tg_list + +if doMC: + myTuple.ToolList += ['TupleToolMCBackgroundInfo'] + myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] + myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] + + +from Configurables import TupleToolDecay +for particle in list(branches.keys()): + myTuple.addTool(TupleToolDecay, name=particle) +myTuple.ReFitPVs = True + + +from Configurables import TupleToolDecayTreeFitter +MassFit = TupleToolDecayTreeFitter("MassFit") +MassFit.constrainToOriginVertex = True +MassFit.Verbose = True +MassFit.UpdateDaughters = True +myTuple.B.addTool(MassFit) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] + +Dres = TupleToolDecayTreeFitter("Dres") +Dres.constrainToOriginVertex = True +Dres.UpdateDaughters = True +Dres.Verbose = True +myTuple.B.addTool(Dres) +myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] +myTuple.B.Dres.Substitutions={ +'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', +'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' +} + + +if doMC: + from Configurables import TupleToolMCTruth + MCTruth = TupleToolMCTruth('Truth') + MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] + mct = MCDecayTreeTuple('truth') + if evt_type == '12205011': + mct1 = MCDecayTreeTuple('No_reso') + mct2 = MCDecayTreeTuple('f_1') + mct3 = MCDecayTreeTuple('f_2') + mct4 = MCDecayTreeTuple('f_0') + mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" + mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165011': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" + if evt_type == '12165021': + mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" + if evt_type == '12105011': + mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" + mct.Branches = { + "B" : "[B+]CC" + } + mct.ToolList=['MCTupleToolHierarchy', + 'MCTupleToolKinematic', + 'MCTupleToolPrimaries'] +if doMC: + from Configurables import TrackSmearState as SMEAR + smear = SMEAR( 'Smear' ) + DaVinci().UserAlgorithms = [ smear ] +if not doMC: + from Configurables import TrackScaleState as SCALER + scaler = SCALER( 'Scaler' ) + DaVinci().UserAlgorithms = [ scaler ] +if doMC: + DaVinci().appendToMainSequence([mct]) + if evt_type == '12205011': + DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) + +from Configurables import CheckPV +checkpv = CheckPV() +DaVinci().UserAlgorithms += [checkpv] +DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] +DaVinci().DataType = data_type +if not doMC: + from Configurables import CondDB + CondDB( LatestGlobalTagByDataType = data_type ) +DaVinci().Simulation = True if doMC else False +#-------------------- +#-------------------- +DaVinci().EvtMax = -1 # Number of events +#DaVinci().EvtMax = 2000 # Number of events +DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) +if doMC: + DaVinci().InputType = 'DST' +else: + DaVinci().InputType = 'MDST' +DaVinci().PrintFreq = 1000 +DaVinci().SkipEvents = 0 # Events to skip +DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file +DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 + +if not doMC: + from PhysConf.Filters import LoKi_Filters + fltrs = LoKi_Filters ( + STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" + ) + DaVinci().EventPreFilters = fltrs.filters('Filters') + + +from GaudiConf import IOHelper + +# Use the local input data +IOHelper().inputFiles([ + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' + #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' +], clear=True) diff --git a/Btof1285/info.yaml b/Btof1285/info.yaml index b847c0d877..a64f7e60f1 100644 --- a/Btof1285/info.yaml +++ b/Btof1285/info.yaml @@ -11,72 +11,72 @@ defaults: input: bk_query: /LHCb/Collision11/Beam3500GeV-VeloClosed-MagDown/Real Data/Reco14/Stripping21r1/90000000/BHADRON.MDST options: - - davinci_Data_2011.py + - davinci_Data_Btof1285.py 2011_MagUp: input: bk_query: /LHCb/Collision11/Beam3500GeV-VeloClosed-MagUp/Real Data/Reco14/Stripping21r1/90000000/BHADRON.MDST options: - - davinci_Data_2011.py + - davinci_Data_Btof1285.py 2012_MagDown: input: bk_query: /LHCb/Collision12/Beam4000GeV-VeloClosed-MagDown/Real Data/Reco14/Stripping21/90000000/BHADRON.MDST options: - - davinci_Data_2012.py + - davinci_Data_Btof1285.py 2012_MagUp: input: bk_query: /LHCb/Collision12/Beam4000GeV-VeloClosed-MagUp/Real Data/Reco14/Stripping21/90000000/BHADRON.MDST options: - - davinci_Data_2012.py + - davinci_Data_Btof1285.py 2015_MagDown: input: bk_query: /LHCb/Collision15/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco15a/Stripping24r2/90000000/BHADRON.MDST options: - - davinci_Data_2015.py + - davinci_Data_Btof1285.py 2015_MagUp: input: bk_query: /LHCb/Collision15/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco15a/Stripping24r2/90000000/BHADRON.MDST options: - - davinci_Data_2015.py + - davinci_Data_Btof1285.py 2016_MagUp: input: bk_query: /LHCb/Collision16/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco16/Stripping28r2/90000000/BHADRON.MDST options: - - davinci_Data_2016.py + - davinci_Data_Btof1285.py 2016_MagDown: input: bk_query: /LHCb/Collision16/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco16/Stripping28r2/90000000/BHADRON.MDST options: - - davinci_Data_2016.py + - davinci_Data_Btof1285.py 2017_MagUp: input: bk_query: /LHCb/Collision17/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco17/Stripping29r2/90000000/BHADRON.MDST options: - - davinci_Data_2017.py + - davinci_Data_Btof1285.py 2017_MagDown: input: bk_query: /LHCb/Collision17/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco17/Stripping29r2/90000000/BHADRON.MDST options: - - davinci_Data_2017.py + - davinci_Data_Btof1285.py 2018_MagUp: input: bk_query: /LHCb/Collision18/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco18/Stripping34/90000000/BHADRON.MDST options: - - davinci_Data_2018.py + - davinci_Data_Btof1285.py 2018_MagDown: input: bk_query: /LHCb/Collision18/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco18/Stripping34/90000000/BHADRON.MDST options: - - davinci_Data_2018.py + - davinci_Data_Btof1285.py -- GitLab From 65edcd89b3de315a6fe9b664eda60aef3cdde0dd Mon Sep 17 00:00:00 2001 From: razhang <razhang razhang@cern.ch> Date: Mon, 25 Nov 2024 03:47:01 +0100 Subject: [PATCH 3/4] remove --- Btof1285/davinci_Data_2011.py | 216 ---------------------------------- Btof1285/davinci_Data_2012.py | 216 ---------------------------------- Btof1285/davinci_Data_2015.py | 216 ---------------------------------- Btof1285/davinci_Data_2016.py | 216 ---------------------------------- Btof1285/davinci_Data_2017.py | 216 ---------------------------------- Btof1285/davinci_Data_2018.py | 216 ---------------------------------- 6 files changed, 1296 deletions(-) delete mode 100755 Btof1285/davinci_Data_2011.py delete mode 100755 Btof1285/davinci_Data_2012.py delete mode 100755 Btof1285/davinci_Data_2015.py delete mode 100755 Btof1285/davinci_Data_2016.py delete mode 100755 Btof1285/davinci_Data_2017.py delete mode 100755 Btof1285/davinci_Data_2018.py diff --git a/Btof1285/davinci_Data_2011.py b/Btof1285/davinci_Data_2011.py deleted file mode 100755 index 95d22bf328..0000000000 --- a/Btof1285/davinci_Data_2011.py +++ /dev/null @@ -1,216 +0,0 @@ -import GaudiKernel.SystemOfUnits as Units -from GaudiConfUtils import ConfigurableGenerators -from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles -from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand -from DecayTreeTuple.Configuration import * -from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass -from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool -from Configurables import GaudiSequencer, PrintDecayTree -from MVADictHelpers import * -#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' -outTag = '' -line = 'Buto5h_K4pi_exclLine' -doMC = False -data_type = '2011' -if doMC: - stream_loc = 'AllStreams' - evt_type = '12205011' -else: - stream_loc = 'Bhadron' - -from Configurables import FilterInTrees -from PhysSelPython.Wrappers import Selection, DataOnDemand -from PhysConf.Selections import CombineSelection - -if doMC: - Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') - Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') -else: - #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) - tesLoc = 'Phys/{0}/Particles'.format(line) - kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") - kaons_from_B_sel = Selection("kaons_from_B_sel", - Algorithm=kaons_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") - pions_from_B_sel = Selection("pions_from_B_sel", - Algorithm=pions_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - Kaons = kaons_from_B_sel - Pions = pions_from_B_sel - - -XX1 = CombineParticles('D0', - DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", - CombinationCut="(AM > 100.0*MeV)", - DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' - }, - MotherCut='(PT > 100.0*MeV)') -XX1_sel = Selection('XX1_sel', - Algorithm=XX1, - RequiredSelections=[Pions]) - - -B_sel = CombineSelection( - 'Sel_B', - [XX1_sel,Kaons], - DecayDescriptor='[B+ -> f_1(1285) K+]cc', - CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', - DaughtersCuts ={ - 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, - MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' -) - -#-------------------- -#-------------------- - -decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" -branches={ - "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", - "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", - "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", - "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", - } -tl = ["TupleToolKinematic", - "TupleToolPropertime", - "TupleToolPid", - "TupleToolTrackInfo", - "TupleToolPrimaries", - "TupleToolEventInfo", - "TupleToolTrackInfo", - "TupleToolRecoStats", - "TupleToolGeometry", - "TupleToolTISTOS", - "TupleToolL0Data", - "TupleToolL0Calo"] - -from PhysConf.Selections import TupleSelection -myTuple = TupleSelection( -'myTuple', -[B_sel], -Decay=decaydesc, -Branches=branches, -ToolList=tl, -) - -tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] -myTuple.B.addTupleTool("TupleToolTISTOS") -myTuple.B.TupleToolTISTOS.Verbose = True -myTuple.B.TupleToolTISTOS.TriggerList = tg_list - -if doMC: - myTuple.ToolList += ['TupleToolMCBackgroundInfo'] - myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] - myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] - - -from Configurables import TupleToolDecay -for particle in list(branches.keys()): - myTuple.addTool(TupleToolDecay, name=particle) -myTuple.ReFitPVs = True - - -from Configurables import TupleToolDecayTreeFitter -MassFit = TupleToolDecayTreeFitter("MassFit") -MassFit.constrainToOriginVertex = True -MassFit.Verbose = True -MassFit.UpdateDaughters = True -myTuple.B.addTool(MassFit) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] - -Dres = TupleToolDecayTreeFitter("Dres") -Dres.constrainToOriginVertex = True -Dres.UpdateDaughters = True -Dres.Verbose = True -myTuple.B.addTool(Dres) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] -myTuple.B.Dres.Substitutions={ -'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', -'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' -} - - -if doMC: - from Configurables import TupleToolMCTruth - MCTruth = TupleToolMCTruth('Truth') - MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] - mct = MCDecayTreeTuple('truth') - if evt_type == '12205011': - mct1 = MCDecayTreeTuple('No_reso') - mct2 = MCDecayTreeTuple('f_1') - mct3 = MCDecayTreeTuple('f_2') - mct4 = MCDecayTreeTuple('f_0') - mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" - mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165011': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165021': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" - if evt_type == '12105011': - mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct.Branches = { - "B" : "[B+]CC" - } - mct.ToolList=['MCTupleToolHierarchy', - 'MCTupleToolKinematic', - 'MCTupleToolPrimaries'] -if doMC: - from Configurables import TrackSmearState as SMEAR - smear = SMEAR( 'Smear' ) - DaVinci().UserAlgorithms = [ smear ] -if not doMC: - from Configurables import TrackScaleState as SCALER - scaler = SCALER( 'Scaler' ) - DaVinci().UserAlgorithms = [ scaler ] -if doMC: - DaVinci().appendToMainSequence([mct]) - if evt_type == '12205011': - DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) - -from Configurables import CheckPV -checkpv = CheckPV() -DaVinci().UserAlgorithms += [checkpv] -DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] -DaVinci().DataType = data_type -if not doMC: - from Configurables import CondDB - CondDB( LatestGlobalTagByDataType = data_type ) -DaVinci().Simulation = True if doMC else False -#-------------------- -#-------------------- -DaVinci().EvtMax = -1 # Number of events -#DaVinci().EvtMax = 2000 # Number of events -DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) -if doMC: - DaVinci().InputType = 'DST' -else: - DaVinci().InputType = 'MDST' -DaVinci().PrintFreq = 1000 -DaVinci().SkipEvents = 0 # Events to skip -DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file -DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 - -if not doMC: - from PhysConf.Filters import LoKi_Filters - fltrs = LoKi_Filters ( - STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" - ) - DaVinci().EventPreFilters = fltrs.filters('Filters') - - -from GaudiConf import IOHelper - -# Use the local input data -IOHelper().inputFiles([ - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' -], clear=True) diff --git a/Btof1285/davinci_Data_2012.py b/Btof1285/davinci_Data_2012.py deleted file mode 100755 index a09f863316..0000000000 --- a/Btof1285/davinci_Data_2012.py +++ /dev/null @@ -1,216 +0,0 @@ -import GaudiKernel.SystemOfUnits as Units -from GaudiConfUtils import ConfigurableGenerators -from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles -from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand -from DecayTreeTuple.Configuration import * -from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass -from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool -from Configurables import GaudiSequencer, PrintDecayTree -from MVADictHelpers import * -#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' -outTag = '' -line = 'Buto5h_K4pi_exclLine' -doMC = False -data_type = '2012' -if doMC: - stream_loc = 'AllStreams' - evt_type = '12205011' -else: - stream_loc = 'Bhadron' - -from Configurables import FilterInTrees -from PhysSelPython.Wrappers import Selection, DataOnDemand -from PhysConf.Selections import CombineSelection - -if doMC: - Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') - Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') -else: - #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) - tesLoc = 'Phys/{0}/Particles'.format(line) - kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") - kaons_from_B_sel = Selection("kaons_from_B_sel", - Algorithm=kaons_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") - pions_from_B_sel = Selection("pions_from_B_sel", - Algorithm=pions_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - Kaons = kaons_from_B_sel - Pions = pions_from_B_sel - - -XX1 = CombineParticles('D0', - DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", - CombinationCut="(AM > 100.0*MeV)", - DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' - }, - MotherCut='(PT > 100.0*MeV)') -XX1_sel = Selection('XX1_sel', - Algorithm=XX1, - RequiredSelections=[Pions]) - - -B_sel = CombineSelection( - 'Sel_B', - [XX1_sel,Kaons], - DecayDescriptor='[B+ -> f_1(1285) K+]cc', - CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', - DaughtersCuts ={ - 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, - MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' -) - -#-------------------- -#-------------------- - -decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" -branches={ - "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", - "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", - "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", - "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", - } -tl = ["TupleToolKinematic", - "TupleToolPropertime", - "TupleToolPid", - "TupleToolTrackInfo", - "TupleToolPrimaries", - "TupleToolEventInfo", - "TupleToolTrackInfo", - "TupleToolRecoStats", - "TupleToolGeometry", - "TupleToolTISTOS", - "TupleToolL0Data", - "TupleToolL0Calo"] - -from PhysConf.Selections import TupleSelection -myTuple = TupleSelection( -'myTuple', -[B_sel], -Decay=decaydesc, -Branches=branches, -ToolList=tl, -) - -tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] -myTuple.B.addTupleTool("TupleToolTISTOS") -myTuple.B.TupleToolTISTOS.Verbose = True -myTuple.B.TupleToolTISTOS.TriggerList = tg_list - -if doMC: - myTuple.ToolList += ['TupleToolMCBackgroundInfo'] - myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] - myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] - - -from Configurables import TupleToolDecay -for particle in list(branches.keys()): - myTuple.addTool(TupleToolDecay, name=particle) -myTuple.ReFitPVs = True - - -from Configurables import TupleToolDecayTreeFitter -MassFit = TupleToolDecayTreeFitter("MassFit") -MassFit.constrainToOriginVertex = True -MassFit.Verbose = True -MassFit.UpdateDaughters = True -myTuple.B.addTool(MassFit) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] - -Dres = TupleToolDecayTreeFitter("Dres") -Dres.constrainToOriginVertex = True -Dres.UpdateDaughters = True -Dres.Verbose = True -myTuple.B.addTool(Dres) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] -myTuple.B.Dres.Substitutions={ -'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', -'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' -} - - -if doMC: - from Configurables import TupleToolMCTruth - MCTruth = TupleToolMCTruth('Truth') - MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] - mct = MCDecayTreeTuple('truth') - if evt_type == '12205011': - mct1 = MCDecayTreeTuple('No_reso') - mct2 = MCDecayTreeTuple('f_1') - mct3 = MCDecayTreeTuple('f_2') - mct4 = MCDecayTreeTuple('f_0') - mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" - mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165011': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165021': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" - if evt_type == '12105011': - mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct.Branches = { - "B" : "[B+]CC" - } - mct.ToolList=['MCTupleToolHierarchy', - 'MCTupleToolKinematic', - 'MCTupleToolPrimaries'] -if doMC: - from Configurables import TrackSmearState as SMEAR - smear = SMEAR( 'Smear' ) - DaVinci().UserAlgorithms = [ smear ] -if not doMC: - from Configurables import TrackScaleState as SCALER - scaler = SCALER( 'Scaler' ) - DaVinci().UserAlgorithms = [ scaler ] -if doMC: - DaVinci().appendToMainSequence([mct]) - if evt_type == '12205011': - DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) - -from Configurables import CheckPV -checkpv = CheckPV() -DaVinci().UserAlgorithms += [checkpv] -DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] -DaVinci().DataType = data_type -if not doMC: - from Configurables import CondDB - CondDB( LatestGlobalTagByDataType = data_type ) -DaVinci().Simulation = True if doMC else False -#-------------------- -#-------------------- -DaVinci().EvtMax = -1 # Number of events -#DaVinci().EvtMax = 2000 # Number of events -DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) -if doMC: - DaVinci().InputType = 'DST' -else: - DaVinci().InputType = 'MDST' -DaVinci().PrintFreq = 1000 -DaVinci().SkipEvents = 0 # Events to skip -DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file -DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 - -if not doMC: - from PhysConf.Filters import LoKi_Filters - fltrs = LoKi_Filters ( - STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" - ) - DaVinci().EventPreFilters = fltrs.filters('Filters') - - -from GaudiConf import IOHelper - -# Use the local input data -IOHelper().inputFiles([ - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' -], clear=True) diff --git a/Btof1285/davinci_Data_2015.py b/Btof1285/davinci_Data_2015.py deleted file mode 100755 index be9c1d6711..0000000000 --- a/Btof1285/davinci_Data_2015.py +++ /dev/null @@ -1,216 +0,0 @@ -import GaudiKernel.SystemOfUnits as Units -from GaudiConfUtils import ConfigurableGenerators -from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles -from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand -from DecayTreeTuple.Configuration import * -from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass -from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool -from Configurables import GaudiSequencer, PrintDecayTree -from MVADictHelpers import * -#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' -outTag = '' -line = 'Buto5h_K4pi_exclLine' -doMC = False -data_type = '2015' -if doMC: - stream_loc = 'AllStreams' - evt_type = '12205011' -else: - stream_loc = 'Bhadron' - -from Configurables import FilterInTrees -from PhysSelPython.Wrappers import Selection, DataOnDemand -from PhysConf.Selections import CombineSelection - -if doMC: - Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') - Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') -else: - #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) - tesLoc = 'Phys/{0}/Particles'.format(line) - kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") - kaons_from_B_sel = Selection("kaons_from_B_sel", - Algorithm=kaons_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") - pions_from_B_sel = Selection("pions_from_B_sel", - Algorithm=pions_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - Kaons = kaons_from_B_sel - Pions = pions_from_B_sel - - -XX1 = CombineParticles('D0', - DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", - CombinationCut="(AM > 100.0*MeV)", - DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' - }, - MotherCut='(PT > 100.0*MeV)') -XX1_sel = Selection('XX1_sel', - Algorithm=XX1, - RequiredSelections=[Pions]) - - -B_sel = CombineSelection( - 'Sel_B', - [XX1_sel,Kaons], - DecayDescriptor='[B+ -> f_1(1285) K+]cc', - CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', - DaughtersCuts ={ - 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, - MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' -) - -#-------------------- -#-------------------- - -decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" -branches={ - "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", - "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", - "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", - "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", - } -tl = ["TupleToolKinematic", - "TupleToolPropertime", - "TupleToolPid", - "TupleToolTrackInfo", - "TupleToolPrimaries", - "TupleToolEventInfo", - "TupleToolTrackInfo", - "TupleToolRecoStats", - "TupleToolGeometry", - "TupleToolTISTOS", - "TupleToolL0Data", - "TupleToolL0Calo"] - -from PhysConf.Selections import TupleSelection -myTuple = TupleSelection( -'myTuple', -[B_sel], -Decay=decaydesc, -Branches=branches, -ToolList=tl, -) - -tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] -myTuple.B.addTupleTool("TupleToolTISTOS") -myTuple.B.TupleToolTISTOS.Verbose = True -myTuple.B.TupleToolTISTOS.TriggerList = tg_list - -if doMC: - myTuple.ToolList += ['TupleToolMCBackgroundInfo'] - myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] - myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] - - -from Configurables import TupleToolDecay -for particle in list(branches.keys()): - myTuple.addTool(TupleToolDecay, name=particle) -myTuple.ReFitPVs = True - - -from Configurables import TupleToolDecayTreeFitter -MassFit = TupleToolDecayTreeFitter("MassFit") -MassFit.constrainToOriginVertex = True -MassFit.Verbose = True -MassFit.UpdateDaughters = True -myTuple.B.addTool(MassFit) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] - -Dres = TupleToolDecayTreeFitter("Dres") -Dres.constrainToOriginVertex = True -Dres.UpdateDaughters = True -Dres.Verbose = True -myTuple.B.addTool(Dres) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] -myTuple.B.Dres.Substitutions={ -'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', -'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' -} - - -if doMC: - from Configurables import TupleToolMCTruth - MCTruth = TupleToolMCTruth('Truth') - MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] - mct = MCDecayTreeTuple('truth') - if evt_type == '12205011': - mct1 = MCDecayTreeTuple('No_reso') - mct2 = MCDecayTreeTuple('f_1') - mct3 = MCDecayTreeTuple('f_2') - mct4 = MCDecayTreeTuple('f_0') - mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" - mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165011': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165021': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" - if evt_type == '12105011': - mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct.Branches = { - "B" : "[B+]CC" - } - mct.ToolList=['MCTupleToolHierarchy', - 'MCTupleToolKinematic', - 'MCTupleToolPrimaries'] -if doMC: - from Configurables import TrackSmearState as SMEAR - smear = SMEAR( 'Smear' ) - DaVinci().UserAlgorithms = [ smear ] -if not doMC: - from Configurables import TrackScaleState as SCALER - scaler = SCALER( 'Scaler' ) - DaVinci().UserAlgorithms = [ scaler ] -if doMC: - DaVinci().appendToMainSequence([mct]) - if evt_type == '12205011': - DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) - -from Configurables import CheckPV -checkpv = CheckPV() -DaVinci().UserAlgorithms += [checkpv] -DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] -DaVinci().DataType = data_type -if not doMC: - from Configurables import CondDB - CondDB( LatestGlobalTagByDataType = data_type ) -DaVinci().Simulation = True if doMC else False -#-------------------- -#-------------------- -DaVinci().EvtMax = -1 # Number of events -#DaVinci().EvtMax = 2000 # Number of events -DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) -if doMC: - DaVinci().InputType = 'DST' -else: - DaVinci().InputType = 'MDST' -DaVinci().PrintFreq = 1000 -DaVinci().SkipEvents = 0 # Events to skip -DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file -DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 - -if not doMC: - from PhysConf.Filters import LoKi_Filters - fltrs = LoKi_Filters ( - STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" - ) - DaVinci().EventPreFilters = fltrs.filters('Filters') - - -from GaudiConf import IOHelper - -# Use the local input data -IOHelper().inputFiles([ - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' -], clear=True) diff --git a/Btof1285/davinci_Data_2016.py b/Btof1285/davinci_Data_2016.py deleted file mode 100755 index 091e040441..0000000000 --- a/Btof1285/davinci_Data_2016.py +++ /dev/null @@ -1,216 +0,0 @@ -import GaudiKernel.SystemOfUnits as Units -from GaudiConfUtils import ConfigurableGenerators -from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles -from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand -from DecayTreeTuple.Configuration import * -from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass -from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool -from Configurables import GaudiSequencer, PrintDecayTree -from MVADictHelpers import * -#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' -outTag = '' -line = 'Buto5h_K4pi_exclLine' -doMC = False -data_type = '2016' -if doMC: - stream_loc = 'AllStreams' - evt_type = '12205011' -else: - stream_loc = 'Bhadron' - -from Configurables import FilterInTrees -from PhysSelPython.Wrappers import Selection, DataOnDemand -from PhysConf.Selections import CombineSelection - -if doMC: - Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') - Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') -else: - #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) - tesLoc = 'Phys/{0}/Particles'.format(line) - kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") - kaons_from_B_sel = Selection("kaons_from_B_sel", - Algorithm=kaons_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") - pions_from_B_sel = Selection("pions_from_B_sel", - Algorithm=pions_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - Kaons = kaons_from_B_sel - Pions = pions_from_B_sel - - -XX1 = CombineParticles('D0', - DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", - CombinationCut="(AM > 100.0*MeV)", - DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' - }, - MotherCut='(PT > 100.0*MeV)') -XX1_sel = Selection('XX1_sel', - Algorithm=XX1, - RequiredSelections=[Pions]) - - -B_sel = CombineSelection( - 'Sel_B', - [XX1_sel,Kaons], - DecayDescriptor='[B+ -> f_1(1285) K+]cc', - CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', - DaughtersCuts ={ - 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, - MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' -) - -#-------------------- -#-------------------- - -decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" -branches={ - "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", - "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", - "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", - "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", - } -tl = ["TupleToolKinematic", - "TupleToolPropertime", - "TupleToolPid", - "TupleToolTrackInfo", - "TupleToolPrimaries", - "TupleToolEventInfo", - "TupleToolTrackInfo", - "TupleToolRecoStats", - "TupleToolGeometry", - "TupleToolTISTOS", - "TupleToolL0Data", - "TupleToolL0Calo"] - -from PhysConf.Selections import TupleSelection -myTuple = TupleSelection( -'myTuple', -[B_sel], -Decay=decaydesc, -Branches=branches, -ToolList=tl, -) - -tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] -myTuple.B.addTupleTool("TupleToolTISTOS") -myTuple.B.TupleToolTISTOS.Verbose = True -myTuple.B.TupleToolTISTOS.TriggerList = tg_list - -if doMC: - myTuple.ToolList += ['TupleToolMCBackgroundInfo'] - myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] - myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] - - -from Configurables import TupleToolDecay -for particle in list(branches.keys()): - myTuple.addTool(TupleToolDecay, name=particle) -myTuple.ReFitPVs = True - - -from Configurables import TupleToolDecayTreeFitter -MassFit = TupleToolDecayTreeFitter("MassFit") -MassFit.constrainToOriginVertex = True -MassFit.Verbose = True -MassFit.UpdateDaughters = True -myTuple.B.addTool(MassFit) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] - -Dres = TupleToolDecayTreeFitter("Dres") -Dres.constrainToOriginVertex = True -Dres.UpdateDaughters = True -Dres.Verbose = True -myTuple.B.addTool(Dres) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] -myTuple.B.Dres.Substitutions={ -'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', -'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' -} - - -if doMC: - from Configurables import TupleToolMCTruth - MCTruth = TupleToolMCTruth('Truth') - MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] - mct = MCDecayTreeTuple('truth') - if evt_type == '12205011': - mct1 = MCDecayTreeTuple('No_reso') - mct2 = MCDecayTreeTuple('f_1') - mct3 = MCDecayTreeTuple('f_2') - mct4 = MCDecayTreeTuple('f_0') - mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" - mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165011': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165021': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" - if evt_type == '12105011': - mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct.Branches = { - "B" : "[B+]CC" - } - mct.ToolList=['MCTupleToolHierarchy', - 'MCTupleToolKinematic', - 'MCTupleToolPrimaries'] -if doMC: - from Configurables import TrackSmearState as SMEAR - smear = SMEAR( 'Smear' ) - DaVinci().UserAlgorithms = [ smear ] -if not doMC: - from Configurables import TrackScaleState as SCALER - scaler = SCALER( 'Scaler' ) - DaVinci().UserAlgorithms = [ scaler ] -if doMC: - DaVinci().appendToMainSequence([mct]) - if evt_type == '12205011': - DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) - -from Configurables import CheckPV -checkpv = CheckPV() -DaVinci().UserAlgorithms += [checkpv] -DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] -DaVinci().DataType = data_type -if not doMC: - from Configurables import CondDB - CondDB( LatestGlobalTagByDataType = data_type ) -DaVinci().Simulation = True if doMC else False -#-------------------- -#-------------------- -DaVinci().EvtMax = -1 # Number of events -#DaVinci().EvtMax = 2000 # Number of events -DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) -if doMC: - DaVinci().InputType = 'DST' -else: - DaVinci().InputType = 'MDST' -DaVinci().PrintFreq = 1000 -DaVinci().SkipEvents = 0 # Events to skip -DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file -DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 - -if not doMC: - from PhysConf.Filters import LoKi_Filters - fltrs = LoKi_Filters ( - STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" - ) - DaVinci().EventPreFilters = fltrs.filters('Filters') - - -from GaudiConf import IOHelper - -# Use the local input data -IOHelper().inputFiles([ - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' -], clear=True) diff --git a/Btof1285/davinci_Data_2017.py b/Btof1285/davinci_Data_2017.py deleted file mode 100755 index 7a98b131b8..0000000000 --- a/Btof1285/davinci_Data_2017.py +++ /dev/null @@ -1,216 +0,0 @@ -import GaudiKernel.SystemOfUnits as Units -from GaudiConfUtils import ConfigurableGenerators -from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles -from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand -from DecayTreeTuple.Configuration import * -from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass -from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool -from Configurables import GaudiSequencer, PrintDecayTree -from MVADictHelpers import * -#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' -outTag = '' -line = 'Buto5h_K4pi_exclLine' -doMC = False -data_type = '2017' -if doMC: - stream_loc = 'AllStreams' - evt_type = '12205011' -else: - stream_loc = 'Bhadron' - -from Configurables import FilterInTrees -from PhysSelPython.Wrappers import Selection, DataOnDemand -from PhysConf.Selections import CombineSelection - -if doMC: - Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') - Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') -else: - #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) - tesLoc = 'Phys/{0}/Particles'.format(line) - kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") - kaons_from_B_sel = Selection("kaons_from_B_sel", - Algorithm=kaons_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") - pions_from_B_sel = Selection("pions_from_B_sel", - Algorithm=pions_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - Kaons = kaons_from_B_sel - Pions = pions_from_B_sel - - -XX1 = CombineParticles('D0', - DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", - CombinationCut="(AM > 100.0*MeV)", - DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' - }, - MotherCut='(PT > 100.0*MeV)') -XX1_sel = Selection('XX1_sel', - Algorithm=XX1, - RequiredSelections=[Pions]) - - -B_sel = CombineSelection( - 'Sel_B', - [XX1_sel,Kaons], - DecayDescriptor='[B+ -> f_1(1285) K+]cc', - CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', - DaughtersCuts ={ - 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, - MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' -) - -#-------------------- -#-------------------- - -decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" -branches={ - "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", - "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", - "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", - "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", - } -tl = ["TupleToolKinematic", - "TupleToolPropertime", - "TupleToolPid", - "TupleToolTrackInfo", - "TupleToolPrimaries", - "TupleToolEventInfo", - "TupleToolTrackInfo", - "TupleToolRecoStats", - "TupleToolGeometry", - "TupleToolTISTOS", - "TupleToolL0Data", - "TupleToolL0Calo"] - -from PhysConf.Selections import TupleSelection -myTuple = TupleSelection( -'myTuple', -[B_sel], -Decay=decaydesc, -Branches=branches, -ToolList=tl, -) - -tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] -myTuple.B.addTupleTool("TupleToolTISTOS") -myTuple.B.TupleToolTISTOS.Verbose = True -myTuple.B.TupleToolTISTOS.TriggerList = tg_list - -if doMC: - myTuple.ToolList += ['TupleToolMCBackgroundInfo'] - myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] - myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] - - -from Configurables import TupleToolDecay -for particle in list(branches.keys()): - myTuple.addTool(TupleToolDecay, name=particle) -myTuple.ReFitPVs = True - - -from Configurables import TupleToolDecayTreeFitter -MassFit = TupleToolDecayTreeFitter("MassFit") -MassFit.constrainToOriginVertex = True -MassFit.Verbose = True -MassFit.UpdateDaughters = True -myTuple.B.addTool(MassFit) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] - -Dres = TupleToolDecayTreeFitter("Dres") -Dres.constrainToOriginVertex = True -Dres.UpdateDaughters = True -Dres.Verbose = True -myTuple.B.addTool(Dres) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] -myTuple.B.Dres.Substitutions={ -'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', -'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' -} - - -if doMC: - from Configurables import TupleToolMCTruth - MCTruth = TupleToolMCTruth('Truth') - MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] - mct = MCDecayTreeTuple('truth') - if evt_type == '12205011': - mct1 = MCDecayTreeTuple('No_reso') - mct2 = MCDecayTreeTuple('f_1') - mct3 = MCDecayTreeTuple('f_2') - mct4 = MCDecayTreeTuple('f_0') - mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" - mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165011': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165021': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" - if evt_type == '12105011': - mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct.Branches = { - "B" : "[B+]CC" - } - mct.ToolList=['MCTupleToolHierarchy', - 'MCTupleToolKinematic', - 'MCTupleToolPrimaries'] -if doMC: - from Configurables import TrackSmearState as SMEAR - smear = SMEAR( 'Smear' ) - DaVinci().UserAlgorithms = [ smear ] -if not doMC: - from Configurables import TrackScaleState as SCALER - scaler = SCALER( 'Scaler' ) - DaVinci().UserAlgorithms = [ scaler ] -if doMC: - DaVinci().appendToMainSequence([mct]) - if evt_type == '12205011': - DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) - -from Configurables import CheckPV -checkpv = CheckPV() -DaVinci().UserAlgorithms += [checkpv] -DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] -DaVinci().DataType = data_type -if not doMC: - from Configurables import CondDB - CondDB( LatestGlobalTagByDataType = data_type ) -DaVinci().Simulation = True if doMC else False -#-------------------- -#-------------------- -DaVinci().EvtMax = -1 # Number of events -#DaVinci().EvtMax = 2000 # Number of events -DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) -if doMC: - DaVinci().InputType = 'DST' -else: - DaVinci().InputType = 'MDST' -DaVinci().PrintFreq = 1000 -DaVinci().SkipEvents = 0 # Events to skip -DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file -DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 - -if not doMC: - from PhysConf.Filters import LoKi_Filters - fltrs = LoKi_Filters ( - STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" - ) - DaVinci().EventPreFilters = fltrs.filters('Filters') - - -from GaudiConf import IOHelper - -# Use the local input data -IOHelper().inputFiles([ - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' -], clear=True) diff --git a/Btof1285/davinci_Data_2018.py b/Btof1285/davinci_Data_2018.py deleted file mode 100755 index a84a6bc89f..0000000000 --- a/Btof1285/davinci_Data_2018.py +++ /dev/null @@ -1,216 +0,0 @@ -import GaudiKernel.SystemOfUnits as Units -from GaudiConfUtils import ConfigurableGenerators -from Configurables import PrintDecayTree, DecayTreeTuple, DaVinci, SelDSTWriter, FilterDesktop, FilterInTrees, LoKi__HDRFilter, FilterDesktop,CombineParticles -from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand -from DecayTreeTuple.Configuration import * -from Configurables import LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolVeto, TupleToolSubMass -from Configurables import LoKi__HDRFilter, LoKi__VertexFitter, LoKi__Hybrid__EvtTupleTool -from Configurables import GaudiSequencer, PrintDecayTree -from MVADictHelpers import * -#outTag = '/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/' -outTag = '' -line = 'Buto5h_K4pi_exclLine' -doMC = False -data_type = '2018' -if doMC: - stream_loc = 'AllStreams' - evt_type = '12205011' -else: - stream_loc = 'Bhadron' - -from Configurables import FilterInTrees -from PhysSelPython.Wrappers import Selection, DataOnDemand -from PhysConf.Selections import CombineSelection - -if doMC: - Kaons = DataOnDemand('Phys/StdAllNoPIDsKaons/Particles') - Pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles') -else: - #tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream_loc, line) - tesLoc = 'Phys/{0}/Particles'.format(line) - kaons_from_B = FilterInTrees('kaons_from_B_filter', Code="('K+' == ABSID)") - kaons_from_B_sel = Selection("kaons_from_B_sel", - Algorithm=kaons_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - pions_from_B = FilterInTrees('pions_from_B_filter', Code="('pi+' == ABSID)") - pions_from_B_sel = Selection("pions_from_B_sel", - Algorithm=pions_from_B, - RequiredSelections=[DataOnDemand(Location=tesLoc)]) - Kaons = kaons_from_B_sel - Pions = pions_from_B_sel - - -XX1 = CombineParticles('D0', - DecayDescriptor="f_1(1285) -> pi+ pi+ pi- pi-", - CombinationCut="(AM > 100.0*MeV)", - DaughtersCuts ={'pi+':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'pi-':'(PT > 150.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)' - }, - MotherCut='(PT > 100.0*MeV)') -XX1_sel = Selection('XX1_sel', - Algorithm=XX1, - RequiredSelections=[Pions]) - - -B_sel = CombineSelection( - 'Sel_B', - [XX1_sel,Kaons], - DecayDescriptor='[B+ -> f_1(1285) K+]cc', - CombinationCut='(AM < 5679.0*MeV) & (AM > 5000.0*MeV)', - DaughtersCuts ={ - 'K+':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)', - 'K-':'(PT > 250.0*MeV) & (TRCHI2DOF < 1.7) & (MIPCHI2DV(PRIMARY) > 6.0) & (TRGHP < 0.2)'}, - MotherCut='(BPVDIRA > 0.9999) & (VFASPF(VCHI2) < 30.0) & (BPVIP()<0.06) & (PT >1000.0*MeV) & (BPVVDCHI2 > 100.0)' -) - -#-------------------- -#-------------------- - -decaydesc = "[B+ -> ^K+ ^(f_1(1285) -> ^pi+ ^pi+ ^pi- ^pi-)]CC" -branches={ - "B" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "K" : "[B+ -> ^K+ (f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "f_1285" : "[B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)]CC", - "pi3" : "[B+ -> K+ (f_1(1285) -> ^pi+ pi+ pi- pi-)]CC", - "pi5" : "[B+ -> K+ (f_1(1285) -> pi+ ^pi+ pi- pi-)]CC", - "pi2" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ ^pi- pi-)]CC", - "pi4" : "[B+ -> K+ (f_1(1285) -> pi+ pi+ pi- ^pi-)]CC", - } -tl = ["TupleToolKinematic", - "TupleToolPropertime", - "TupleToolPid", - "TupleToolTrackInfo", - "TupleToolPrimaries", - "TupleToolEventInfo", - "TupleToolTrackInfo", - "TupleToolRecoStats", - "TupleToolGeometry", - "TupleToolTISTOS", - "TupleToolL0Data", - "TupleToolL0Calo"] - -from PhysConf.Selections import TupleSelection -myTuple = TupleSelection( -'myTuple', -[B_sel], -Decay=decaydesc, -Branches=branches, -ToolList=tl, -) - -tg_list=["L0HadronDecision","Hlt1TrackAllL0Decision","Hlt1TrackMVADecision","Hlt1TwoTrackMVADecision","Hlt2Topo2BodyBBDTDecision","Hlt2Topo3BodyBBDTDecision","Hlt2Topo4BodyBBDTDecision"] -myTuple.B.addTupleTool("TupleToolTISTOS") -myTuple.B.TupleToolTISTOS.Verbose = True -myTuple.B.TupleToolTISTOS.TriggerList = tg_list - -if doMC: - myTuple.ToolList += ['TupleToolMCBackgroundInfo'] - myTuple.ToolList += ["TupleToolMCTruth/TupleToolMCTruth"] - myTuple.TupleToolMCTruth.ToolList+=["MCTupleToolHierarchy", "MCTupleToolReconstructed"] - - -from Configurables import TupleToolDecay -for particle in list(branches.keys()): - myTuple.addTool(TupleToolDecay, name=particle) -myTuple.ReFitPVs = True - - -from Configurables import TupleToolDecayTreeFitter -MassFit = TupleToolDecayTreeFitter("MassFit") -MassFit.constrainToOriginVertex = True -MassFit.Verbose = True -MassFit.UpdateDaughters = True -myTuple.B.addTool(MassFit) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/MassFit"] - -Dres = TupleToolDecayTreeFitter("Dres") -Dres.constrainToOriginVertex = True -Dres.UpdateDaughters = True -Dres.Verbose = True -myTuple.B.addTool(Dres) -myTuple.B.ToolList += ["TupleToolDecayTreeFitter/Dres"] -myTuple.B.Dres.Substitutions={ -'B+ -> K+ ^(f_1(1285) -> pi+ pi+ pi- pi-)' : 'D~0', -'B- -> K- ^(f_1(1285) -> pi- pi- pi+ pi+)' : 'D0' -} - - -if doMC: - from Configurables import TupleToolMCTruth - MCTruth = TupleToolMCTruth('Truth') - MCTruth.ToolList = ["MCTupleToolKinematic","MCTupleToolHierarchy", "MCTupleToolReconstructed"] - mct = MCDecayTreeTuple('truth') - if evt_type == '12205011': - mct1 = MCDecayTreeTuple('No_reso') - mct2 = MCDecayTreeTuple('f_1') - mct3 = MCDecayTreeTuple('f_2') - mct4 = MCDecayTreeTuple('f_0') - mct.Decay = "[[B+]CC ==> ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct1.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct2.Decay = "[[B+]CC => ^(f_1(1285) => ^(rho(770)0=> ^pi+ ^pi-) ^pi+ ^pi-) ^K+]CC" - mct3.Decay = "[[B+]CC => ^(f_2(1270) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - mct4.Decay = "[[B+]CC => ^(f_0(1500) => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165011': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^K+]CC" - if evt_type == '12165021': - mct.Decay = "[[B+]CC => ^(D~0 => ^pi+ ^pi- ^pi+ ^pi-) ^pi+]CC" - if evt_type == '12105011': - mct.Decay = "[[B+]CC => ^pi+ ^pi- ^pi+ ^pi- ^K+]CC" - mct.Branches = { - "B" : "[B+]CC" - } - mct.ToolList=['MCTupleToolHierarchy', - 'MCTupleToolKinematic', - 'MCTupleToolPrimaries'] -if doMC: - from Configurables import TrackSmearState as SMEAR - smear = SMEAR( 'Smear' ) - DaVinci().UserAlgorithms = [ smear ] -if not doMC: - from Configurables import TrackScaleState as SCALER - scaler = SCALER( 'Scaler' ) - DaVinci().UserAlgorithms = [ scaler ] -if doMC: - DaVinci().appendToMainSequence([mct]) - if evt_type == '12205011': - DaVinci().appendToMainSequence([mct1,mct2,mct3,mct4]) - -from Configurables import CheckPV -checkpv = CheckPV() -DaVinci().UserAlgorithms += [checkpv] -DaVinci().UserAlgorithms += [SelectionSequence("seq", myTuple).sequence()] -DaVinci().DataType = data_type -if not doMC: - from Configurables import CondDB - CondDB( LatestGlobalTagByDataType = data_type ) -DaVinci().Simulation = True if doMC else False -#-------------------- -#-------------------- -DaVinci().EvtMax = -1 # Number of events -#DaVinci().EvtMax = 2000 # Number of events -DaVinci().RootInTES = '/Event/{0}'.format(stream_loc) -if doMC: - DaVinci().InputType = 'DST' -else: - DaVinci().InputType = 'MDST' -DaVinci().PrintFreq = 1000 -DaVinci().SkipEvents = 0 # Events to skip -DaVinci().HistogramFile = outTag+"DVHistos_data1_X.root" # Histogram file -DaVinci().TupleFile = outTag+"Tuple_data1_X.root" # Ntuple1 - -if not doMC: - from PhysConf.Filters import LoKi_Filters - fltrs = LoKi_Filters ( - STRIP_Code = "HLT_PASS_RE('StrippingButo5h_K4pi_exclLineDecision')" - ) - DaVinci().EventPreFilters = fltrs.filters('Filters') - - -from GaudiConf import IOHelper - -# Use the local input data -IOHelper().inputFiles([ - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' - #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' -], clear=True) -- GitLab From c04a4730057c9356efb134e01cd40c7df7ffdd16 Mon Sep 17 00:00:00 2001 From: razhang <razhang razhang@cern.ch> Date: Mon, 25 Nov 2024 07:02:15 +0100 Subject: [PATCH 4/4] fix the local input --- Btof1285/davinci_Data_Btof1285.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Btof1285/davinci_Data_Btof1285.py b/Btof1285/davinci_Data_Btof1285.py index 95d22bf328..ba49b652b1 100755 --- a/Btof1285/davinci_Data_Btof1285.py +++ b/Btof1285/davinci_Data_Btof1285.py @@ -206,11 +206,11 @@ if not doMC: DaVinci().EventPreFilters = fltrs.filters('Filters') -from GaudiConf import IOHelper +#from GaudiConf import IOHelper # Use the local input data -IOHelper().inputFiles([ +#IOHelper().inputFiles([ #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/12205011_test_00240113_00000015_1.AllStreams.dst' #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00240134_00000010_1.AllStreams.dst' #'/afs/ihep.ac.cn/users/z/zhangranyu/jobs/5T/f1285/00239594_00000022_1.AllStreams.dst' -], clear=True) +#], clear=True) -- GitLab