def muonTracksFORmuonAlignment():

    # this still needs to be worked out
    from Configurables import Escher
    Escher().RecoSequence = [
        "Hlt", "Decoding", "AlignTr", "Vertex", "RICH", "CALO", "MUON", "PROTO"
    ]  # ????
    Escher().MoniSequence = ["Tr", "OT"]

    # if the Escher hlt filter is not set, set it here
    if not hasattr(Escher(), "HltFilterCode") or not Escher().HltFilterCode:
        Escher(
        ).HltFilterCode = "HLT_PASS_RE( 'Hlt1DiMuonHighMass*Decision' )"  # Hlt2-->Hlt1 requirement

    # revive only particles used for trigger
    print 'Hlt lines to be used: '
    print ReviveHltTracks(['Hlt1DiMuonHighMassDecision'])

    # Now create the J/psi candidates
    from Configurables import CombineParticles, FilterDesktop
    from CommonParticles.StdAllLooseMuons import StdAllLooseMuons  # requires IsMuon==1
    from CommonParticles.StdLooseJpsi2MuMu import StdLooseJpsi2MuMu  # requires (ADAMASS('J/psi')<100.*MeV)&(ADOCACHI2CUT(30,'')) && "(VFASPF(VCHI2) < 25.)"

    StdLooseJpsi2MuMu.DaughtersCuts = {"mu-": "( P> 6000*MeV)"}  # momentum cut

    ## tighten the mass window for candidates used in alignment
    AlignJpsi2MuMu = FilterDesktop(
        "AlignJpsi2MuMu",
        Inputs=["Phys/StdLooseJpsi2MuMu"],
        Code="(ADMASS('J/psi(1S)') < 35.*MeV) & (VFASPF(VCHI2) < 10.)"
    )  # tighter requirements

    from Configurables import ChargedProtoParticleMaker, ChargedProtoParticleAddMuonInfo
    #####, ChargedProtoCombineDLLsAlg
    from Configurables import TrackParticleMonitor, GaudiSequencer
    recoJpsiSeq = GaudiSequencer("RecoJpsiSeq")
    recoJpsiSeq.Members = [
        ChargedProtoParticleMaker('ChargedProtoPMaker'),
        ChargedProtoParticleAddMuonInfo('ChargedProtoPAddMuon'),
        ###ChargedProtoCombineDLLsAlg('ChargedProtoPCombDLLs'),
        StdAllLooseMuons,
        StdLooseJpsi2MuMu,
        TrackParticleMonitor(
            'StdLooseJpsi2MuMuMonitor',
            InputLocation='/Event/Phys/StdLooseJpsi2MuMu/Particles',
            MinMass=3000,
            MaxMass=3190),
        AlignJpsi2MuMu,
        TrackParticleMonitor(
            'AlignJpsi2MuMuMonitor',
            InputLocation='/Event/Phys/AlignJpsi2MuMu/Particles',
            MinMass=3000,
            MaxMass=3190),
    ]

    sel = ParticleSelection(Name='MufromJpsiMuMu',
                            Location='/Event/Phys/AlignJpsi2MuMu/Particles',
                            Algorithm=recoJpsiSeq)
    return sel
def configureAlignment():
    from Configurables import Escher, TAlignment
    Escher(
    ).HltFilterCode = "HLT_PASS( 'Hlt1CalibTrackingKPiDetachedDecision' )"
    Escher().PrintFreq = 1
    from TAlignment.ParticleSelections import defaultHLTD0Selection
    TAlignment().ParticleSelections = [defaultHLTD0Selection()]
    from TAlignment.TrackSelections import NoPIDTracksFromHlt
    TAlignment().TrackSelections = [NoPIDTracksFromHlt()]

    from TAlignment.AlignmentScenarios import configureTrackerAlignment
    configureTrackerAlignment()
