tuple = DecayTreeTuple("TupleJPsi2KsKs") # Give DecayTreeTuple the location of your stripped candidates # If you apply a selection, this will be the output of a selection sequence object. tuple.Inputs = [seq.outputLocation()] tuple.ToolList = [ "TupleToolKinematic", "TupleToolEventInfo", "TupleToolTrackInfo", "TupleToolPid", "TupleToolGeometry", "TupleToolAngles", ] tuple.InputPrimaryVertices = "/Event/Charm/Rec/Vertex/Primary" # # Other event infos tuple.addTupleTool("LoKi::Hybrid::EvtTupleTool/LoKi_Evt") tuple.LoKi_Evt.VOID_Variables = { "nTracks": "CONTAINS('/Event/Charm/Rec/Track/Best')", "nPVs": "CONTAINS('/Event/Charm/Rec/Vertex/Primary')", } # Other variables tuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_All") tuple.LoKi_All.Variables = {"Eta": "ETA", "Phi": "PHI"}
CombinationCut= "( (ADAMASS('Lambda_c+') < 110*MeV) | (ADAMASS('Xi_c+') < 110*MeV) )", MotherCut= "( (VFASPF(VCHI2/VDOF)< 10) & ( (ADMASS('Lambda_c+') < 80*MeV) | (ADMASS('Xi_c+') < 80*MeV) )" ) from PhysConf.Selections import Selection, SelectionSequence Lc2pKpi_sel = Selection('Lc2pKpi_sel', Algorithm=Lc2pKpi_combiner, RequiredSelections=[Pions, Kaons, Protons]) Lc2pKpi_seq = SelectionSequence('Lc2pKpi_seq', TopSelection=Lc2pKpi_sel) DaVinci().UserAlgorithms += [Lc2pKpi_seq.sequence()] tuple_Lc2pKpi.Inputs = [Lc2pKpi_sel.outputLocation()] if (Turbo and year in ["2015", "2016"]): tuple_Lc2pKpi.InputPrimaryVertices = '/Event/Turbo/Primary' # (detached) B -> (Lc -> p K pi) mu nu #line = "SelLc2PKPiforCharmFromBSemi" #tuple_b2Lc2pKpi = DecayTreeTuple( 'tuple_b2Lc2pKpi' ) #tuple_b2Lc2pKpi.Inputs = ['Phys/{0}/Particles'.format(line)] #tuple_b2Lc2pKpi.Decay = '[ Beauty -> ^( Lambda_c+ -> ^p ^K- ^pi+ ) ^mu- ]CC' tuples = [tuple_Lc2pKpi] # Define common tuple tools tupletools = [] tupletools.append("TupleToolKinematic") # Mass and momenta tupletools.append("TupleToolPid") # PID info tupletools.append("TupleToolANNPID") # ProbNN for specific MC tunes tupletools.append("TupleToolGeometry") # ENDVERTEX, OWNPV, IP, FD, DIRA
def makeTuple(self): """ Make tuple """ from Configurables import FitDecayTrees, DecayTreeTuple, TupleToolDecayTreeFitter, TupleToolDecay, TupleToolTrigger, TupleToolTISTOS, TupleToolPropertime, PropertimeFitter, TupleToolKinematic, TupleToolGeometry, TupleToolEventInfo, TupleToolPrimaries, TupleToolPid, TupleToolTrackInfo, TupleToolRecoStats, TupleToolMCTruth, LoKi__Hybrid__TupleTool, LoKi__Hybrid__EvtTupleTool tuple = DecayTreeTuple('Tuple'+self.name) # I can put as an argument a name if I use more than a DecayTreeTuple tuple.Inputs = [ self.sequence.outputLocation() ] tuple.Decay = self.dec tuple.ToolList = ['TupleToolKinematic', 'TupleToolEventInfo', 'TupleToolTrackInfo', 'TupleToolPid', 'TupleToolGeometry', 'TupleToolAngles', # Helicity angle # 'TupleToolPropertime', #proper time TAU of reco particles ] tuple.InputPrimaryVertices = '/Event/Charm/Rec/Vertex/Primary' # Other event infos tuple.addTupleTool('LoKi::Hybrid::EvtTupleTool/LoKi_Evt') tuple.LoKi_Evt.VOID_Variables = { #"nSPDHits" : " CONTAINS('Raw/Spd/Digits') " , 'nTracks' : " CONTAINS ('Charm/Rec/Track/Best') " , } # # Other variables # tuple.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_All') # tuple.LoKi_All.Variables = { # 'BPVIPCHI2' : 'BPVIPCHI2()', # 'BPVDIRA' : 'BPVDIRA', # 'BPVLTFITCHI2' : 'BPVLTFITCHI2()', # } tuple.addBranches(self.branches) tuple.phi.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_phi") tuple.phi.LoKi_phi.Variables = { 'DOCAMAX' : 'DOCAMAX', "MassDiff_Phi" : "DMASS('phi(1020)')", "BPVDIRA" : "BPVDIRA", "IPS_Phi" : "MIPCHI2DV(PRIMARY)", "VFASPF_CHI2DOF" : "VFASPF(VCHI2/VDOF)", "VFASPF_CHI2" : "VFASPF(VCHI2)", "BPVIPCHI2" : "BPVIPCHI2()", "ADOCA" : "DOCA(1,2)", "ADOCACHI2" : "DOCACHI2(1,2)", "DTF_CHI2_PV" : "DTF_CHI2( True, 'phi(1020)' )", "DTF_NDOF_PV" : "DTF_NDOF( True, 'phi(1020)' )", "DTF_M_PV" : "DTF_FUN ( M, True, 'phi(1020)' )", "DTF_M_Ks1_PV" : "DTF_FUN ( CHILD(M,1), True, 'phi(1020)' )", "DTF_M_Ks2_PV" : "DTF_FUN ( CHILD(M,2), True, 'phi(1020)' )", # "DTF_CTAU_Ks1" : "DTF_CTAU(1, False, 'phi(1020)' )", # "DTF_CTAU_Ks2" : "DTF_CTAU(2, False, 'phi(1020)' )", } def mySharedConf_Ks(branch): atool=branch.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_Ks') atool.Variables = { "BPVDIRA" : "BPVDIRA", "VFASPF_CHI2DOF" : "VFASPF(VCHI2/VDOF)", "VFASPF_CHI2" : "VFASPF(VCHI2)", "BPVIPCHI2" : "BPVIPCHI2()", "BPVVD" : "BPVVD", "BPVVDCHI2" : "BPVVDCHI2", "ADOCA" : "DOCA(1,2)", "ADOCACHI2" : "DOCACHI2(1,2)", 'BPVLTIME' : 'BPVLTIME()', } PropertimeTool = branch.addTupleTool("TupleToolPropertime/Propertime_Ks") mySharedConf_Ks(tuple.Ks1) mySharedConf_Ks(tuple.Ks2) def mySharedConf_pi(branch): atool=branch.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_pi') atool.Variables = { 'TRCHI2DOF' : 'TRCHI2DOF', 'TRGHOSTPROB' : 'TRGHOSTPROB', } mySharedConf_pi(tuple.pi1) mySharedConf_pi(tuple.pi2) mySharedConf_pi(tuple.pi3) mySharedConf_pi(tuple.pi4) # Triggers: tuple.phi.addTupleTool('TupleToolTISTOS/TISTOS') tuple.phi.TISTOS.TriggerList = trigger_list tuple.phi.TISTOS.VerboseL0 = True tuple.phi.TISTOS.VerboseHlt1 = True tuple.phi.TISTOS.VerboseHlt2 = True if dataSample.isMC: from Configurables import MCDecayTreeTuple, MCTupleToolKinematic, TupleToolMCTruth, MCTupleToolHierarchy, MCTupleToolReconstructed, MCTupleToolAngles, TupleToolMCBackgroundInfo tuple.addTupleTool('TupleToolMCTruth/MCTruth') tuple.MCTruth.ToolList = ['MCTupleToolKinematic', 'MCTupleToolHierarchy', 'MCTupleToolReconstructed', 'MCTupleToolAngles', ] tuple.phi.addTupleTool( "TupleToolMCBackgroundInfo") self.sequence.sequence().Members += [tuple]
mytuple.setDescriptorTemplate(decaystring) if (inputtype == "DST"): mytuple.Inputs = [ '/Event/{0}/Phys/{1}/Particles'.format(stream, stripline) for stripline in striplines ] if (inputtype == "MDST"): mytuple.Inputs = [ 'Phys/{0}/Particles'.format(stripline) for stripline in striplines ] if (Turbo): mytuple.Inputs = [ '{0}/Particles'.format(stripline) for stripline in striplines ] if (Turbo and year in ["2015", "2016"]): mytuple.InputPrimaryVertices = '/Event/Turbo/Primary' # add DecayTreeFitter tool to constrain origin to PV and refit kinematics if ("Lc2pKpi" in decay): dtftool = mytuple.lcplus.addTupleTool( 'TupleToolDecayTreeFitter/PVConstrainedDTF') dtftool.constrainToOriginVertex = True if (decay == "Lb2LcMuX"): dtftool = mytuple.lambdab0.addTupleTool( 'TupleToolDecayTreeFitter/PVConstrainedDTF_Lb') dtftool.constrainToOriginVertex = True dtftool2 = mytuple.lambdacplus.addTupleTool( 'TupleToolDecayTreeFitter/PVConstrainedDTF_Lc') dtftool2.constrainToOriginVertex = True tuples = [mytuple]