Beispiel #1
0
def Dstar ( name,
            D0Sel,
            config,
            Monitor) :
    """
    Selection for D*
    """
    
    _DSt = CombineParticles()
    _DSt.DecayDescriptor = "[D*(2010)+ -> D0 pi+]cc"
    slowPiCuts = "(PT>%(SlowPiPt)s) & (TRCHI2DOF < %(SlowPiTrkChi2)s)" %locals()['config']
    d0Cuts = "ALL"
    _DSt.DaughtersCuts   = { 'pi+' : slowPiCuts, 'D0' : d0Cuts }
    combcut = """
    (APT>%(DstarPt)s)
    & (ADAMASS('D*(2010)+')<75)
    & (AM - AM1 < 165 * MeV) 
    """
    _DSt.CombinationCut = combcut %locals()['config']
    mothercut = """
    (VFASPF(VCHI2PDOF)<%(DstarVtxChi2Ndof)s)
    & (M-MAXTREE('D0'==ABSID,M)<%(DeltaM_Max)s)
    & (M-MAXTREE('D0'==ABSID,M)>%(DeltaM_Min)s)
    """
    _DSt.MotherCut =  mothercut %locals()['config']
    
    if Monitor != None :    
        _DSt.Preambulo    = [
            ## define historam type (shortcut)
            "Histo  = Gaudi.Histo1DDef"  ,
            ## monitor LL-case
            "mass     = monitor ( M / GeV ,    Histo ( 'DSt' , 1.93 , 2.09 , 100 ) , 'M'     ) " ,
            "deltaM   = monitor ( M - M1 /MeV, Histo ( 'DSt' , 135  , 160  , 50  ) , 'DeltaM') " ,
            "pT       = monitor ( PT / GeV ,   Histo ( 'DSt' , 0.00 , 20.0 , 100 ) , 'pT'    ) " ,
            "y        = monitor ( Y ,          Histo ( 'DSt' , 1.60 , 5.40 , 100 ) , 'y'     ) "
            ]
        _DSt.Monitor       = True
        _DSt.HistoProduce  = True
        _DSt.MotherMonitor = """ process ( mass )
        >> process ( deltaM )
        >> process ( pT )
        >> process ( y )
        >> EMPTY
        """
        
    DSt = Selection("SelDSt2D0PiFor"+name,
                    Algorithm = _DSt,
                    RequiredSelections = [StdAllNoPIDsPions,
                                          D0Sel])
    
    return DSt
Beispiel #2
0
def D0 ( name,
         config,
         Monitor
         ) :
    """
    Selection for D0
    """
    
    _D0 = CombineParticles()
    _D0.DecayDescriptor = "[D0 -> K- pi+]cc"
    dauCutStr = "(PT > %(DaugPt)s) & (P > %(DaugP)s) & (TRCHI2DOF < %(DaugTrkChi2)s) & (MIPCHI2DV(PRIMARY) > %(DaugIPChi2)s)" %locals()['config']
    _D0.DaughtersCuts = { "K+" : dauCutStr,
                          "pi+" : dauCutStr
                          }
    _D0.CombinationCut = "(ADAMASS('D0')<85 * MeV)" %locals()['config']
    mothercut = """
    (PT>%(D0Pt)s)
    & (VFASPF(VCHI2PDOF)<%(D0VtxChi2Ndof)s)
    & (BPVVDCHI2>%(D0FDChi2)s)
    & (BPVDIRA>%(D0BPVDira)s)
    & (BPVIPCHI2()<%(D0IPChi2)s)
    & (ADMASS('D0') < %(D0MassWin)s )
    & ( ADWM( 'D0' , WM( 'pi-' , 'K+') ) > %(DCS_WrongMass)s)
    & ( ADWM( 'D0' , WM( 'K-' , 'K+') ) > %(KK_WrongMass)s)
    & ( ADWM( 'D0' , WM( 'pi-' , 'pi+') ) > %(PiPi_WrongMass)s)
    """
    _D0.MotherCut = mothercut %locals()['config']
    
    if Monitor != None :    
        _D0.Preambulo    = [
            ## define historam type (shortcut)
            "Histo  = Gaudi.Histo1DDef"  ,
            ## monitor LL-case
            "mass     = monitor ( M / GeV , Histo ( 'D0' , 1.79 , 1.94 , 100 ) , 'M'     ) " ,
            "pT       = monitor ( PT / GeV , Histo ( 'D0' , 0.00 , 20.0 , 100 ) , 'pT'   ) " ,
            "y        = monitor ( Y , Histo ( 'D0' , 1.60 , 5.40 , 100 ) , 'y'           ) "
            ]
        _D0.Monitor       = True
        _D0.HistoProduce  = True
        _D0.MotherMonitor = """ process ( mass )
        >> process ( pT )
        >> process ( y )
        >> EMPTY
            """
            
    D0 = Selection("SelD02RSKPiFor"+name,
                   Algorithm = _D0,
                   RequiredSelections = [StdAllNoPIDsKaons,
                                         StdAllNoPIDsPions])
    return D0
