def __init__(self, name, config): LineBuilder.__init__(self, name, config) d0 = makeD02kpipi0(name) d0conj = ConjugateNeutralPID() d0ws = Selection("D0WSFor" + name, Algorithm = d0conj, RequiredSelections = [ d0 ] ) dstar = makeDstar2Dpi(name, d0) dstarws = makeDstar2Dpi(name, d0ws) lineRS = StrippingLine(name + "RS" , prescale = config["RSPrescale"] , selection = dstar ) lineWS = StrippingLine(name + "WS" , prescale = config["WSPrescale"] , selection = dstarws ) self.registerLine( lineRS ) self.registerLine( lineWS )
def makeD02hhhh ( moduleName ,combMassWin ,massWin ,maxDOCA ,pt ,dauPt ,dauMom ,vtxChi2DOF ,FDChi2 ,IPChi2 ,dauMaxIPChi2 ,dauIPChi2 ,DIRA ,trackChi2DOF ,applyKaonPIDK ,kaonPIDK ,applyPionPIDK ,pionPIDK ,applyGhostProbCut ,ghostProbCut ,runK3pi ,run4pi ,run2K2pi ,run3Kpi ): """Creates a D0->hhhh Selection object, merging D0->K3pi CF , D0->K3pi DCS, D0->pi3K CF , D0->pi3K DCS, D0->KKpipi and D0->4pi, with cuts for physics analysis. Uses StandardParticle objects 'StdAllNoPIDsKaons' and 'StdAllNoPIDsPions' for lines without PID cuts, and 'StdAllLooseKaons' and 'StdAllLoosePions' for line with PID cuts. Arguments: - moduleName : name of Selection - combMassWin : mass window cut on combination (MeV/c^2) - massWin : mass window cut (MeV/c^2) - maxDOCA : maximum DOCA of D0 daughters (mm) - pt : minimum transverse momentum of D0 (MeV/c) - dauPt : minimum transverse momentum of D0 daughters (MeV/c) - dauMom : minimum momentum of D0 daughters (MeV/c) - vtxChi2DOF : maximum vertex chi2 / d.o.f. - FDChi2 : minimum vertex chi2 - IPChi2 : maximum IP chi2 - dauMaxIPChi2 :require at leat one D0 daughter with IP chi2 greather than this value - dauIPChi2 : minimum IP chi2 of D0 daughters - DIRA : cosine of angle sustended by momentum and flight direction vectors of D0 - trackChi2DOF : maximum track chi2 / d.o.f. of D0 daughters (unitless) - applyKaonPIDK : boolean for whether we apply a kaon PIDK cut - kaonPIDK : DLL(K-pi) cut applied to kaon - applyPionPIDK : boolean for whether we apply a pion PIDK cut - pionPIDK : DLL(K-pi) cut applied to pions """ _prefitCuts = "(ADAMASS('D0')<%(combMassWin)s) & (APT>%(pt)s) & " \ "(AMAXDOCA('')<%(maxDOCA)s) & " \ "(AHASCHILD(((ABSID=='K+') | (ABSID=='pi+')) & " \ "(MIPCHI2DV(PRIMARY)>%(dauMaxIPChi2)s)))" %locals() _motherCuts = "(VFASPF(VCHI2/VDOF)<%(vtxChi2DOF)s) & " \ "(BPVVDCHI2>%(FDChi2)s) & (BPVIPCHI2()<%(IPChi2)s) & " \ "(BPVDIRA>%(DIRA)s) & (ADMASS('D0')<%(massWin)s) & " \ "(PT>%(pt)s)" %locals() _kaonCuts = "(TRCHI2DOF<%(trackChi2DOF)s)" \ " &(PT>%(dauPt)s)&(P>%(dauMom)s)" \ " & (MIPCHI2DV(PRIMARY)>%(dauIPChi2)s)" \ %locals() _pionCuts = copy(_kaonCuts) if applyKaonPIDK: _kaonCutsOLD = copy(_kaonCuts) _kaonCuts="(PIDK>%(kaonPIDK)s) & (HASRICH) & " %locals() _kaonCuts+=_kaonCutsOLD if applyPionPIDK: _pionCutsOLD = copy(_pionCuts) _pionCuts="(PIDK<%(pionPIDK)s) & (HASRICH) & " %locals() _pionCuts+=_pionCutsOLD if applyGhostProbCut: _ghostCut = "( TRGHOSTPROB < %(ghostProbCut)s )" %locals() _kaonCutsOLD = copy(_kaonCuts) _pionCutsOLD = copy(_pionCuts) _kaonCuts = _kaonCutsOLD + " & " + _ghostCut _pionCuts = _pionCutsOLD + " & " + _ghostCut from StandardParticles import StdAllNoPIDsPions, StdAllNoPIDsKaons from StandardParticles import StdAllLoosePions, StdAllLooseKaons _kaons = StdAllNoPIDsKaons _pions = StdAllNoPIDsPions if applyKaonPIDK: _kaons = StdAllLooseKaons if applyPionPIDK: _pions = StdAllLoosePions _conjPID = ConjugateNeutralPID() _d02k3pi = CombineParticles (DecayDescriptor = "[D0 -> K- pi+ pi- pi+]cc" ,CombinationCut = _prefitCuts ,MotherCut = _motherCuts ,DaughtersCuts = { "K+" : _kaonCuts ,"pi+" : _pionCuts } ) _selD02K3Pi = Selection('D02K3PiFor'+moduleName ,Algorithm=_d02k3pi ,RequiredSelections=[_pions,_kaons]) _selD02K3PiConj = Selection('D02K3PiConjFor'+moduleName ,Algorithm=_conjPID ,RequiredSelections=[_selD02K3Pi]) _d02pi3k = copy(_d02k3pi) _d02pi3k.DecayDescriptor="[D0 -> K+ K- K- pi+]cc" _selD02Pi3K = Selection('D02Pi3KFor'+moduleName ,Algorithm=_d02pi3k ,RequiredSelections=[_pions,_kaons]) _selD02Pi3KConj = Selection('D02Pi3KConjFor'+moduleName ,Algorithm=_conjPID ,RequiredSelections=[_selD02Pi3K]) _d02kkpipi = copy(_d02k3pi) _d02kkpipi.DecayDescriptor="D0 -> K+ K- pi+ pi-" _selD02KKPiPi = Selection('D02KKPiPiFor'+moduleName ,Algorithm=_d02kkpipi ,RequiredSelections=[_pions,_kaons]) _selD02KKPiPiConj = Selection('D02KKPiPiConjFor'+moduleName ,Algorithm=_conjPID ,RequiredSelections=[_selD02KKPiPi]) _d02fourpi = copy(_d02k3pi) _d02fourpi.DecayDescriptor="D0 -> pi+ pi- pi+ pi-" _d02fourpi.DaughtersCuts={'pi+' : _pionCuts} _selD02FourPi = Selection('D02FourPiFor'+moduleName ,Algorithm=_d02fourpi ,RequiredSelections=[_pions]) _selD02FourPiConj = Selection('D02FourPiConjFor'+moduleName ,Algorithm=_conjPID ,RequiredSelections=[_selD02FourPi]) _selectionsToRun = [] if runK3pi: _selectionsToRun += [_selD02K3Pi, _selD02K3PiConj] if run4pi: _selectionsToRun += [_selD02FourPi, _selD02FourPiConj] if run2K2pi: _selectionsToRun += [_selD02KKPiPi, _selD02KKPiPiConj] if run3Kpi: _selectionsToRun += [_selD02Pi3K, _selD02Pi3KConj] _d0Sel = MergedSelection('D02hhhhFor'+moduleName ,RequiredSelections=_selectionsToRun # ,RequiredSelections=[_selD02K3Pi # ,_selD02K3PiConj # ,_selD02KKPiPi # ,_selD02KKPiPiConj # ,_selD02FourPi # ,_selD02FourPiConj # ,_selD02Pi3K # ,_selD02Pi3KConj] ) return _d0Sel
def makeD02hhll(moduleName, combMassWin, massWin, maxDOCA, pt, dauPt, dauMom, vtxChi2DOF, FDChi2, IPChi2, dauMaxIPChi2, dauIPChi2, DIRA, trackChi2DOF, applyKaonPIDK, kaonPIDK, applyPionPIDK, pionPIDK, applyElePIDe, elePIDe, applyGhostProbCut, ghostProbCut): """Creates a D0->hhll Selection object, merging D0->Kpi(mumu,ee,e+mu-,mu+e-) CF , D0->Kpi(mumu,ee,e+mu-,mu+e-) DCS, D0->KK(mumu,ee,e+mu-,mu+e-) and D0->pipi(mumu,ee,e+mu-,mu+e-), with cuts for physics analysis. Uses StandardParticle objects 'StdAllLooseKaons', 'StdAllLoosePions' and 'StdAllLooseMuons' Arguments: - moduleName : name of Selection - combMassWin : mass window cut on combination (MeV/c^2) - massWin : mass window cut (MeV/c^2) - maxDOCA : maximum DOCA of D0 daughters (mm) - pt : minimum transverse momentum of D0 (MeV/c) - dauPt : minimum transverse momentum of D0 daughters (MeV/c) - dauMom : minimum momentum of D0 daughters (MeV/c) - vtxChi2DOF : maximum vertex chi2 / d.o.f. - FDChi2 : minimum vertex chi2 - IPChi2 : maximum IP chi2 - dauMaxIPChi2 :require at leat one D0 daughter with IP chi2 greather than this value - dauIPChi2 : minimum IP chi2 of D0 daughters - DIRA : cosine of angle sustended by momentum and flight direction vectors of D0 - trackChi2DOF : maximum track chi2 / d.o.f. of D0 daughters (unitless) - applyKaonPIDK : boolean for whether we apply a kaon PIDK cut - kaonPIDK : DLL(K-pi) cut applied to kaon - applyPionPIDK : boolean for whether we apply a pion PIDK cut - pionPIDK : DLL(K-pi) cut applied to pions """ _prefitCuts = "(ADAMASS('D0')<%(combMassWin)s) & (APT>%(pt)s) & " \ "(AMAXDOCA('')<%(maxDOCA)s) & " \ "(AHASCHILD(((ABSID=='K+') | (ABSID=='pi+') | (ABSID=='mu+') ) & " \ "(MIPCHI2DV(PRIMARY)>%(dauMaxIPChi2)s)))" %locals() _motherCuts = "(VFASPF(VCHI2/VDOF)<%(vtxChi2DOF)s) & " \ "(BPVVDCHI2>%(FDChi2)s) & (BPVIPCHI2()<%(IPChi2)s) & " \ "(BPVDIRA>%(DIRA)s) & (ADMASS('D0')<%(massWin)s) & " \ "(PT>%(pt)s)" %locals() _kaonCuts = "(TRCHI2DOF<%(trackChi2DOF)s)" \ " &(PT>%(dauPt)s)&(P>%(dauMom)s)" \ " & (MIPCHI2DV(PRIMARY)>%(dauIPChi2)s)" \ %locals() _pionCuts = copy(_kaonCuts) _muonCuts = copy(_kaonCuts) _eleCuts = copy(_kaonCuts) PiMuPair_Mu_Cut = "(INTREE( (ID=='mu+') & (PT> %(dauPt)s *MeV) & (TRCHI2DOF < %(trackChi2DOF)s) & ((MIPCHI2DV(PRIMARY)) > %(dauIPChi2)s) & (TRGHOSTPROB<%(ghostProbCut)s ) ))" % locals( ) PiMuPair_Pi_Cut = "(INTREE( (ID=='pi-') & (PT> %(dauPt)s *MeV) & (TRCHI2DOF < %(trackChi2DOF)s) & ((MIPCHI2DV(PRIMARY)) > %(dauIPChi2)s) & (TRGHOSTPROB<%(ghostProbCut)s ) ))" % locals( ) _PiMuCuts = PiMuPair_Mu_Cut + " & " + PiMuPair_Pi_Cut PiMuPair_Pi_Cut_PID = "(INTREE( (ID=='pi-') & (PT> %(dauPt)s *MeV) & (TRCHI2DOF < %(trackChi2DOF)s) & ((MIPCHI2DV(PRIMARY)) > %(dauIPChi2)s) & (PIDK<%(pionPIDK)s) & (TRGHOSTPROB<%(ghostProbCut)s ) ))" % locals( ) if applyKaonPIDK: _kaonCutsOLD = copy(_kaonCuts) _kaonCuts = "(PIDK>%(kaonPIDK)s) & (HASRICH) & " % locals() _kaonCuts += _kaonCutsOLD if applyPionPIDK: _pionCutsOLD = copy(_pionCuts) _pionCuts = "(PIDK<%(pionPIDK)s) & (HASRICH) & " % locals() _pionCuts += _pionCutsOLD _PiMuCuts = PiMuPair_Mu_Cut + " & " + PiMuPair_Pi_Cut_PID if applyElePIDe: _eleCutsOLD = copy(_eleCuts) _eleCuts = "(PIDe>%(elePIDe)s) & " % locals() _eleCuts += _eleCutsOLD if applyGhostProbCut: _ghostCut = "( TRGHOSTPROB < %(ghostProbCut)s )" % locals() _kaonCutsOLD = copy(_kaonCuts) _pionCutsOLD = copy(_pionCuts) _eleCutsOLD = copy(_eleCuts) _kaonCuts = _kaonCutsOLD + " & " + _ghostCut _pionCuts = _pionCutsOLD + " & " + _ghostCut _eleCuts = _eleCutsOLD + " & " + _ghostCut from StandardParticles import StdAllNoPIDsPions, StdAllNoPIDsKaons from StandardParticles import StdAllLoosePions, StdAllLooseKaons, StdAllLooseMuons from StandardParticles import StdAllNoPIDsElectrons, StdAllLooseElectrons from StandardParticles import StdAllLooseMuPion _kaons = StdAllLooseKaons _pions = StdAllLoosePions _muons = StdAllLooseMuons _eles = StdAllLooseElectrons _PiMus = StdAllLooseMuPion if applyElePIDe: _eles = StdAllLooseElectrons ### Select kpi modes # MuMu _d02kpi = CombineParticles(DecayDescriptor="[D0 -> K- pi+ mu+ mu-]cc", CombinationCut=_prefitCuts, MotherCut=_motherCuts, DaughtersCuts={ "K+": _kaonCuts, "pi+": _pionCuts, "mu+": _muonCuts }) _selD02KPi = Selection('D02KPiFor' + moduleName, Algorithm=_d02kpi, RequiredSelections=[_muons, _kaons, _pions]) _conjPID = ConjugateNeutralPID() _selD02KPiConj = Selection('D02KPiConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02KPi]) # MuMu SS _d02kpiSS = CombineParticles(DecayDescriptor="[D0 -> K- mu+ rho(770)0]cc", CombinationCut=_prefitCuts, MotherCut=_motherCuts, DaughtersCuts={ "K+": _kaonCuts, "mu+": _muonCuts, "rho(770)0": _PiMuCuts }) _selD02KPiSS = Selection('D02KPiSSFor' + moduleName, Algorithm=_d02kpiSS, RequiredSelections=[_muons, _kaons, _PiMus]) _selD02KPiSSConj = Selection('D02KPiSSConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02KPiSS]) # EE _d02kpi_EE = CombineParticles(DecayDescriptor="[D0 -> K- pi+ e+ e-]cc", CombinationCut=_prefitCuts, MotherCut=_motherCuts, DaughtersCuts={ "K+": _kaonCuts, "pi+": _pionCuts, "e+": _eleCuts }) _selD02KPi_EE = Selection('D02KPi_EE_For' + moduleName, Algorithm=_d02kpi_EE, RequiredSelections=[_eles, _kaons, _pions]) _selD02KPi_EE_Conj = Selection('D02KPi_EE_ConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02KPi_EE]) # EMu _d02kpi_EMu = CombineParticles(DecayDescriptor="[D0 -> K- pi+ e+ mu-]cc", CombinationCut=_prefitCuts, MotherCut=_motherCuts, DaughtersCuts={ "K+": _kaonCuts, "pi+": _pionCuts, "mu+": _muonCuts, "e+": _eleCuts }) _selD02KPi_EMu = Selection( 'D02KPi_EMu_For' + moduleName, Algorithm=_d02kpi_EMu, RequiredSelections=[_eles, _muons, _kaons, _pions]) _selD02KPi_EMu_Conj = Selection('D02KPi_EMu_ConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02KPi_EMu]) # MuE _d02kpi_MuE = CombineParticles(DecayDescriptor="[D0 -> K- pi+ mu+ e-]cc", CombinationCut=_prefitCuts, MotherCut=_motherCuts, DaughtersCuts={ "K+": _kaonCuts, "pi+": _pionCuts, "mu+": _muonCuts, "e+": _eleCuts }) _selD02KPi_MuE = Selection( 'D02KPi_MuE_For' + moduleName, Algorithm=_d02kpi_MuE, RequiredSelections=[_eles, _muons, _kaons, _pions]) _selD02KPi_MuE_Conj = Selection('D02KPi_MuE_ConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02KPi_MuE]) ### Select KK modes # MuMu _d02kk = copy(_d02kpi) _d02kk.DecayDescriptor = "D0 -> K+ K- mu+ mu-" _selD02KK = Selection('D02KKFor' + moduleName, Algorithm=_d02kk, RequiredSelections=[_muons, _kaons]) _selD02KKConj = Selection('D02KKConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02KK]) # EE _d02kk_EE = copy(_d02kpi_EE) _d02kk_EE.DecayDescriptor = "D0 -> K+ K- e+ e-" _selD02KK_EE = Selection('D02KK_EE_For' + moduleName, Algorithm=_d02kk_EE, RequiredSelections=[_eles, _kaons]) _selD02KK_EE_Conj = Selection('D02KK_EE_ConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02KK_EE]) # EMu _d02kk_EMu = copy(_d02kpi_EMu) _d02kk_EMu.DecayDescriptor = "D0 -> K+ K- e+ mu-" _selD02KK_EMu = Selection('D02KK_EMu_For' + moduleName, Algorithm=_d02kk_EMu, RequiredSelections=[_muons, _eles, _kaons]) _selD02KK_EMu_Conj = Selection('D02KK_EMu_ConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02KK_EMu]) # MuE _d02kk_MuE = copy(_d02kpi_MuE) _d02kk_MuE.DecayDescriptor = "D0 -> K+ K- mu+ e-" _selD02KK_MuE = Selection('D02KK_MuE_For' + moduleName, Algorithm=_d02kk_MuE, RequiredSelections=[_muons, _eles, _kaons]) _selD02KK_MuE_Conj = Selection('D02KK_MuE_ConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02KK_MuE]) ### Select PiPi modes # MuMu _d02pipi = copy(_d02kpi) _d02pipi.DecayDescriptor = "D0 -> pi+ pi- mu+ mu-" _d02pipi.DaughtersCuts = { "K+": _kaonCuts, "pi+": _pionCuts, "mu+": _muonCuts } _selD02PiPi = Selection('D02PiPiFor' + moduleName, Algorithm=_d02pipi, RequiredSelections=[_muons, _pions]) _selD02PiPiConj = Selection('D02PiPiConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02PiPi]) # EE _d02pipi_EE = copy(_d02kpi_EE) _d02pipi_EE.DecayDescriptor = "D0 -> pi+ pi- e+ e-" _d02pipi_EE.DaughtersCuts = { "K+": _kaonCuts, "pi+": _pionCuts, "e+": _eleCuts } _selD02PiPi_EE = Selection('D02PiPi_EE_For' + moduleName, Algorithm=_d02pipi_EE, RequiredSelections=[_eles, _pions]) _selD02PiPi_EE_Conj = Selection('D02PiPi_EE_ConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02PiPi_EE]) # EMu _d02pipi_EMu = copy(_d02kpi_EMu) _d02pipi_EMu.DecayDescriptor = "D0 -> pi+ pi- e+ mu-" _d02pipi_EMu.DaughtersCuts = { "K+": _kaonCuts, "pi+": _pionCuts, "mu+": _muonCuts, "e+": _eleCuts } _selD02PiPi_EMu = Selection('D02PiPi_EMu_For' + moduleName, Algorithm=_d02pipi_EMu, RequiredSelections=[_eles, _muons, _pions]) _selD02PiPi_EMu_Conj = Selection('D02PiPi_EMu_ConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02PiPi_EMu]) # MuE _d02pipi_MuE = copy(_d02kpi_MuE) _d02pipi_MuE.DecayDescriptor = "D0 -> pi+ pi- mu+ e-" _d02pipi_MuE.DaughtersCuts = { "K+": _kaonCuts, "pi+": _pionCuts, "mu+": _muonCuts, "e+": _eleCuts } _selD02PiPi_MuE = Selection('D02PiPi_MuE_For' + moduleName, Algorithm=_d02pipi_MuE, RequiredSelections=[_eles, _muons, _pions]) _selD02PiPi_MuE_Conj = Selection('D02PiPi_MuE_ConjFor' + moduleName, Algorithm=_conjPID, RequiredSelections=[_selD02PiPi_MuE]) ### Wrapping everything up _d0Sel = MergedSelection( 'D02hhllFor' + moduleName, RequiredSelections=[ _selD02KPi, _selD02KPiConj, _selD02KPiSS, _selD02KPiSSConj, _selD02KPi_EE, _selD02KPi_EE_Conj, _selD02KPi_EMu, _selD02KPi_EMu_Conj, _selD02KPi_MuE, _selD02KPi_MuE_Conj, _selD02KK, _selD02KKConj, _selD02KK_EE, _selD02KK_EE_Conj, _selD02KK_EMu, _selD02KK_EMu_Conj, _selD02KK_MuE, _selD02KK_MuE_Conj, _selD02PiPi, _selD02PiPiConj, _selD02PiPi_EE, _selD02PiPi_EE_Conj, _selD02PiPi_EMu, _selD02PiPi_EMu_Conj, _selD02PiPi_MuE, _selD02PiPi_MuE_Conj ]) return _d0Sel