def ReviveHltTracks(TriggerLines=[]):

    HltLines = TriggerLines
    # Default trigger lines from Escher filter
    from Configurables import Escher
    if len(TriggerLines) == 0:
        lines = Escher().HltFilterCode.split('\'')
        for l in lines:
            if l.find('Hlt') != -1 and l.find('Decision') - 1:
                HltLines.append(l)

    # revive only particles used for trigger
    from Configurables import GaudiSequencer
    trackseq = GaudiSequencer("RecoAlignTrSeq")

    from Configurables import HltTrackConverter
    hltTrackConv = HltTrackConverter("HltTrackConv")
    hltTrackConv.HltLinesToUse = HltLines
    hltTrackConv.TrackDestination = 'Rec/Track/AllBest'
    if Escher().DataType in ['2015']:
        hltTrackConv.SelReportsLocation = 'Hlt1/SelReports'

    ## TODO: Watch out for the HLT1/2 Split here!!
    ## probably the decoder DB will take care of it for you...
    from DAQSys.Decoders import DecoderDB
    hltdecs = []
    if Escher().DataType in ['2015']:
        decDec = DecoderDB["HltDecReportsDecoder/Hlt1DecReportsDecoder"]
        selDec = DecoderDB["HltSelReportsDecoder/Hlt1SelReportsDecoder"]
        hltdecs += [decDec, selDec]
    else:
        from DAQSys.DecoderClass import decodersForBank
        hltdecs = decodersForBank(DecoderDB, "HltSelReports")
    trackseq.Members += [d.setup() for d in hltdecs]
    trackseq.Members += [hltTrackConv]

    # Add a filter to skip events with empty input container
    from Configurables import LoKi__VoidFilter as Filter
    fltr = Filter('TrackConvOutput',
                  Code=" 1 < CONTAINS ( '%s') " %
                  hltTrackConv.TrackDestination)
    trackseq.Members.append(fltr)

    # create a sequence that fits the tracks and does the hit-adding
    from TAlignment.Utils import configuredFitAndHitAdderSequence
    fitseq = configuredFitAndHitAdderSequence(
        Name='HltBest',
        InputLocation=hltTrackConv.TrackDestination,
        OutputLocation='Rec/Track/Best')
    trackseq.Members.append(fitseq)
    return HltLines
def protoParticlesFromHLTSelSequence(Name,
                                     HltDecision,
                                     ApplyRichID=False,
                                     ApplyMuonID=False):
    # create a sequence that
    # * revives tracks from an HLT sequence
    # * fits them
    # * runs rich or muon ID on demand
    # tracks will be stored at location 'Rec/Track/' + Name
    # protoparticles will be stored at location ????
    trackListName = 'Rec/Track/' + Name
    from Configurables import GaudiSequencer
    seq = GaudiSequencer(Name + "Seq")
    # revive only particles used for trigger
    from Configurables import HltTrackConverter
    hltTrackConv = HltTrackConverter(Name + "HltTrackConv")
    hltTrackConv.ReadHltLinesFrom1stEvent = HltDecision
    hltTrackConv.TrackDestination = 'Rec/Track/' + Name + 'All'
    if Escher().DataType in ['2015']:
        hltTrackConv.SelReportsLocation = 'Hlt1/SelReports'

    ## TODO: Watch out for the HLT1/2 Split here!!
    ## probably the decoder DB will take care of it for you...
    from DAQSys.Decoders import DecoderDB
    hltdecs = []
    if Escher().DataType in ['2015']:
        decDec = DecoderDB["HltDecReportsDecoder/Hlt1DecReportsDecoder"]
        selDec = DecoderDB["HltSelReportsDecoder/Hlt1SelReportsDecoder"]
        hltdecs += [decDec, selDec]
    else:
        from DAQSys.DecoderClass import decodersForBank
        hltdecs = decodersForBank(DecoderDB, "HltSelReports")
    trackseq.Members += [d.setup() for d in hltdecs]
    trackseq.Members += [hltTrackConv]

    # now fit those tracks and apply a selection
    from TAlignment.Utils import configuredFitAndHitAdderSequence
    fitseq = configuredFitAndHitAdderSequence(Name + 'Fit',
                                              trackListName + 'All',
                                              trackListName)
    seq.Members += [fitseq]
    # next step, prepare the RICH sequence, if we need it.
    #if ApplyRichID:
    return seq
def configureAlignment():

    from Configurables import Escher, TAlignment

    Escher().HltFilterCode = "HLT_PASS( 'Hlt1DiMuonHighMassDecision' )"
    from TAlignment.TrackSelections import BestMuonTracks
    TAlignment().TrackSelections = [BestMuonTracks('OnlineMuonAlignment')]

    from TAlignment.AlignmentScenarios import configureMuonAlignment
    configureMuonAlignment()