Beispiel #3
0
    def Lam0 ( self ) :
        """
        Selection for Lam0 
        """
        if hasattr ( self , 'Lam0_LL' ) :
            return self.Lam0_LL

        _Lam0 = CombineParticles(
            #self.name + "StripLam0" ,
            DecayDescriptor = "[ Lambda0 -> p+ pi-]cc" ,
            Preambulo       = self._Preambulo,
            DaughtersCuts   = {
            '' : self._lam0_daughtersCuts ()
            } ,
            CombinationCut  = "AM < 1.5 * GeV " ,
            MotherCut       = self._lam0_motherCut()
            )

        if  self._monitor == True :
            _Lam0.Preambulo       += [
                ## define historam type (shortcut)
                "Histo  = Gaudi.Histo1DDef"  ,
                ## monitor LL-case
                "massLL     = monitor ( M / GeV ,             Histo ( 'Lambda0, LL-case' , 1.080 , 1.140 , 100 ) , 'M_LL'    ) " ,
                "p1LL       = monitor ( CHILD( P, 1 ) / GeV , Histo ( 'Lambda0, LL-case' , 0.00  , 120   , 100 ) , 'p1_LL'   ) " ,
                "p2LL       = monitor ( CHILD( P, 2 ) / GeV , Histo ( 'Lambda0, LL-case' , 0.00  , 120   , 100 ) , 'p2_LL'   ) " ,
                ]
            _Lam0.Monitor         = True ,
            _Lam0.HistoProduce    = True ,
            _Lam0.MotherMonitor = """ process ( massLL )
            >> process ( p1LL )
            >> process ( p2LL )
            >> EMPTY
            """
        

        self.Lam0_LL = Selection("SelLam02PPi_LL" + self._name,
                                 Algorithm = _Lam0,
                                 RequiredSelections = [ StdAllNoPIDsPions, StdAllNoPIDsProtons ]) 

        return self.Lam0_LL
