Ejemplo n.º 1
0

def _psi_(self):
    """
    psi(') -> mu+ mu-
    """
    return psis


PsiX0.psi = _psi_
PsiX.psi = _psi_

psix = PsiX('PsiX', {})
psix0 = PsiX0('PsiX0', {})
for s in (
        psix.psi_pi(),
        psix.psi_K(),
        #
        psix.psi_2pi(),
        psix.psi_2K(),
        psix.psi_2Kpi(),
        ##
        psix.psi_3pi(),
        psix.psi_3K(),
        psix.psi_3Kpi(),
        ##
        psix.psi_4pi(),
        psix.psi_4Kpi(),
        psix.psi_4K(),
        ##
        psix.psi_5pi(),
Ejemplo n.º 2
0
def configure ( inputdata        ,    ## the list of input files  
                catalogs = []    ,    ## xml-catalogs (filled by GRID)
                castor   = False ,    ## use the direct access to castor/EOS ? 
                params   = {}    ) :

    from PhysSelPython.Wrappers import AutomaticData
    jpsi_name = 'FullDSTDiMuonJpsi2MuMuDetachedLine'
    psi2_name = 'FullDSTDiMuonPsi2MuMuDetachedLine'
    jpsi  = AutomaticData ( '/Event/AllStreams/Phys/%s/Particles' % jpsi_name ) 
    psi2s = AutomaticData ( '/Event/AllStreams/Phys/%s/Particles' % psi2_name )
    
    from PhysSelPython.Wrappers import MergedSelection
    psis = MergedSelection (
    		'SelDetachedPsisForBandQ' ,  
    		RequiredSelections = [ jpsi , psi2s ] 
    )

    from StrippingSelections.StrippingPsiXForBandQ import PsiX_BQ_Conf    as PsiX
    from StrippingSelections.StrippingPsiX0        import PsiX0Conf       as PsiX0 

    def _psi_ ( self ) :
        """
        psi(') -> mu+ mu- 
        """
        return psis

    PsiX0 . psi = _psi_
    PsiX  . psi = _psi_

    logger.warning ( "Redefine PsiX .psi" )

    psix   = PsiX   ( 'PsiX'  , {} )
    psix0  = PsiX0  ( 'PsiX0' , {} )
    for s in ( psix.psi_pi       () ,
           psix.psi_K        () ,
           #
           psix.psi_2pi      () ,
           psix.psi_2K       () ,
           psix.psi_2Kpi     () ,
           ## 
           psix.psi_3pi      () ,
           psix.psi_3K       () ,
           psix.psi_3Kpi     () ,
           ##
           psix.psi_4pi      () ,
           psix.psi_4Kpi     () ,
           psix.psi_4K       () ,
           ##
           psix.psi_5pi      () ,
           psix.psi_5K       () ,
           psix.psi_5Kpi     () ,
           ##
           psix.psi_6pi      () ,
           psix.psi_6Kpi     () ,
           ##
           psix.psi_7pi      () ,
           psix.psi_7Kpi     () ,
           ##
           # Lb 
           psix.psi_pK       () ,
           psix.psi_ppi      () ,
           psix.psi_pKpipi   () ,
           ##
           # 2protons 
           psix.psi_pp       () ,
           psix.psi_pppi     () ,
           psix.psi_ppK      () ,
           psix.psi_pppipi   () ,
           psix.psi_ppKpipi  () ,
           psix.psi_pppipipi () ,
           ##
           ) :
      a = s.algorithm ()
      a.ParticleCombiners = { '' : 'LoKi::VertexFitter:PUBLIC' }
      #
      a.MaxCandidates          = 2000
      a.StopAtMaxCandidates    = True 
      a.StopIncidentType       = 'ExceedsCombinatoricsLimit'
      # 
    from PhysSelPython.Wrappers import MultiSelectionSequence
    from PhysSelPython.Wrappers import      SelectionSequence    
    psi_x = MultiSelectionSequence (
        "PSIX"      ,
        Sequences = [
        ## channels with chic
        # 
        SelectionSequence ( 'B2CHICK'     , psix0 . b2chicK     () ) ,
        SelectionSequence ( 'B2CHICKK'    , psix0 . b2chicKK    () ) ,
        SelectionSequence ( 'B2CHICKPi'   , psix0 . b2chicKpi   () ) ,
        SelectionSequence ( 'B2CHICKPiPi' , psix0 . b2chicKpipi () ) ,
        SelectionSequence ( 'B2CHICPiPi'  , psix0 . b2chicpipi  () ) ,
        #
        SelectionSequence ( 'BC2CHICPi'   , psix0 . bc2chicpi    () ) ,
        SelectionSequence ( 'Lb2CHICPi'   , psix0 . lb2chicpK    () ) ,
        ]
    )

    ## import DaVinci 
    from Configurables import DaVinci
    ## delegate the actual configuration to DaVinci
    dv = DaVinci ( DataType      = '2011'        ,
                   InputType     = 'DST'         ,
		   Simulation	 = True		 ,
		   Lumi		 = False	 ,
                   TupleFile     = 'Tuples.root'   ## IMPORTANT 
                   )
    
    ## add the name of Bender algorithm into User sequence sequence 
    alg_name = 'HistosAndTuples'
    dv.UserAlgorithms += [ psi_x.sequence(), 'TrackScaleState', alg_name ]

    
    ## define the input data
    setData  ( inputdata , catalogs , castor )
    
    ## get/create application manager
    gaudi = appMgr() 
    
    ## (1) create the algorithm with given name 
    alg = HistosAndTuples (
        alg_name ,
        Inputs    = [ 'Phys/SelB2ChicPiPiForPsiX0/Particles' ]
        )
             
    return SUCCESS 
def configure ( datafiles , catalogs = [] , castor = False ) :
    """
    Job configuration
    """

    from Configurables           import DaVinci       ## needed for job configuration
    from Configurables           import EventSelector ## needed for job configuration
    
    from Configurables import MessageSvc
    msg = MessageSvc()
    msg.setError += [ 'HcalDet.Quality'   ,
                      'EcalDet.Quality'   ,
                      'MagneticFieldSvc'  ,
                      'PropertyConfigSvc' ]


##     # =========================================================================
##     ## 0) Rerun stripping if MC is nt MC/2011 or MC/2012 
##     # =========================================================================
##     if   '2012' == the_year : 
##         import StrippingArchive.Stripping20.StrippingDiMuonNew              as DiMuon 
##         import StrippingSettings.Stripping20.LineConfigDictionaries_BandQ   as LineSettings
##     elif '2011' == the_year :
##         import StrippingArchive.Stripping20r1.StrippingDiMuonNew            as DiMuon 
##         import StrippingSettings.Stripping20r1.LineConfigDictionaries_BandQ as LineSettings

##     config  = LineSettings.FullDSTDiMuon['CONFIG']
##     name    = 'FullDST'
##     builder = DiMuon.DiMuonConf ( name , config )

##     ## selection
##     jpsi  = builder.SelJpsi2MuMuDetached


    # =========================================================================
    ## 0) Otherwise use existing stripping ilne 
    # =========================================================================
    
    from PhysSelPython.Wrappers import AutomaticData
    jpsi_location = 'FullDSTDiMuonJpsi2MuMuDetachedLine'
    jpsi = AutomaticData ( Location = '/Event/AllStreams/Phys/%s/Particles' % jpsi_location )

    
    # =============================================================================
    from StrippingSelections.StrippingPsiXForBandQ import PsiX_BQ_Conf    as PsiX
    
    # =============================================================================
    ## 1) redefine stripping configurations 
    # ============================================================================= 
    
    #
    ## redefine psi(') -> mu+ mu-
    # 
    def _psi_ ( self ) :
        """
        psi(') -> mu+ mu- 
        """
        return jpsi
    
    PsiX  . psi = _psi_
    
    logger.warning ( "Redefine PsiX .psi" )
    
    # =============================================================================
    ## 2) unify the pion& kaon  selections 
    # =============================================================================
    _PionCut_  = """
    ( CLONEDIST   > 5000   ) & 
    ( TRCHI2DOF   < 4      ) &
    ( TRGHOSTPROB < 0.4    ) &
    ( PT          > 200 * MeV               ) & 
    in_range ( 2          , ETA , 4.9       ) &
    in_range ( 3.2 * GeV  , P   , 150 * GeV ) &
    HASRICH                  &
    ( PROBNNpi     > 0.15  ) &
    ( MIPCHI2DV()  > 9.    )
    """
    _KaonCut_  = """
    ( CLONEDIST   > 5000   ) & 
    ( TRCHI2DOF   < 4      ) & 
    ( TRGHOSTPROB < 0.4    ) & 
    ( PT          > 200 * MeV               ) & 
    in_range ( 2          , ETA , 4.9       ) &
    in_range ( 3.2 * GeV  , P   , 150 * GeV ) &
    HASRICH                  &
    ( PROBNNk      > 0.15  ) &
    ( MIPCHI2DV()  > 9.    ) 
    """ 
    
    from GaudiConfUtils.ConfigurableGenerators import FilterDesktop
    _alg_pi  = FilterDesktop (
        ##
        Code = _PionCut_ ,
        ##
        )
    
    from PhysSelPython.Wrappers  import Selection
    from StandardParticles       import StdAllNoPIDsPions as input_pions 
    pions  = Selection (
        "SelPiForBQ"                       ,
        Algorithm          =  _alg_pi      ,
        RequiredSelections = [ input_pions ]  
        )
    
    from GaudiConfUtils.ConfigurableGenerators import FilterDesktop
    _alg_k  = FilterDesktop (
        ##
        Code = _KaonCut_ ,
        ##
        )
    
    from PhysSelPython.Wrappers  import Selection
    from StandardParticles       import StdAllNoPIDsKaons as input_kaons 
    kaons  = Selection (
        "SelKForBQ"      ,
        Algorithm          =   _alg_k      ,
        RequiredSelections = [ input_kaons ]  
        )
    
    
    def _kaons_   ( self ) : return kaons 
    def _pions_   ( self ) : return pions 
    
    #
    ## get the selections 
    #
    
    for s in [ PsiX ]  :
        s.pions   = _pions_
        s.kaons   = _kaons_
        
    logger.warning ( "Redefine PsiX.kaons          " )
    logger.warning ( "Redefine PsiX.kaons          " )

        
    psix   = PsiX   ( 'PsiX'  , {} )


    for s in [ psix.psi_pi() ] :
        
        a = s.algorithm ()
        a.ParticleCombiners = { '' : 'LoKi::VertexFitter:PUBLIC' } 
        
        
    from PhysSelPython.Wrappers import      SelectionSequence    
    sel_seq = SelectionSequence ( 'B2PsiPi'   , psix . psi_pi   () )
    

    the_year = '2012'
    davinci = DaVinci (
        DataType      = the_year ,
        InputType     = 'DST'    ,
        Simulation    = True     ,
        PrintFreq     = 1000     ,
        EvtMax        = -1       , 
        HistogramFile = 'DVHistos.root' ,
        TupleFile     = 'DVNtuples.root' ,
        Lumi          = True ,
        ##
        # MC : 
        ## SIMCOND : 'Sim08-20130503-1', 'Sim08-20130503-1-vc-md100'
        #
        DDDBtag   = "Sim08-20130503-1"         ,
        CondDBtag = "Sim08-20130503-1-vc-md100"    
        )
    
    
    my_name = "Bplus"
    from Configurables import GaudiSequencer
    
    davinci.UserAlgorithms = [ sel_seq.sequence() , my_name ] 
    
    setData ( datafiles , catalogs , castor )
    
    gaudi = appMgr()
    
    print 'seq.outputLocation()= ', sel_seq.outputLocation()    # Phys/SelPsi3KPiForPsiX/Particles
    alg = Jpsi_mu(
        my_name               ,   ## Algorithm name
        Inputs = [
        sel_seq.outputLocation()
        ] ,
        PP2MCs = [ 'Relations/Rec/ProtoP/Charged' ]
        )

    return SUCCESS 
Ejemplo n.º 4
0
def configure ( inputdata        ,    ## the list of input files  
                catalogs = []    ,    ## xml-catalogs (filled by GRID)
                castor   = False ,    ## use the direct access to castor/EOS ? 
                params   = {}    ) :

    from PhysSelPython.Wrappers import AutomaticData
    jpsi_name = 'FullDSTDiMuonJpsi2MuMuDetachedLine'
    psi2_name = 'FullDSTDiMuonPsi2MuMuDetachedLine'
    jpsi  = AutomaticData ( '/Event/AllStreams/Phys/%s/Particles' % jpsi_name ) 
    psi2s = AutomaticData ( '/Event/AllStreams/Phys/%s/Particles' % psi2_name )
    
    from PhysSelPython.Wrappers import MergedSelection
    psis = MergedSelection (
    		'SelDetachedPsisForBandQ' ,  
    		RequiredSelections = [ jpsi , psi2s ] 
    )

    from StrippingSelections.StrippingPsiXForBandQ import PsiX_BQ_Conf    as PsiX
    from StrippingSelections.StrippingPsiX0        import PsiX0Conf       as PsiX0 

    def _psi_ ( self ) :
        """
        psi(') -> mu+ mu- 
        """
        return psis

    PsiX0 . psi = _psi_
    PsiX  . psi = _psi_

    logger.warning ( "Redefine PsiX .psi" )

    psix   = PsiX   ( 'PsiX'  , {} )
    psix0  = PsiX0  ( 'PsiX0' , {} )
    for s in ( psix.psi_pi       () ,
           psix.psi_K        () ,
           #
           psix.psi_2pi      () ,
           psix.psi_2K       () ,
           psix.psi_2Kpi     () ,
           ## 
           psix.psi_3pi      () ,
           psix.psi_3K       () ,
           psix.psi_3Kpi     () ,
           ##
           psix.psi_4pi      () ,
           psix.psi_4Kpi     () ,
           psix.psi_4K       () ,
           ##
           psix.psi_5pi      () ,
           psix.psi_5K       () ,
           psix.psi_5Kpi     () ,
           ##
           psix.psi_6pi      () ,
           psix.psi_6Kpi     () ,
           ##
           psix.psi_7pi      () ,
           psix.psi_7Kpi     () ,
           ##
           # Lb 
           psix.psi_pK       () ,
           psix.psi_ppi      () ,
           psix.psi_pKpipi   () ,
           ##
           # 2protons 
           psix.psi_pp       () ,
           psix.psi_pppi     () ,
           psix.psi_ppK      () ,
           psix.psi_pppipi   () ,
           psix.psi_ppKpipi  () ,
           psix.psi_pppipipi () ,
           ##
           ) :
      a = s.algorithm ()
      a.ParticleCombiners = { '' : 'LoKi::VertexFitter:PUBLIC' }
      #
      a.MaxCandidates          = 2000
      a.StopAtMaxCandidates    = True 
      a.StopIncidentType       = 'ExceedsCombinatoricsLimit'
      # 
    from PhysSelPython.Wrappers import MultiSelectionSequence
    from PhysSelPython.Wrappers import      SelectionSequence    
    psi_x = MultiSelectionSequence (
        "PSIX"      ,
        Sequences = [
        ## channels with chic
        # 
        SelectionSequence ( 'B2CHICK'     , psix0 . b2chicK     () ) ,
        SelectionSequence ( 'B2CHICKK'    , psix0 . b2chicKK    () ) ,
        SelectionSequence ( 'B2CHICKPi'   , psix0 . b2chicKpi   () ) ,
        SelectionSequence ( 'B2CHICKPiPi' , psix0 . b2chicKpipi () ) ,
        SelectionSequence ( 'B2CHICPiPi'  , psix0 . b2chicpipi  () ) ,
        #
        SelectionSequence ( 'BC2CHICPi'   , psix0 . bc2chicpi    () ) ,
        SelectionSequence ( 'Lb2CHICPi'   , psix0 . lb2chicpK    () ) ,
        ]
    )

    ## import DaVinci 
    from Configurables import DaVinci
    ## delegate the actual configuration to DaVinci
    dv = DaVinci ( DataType      = '2012'        ,
                   InputType     = 'DST'         ,
		   Simulation	 = True		 ,
		   Lumi		 = False	 ,
                   TupleFile     = 'Tuples.root'   ## IMPORTANT 
                   )
    
    ## add the name of Bender algorithm into User sequence sequence 
    alg_name = 'HistosAndTuples'
    dv.UserAlgorithms += [ psi_x.sequence(), 'TrackScaleState', alg_name ]

    
    ## define the input data
    setData  ( inputdata , catalogs , castor )
    
    ## get/create application manager
    gaudi = appMgr() 
    
    ## (1) create the algorithm with given name 
    alg = HistosAndTuples (
        alg_name ,
        Inputs    = [ 'Phys/SelB2ChicPiPiForPsiX0/Particles' ]
        )
             
    return SUCCESS 
Ejemplo n.º 5
0
from StrippingSelections.StrippingPsiXForBandQ import PsiX_BQ_Conf    as PsiX
from StrippingSelections.StrippingPsiX0        import PsiX0Conf       as PsiX0

def _psi_ ( self ) :
    """
    psi(') -> mu+ mu-
    """
    return psis

PsiX0 . psi = _psi_
PsiX  . psi = _psi_

psix   = PsiX   ( 'PsiX'  , {} )
psix0  = PsiX0  ( 'PsiX0' , {} )
for s in ( psix.psi_pi       () ,
           psix.psi_K        () ,
           #
           psix.psi_2pi      () ,
           psix.psi_2K       () ,
           psix.psi_2Kpi     () ,
           ##
           psix.psi_3pi      () ,
           psix.psi_3K       () ,
           psix.psi_3Kpi     () ,
           ##
           psix.psi_4pi      () ,
           psix.psi_4Kpi     () ,
           psix.psi_4K       () ,
           ##
           psix.psi_5pi      () ,