def MinimalRichSequence():
    # Tweak a little bit RICH
    from Configurables import Escher, GaudiSequencer, RichRecSysConf, RecSysConf
    richSeqName = Escher()._instanceName(RichRecSysConf)
    richSeq = GaudiSequencer(richSeqName + "Seq")
    richSeq.MeasureTime = True
    richConf = RichRecSysConf("RichOfflineRec")
    richConf.DataType = Escher().getProp("DataType")
    #    richConf.Context    = "HLT"
    #enable 'fast' PID settings
    richConf.PidConfig = "FastGlobal"
    # only consider the Pion and Kaon hypos (instead of the full list. This means you will
    # only have DLL(K-pi) available, but if that is all you need its OK).
    richConf.Particles = ["pion", "kaon"]
    #turn off trackless ring finding
    richConf.TracklessRingAlgs = []
    #richConf.trackConfig().InputTracksLocation = '/Rec/Track/PidTracks'
    # Set the sequence to run the RICH PID in
    richConf.setProp("RecoSequencer", richSeq)
    return
Beispiel #7
0
#  
#   -n <number of iterations>
#   -p <number of processes>
#   -e <number of events>
#
# SetupProject Alignment 
###############################################################################
from Gaudi.Configuration import *
import GaudiKernel.SystemOfUnits as units
from TrackMonitors.BGIRecoConf import BGIRecoConf
from Configurables import CondDB, CondDBAccessSvc, RecSysConf

#RecSysConf().RecoSequence = ["Decoding", "VELO", "Tr", "Vertex", "TT"]

from Configurables import Escher
theApp = Escher()
theApp.DataType   = "2012" # Check that this is true
from Configurables import CondDB
CondDB(LatestGlobalTagByDataType=theApp.DataType)
# theApp.CondDBtag = "sim-20130522-vc-md100"#'sim-20111111-vc-md100'
# theApp.DDDBtag = "dddb-20130929"#'MC11-20111102'
theApp.Simulation = True
#theApp.WithMC = True
theApp.InputType  = "DST" #"MDF"
theApp.PrintFreq = 5000
theApp.EvtMax = 3 #00 #2000#160000 #20000
#theApp.SkipEvents = 20 
theApp.DatasetName = 'Align'
#theApp.UseFileStager = True

from Configurables import UpdateManagerSvc
Beispiel #8
0
#
#   $ESCHEROPTS/gaudiiter.py -n 10 -e -1 $ESCHEROPTS/AlignVeloHalves_ok2.py $ESCHEROPTS/2008-MC-Files.py
#
##############################################################################

from Configurables import (Escher, TrackSys, RecSysConf)
from Gaudi.Configuration import *
from GaudiConf.Configuration import *

from GaudiKernel.ProcessJobOptions import importOptions
importOptions('$STDOPTS/PreloadUnits.opts')

#Escher().DataType  = "2008"
#Escher().DDDBtag   = "default"
#Escher().CondDBtag = "default"
Escher().Detectors = ["Velo"]
Escher().Kalman = True
Escher().Millepede = False
Escher(
).TrackContainer = "Rec/Track/Best"  # Velo, VeloR, Long, Upstream, Downstream, Ttrack, Muon or Calo
Escher().EvtMax = 100
Escher().UseOracle = False
Escher().SpecialData = ["fieldOff"]
#TrackSys().ExpertTracking += [ "noMaterialCorrections"]
TrackSys().ExpertTracking += ["simplifiedGeometry"]
#TrackSys().ExpertTracking += ["noDrifttimes" ]
TrackSys().TrackExtraInfoAlgorithms = ['']
#TrackSys().TrackPatRecAlgorithms = ["Velo","Forward","PatSeed","PatMatch","Downstream","VeloTT"]
TrackSys().TrackPatRecAlgorithms = ["Velo", "Forward", "PatSeed", "PatMatch"]
TrackSys().TrackPatRecAlgorithms = ["Velo", "PatSeed", "PatMatch"]
#TrackSys().TrackPatRecAlgorithms = ["Velo","TsaSeed","PatMatch"]
Beispiel #9
0
# This file must be given as last argument to gaudirun.py, after Escher<conf>.py

# Syntax is:
#   gaudirun.py Escher<conf>.py DC06-Files.py
#
from Gaudi.Configuration import *
from Configurables import Escher, LHCbApp

#-- File catalogs. First one is read-write
FileCatalog().Catalogs = [
    "xmlcatalog_file:MyCatalog.xml",
    "xmlcatalog_file:$BRUNELROOT/job/NewCatalog.xml"
]

