def makeJetGroup(self, _name, njets, ptcut=0): JetGroup = CombineParticles("Combine" + _name) if njets == 2: JetGroup.DecayDescriptor = "H_10 -> CELLjet CELLjet" elif njets == 4: JetGroup.DecayDescriptor = "H_10 -> CELLjet CELLjet CELLjet CELLjet" elif njets == 6: JetGroup.DecayDescriptor = "H_10 -> CELLjet CELLjet CELLjet CELLjet CELLjet CELLjet" elif njets == 8: JetGroup.DecayDescriptor = "H_10 -> CELLjet CELLjet CELLjet CELLjet CELLjet CELLjet CELLjet CELLjet" else: raise ValueError JetGroup.ParticleCombiners = {"": "LoKi::VertexFitter"} JetGroup.addTool(LoKi__VertexFitter, name="LoKi::VertexFitter") vfitter = getattr(JetGroup, "LoKi::VertexFitter") vfitter.Jets = "" if ptcut == 1: JetGroup.DaughtersCuts = { "CELLjet": " (PT > %(min_jet_pT)s ) " % self._config } elif ptcut == 2: JetGroup.DaughtersCuts = { "CELLjet": " (PT > %(min_jet_pT_ExclusiveDiJet)s ) " % self._config } JetGroup.MotherCut = "ALL" requiredSelections = [self.__taggedJets] return Selection("Sel" + _name, Algorithm=JetGroup, RequiredSelections=requiredSelections)
def makeJetGroup(self, name, config): JetGroup = CombineParticles("Combine" + name) JetGroup.DecayDescriptor = "H_10 -> CELLjet CELLjet" JetGroup.ParticleCombiners = {"": "LoKi::VertexFitter"} JetGroup.addTool(LoKi__VertexFitter, name="LoKi::VertexFitter") vfitter = getattr(JetGroup, "LoKi::VertexFitter") vfitter.Jets = "" JetGroup.DaughtersCuts = { "CELLjet": " (PT > %(min_jet_pT)s ) " % config } JetGroup.CombinationCut = "AALLSAMEBPV " JetGroup.MotherCut = "ALL" ## TOS_HLT2 on-demand hlt = config['TOS_HLT2'] if hlt: JetGroup.MotherCut += '& (TOS("%s", "Hlt2TriggerTisTos"))' % hlt requiredSelections = [DataOnDemand(Location="Phys/StdJets/Particles")] return Selection("Sel" + name, Algorithm=JetGroup, RequiredSelections=requiredSelections)
def SelWDiJets(name, conf, desc, sel_W, TOS_HLT2=None): """ Create the combination of W + DiJets """ ## Create CombineParticle, with caveat on jet combining. DiJet = CombineParticles("Combine" + name) DiJet.ParticleCombiners = {"": "LoKi::VertexFitter"} DiJet.addTool(LoKi__VertexFitter, name="LoKi::VertexFitter") vfitter = getattr(DiJet, "LoKi::VertexFitter") vfitter.Jets = "" ## Apply cuts, with TOS optionally # Asking AT LEAST one of the jet to be TOSed by given trigger. ccut = "AALLSAMEBPV "\ "& ( dr_13 > %(dr_lepton_jet)s )"\ "& ( dr_23 > %(dr_lepton_jet)s )" %conf if TOS_HLT2: cut_tos = "(TOS('%s','Hlt2TriggerTisTos'))" % TOS_HLT2 cut_tosjet = '(ACHILDCUT({0}, 1) | ACHILDCUT({0}, 2))'.format(cut_tos) ccut += ('&' + cut_tosjet) DiJet.Preambulo = preambulo DiJet.DecayDescriptor = desc DiJet.DaughtersCuts = {"CELLjet": "(PT > %(min_jet_pT)s)" % conf} DiJet.CombinationCut = ccut DiJet.MotherCut = "ALL" return Selection(name, Algorithm=DiJet, RequiredSelections=[sel_W, StdJets])
def makeDiJet(self, _name): DiJet = CombineParticles("Combine" + _name) DiJet.DecayDescriptor = "[H+ -> CELLjet CELLjet mu+]cc" DiJet.ParticleCombiners = {"": "LoKi::VertexFitter"} DiJet.addTool(LoKi__VertexFitter, name="LoKi::VertexFitter") vfitter = getattr(DiJet, "LoKi::VertexFitter") vfitter.Jets = "" DiJet.DaughtersCuts = { "CELLjet": " (PT > %(min_jet_pT)s * GeV ) " % self._config } DiJet.Preambulo = [ "from GaudiKernel.SystemOfUnits import degree", "eta_1 = ACHILDFUN(1,ETA)", "eta_2 = ACHILDFUN(2,ETA)", "eta_3 = ACHILDFUN(3,ETA)", "phi_1 = ACHILDFUN(1,PHI)", "phi_2 = ACHILDFUN(2,PHI)", "phi_3 = ACHILDFUN(3,PHI)", ## "deta_13 = eta_1 - eta_3", "deta_23 = eta_2 - eta_3", ## "dphi_13 = phi_1 - phi_3 ", "dphi_23 = phi_2 - phi_3", ## "dphi_13 = switch ( dphi_13 > 180 * degree , dphi_13 - 180 * degree , dphi_13 ) ", "dphi_13 = switch ( dphi_13 < -180 * degree , dphi_13 + 180 * degree , dphi_13 ) ", "dphi_23 = switch ( dphi_23 > 180 * degree , dphi_23 - 180 * degree , dphi_23 ) ", "dphi_23 = switch ( dphi_23 < -180 * degree , dphi_23 + 180 * degree , dphi_23 ) ", ## "dr_13 = sqrt(deta_13**2 + dphi_13**2)", "dr_23 = sqrt(deta_23**2 + dphi_23**2)", ] DiJet.CombinationCut = "AALLSAMEBPV "\ "& ( dr_13 > %(dr_lepton_jet)s )"\ "& ( dr_23 > %(dr_lepton_jet)s )" %self._config DiJet.MotherCut = "ALL" requiredSelections = [self.sel_Wmu, StdJets] return Selection("Sel" + _name, Algorithm=DiJet, RequiredSelections=requiredSelections)
def makeDiJetPair(self,_name): DiJetPair = CombineParticles("Combine"+_name) DiJetPair.DecayDescriptor = "H_20 -> H_10 H_10" DiJetPair.ParticleCombiners = {"" : "LoKi::VertexFitter"} DiJetPair.addTool( LoKi__VertexFitter, name="LoKi::VertexFitter" ) DiJetPair.MotherCut = "ALL" requiredSelections = [self.sel_DiJet_noPT] return Selection ("Sel"+_name, Algorithm = DiJetPair, RequiredSelections = requiredSelections)
def makeDiJetGamma(self, _name, loose=0): DiJetGamma = CombineParticles("Combine" + _name) DiJetGamma.DecayDescriptor = "H_20 -> H_10 gamma" DiJetGamma.ParticleCombiners = {'': 'LoKi::VertexFitter:PUBLIC'} DiJetGamma.MotherCut = "ALL" if loose: requiredSelections = [self.sel_PhotonLoose, self.sel_DiJetLoose] else: requiredSelections = [self.sel_Photon, self.sel_DiJet] return Selection("Sel" + _name, Algorithm=DiJetGamma, RequiredSelections=requiredSelections)
def makeOb2OGamma(name, oSel, photons, params): _name = name _combcut = "(ADAMASS('Omega_b-') < %(CombMassWinOmegab)s * MeV)" % params _mothercut = "(PT > %(MinPTOb)s * MeV) & (P > %(MinPOb)s*MeV) & (MTDOCACHI2(1) < %(MTDOCACHI2_MAX)s)" % params _Combine = CombineParticles(name=_name, DecayDescriptor="[Omega_b- -> Omega- gamma]cc", CombinationCut=_combcut, MotherCut=_mothercut) _Combine.ParticleCombiners = {'': 'ParticleAdder'} return Selection(name + 'OGamma', Algorithm=_Combine, RequiredSelections=[oSel, photons])
def makeXib2XiGamma(name, xiSel, photons, params): _name = name _combcut = "(ADAMASS('Xi_b-') < %(CombMassWinXib)s * MeV)" % params _mothercut = "(PT > %(MinPTXib)s * MeV) & (P > %(MinPXib)s*MeV) & (MTDOCACHI2(1) < %(MTDOCACHI2_MAX)s)" % params _Combine = CombineParticles(name=_name, DecayDescriptor="[Xi_b- -> Xi- gamma]cc", CombinationCut=_combcut, MotherCut=_mothercut) _Combine.ParticleCombiners = {'': 'ParticleAdder'} return Selection(name + 'XiGamma', Algorithm=_Combine, RequiredSelections=[xiSel, photons])
def makeJetGroup(self, _name): JetGroup = CombineParticles("Combine" + _name) JetGroup.DecayDescriptor = "H_10 -> CELLjet CELLjet" JetGroup.ParticleCombiners = {"": "MomentumCombiner"} # JetGroup.addTool( LoKi__VertexFitter, name="LoKi::VertexFitter" ) # vfitter = getattr ( JetGroup , "LoKi::VertexFitter" ) # vfitter.Jets = "" JetGroup.DaughtersCuts = { "CELLjet": " (PT > %(min_jet_pT)s ) " % self._config } JetGroup.CombinationCut = "AALLSAMEBPV " JetGroup.MotherCut = "ALL" return Selection("Sel" + _name, Algorithm=JetGroup, RequiredSelections=[DataOnDemand(self.emptySelLoc)])
def makeDiJet(self, _name, loose=0): DiJet = CombineParticles("Combine" + _name) DiJet.DecayDescriptor = "H_10 -> CELLjet CELLjet" DiJet.ParticleCombiners = {'': 'LoKi::VertexFitter:PUBLIC'} if loose: DiJet.DaughtersCuts = { "CELLjet": " (PT > %(minJetpTLoose)s * GeV ) " % self._config } else: DiJet.DaughtersCuts = { "CELLjet": " (PT > %(minJetpT)s * GeV ) " % self._config } DiJet.CombinationCut = "AALLSAMEBPV" DiJet.MotherCut = "ALL" return Selection("Sel" + _name, Algorithm=DiJet, RequiredSelections=[StdJets])
def __init__(self, name, config): self.name = name LineBuilder.__init__(self, name, config) ################################################################################# # Configure trigger ################################################################################# l0 = None if config['L0']: l0 = "L0_CHANNEL_RE('%s')" % ('|'.join(config['L0'])) hlt = None if config['HLT']: hlt = "HLT_PASS_RE('%s')" % ('|'.join(config['HLT'])) ################################################################################# # Build Lambda_0 ################################################################################# tracks_code = """(MAXTREE(TRCHI2DOF, HASTRACK) < %(Track_Chi2ndf_Max)s) & (MINTREE(TRCHI2DOF, HASTRACK) < %(Track_MinChi2ndf_Max)s) & (MAXTREE(TRGHOSTPROB, HASTRACK) < %(Track_GhostProb_Max)s) & (INTREE(('p+'==ABSID) & (PT > %(Proton_Pt_Min)s))) & (INTREE(('pi+'==ABSID) & (PT > %(Pion_Pt_Min)s))) & (INTREE(('p+'==ABSID) & (P > %(Proton_P_Min)s))) & (INTREE(('pi+'==ABSID) & (P > %(Pion_P_Min)s)))""" lambda0_ll_dod = DataOnDemand( Location='Phys/StdLooseLambdaLL/Particles') lambda0_ll_code = """(PT>%(Lambda0_Pt_Min)s*MeV) & (VFASPF(VCHI2/VDOF)<%(Lambda0_VtxChi2_Max)s) & (MINTREE(MIPCHI2DV(PRIMARY), ISLONG) > %(TrackLL_IPChi2_Min)s) & (MIPDV(PRIMARY) > %(Lambda0LL_IP_Min)s*mm) & (ADMASS('Lambda0') < %(Lambda0LL_MassWindow)s*MeV)""" lambda0_ll_code = (lambda0_ll_code + " & " + tracks_code) % config lambda0_ll_filter = FilterDesktop(Code=lambda0_ll_code) lambda0_ll = Selection("LooseLambda0LL", Algorithm=lambda0_ll_filter, RequiredSelections=[lambda0_ll_dod]) lambda0_dd_dod = DataOnDemand( Location='Phys/StdLooseLambdaDD/Particles') lambda0_dd_code = """(PT>%(Lambda0_Pt_Min)s*MeV) & (VFASPF(VCHI2/VDOF)<%(Lambda0_VtxChi2_Max)s) & (ADMASS('Lambda0') < %(Lambda0DD_MassWindow)s*MeV)""" lambda0_dd_code = (lambda0_dd_code + " & " + tracks_code) % config lambda0_dd_filter = FilterDesktop(Code=lambda0_dd_code) lambda0_dd = Selection("LooseLambda0DD", Algorithm=lambda0_dd_filter, RequiredSelections=[lambda0_dd_dod]) lambda0 = MergedSelection("LooseLambda0", RequiredSelections=[lambda0_ll, lambda0_dd]) ################################################################################# # Filter photons ################################################################################# photons_noncnv_filter = FilterDesktop( Code="(PT > %(Photon_PT_Min)s*MeV) & (CL > %(Photon_CL_Min)s)" % config) photons_noncnv = Selection("Photons_NonCnv", Algorithm=photons_noncnv_filter, RequiredSelections=[StdLooseAllPhotons]) photons_cnv_merged = MergedSelection( "Photons_Cnv_Merge", RequiredSelections=[StdAllLooseGammaDD, StdAllLooseGammaLL]) photons_cnv_code = """(HASVERTEX) & (MM < %(PhotonCnv_MM_Max)s*MeV) & (PT > %(PhotonCnv_PT_Min)s*MeV) & (VFASPF(VCHI2/VDOF)<%(PhotonCnv_VtxChi2_Max)s)""" % config photons_cnv_filter = FilterDesktop(Code=photons_cnv_code % config) photons_cnv = Selection("Photons_Cnv", Algorithm=photons_cnv_filter, RequiredSelections=[photons_cnv_merged]) ################################################################################# # Build Lambda_b ################################################################################# # With non-converted photons lambda_b_combine = CombineParticles("Lambdab_NonConv_Combine") lambda_b_combine.DecayDescriptor = "[Lambda_b0 -> Lambda0 gamma]cc" lambda_b_combine.DaughtersCuts = {'Lambda0': 'ALL', 'gamma': 'ALL'} lambda_b_combine.ParticleCombiners = {'': 'ParticleAdder'} lambda_b_combine.CombinationCut = """(ADAMASS('Lambda_b0') < %(Lambdab_MassWindow)s*MeV) & (ASUM(PT) > %(Lambdab_SumPt_Min)s )""" % config lambda_b_combine.MotherCut = """(PT > %(Lambdab_Pt_Min)s*MeV) & (MTDOCACHI2(1) < %(Lambdab_MTDOCAChi2_Max)s)""" % config lambda_b = Selection("Lambdab_NonConv_Sel", Algorithm=lambda_b_combine, RequiredSelections=[photons_noncnv, lambda0]) # With converted photons lambda_b_cnv_combine = CombineParticles("Lambdab_Conv_Combine") lambda_b_cnv_combine.DecayDescriptor = "[Lambda_b0 -> Lambda0 gamma]cc" lambda_b_cnv_combine.DaughtersCuts = {'Lambda0': 'ALL', 'gamma': 'ALL'} lambda_b_cnv_combine.ParticleCombiners = { "": "OfflineVertexFitter:PUBLIC" } lambda_b_cnv_combine.CombinationCut = "(ADAMASS('Lambda_b0') < 1.5*%(Lambdab_MassWindow)s*MeV)" % config lambda_b_cnv_combine.MotherCut = """(HASVERTEX) & (VFASPF(VCHI2/VDOF)<%(Lambdab_VtxChi2_Max)s) & (PT > %(Lambdab_Pt_Min)s*MeV) & (BPVIPCHI2() < %(Lambdab_IPChi2_Max)s) & (ADMASS('Lambda_b0') < %(Lambdab_MassWindow)s*MeV)""" % config #(MTDOCACHI2(1) < %(Lambdab_MTDOCAChi2_Max)s) & lambda_b_cnv = Selection("Lambdab_Conv_Sel", Algorithm=lambda_b_cnv_combine, RequiredSelections=[photons_cnv, lambda0]) ################################################################################# # Build lines ################################################################################# sels_line = { 'Phys/StdLooseLambdaLL': 'Lambda0', 'Phys/StdLooseLambdaDD': 'Lambda0' } self.line = StrippingLine("Lb2L0Gamma", prescale=config["Lb2L0GammaPrescale"], L0DU=l0, HLT=hlt, checkPV=True, RelatedInfoTools=[ self.get_cone_relinfo(sels_line, 1.7, 1), self.get_cone_relinfo( sels_line, 1.35, 1), self.get_cone_relinfo(sels_line, 1.0, 1), self.get_vtxisol_relinfo(lambda_b), ], RequiredRawEvents=['Calo'], selection=lambda_b) self.registerLine(self.line) sels_line_cnv = { 'Phys/StdLooseLambdaLL': 'Lambda0', 'Phys/StdLooseLambdaDD': 'Lambda0', lambda_b_cnv: 'Lambdab' } self.line_cnv = StrippingLine( "Lb2L0GammaConverted", prescale=config["Lb2L0GammaPrescale"], L0DU=l0, HLT=hlt, checkPV=True, RelatedInfoTools=[ self.get_cone_relinfo(sels_line_cnv, 1.7, 1), self.get_cone_relinfo(sels_line_cnv, 1.35, 1), self.get_cone_relinfo(sels_line_cnv, 1.0, 1), self.get_vtxisol_relinfo(lambda_b_cnv), ], RequiredRawEvents=['Calo'], selection=lambda_b_cnv) self.registerLine(self.line_cnv)
D0CombCut = "(ADAMASS('D0')<100*MeV) & (ADOCAMAX('')<0.5*mm)" DpCombCut = "(ADAMASS('D+')<100*MeV) & (ADOCAMAX('')<0.5*mm)" DstCombCut = "(ADAMASS('D*(2010)+')<50*MeV) & (ADOCAMAX('')<0.5*mm)" LCCombCut = "(ADAMASS('Lambda_c+')<110*MeV) & (ADOCAMAX('')<0.5*mm)" DMotherCut = "(VFASPF(VCHI2/VDOF)<10) & (BPVVDCHI2>25) & (BPVDIRA>0.998)" D0MotherCut = "(ADMASS('D0')<50*MeV) & " + DMotherCut DpMotherCut = "(ADMASS('D+')<50*MeV) & " + DMotherCut DstMotherCut = "(M-MAXTREE('D0'==ABSID,M)<165.5) & (VFASPF(VCHI2/VDOF)<25) & (BPVVDCHI2>25) & (BPVDIRA>0.998)" LCMotherCut = "(ADMASS('Lambda_c+')<100*MeV) & (VFASPF(VCHI2/VDOF)<10) & (BPVVDCHI2>25) & (BPVDIRA>0.998)" # ============================================================================= # D0 -> K Pi # Tag_StdD02KPi = CombineParticles("Tag_StdD02KPi") Tag_StdD02KPi.ParticleCombiners = {'' : 'LoKi::VertexFitter:PUBLIC' } Tag_StdD02KPi.Preambulo = CharmPreambulo Tag_StdD02KPi.DecayDescriptors = ["[D0 -> K- pi+]cc"] Tag_StdD02KPi.CombinationCut = D0CombCut Tag_StdD02KPi.MotherCut = D0MotherCut Tag_StdD02KPi.Inputs = [OutputKaonList, OutputPionList] Tag_StdD02KPi.Output = "Phys/" + Tag_StdD02KPi.name() + "/Particles" locations.update(updateDoD(Tag_StdD02KPi)) #Tag_CharmRecSeq.Members += [Tag_StdD02KPi] # ============================================================================= # D0 -> K Pi Pi Pi # Tag_StdD02KPiPiPi = CombineParticles ("Tag_StdD02KPiPiPi") Tag_StdD02KPiPiPi.ParticleCombiners = {'' : 'LoKi::VertexFitter:PUBLIC' } Tag_StdD02KPiPiPi.Preambulo = CharmPreambulo
"( ( ANUM( ( TRTYPE == 4 ) & ( ABSID == 'e-' ) ) == 1 ) & ( ANUM( ( TRTYPE == 1 ) & ( ABSID == 'e-' ) ) == 1 ) )" } #Offline and Particle not working yet DO NOT USE #from Configurables import OfflineVertexFitter, ParticleVertexFitter for name in combs: Ks2pipiee[name] = CombineParticles("TrackSel" + name + "_Ks2pipiee") if "V" in name: Ks2pipiee[name].DecayDescriptors = [ "KS0 -> pi+ pi- e+ e-", "KS0 -> pi+ pi- e+ e+", "KS0 -> pi+ pi- e- e-" ] if args.fitter == 'loki': Ks2pipiee[name].ParticleCombiners = {"": "LoKi::VertexFitter"} Ks2pipiee[name].addTool(LoKi__VertexFitter, name="LoKi::VertexFitter") if args.fitter == 'particle': Ks2pipiee[name].ParticleCombiners = {"": "ParticleVertexFitter"} Ks2pipiee[name].addTool(ParticleVertexFitter) if args.fitter == 'offline': Ks2pipiee[name].ParticleCombiners = {"": "OfflineVertexFitter"} Ks2pipiee[name].addTool(OfflineVertexFitter) else: Ks2pipiee[name].DecayDescriptor = "KS0 -> pi+ pi- e+ e-" Ks2pipiee[name].Preambulo = [ "from LoKiPhysMC.decorators import *", "from LoKiPhysMC.functions import mcMatch"