Beispiel #4
0
    def K0SDD ( self ) :
        """
        Selection for K0S DD 
        """
        if hasattr ( self , 'K0S_DD' ) :
            return self.K0S_DD
        
        _K0SDD = CombineParticles(
            #self.name + "StripK0S_DD" ,
            DecayDescriptor = "KS0 -> pi+ pi-" ,
            Preambulo       = self._Preambulo,
            DaughtersCuts   = {
            '' : self._k0s_daughtersCuts ()
            } ,
            CombinationCut  = "AM < 1.0 * GeV " ,
            MotherCut       = self._k0s_motherCut()
            )

        if self._monitor == True :
            _K0SDD.Preambulo       += [
                ## define historam type (shortcut)
                "Histo  = Gaudi.Histo1DDef"  ,
                ## monitor LL-case
                "massDD     = monitor ( M / GeV ,             Histo ( 'K0S, DD-case' , 0.45 , 0.55 , 100 ) , 'M_DD'    ) " ,
                "p1DD       = monitor ( CHILD( P, 1 ) / GeV , Histo ( 'K0S, DD-case' , 0.00 , 120 ,  100 ) , 'p1_DD'   ) " ,
                "p2DD       = monitor ( CHILD( P, 2 ) / GeV , Histo ( 'K0S, DD-case' , 0.00 , 120 ,  100 ) , 'p2_DD'   ) " ,
                ]
            _K0SDD.Monitor         = True ,
            _K0SDD.HistoProduce    = True ,
            _K0SDD.MotherMonitor = """ process ( massDD )
            >> process ( p1DD )
            >> process ( p2DD )
            >> EMPTY
            """
        
        self.K0S_DD = Selection("SelK0S2PiPi_DD_" + self._name,
                                Algorithm = _K0SDD,
                                RequiredSelections = [ StdNoPIDsDownPions ]) 

        return self.K0S_DD
    def Lam0DD ( self ) :
        """
        Selection for Lam0 DD 
        """
        if hasattr ( self , 'Lam0_DD' ) :
            return self.Lam0_DD

        _Lam0DD = CombineParticles(
            #self.name + "StripLam0_DD" ,
            DecayDescriptor = "[ Lambda0 -> p+ pi-]cc" ,
            Preambulo       = self._Preambulo,
            DaughtersCuts   = {
            '' : self._lam0_daughtersCuts (),
            } ,
            CombinationCut  = "AM < 1.5 * GeV " ,
            MotherCut       = self._lam0_motherCut()        
            )

        if  self._monitor != None :
            _Lam0DD.Preambulo       += [
                ## define historam type (shortcut)
                "Histo  = Gaudi.Histo1DDef"  ,
                ## monitor LL-case
                "massDD     = monitor ( M / GeV ,             Histo ( 'Lambda0, DD-case' , 1.080 , 1.140 , 100 ) , 'M_DD'    ) " ,
                "p1DD       = monitor ( CHILD( P, 1 ) / GeV , Histo ( 'Lambda0, DD-case' , 0.00  , 120   , 100 ) , 'p1_DD'   ) " ,
                "p2DD       = monitor ( CHILD( P, 2 ) / GeV , Histo ( 'Lambda0, DD-case' , 0.00  , 120   , 100 ) , 'p2_DD'   ) " ,
                ]
            _Lam0DD.Monitor         = True ,
            _Lam0DD.HistoProduce    = True ,
            _Lam0DD.MotherMonitor = """ process ( massDD )
            >> process ( p1DD )
            >> process ( p2DD )
            >> EMPTY
            """
        self.Lam0_DD = Selection("SelLam02PiPi_DD",
                                 Algorithm = _Lam0DD,
                                 RequiredSelections = [ StdNoPIDsDownPions , StdNoPIDsDownProtons]) 
        
        return self.Lam0_DD