# update the escher data type, just in case
Escher().DataType = "DC06"

#-- Main ('signal') event input
inputType = Escher().getProp("InputType").upper()

#-- DC06 database tags are backwards compatible by construction, use default
LHCbApp().DDDBtag = "default"
LHCbApp().CondDBtag = "default"

if inputType == "MDF":
    # Example MDF file. File MUST be described in the FileCatalog, with an FID
    # generated externally, as it is not contained in the MDF file. If the FID is
    # not provided in the Catalog, the output dataset will not contain the
    # information to allow navigation back to the MDF data when reading
    datasetName = "00001820_00000001"
    # B->J/Psi(mumu)Ks events with Boole v12r4, Gauss v25r2, XmlDDDB v30r8
# Syntax is:
#
#   gaudirun.py $ESCHEROPTS/AlignOTCosmics.py $ESCHEROPTS/2008-Cosmic-Data.py
#
# or
#
#   $ESCHEROPTS/gaudiiter.py -n NUMITER -e NUMEVENTS $ESCHEROPTS/AlignOTCosmics.py $ESCHEROPTS/2008-Cosmic-Data.py
#
##############################################################################

from Configurables import (Escher, TrackSys, RecSysConf)

from GaudiKernel.ProcessJobOptions import importOptions
importOptions('$STDOPTS/PreloadUnits.opts')

Escher().DataType = "2008"
Escher().Kalman = True
Escher().Millepede = False
Escher(
).TrackContainer = "Rec/Track/Best"  # Velo, VeloR, Long, Upstream, Downstream, Ttrack, Muon or Calo
Escher().EvtMax = 100000
Escher().SpecialData = ["fieldOff", "cosmics"]
TrackSys().ExpertTracking += ["noDrifttimes", "kalmanSmoother"]
TrackSys().TrackPatRecAlgorithms = ["PatSeed"]
TrackSys().TrackExtraInfoAlgorithms = ['']

RecSysConf().RecoSequence = ["TT", "IT", "OT", "Tr"]

# load a special database
#from Configurables import ( CondDB, CondDBAccessSvc )
#otGeom = CondDBAccessSvc( 'OTGeom' )
#
#   gaudirun.py $ESCHEROPTS/AlignVeloSensors.py $ESCHEROPTS/2008-MC-Files.py
#   gaudirun.py $ESCHEROPTS/AlignVeloSensors.py $ESCHEROPTS/DC06-Files.py
#
#   $ESCHEROPTS/gaudiiter.py -n 10 -e -1 $ESCHEROPTS/AlignVeloHalves_ok2.py $ESCHEROPTS/2008-MC-Files.py
#
##############################################################################

from Configurables import ( Escher, TrackSys, RecSysConf )
from Gaudi.Configuration import *
from GaudiConf.Configuration import *

from GaudiKernel.ProcessJobOptions import importOptions
importOptions('$STDOPTS/PreloadUnits.opts')

Escher().Kalman = True
Escher().Millepede = False
Escher().TrackContainer = "Rec/Track/Best" # Velo, VeloR, Long, Upstream, Downstream, Ttrack, Muon or Calo
Escher().EvtMax = 1000
Escher().UseOracle = False
Escher().SpecialData = [ "earlyData" ]
Escher().DatasetName = "Collisions2010"
TrackSys().ExpertTracking += [ "simplifiedGeometry"]
TrackSys().TrackExtraInfoAlgorithms = ['']
RecSysConf().RecoSequence = ["Decoding","VELO","TT","IT","OT","Tr","Vertex"]
Escher().MoniSequence = ["Tr","OT","ST"]

from Configurables import MagneticFieldSvc
MagneticFieldSvc().OutputLevel = 1

from Configurables import TAlignment
Beispiel #12
0
# This file must be given as last argument to gaudirun.py, after Brunel<conf>.py

# Syntax is:
#   gaudirun.py Brunel<conf>.py 2008-Files.py
#
from Gaudi.Configuration import *
from Configurables import Escher, LHCbApp

#-- File catalogs. First one is read-write
FileCatalog().Catalogs = [
    "xmlcatalog_file:MyCatalog.xml",
    "xmlcatalog_file:$BRUNELROOT/job/NewCatalog.xml"
]

#-- Main ('signal') event input
Escher().InputType = "digi"
inputType = Escher().getProp("InputType").upper()