Beispiel #6
0
def BtoDlnuLine(module_name,
                name,
                BDecays,
                DDecays,
                CONFIG,
                CHARM_DAUGHTERS,
                MUON,
                FAKE_MUON=None):

    DEFAULT_GECs = {
        "Code":
        "( recSummaryTrack(LHCb.RecSummary.nLongTracks, TrLONG) < %(GEC_nLongTrk)s )"
        % CONFIG,
        "Preambulo": ["from LoKiTracks.decorators import *"]
    }

    CHARM_DaugCuts = {}
    CHARM_ComboCuts = CONFIG["CharmComboCuts"]
    CHARM_MotherCuts = CONFIG["CharmMotherCuts"]
    CHARM_ComboCuts += " & (ADOCACHI2CUT( %(D_DocaChi2Max)s, ''))" % CONFIG
    CHARM_MotherCuts += "& (VFASPF(VCHI2/VDOF) < %(D_VCHI2DOF)s) " \
        "& (BPVVDCHI2 > %(D_FDCHI2)s) &  (BPVDIRA> %(D_BPVDIRA)s)"  % CONFIG

    if "CharmDaugCuts" in CONFIG.keys():
        CHARM_DaugCuts = CONFIG["CharmDaugCuts"]
    if "CharmExtraComboCuts" in CONFIG.keys():
        CHARM_ComboCuts += CONFIG["CharmExtraComboCuts"]
    if "CharmExtraMotherCuts" in CONFIG.keys():
        CHARM_MotherCuts += CONFIG["CharmExtraMotherCuts"]

    CHARM = Selection("CharmSelFor" + name + module_name,
                      Algorithm=CombineParticles(
                          DecayDescriptors=DDecays,
                          DaughtersCuts=CHARM_DaugCuts,
                          CombinationCut=CHARM_ComboCuts,
                          MotherCut=CHARM_MotherCuts),
                      RequiredSelections=CHARM_DAUGHTERS)

    USED_CHARM = CHARM
    if "D*" in BDecays:
        DST = makeDstar("CharmSelDstFor" + name + module_name, CHARM, CONFIG)
        USED_CHARM = DST

    B_combinationCut = "(AM > %(B_MassMin)s) & (AM < %(B_MassMax)s) & (ADOCACHI2CUT( %(B_DocaChi2Max)s, ''))" % CONFIG
    B_motherCut = " (MM>%(B_MassMin)s) & (MM<%(B_MassMax)s)"\
        "&(VFASPF(VCHI2/VDOF)< %(B_VCHI2DOF)s) & (BPVDIRA> %(B_DIRA)s)"\
        "&(MINTREE(((ABSID=='D+')|(ABSID=='D0')|(ABSID=='Lambda_c+')|(ABSID=='Omega_c0')|(ABSID=='Xi_c+'))"\
        ", VFASPF(VZ))-VFASPF(VZ) > %(B_D_DZ)s  ) " %CONFIG
    if "ExtraComboCuts" in CONFIG.keys():
        B_combinationCut += CONFIG["ExtraComboCuts"]
    if "ExtraMotherCuts" in CONFIG.keys():
        B_motherCut += CONFIG["ExtraMotherCuts"]

    B_DaugCuts = {}
    if "ExtraMuonCuts" in CONFIG.keys():
        B_DaugCuts = {"mu+": CONFIG["ExtraMuonCuts"]}
    if "ExtraElectronCuts" in CONFIG.keys():
        B_DaugCuts = {"e+": CONFIG["ExtraElectronCuts"]}
    _B = CombineParticles(DecayDescriptors=BDecays,
                          DaughtersCuts=B_DaugCuts,
                          CombinationCut=B_combinationCut,
                          MotherCut=B_motherCut)

    if CONFIG["Monitor"] == True:
        _B.Preambulo = [
            "hdm1 = Gaudi.Histo1DDef ( 'D_M' , 1700 , 2800  , 200 )"
        ]
        _B.Monitor = True
        _B.MotherMonitor = "process ( monitor ( CHILD(M,1) , hdm1 , 'D_M' ) )  >> ~EMPTY " ""

    BSel = Selection("BSelFor" + name + module_name,
                     Algorithm=_B,
                     RequiredSelections=[MUON, USED_CHARM])

    BSelTOS = TOSFilter("BSelFor" + name + module_name + "TOS", BSel,
                        CONFIG["TTSpecs"])

    LINE_NAME = module_name + "_" + name
    _prescale = 1.0
    if LINE_NAME in CONFIG["prescales"].keys():
        _prescale = CONFIG["prescales"][LINE_NAME]
    main_line = StrippingLine(LINE_NAME,
                              selection=BSelTOS,
                              HLT1=CONFIG["HLT1"],
                              HLT2=CONFIG["HLT2"],
                              FILTER=DEFAULT_GECs,
                              prescale=_prescale)

    if FAKE_MUON == None:
        return main_line
    else:
        BSelFake = Selection("BSelFakeFor" + name + module_name,
                             Algorithm=_B,
                             RequiredSelections=[FAKE_MUON, USED_CHARM])

        BSelFakeTOS = TOSFilter("BSelFakeFor" + name + module_name + "TOS",
                                BSelFake, CONFIG["TTSpecs"])
        return {
            "RealMuon":
            main_line,
            "FakeMuon":
            StrippingLine(LINE_NAME + '_FakeMuon',
                          selection=BSelFakeTOS,
                          HLT1=CONFIG["HLT1"],
                          HLT2=CONFIG["HLT2"],
                          FILTER=DEFAULT_GECs,
                          prescale=CONFIG["prescaleFakes"])
        }