if inputType == "MDF":
    import sys
    print "**********************************************************************"
    print " 2008 real data requires special options. Use 2008-TED-Data.py instead"
    print "**********************************************************************"
    sys.exit()

elif inputType == "DST":
    # Example POOL DST (reprocessing)
    datasetName = "00001820_00000001"
    # No 2008 DST file yet, format is as follows:
    # EventSelector().Input = ["DATAFILE='PFN:castor:/castor/cern.ch/grid/lhcb/production/DC06/phys-v2-lumi2/00001820/DST/0000/" + datasetName + "_5.dst' TYP='POOL_ROOTTREE' OPT='READ'"]
###############################################################################
# File for running alignment with J/psi reconstructed from HLT sel reports
###############################################################################
# Syntax is:
#   gaudiiter.py Escher-AlignMUON.py <someDataFiles>.py
###############################################################################

from Configurables import Escher

# Just instantiate the configurable...
theApp = Escher()
theApp.DataType = "2012"
#theApp.InputType  = "MDF"
theApp.InputType = "DST"
theApp.PrintFreq = 10
theApp.EvtMax = 10000
theApp.DatasetName = 'AlignHlt1JpsiMUON'

# COND DB
theApp.DDDBtag = 'dddb-20130111'
theApp.CondDBtag = 'cond-20130114'

# trigger requirements
theApp.HltFilterCode = "HLT_PASS_RE( 'Hlt2ExpressJPsiDecision' )"

# specify the input to the alignment
from Configurables import TAlignment
#from TAlignment.ParticleSelections import muonTracksFORmuonAlignment # Stefania
#TAlignment().ParticleSelections = [ muonTracksFORmuonAlignment() ] # Stefania

from TAlignment.TrackSelections import BestMuonTracks
Beispiel #14
0
misSet = opts.get('misSet','MisGM') 

isBeamGas = dataset != 'D02KPi'


if isBeamGas:
    BGIRecoConf().RecoVELOSeq = GaudiSequencer("RecoVELOSeq")
    BGIRecoConf().RecoVertexSeq = GaudiSequencer("RecoVertexSeq")
    BGIRecoConf().PV3DTuning = False
    BGIRecoConf().PVAlgorithm = 'PatPV3D'
    BGIRecoConf().PVSeedTool = 'PVSeed3DTool'
    BGIRecoConf().PVFitterTool = 'LSAdaptPV3DFitter'
    BGIRecoConf().PrimaryVertices = "Rec/Vertex/Primary"

from Configurables import Escher
theApp = Escher()
theApp.CondDBtag = "sim-20130522-vc-md100"#'sim-20111111-vc-md100'
theApp.DDDBtag = "dddb-20130929"#'MC11-20111102'
theApp.DataType   = "2011" # Check that this is true
theApp.Simulation = True
#theApp.WithMC = True
theApp.InputType  = "DST"
theApp.PrintFreq = 5000
theApp.EvtMax = 300 #2000#160000 #20000
#theApp.SkipEvents = 20 
theApp.DatasetName = 'AlignCollisions'
#theApp.UseFileStager = True

# Refit Velo segment of long tracks to not be biased by Tracker

from Configurables import GaudiSequencer
###############################################################################
# File for running alignment with J/psi reconstructed from HLT sel reports
###############################################################################
# Syntax is:
#   gaudiiter.py Escher-AlignHltJpsi.py <someDataFiles>.py
###############################################################################

from Configurables import Escher

# Just instantiate the configurable...
theApp = Escher()
theApp.DataType   = "2012"
theApp.InputType  = "MDF"
theApp.PrintFreq = 10000
theApp.EvtMax = 200000
theApp.DatasetName = 'AlignHltD0'
#theApp.DatasetName += '-IgnoreVelo'
#theApp.HltFilterCode = "HLT_PASS_RE( 'Hlt2ExpressDStar2D0PiDecision' )"
theApp.HltFilterCode = "HLT_PASS_RE( 'Hlt2ExpressD02KPiDecision' )"
#theApp.HltFilterCode = "HLT_PASS_RE( 'Hlt2CharmHadD02HH_D02KPiDecision' )"

# COND DB
theApp.DDDBtag = 'head-20120316'
theApp.CondDBtag = 'head-20120316'

# add the filestager
theApp.UseFileStager = True

# specify the input to the alignment
from Configurables import TAlignment
from TAlignment.ParticleSelections import defaultHLTD0Selection