#!/bin/env python import sys sys.path.append('.') # Test data #from GaudiConf import IOHelper #IOHelper('ROOT').inputFiles(['/eos/lhcb/grid/prod/lhcb/LHCb/Collision16/EW.DST/00069603/0000/00069603_00001133_1.ew.dst'], clear = True) # from PhysConf.Filters import LoKi_Filters fltrs = LoKi_Filters ( STRIP_Code = """ HLT_PASS_RE ( 'StrippingLowMultLMR2HHLineDecision' ) """ ) from PhysSelPython.Wrappers import SimpleSelection, MergedSelection, DataOnDemand, Selection from GaudiConfUtils.ConfigurableGenerators import FilterDesktop, CombineParticles ##other selections from StandardParticles import StdAllNoPIDsKaons as loosekaons kaons = SimpleSelection ( 'kaons' , FilterDesktop , [ loosekaons ] , DecayDescriptor = "[K+]cc", Code = (#"(PIDK - PIDpi > 5) & " "(PT>50*MeV)" "& (TRGHOSTPROB<0.3)")
#DaVinci().CondDBtag = 'cond-20161004' #DaVinci().DDDBtag = 'dddb-20150724' DaVinci().UserAlgorithms = [ convLLSeq, convDDSeq, caloSeq, #mergedpi0Seq, dimuSeq ] #================ # Setup Turbo if TYPE == "Displ": from PhysConf.Filters import LoKi_Filters hltFilter = LoKi_Filters( HLT2_Code="HLT_PASS_RE('.*ExoticaDisplDiMuonDecision.*')") DaVinci().EventPreFilters = hltFilter.filters('TriggerFilters') #fltrSeq = hltFilter.sequence ( 'MyHLTFilters' ) #DaVinci().EventPreFilters = [fltrSeq] rootInTes = "" else: if YEAR == 2016: from Configurables import DstConf from Configurables import TurboConf DaVinci().Turbo = True DstConf().Turbo = True TurboConf().PersistReco = True
#!/bin/env python import sys sys.path.append('.') from PhysConf.Filters import LoKi_Filters fltrs = LoKi_Filters ( STRIP_Code = """ HLT_PASS_RE ( 'StrippingZ02MuMu.*' ) """ ) # Data type configuration. from GaudiKernel import SystemOfUnits as Units ##Type = 'MC' JetPtMin = 10 * Units.GeV from StandardParticles import StdAllNoPIDsMuons as loosemuons from PhysSelPython.Wrappers import SimpleSelection, MergedSelection, DataOnDemand, Selection from GaudiConfUtils.ConfigurableGenerators import FilterDesktop, CombineParticles from commonSelections import * from PhysSelPython.Wrappers import SelectionSequence Z_seq = SelectionSequence('Z_Seq', TopSelection=Zs) # Create the generated jets.
leptonicMicroDSTname = 'Leptonic' charmMicroDSTname = 'Charm' pidMicroDSTname = 'PID' bhadronMicroDSTname = 'Bhadron' mdstStreams = [ leptonicMicroDSTname,charmMicroDSTname,pidMicroDSTname,bhadronMicroDSTname ] dstStreams = [ "BhadronCompleteEvent", "CharmCompleteEvent", "CharmToBeSwum", "Dimuon", "EW", "Semileptonic", "Calibration", "MiniBias", "Radiative" ] stripTESPrefix = 'Strip' from Configurables import ProcStatusCheck from PhysConf.Filters import LoKi_Filters flts = LoKi_Filters(VOID_Code = "( TrSource(TrSOURCE('/Event/Rec/Track/Best', TrLONG))"\ " >> ( sum( TrPT,TrP < 1 * TeV ) > 1 * TeV ) )" , VOID_Preambulo = ["from LoKiTracks.decorators import *" , "from LoKiCore.functions import * ", "from GaudiKernel.SystemOfUnits import *"]) filterBadEvents = GaudiSequencer("BadEventFilter", ModeOR = True, Members = [ flts.sequencer("GECFilter"), ProcStatusCheck() ] ) streamFilter = { 'default' : filterBadEvents, 'MiniBias' : ProcStatusCheck() } sc = StrippingConf( Streams = streams, MaxCandidates = 2000, AcceptBadEvents = False, BadEventSelection = streamFilter, TESPrefix = stripTESPrefix,
#!/bin/env python import sys sys.path.append('.') from PhysConf.Filters import LoKi_Filters fltrs = LoKi_Filters(STRIP_Code=""" HLT_PASS_RE ( 'StrippingMuMuSSLine4.*' ) """) # Data type configuration. from GaudiKernel import SystemOfUnits as Units ##Type = 'MC' JetPtMin = 10 * Units.GeV ## Data. #from GaudiConf import IOHelper #IOHelper('ROOT').inputFiles(['/eos/lhcb/grid/prod/lhcb/LHCb/Collision16/EW.DST/00069603/0000/00069603_00005740_1.ew.dst'],#'/eos/lhcb/grid/prod/lhcb/LHCb/Collision16/EW.DST/00061346/0000/00061346_00007712_1.ew.dst'],#/tmp/dcraik/00042952_00000002_1.ldst'], #/data/dst/MC15.MD.49000004.1.00.dst'], # clear = True) ##Type = 'MC' from StandardParticles import StdAllNoPIDsMuons as loosemuons from PhysSelPython.Wrappers import SimpleSelection, MergedSelection, DataOnDemand, Selection from GaudiConfUtils.ConfigurableGenerators import FilterDesktop, CombineParticles from commonSelections import * from PhysSelPython.Wrappers import SelectionSequence Z_seq = SelectionSequence('Z_Seq', TopSelection=SSZs) # Create the generated jets.
#elif jobType.startswith('Data'): DaVinci().Simulation = False DaVinci().Lumi = False DaVinci().DataType = '2016' DaVinci().CondDBtag = 'cond-20161004' DaVinci().DDDBtag = 'dddb-20150724' DaVinci().UserAlgorithms = [convLLSeq, convDDSeq, caloSeq, dimuSeq] #================ # Setup Turbo if True: from Configurables import DstConf from Configurables import TurboConf from PhysConf.Filters import LoKi_Filters #hltFilter = LoKi_Filters(HLT2_Code = "HLT_PASS_RE('.*ExoticaDisplDiMuonDecision.*')") hltFilter = LoKi_Filters( HLT2_Code="HLT_PASS_RE('.*ExoticaPrmptDiMuonTurboDecision.*')") hlt = LoKi_Filters( HLT2_Code="HLT_PASS_RE('.*Hlt2Exotica.*TurboDecision.*')") DaVinci().Turbo = True DstConf().Turbo = True #DstConf().Turbo = False TurboConf().PersistReco = True #DaVinci().EventPreFilters = hltFilter.filters('TriggerFilters') #from GaudiConf import IOHelper #IOHelper().inputFiles([ # '~/DSTs/pPbPhotons/MinBiasMC.dst' #],clear=True) #=================== # Setup GaudiPython
def options(year, mag, data_type, mode): #======================================# #=== DaVinci script for Data and MC ===# #======================================# #=== year = year of data taking ===# #=== mag = magnet polarity of data ===# #=== data_type = MC or data? ===# #======================================# #=== These variables are given to ===# #=== function by the ganga script, ===# #=== which is different, depending ===# #=== on whether MC or data is being ===# #=== looked at. ===# #======================================# from Configurables import DaVinci from Configurables import MCMatchObjP2MCRelator from PhysConf.Filters import LoKi_Filters #===========================# #=== Check if MC or Data ===# #===========================# if data_type == "data": data = True elif data_type == "MC": data = False else: print "WARNING: data type not recognised. Please enter either \"data\" or \"MC\" as the third argument to options()!" #====================================# #=== Setup depending on data type ===# #====================================# if data: stream = 'Bhadron' prefix = 'Data' else: stream = 'AllStreams' prefix = 'MC' #==============================# #=== Assign Stripping Lines ===# #==============================# #=== b2dk d2pi0hh ===# line_k = 'B2D0KD2Pi0HHResolvedBeauty2CharmLine' #=== b2dpi d2pi0hh ===# line_pi = 'B2D0PiD2Pi0HHResolvedBeauty2CharmLine' #=============================# #=== Stripping Pre-Filters ===# #=============================# fltrs = LoKi_Filters( STRIP_Code= "HLT_PASS_RE('StrippingB2D0KD2Pi0HHResolvedBeauty2CharmLineDecision') | HLT_PASS_RE('StrippingB2D0PiD2Pi0HHResolvedBeauty2CharmLineDecision')" ) #==============================# #=== Import necessary tools ===# #==============================# from Configurables import DecayTreeTuple from DecayTreeTuple.Configuration import * if data: from Configurables import TrackScaleState scaler = TrackScaleState('StateScale') scaler.RootInTES = '/Event/{0}/'.format(stream) #===================================================# #=== Setup DecayTreeTuples for each channel/mode ===# #===================================================# etuple = EventTuple() if data: dk_d2kpipi0 = DecayTreeTuple('B2DK_D2KPiPi0') dk_d2pikpi0 = DecayTreeTuple('B2DK_D2PiKPi0') dk_d2kkpi0 = DecayTreeTuple('B2DK_D2KKPi0') dk_d2pipipi0 = DecayTreeTuple('B2DK_D2PiPiPi0') dpi_d2kpipi0 = DecayTreeTuple('B2DPi_D2KPiPi0') dpi_d2pikpi0 = DecayTreeTuple('B2DPi_D2PiKPi0') dpi_d2kkpi0 = DecayTreeTuple('B2DPi_D2KKPi0') dpi_d2pipipi0 = DecayTreeTuple('B2DPi_D2PiPiPi0') else: dk_d2kpipi0 = DecayTreeTuple('B2DK_D2KPiPi0_MC') dk_d2pikpi0 = DecayTreeTuple('B2DK_D2PiKPi0_MC') dk_d2kkpi0 = DecayTreeTuple('B2DK_D2KKPi0_MC') dk_d2pipipi0 = DecayTreeTuple('B2DK_D2PiPiPi0_MC') dpi_d2kpipi0 = DecayTreeTuple('B2DPi_D2KPiPi0_MC') dpi_d2pikpi0 = DecayTreeTuple('B2DPi_D2PiKPi0_MC') dpi_d2kkpi0 = DecayTreeTuple('B2DPi_D2KKPi0_MC') dpi_d2pipipi0 = DecayTreeTuple('B2DPi_D2PiPiPi0_MC') #=== Assign vectors of DecayTreeTuples for easy use later ===# channels = [ dk_d2kpipi0, dk_d2pikpi0, dk_d2kkpi0, dk_d2pipipi0, dpi_d2kpipi0, dpi_d2pikpi0, dpi_d2kkpi0, dpi_d2pipipi0 ] k_chans = [dk_d2kpipi0, dk_d2pikpi0, dk_d2kkpi0, dk_d2pipipi0] pi_chans = [dpi_d2kpipi0, dpi_d2pikpi0, dpi_d2kkpi0, dpi_d2pipipi0] #=== Setting location/inputs is different depending on data type ===# if data: for channel in channels: channel.RootInTES = '/Event/{0}'.format(stream) for channel in k_chans: channel.Inputs = ['Phys/{0}/Particles'.format(line_k)] for channel in pi_chans: channel.Inputs = ['Phys/{0}/Particles'.format(line_pi)] else: for channel in k_chans: if year == '2012' or year == '2011': # 2012 and 2011 MC is DST! channel.Inputs = [ '/Event/{0}/Phys/{1}/Particles'.format(stream, line_k) ] else: channel.Inputs = ['Phys/{0}/Particles'.format(line_k)] for channel in pi_chans: if year == '2012' or year == '2011': channel.Inputs = [ '/Event/{0}/Phys/{1}/Particles'.format(stream, line_pi) ] else: channel.Inputs = ['Phys/{0}/Particles'.format(line_pi)] #=====================================================# #=== Setup decay descriptors for each channel/mode ===# #=====================================================# #=== B2DK ===# dk_d2kpipi0.Decay = '[(B+ --> ^(D0 --> ^K+ ^pi- ^(pi0 --> ^gamma ^gamma)) ^K+) , (B- --> ^(D0 --> ^K- ^pi+ ^(pi0 --> ^gamma ^gamma)) ^K- )]' dk_d2kpipi0.addBranches({ 'Bu': '[(B+ --> (D0 --> K+ pi- (pi0 --> gamma gamma)) K+ ) , (B- --> (D0 --> K- pi+ (pi0 --> gamma gamma)) K- )]', 'D0': '[(B+ --> ^(D0 --> K+ pi- (pi0 --> gamma gamma)) K+) , (B- --> ^(D0 --> K- pi+ (pi0 --> gamma gamma)) K- )]', 'K0': '[(B+ --> (D0 --> ^K+ pi- (pi0 --> gamma gamma)) K+) , (B- --> (D0 --> ^K- pi+ (pi0 --> gamma gamma)) K- )]', 'P0': '[(B+ --> (D0 --> K+ ^pi- (pi0 --> gamma gamma)) K+) , (B- --> (D0 --> K- ^pi+ (pi0 --> gamma gamma)) K- )]', 'Pi0': '[(B+ --> (D0 --> K+ pi- ^(pi0 --> gamma gamma)) K+) , (B- --> (D0 --> K- pi+ ^(pi0 --> gamma gamma)) K- )]', 'Bach': '[(B+ --> (D0 --> K+ pi- (pi0 --> gamma gamma)) ^K+) , (B- --> (D0 --> K- pi+ (pi0 --> gamma gamma)) ^K- )]', 'Gamma1': '[(B+ --> (D0 --> K+ pi- (pi0 --> ^gamma gamma)) K+) , (B- --> (D0 --> K- pi+ (pi0 --> ^gamma gamma)) K- )]', 'Gamma2': '[(B+ --> (D0 --> K+ pi- (pi0 --> gamma ^gamma)) K+) , (B- --> (D0 --> K- pi+ (pi0 --> gamma ^gamma)) K- )]' }) dk_d2pikpi0.Decay = '[(B+ --> ^(D0 --> ^pi+ ^K- ^(pi0 --> ^gamma ^gamma)) ^K+) , (B- --> ^(D0 --> ^pi- ^K+ ^(pi0 --> ^gamma ^gamma)) ^K- )]' dk_d2pikpi0.addBranches({ 'Bu': '[(B+ --> (D0 --> pi+ K- (pi0 --> gamma gamma)) K+ ) , (B- --> (D0 --> pi- K+ (pi0 --> gamma gamma)) K- )]', 'D0': '[(B+ --> ^(D0 --> pi+ K- (pi0 --> gamma gamma)) K+) , (B- --> ^(D0 --> pi- K+ (pi0 --> gamma gamma)) K- )]', 'P0': '[(B+ --> (D0 --> ^pi+ K- (pi0 --> gamma gamma)) K+) , (B- --> (D0 --> ^pi- K+ (pi0 --> gamma gamma)) K- )]', 'K0': '[(B+ --> (D0 --> pi+ ^K- (pi0 --> gamma gamma)) K+) , (B- --> (D0 --> pi- ^K+ (pi0 --> gamma gamma)) K- )]', 'Pi0': '[(B+ --> (D0 --> pi+ K- ^(pi0 --> gamma gamma)) K+) , (B- --> (D0 --> pi- K+ ^(pi0 --> gamma gamma)) K- )]', 'Bach': '[(B+ --> (D0 --> pi+ K- (pi0 --> gamma gamma)) ^K+) , (B- --> (D0 --> pi- K+ (pi0 --> gamma gamma)) ^K- )]', 'Gamma1': '[(B+ --> (D0 --> pi+ K- (pi0 --> ^gamma gamma)) K+) , (B- --> (D0 --> pi- K+ (pi0 --> ^gamma gamma)) K- )]', 'Gamma2': '[(B+ --> (D0 --> pi+ K- (pi0 --> gamma ^gamma)) K+) , (B- --> (D0 --> pi- K+ (pi0 --> gamma ^gamma)) K- )]' }) dk_d2kkpi0.Decay = '[(B+ --> ^(D0 --> ^K+ ^K- ^(pi0 --> ^gamma ^gamma)) ^K+) , (B- --> ^(D0 --> ^K- ^K+ ^(pi0 --> ^gamma ^gamma)) ^K- )]' dk_d2kkpi0.addBranches({ 'Bu': '[(B+ --> (D0 --> K+ K- (pi0 --> gamma gamma)) K+ ) , (B- --> (D0 --> K- K+ (pi0 --> gamma gamma)) K- )]', 'D0': '[(B+ --> ^(D0 --> K+ K- (pi0 --> gamma gamma)) K+) , (B- --> ^(D0 --> K- K+ (pi0 --> gamma gamma)) K- )]', 'K0': '[(B+ --> (D0 --> ^K+ K- (pi0 --> gamma gamma)) K+) , (B- --> (D0 --> ^K- K+ (pi0 --> gamma gamma)) K- )]', 'K1': '[(B+ --> (D0 --> K+ ^K- (pi0 --> gamma gamma)) K+) , (B- --> (D0 --> K- ^K+ (pi0 --> gamma gamma)) K- )]', 'Pi0': '[(B+ --> (D0 --> K+ K- ^(pi0 --> gamma gamma)) K+) , (B- --> (D0 --> K- K+ ^(pi0 --> gamma gamma)) K- )]', 'Bach': '[(B+ --> (D0 --> K+ K- (pi0 --> gamma gamma)) ^K+) , (B- --> (D0 --> K- K+ (pi0 --> gamma gamma)) ^K- )]', 'Gamma1': '[(B+ --> (D0 --> K+ K- (pi0 --> ^gamma gamma)) K+) , (B- --> (D0 --> K- K+ (pi0 --> ^gamma gamma)) K- )]', 'Gamma2': '[(B+ --> (D0 --> K+ K- (pi0 --> gamma ^gamma)) K+) , (B- --> (D0 --> K- K+ (pi0 --> gamma ^gamma)) K- )]' }) dk_d2pipipi0.Decay = '[(B+ --> ^(D0 --> ^pi+ ^pi- ^(pi0 --> ^gamma ^gamma)) ^K+) , (B- --> ^(D0 --> ^pi- ^pi+ ^(pi0 --> ^gamma ^gamma)) ^K- )]' dk_d2pipipi0.addBranches({ 'Bu': '[(B+ --> (D0 --> pi+ pi- (pi0 --> gamma gamma)) K+ ) , (B- --> (D0 --> pi- pi+ (pi0 --> gamma gamma)) K- )]', 'D0': '[(B+ --> ^(D0 --> pi+ pi- (pi0 --> gamma gamma)) K+) , (B- --> ^(D0 --> pi- pi+ (pi0 --> gamma gamma)) K- )]', 'P0': '[(B+ --> (D0 --> ^pi+ pi- (pi0 --> gamma gamma)) K+) , (B- --> (D0 --> ^pi- pi+ (pi0 --> gamma gamma)) K- )]', 'P1': '[(B+ --> (D0 --> pi+ ^pi- (pi0 --> gamma gamma)) K+) , (B- --> (D0 --> pi- ^pi+ (pi0 --> gamma gamma)) K- )]', 'Pi0': '[(B+ --> (D0 --> pi+ pi- ^(pi0 --> gamma gamma)) K+) , (B- --> (D0 --> pi- pi+ ^(pi0 --> gamma gamma)) K- )]', 'Bach': '[(B+ --> (D0 --> pi+ pi- (pi0 --> gamma gamma)) ^K+) , (B- --> (D0 --> pi- pi+ (pi0 --> gamma gamma)) ^K- )]', 'Gamma1': '[(B+ --> (D0 --> pi+ pi- (pi0 --> ^gamma gamma)) K+) , (B- --> (D0 --> pi- pi+ (pi0 --> ^gamma gamma)) K- )]', 'Gamma2': '[(B+ --> (D0 --> pi+ pi- (pi0 --> gamma ^gamma)) K+) , (B- --> (D0 --> pi- pi+ (pi0 --> gamma ^gamma)) K- )]' }) #=== B2DPi ===# dpi_d2kpipi0.Decay = '[(B+ --> ^(D0 --> ^K+ ^pi- ^(pi0 --> ^gamma ^gamma)) ^pi+) , (B- --> ^(D0 --> ^K- ^pi+ ^(pi0 --> ^gamma ^gamma)) ^pi- )]' dpi_d2kpipi0.addBranches({ 'Bu': '[(B+ --> (D0 --> K+ pi- (pi0 --> gamma gamma)) pi+ ) , (B- --> (D0 --> K- pi+ (pi0 --> gamma gamma)) pi- )]', 'D0': '[(B+ --> ^(D0 --> K+ pi- (pi0 --> gamma gamma)) pi+) , (B- --> ^(D0 --> K- pi+ (pi0 --> gamma gamma)) pi- )]', 'K0': '[(B+ --> (D0 --> ^K+ pi- (pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> ^K- pi+ (pi0 --> gamma gamma)) pi- )]', 'P0': '[(B+ --> (D0 --> K+ ^pi- (pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> K- ^pi+ (pi0 --> gamma gamma)) pi- )]', 'Pi0': '[(B+ --> (D0 --> K+ pi- ^(pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> K- pi+ ^(pi0 --> gamma gamma)) pi- )]', 'Bach': '[(B+ --> (D0 --> K+ pi- (pi0 --> gamma gamma)) ^pi+) , (B- --> (D0 --> K- pi+ (pi0 --> gamma gamma)) ^pi- )]', 'Gamma1': '[(B+ --> (D0 --> K+ pi- (pi0 --> ^gamma gamma)) pi+) , (B- --> (D0 --> K- pi+ (pi0 --> ^gamma gamma)) pi- )]', 'Gamma2': '[(B+ --> (D0 --> K+ pi- (pi0 --> gamma ^gamma)) pi+) , (B- --> (D0 --> K- pi+ (pi0 --> gamma ^gamma)) pi- )]' }) dpi_d2pikpi0.Decay = '[(B+ --> ^(D0 --> ^pi+ ^K- ^(pi0 --> ^gamma ^gamma)) ^pi+) , (B- --> ^(D0 --> ^pi- ^K+ ^(pi0 --> ^gamma ^gamma)) ^pi-)]' dpi_d2pikpi0.addBranches({ 'Bu': '[(B+ --> (D0 --> pi+ K- (pi0 --> gamma gamma)) pi+ ) , (B- --> (D0 --> pi- K+ (pi0 --> gamma gamma)) pi- )]', 'D0': '[(B+ --> ^(D0 --> pi+ K- (pi0 --> gamma gamma)) pi+) , (B- --> ^(D0 --> pi- K+ (pi0 --> gamma gamma)) pi-)]', 'P0': '[(B+ --> (D0 --> ^pi+ K- (pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> ^pi- K+ (pi0 --> gamma gamma)) pi-)]', 'K0': '[(B+ --> (D0 --> pi+ ^K- (pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> pi- ^K+ (pi0 --> gamma gamma)) pi-)]', 'Pi0': '[(B+ --> (D0 --> pi+ K- ^(pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> pi- K+ ^(pi0 --> gamma gamma)) pi-)]', 'Bach': '[(B+ --> (D0 --> pi+ K- (pi0 --> gamma gamma)) ^pi+) , (B- --> (D0 --> pi- K+ (pi0 --> gamma gamma)) ^pi-)]', 'Gamma1': '[(B+ --> (D0 --> pi+ K- (pi0 --> ^gamma gamma)) pi+) , (B- --> (D0 --> pi- K+ (pi0 --> ^gamma gamma)) pi-)]', 'Gamma2': '[(B+ --> (D0 --> pi+ K- (pi0 --> gamma ^gamma)) pi+) , (B- --> (D0 --> pi- K+ (pi0 --> gamma ^gamma)) pi-)]' }) dpi_d2kkpi0.Decay = '[(B+ --> ^(D0 --> ^K+ ^K- ^(pi0 --> ^gamma ^gamma)) ^pi+) , (B- --> ^(D0 --> ^K- ^K+ ^(pi0 --> ^gamma ^gamma)) ^pi-)]' dpi_d2kkpi0.addBranches({ 'Bu': '[(B+ --> (D0 --> K+ K- (pi0 --> gamma gamma)) pi+ ) , (B- --> (D0 --> K- K+ (pi0 --> gamma gamma)) pi- )]', 'D0': '[(B+ --> ^(D0 --> K+ K- (pi0 --> gamma gamma)) pi+) , (B- --> ^(D0 --> K- K+ (pi0 --> gamma gamma)) pi-)]', 'K0': '[(B+ --> (D0 --> ^K+ K- (pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> ^K- K+ (pi0 --> gamma gamma)) pi-)]', 'K1': '[(B+ --> (D0 --> K+ ^K- (pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> K- ^K+ (pi0 --> gamma gamma)) pi-)]', 'Pi0': '[(B+ --> (D0 --> K+ K- ^(pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> K- K+ ^(pi0 --> gamma gamma)) pi-)]', 'Bach': '[(B+ --> (D0 --> K+ K- (pi0 --> gamma gamma)) ^pi+) , (B- --> (D0 --> K- K+ (pi0 --> gamma gamma)) ^pi-)]', 'Gamma1': '[(B+ --> (D0 --> K+ K- (pi0 --> ^gamma gamma)) pi+) , (B- --> (D0 --> K- K+ (pi0 --> ^gamma gamma)) pi-)]', 'Gamma2': '[(B+ --> (D0 --> K+ K- (pi0 --> gamma ^gamma)) pi+) , (B- --> (D0 --> K- K+ (pi0 --> gamma ^gamma)) pi-)]' }) dpi_d2pipipi0.Decay = '[(B+ --> ^(D0 --> ^pi+ ^pi- ^(pi0 --> ^gamma ^gamma)) ^pi+) , (B- --> ^(D0 --> ^pi- ^pi+ ^(pi0 --> ^gamma ^gamma)) ^pi- )]' dpi_d2pipipi0.addBranches({ 'Bu': '[(B+ --> (D0 --> pi+ pi- (pi0 --> gamma gamma)) pi+ ) , (B- --> (D0 --> pi- pi+ (pi0 --> gamma gamma)) pi- )]', 'D0': '[(B+ --> ^(D0 --> pi+ pi- (pi0 --> gamma gamma)) pi+) , (B- --> ^(D0 --> pi- pi+ (pi0 --> gamma gamma)) pi- )]', 'P0': '[(B+ --> (D0 --> ^pi+ pi- (pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> ^pi- pi+ (pi0 --> gamma gamma)) pi- )]', 'P1': '[(B+ --> (D0 --> pi+ ^pi- (pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> pi- ^pi+ (pi0 --> gamma gamma)) pi- )]', 'Pi0': '[(B+ --> (D0 --> pi+ pi- ^(pi0 --> gamma gamma)) pi+) , (B- --> (D0 --> pi- pi+ ^(pi0 --> gamma gamma)) pi- )]', 'Bach': '[(B+ --> (D0 --> pi+ pi- (pi0 --> gamma gamma)) ^pi+) , (B- --> (D0 --> pi- pi+ (pi0 --> gamma gamma)) ^pi- )]', 'Gamma1': '[(B+ --> (D0 --> pi+ pi- (pi0 --> ^gamma gamma)) pi+) , (B- --> (D0 --> pi- pi+ (pi0 --> ^gamma gamma)) pi- )]', 'Gamma2': '[(B+ --> (D0 --> pi+ pi- (pi0 --> gamma ^gamma)) pi+) , (B- --> (D0 --> pi- pi+ (pi0 --> gamma ^gamma)) pi- )]' }) #========================================# #=== Setup LoKi variables to be added ===# #========================================# #=== Added to all branches ===# LoKiVars = { "Q": "Q", "DIRA_BPV": "BPVDIRA", "MAXDOCA": "DOCAMAX", "AMAXDOCA": "PFUNA(AMAXDOCA(''))", "MIPCHI2_PV": "MIPCHI2DV(PRIMARY)", "VTXCHI2DOF": "VFASPF(VCHI2/VDOF)", "LT_BPV": "BPVLTIME('PropertimeFitter/ProperTime::PUBLIC')", } if data: #=== Added only to B2DK channels ===# LoKiVars_K = { "ptasy_1.50": "RELINFO('/Event/Bhadron/Phys/B2D0KD2Pi0HHResolvedBeauty2CharmLine/P2ConeVar1','CONEPTASYM',-1000.)" } #=== Added only to B2DPi channels ===# LoKiVars_Pi = { "ptasy_1.50": "RELINFO('/Event/Bhadron/Phys/B2D0PiD2Pi0HHResolvedBeauty2CharmLine/P2ConeVar1','CONEPTASYM',-1000.)" } #============================================# #=== Add tuple tools to relevent branches ===# #============================================# #=== Needed for new MC which has "turbo" in LFN path name ===# default_rel_locs = MCMatchObjP2MCRelator().getDefaultProperty( 'RelTableLocations') rel_locs = [loc for loc in default_rel_locs if 'Turbo' not in loc] if not data: etuple.addTupleTool("TupleToolGeneration") etuple.addTupleTool("TupleToolTrigger") for channel in channels: #=== Added to all branches ===# channel.ToolList += [ "TupleToolAngles", "TupleToolEventInfo", "TupleToolGeometry", "TupleToolKinematic", "TupleToolPid", "TupleToolPrimaries", "TupleToolPropertime", "TupleToolRecoStats", "TupleToolTrackInfo" ] if not data: ttMCt = channel.addTupleTool("TupleToolMCTruth") ttMCt.addTool(MCMatchObjP2MCRelator) ttMCt.MCMatchObjP2MCRelator.RelTableLocations = rel_locs channel.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_All") channel.LoKi_All.Variables = LoKiVars #=== Neutral variables added to photons from pi0 decay ===# channel.Gamma1.addTupleTool("TupleToolPhotonInfo") channel.Gamma1.addTupleTool("TupleToolCaloHypo") channel.Gamma1.addTupleTool("TupleToolProtoPData/ProtoPData") channel.Gamma1.ProtoPData.DataList = ["IsNotE"] channel.Gamma2.addTupleTool("TupleToolPhotonInfo") channel.Gamma2.addTupleTool("TupleToolCaloHypo") channel.Gamma2.addTupleTool("TupleToolProtoPData/ProtoPData") channel.Gamma2.ProtoPData.DataList = ["IsNotE"] #=== Add Pi0 information ===# channel.Pi0.addTupleTool("TupleToolPi0Info") channel.Pi0.addTupleTool("TupleToolCaloHypo") #=== Trigger information added to Bu ===# channel.Bu.addTupleTool("TupleToolTISTOS") channel.Bu.TupleToolTISTOS.Verbose = True # Trigger names changed with runs! TriggerListL0 = ["L0HadronDecision"] TriggerListHlt1 = [] TriggerListHlt2 = [] if year == '2011' or year == '2012': TriggerListHlt1 = ["Hlt1TrackAllL0Decision"] TriggerListHlt2 = [ "Hlt2Topo2BodyBBDTDecision", "Hlt2Topo3BodyBBDTDecision", "Hlt2Topo4BodyBBDTDecision" ] if year == '2015' or year == '2016' or year == '2017': TriggerListHlt1 = [ "Hlt1TrackMVADecision", "Hlt1TwoTrackMVADecision" ] TriggerListHlt2 = [ "Hlt2Topo2BodyDecision", "Hlt2Topo3BodyDecision", "Hlt2Topo4BodyDecision" ] AllTriggers = TriggerListL0 + TriggerListHlt1 + TriggerListHlt2 channel.Bu.TupleToolTISTOS.TriggerList = AllTriggers #=== Kinematic refit of Bu based on fixing D0 mass and fixing origin vertex ===# #=== DPVCFIT = D0 (mass), primary vertex constrained fit ===# channel.Bu.addTupleTool("TupleToolDecayTreeFitter/DPVCFIT") channel.Bu.DPVCFIT.constrainToOriginVertex = True channel.Bu.DPVCFIT.Verbose = True channel.Bu.DPVCFIT.daughtersToConstrain = ["D0"] channel.Bu.DPVCFIT.UpdateDaughters = True #=== Add branches which are exclusive to MC data ===# if not data: channel.ToolList += ["TupleToolMCBackgroundInfo"] ttMCt.ToolList = [ "MCTupleToolDecayType", "MCTupleToolHierarchy", "MCTupleToolKinematic", "MCTupleToolReconstructed" ] #=== Add ptasy_1.50 variable ===# channel.addTupleTool("TupleToolTrackIsolation/ttti") channel.ttti.FillAsymmetry = True channel.ttti.MinConeAngle = 1.5 channel.ttti.MaxConeAngle = 1.5 #=== Add ptasy_1.50 variable for data ===# if data: for channel in k_chans: channel.Bu.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Bu") channel.Bu.LoKi_Bu.Variables = dict(LoKiVars.items() + LoKiVars_K.items()) channel.Pi0.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Pi0") channel.Pi0.LoKi_Pi0.Variables = dict(LoKiVars.items() + LoKiVars_K.items()) channel.Gamma1.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Gamma1") channel.Gamma1.LoKi_Gamma1.Variables = dict(LoKiVars.items() + LoKiVars_K.items()) channel.Gamma2.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Gamma2") channel.Gamma2.LoKi_Gamma2.Variables = dict(LoKiVars.items() + LoKiVars_K.items()) for channel in pi_chans: channel.Bu.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Bu") channel.Bu.LoKi_Bu.Variables = dict(LoKiVars.items() + LoKiVars_Pi.items()) channel.Pi0.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Pi0") channel.Pi0.LoKi_Pi0.Variables = dict(LoKiVars.items() + LoKiVars_Pi.items()) channel.Gamma1.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Gamma1") channel.Gamma1.LoKi_Gamma1.Variables = dict(LoKiVars.items() + LoKiVars_Pi.items()) channel.Gamma2.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Gamma2") channel.Gamma2.LoKi_Gamma2.Variables = dict(LoKiVars.items() + LoKiVars_Pi.items()) #==============================# #=== Finalise configuration ===# #==============================# #=== Set database tags ===# from Configurables import CondDB if data: CondDB(LatestGlobalTagByDataType=year) #=== Configure DaVinci ===# if data: DaVinci().RootInTES = '/Event/{0}'.format(stream) DaVinci().appendToMainSequence([scaler]) DaVinci().EventPreFilters = fltrs.filters('Filters') channels += [etuple] DaVinci().UserAlgorithms += channels #=== Input type for 2012 MC is DST, but all data is MDST ===# if data: DaVinci().InputType = 'MDST' DaVinci( ).TupleFile = prefix + '_Bu2DH_AllModes_' + year + '_Mag' + mag + '.root' if not data: DaVinci( ).TupleFile = prefix + '_Bu2' + mode + '_' + year + '_Mag' + mag + '.root' if year == "2012" or year == "2011": DaVinci().InputType = 'DST' else: DaVinci().InputType = 'MDST' DaVinci().RootInTES = '/Event/{0}'.format(stream) DaVinci().PrintFreq = 1000 DaVinci().DataType = year DaVinci().Simulation = not data DaVinci().Lumi = not DaVinci().Simulation DaVinci().EvtMax = -1 DaVinci().RootCompressionLevel = 'ZLIB:1' #=======================================================# #=== Set database tags! Only needs to be done for MC ===# #=======================================================# if not data: #=== D --> K Pi Pi0 ===# if mode == "DK_D2KPiPi0" or mode == "DPi_D2KPiPi0": if year == "2012": if mag == 'Up': DaVinci().CondDBtag = 'sim-20160321-2-vc-mu100' if mag == 'Down': DaVinci().CondDBtag = 'sim-20160321-2-vc-md100' DaVinci().DDDBtag = 'dddb-20150928' if year == "2015": if mag == 'Up': DaVinci().CondDBtag = 'sim-20161124-vc-mu100' if mag == 'Down': DaVinci().CondDBtag = 'sim-20161124-vc-md100' DaVinci().DDDBtag = 'dddb-20170721-3' #=== D --> Pi Pi Pi0 ===# if mode == "DK_D2PiPiPi0" or mode == "DPi_D2PiPiPi0": if year == "2012": if mag == 'Up': DaVinci().CondDBtag = 'sim-20130522-1-vc-mu100' if mag == 'Down': DaVinci().CondDBtag = 'sim-20130522-1-vc-md100' DaVinci().DDDBtag = 'dddb-20130929-1' #=== D --> K K Pi0 ===# if mode == "DK_D2KKPi0" or mode == "DPi_D2KKPi0": if year == "2012": if mag == 'Up': DaVinci().CondDBtag = 'sim-20130522-1-vc-mu100' if mag == 'Down': DaVinci().CondDBtag = 'sim-20130522-1-vc-md100' DaVinci().DDDBtag = 'dddb-20130929-1' return
#IOHelper('ROOT').inputFiles(['/eos/lhcb/grid/prod/lhcb/LHCb/Protonion16/IFT.DST/00076144/0000/00076144_00000038_1.ift.dst'], clear = True) #IOHelper('ROOT').inputFiles(['/tmp/dcraik/00076144_00000038_1.ift.dst'], clear = True) #IOHelper('ROOT').inputFiles(["/eos/lhcb/grid/prod/lhcb/LHCb/Lead18/IFT.DST/00089031/0000/00089031_00009979_1.ift.dst"], clear = True) ## import DaVinci from Configurables import DaVinci from Configurables import CondDB from PhysConf.Filters import LoKi_Filters #fltrs = LoKi_Filters ( # STRIP_Code = """ # HLT_PASS_RE ( 'StrippingHeavyIonTopologyLowActivityLineDecision' ) # """ #) fltrs = LoKi_Filters( HLT1_Code= "(HLT_PASS('Hlt1BBMicroBiasSoftCEPDecision')) | (HLT_PASS('Hlt1BBMicroBiasLowMultVeloDecision'))" ) dv = DaVinci( DataType='2018', InputType='DST', TupleFile='Tuples.root', ## IMPORTANT HistogramFile='Histos.root', ## IMPORTANT Simulation=False, Lumi=True, EventPreFilters=fltrs.filters('Filters'), #CondDBtag = 'cond-20180625-1', #DDDBtag = 'dddb-20180726-3', #DQFLAGStag = 'dq-20170627', EvtMax=-1 ##TODO #EvtMax = 10000 ##TODO
from Configurables import DaVinci DaVinci().DataType = ThisDataType DaVinci().DDDBtag = ThisDDDBtag DaVinci().CondDBtag = ThisCLCondDBtag DaVinci().DQFLAGStag = ThisDQFLAGStag DaVinci().Lumi = True #DaVinci().Lumi = False DaVinci().TupleFile = 'lumi.root' if 'MC' in Type: DaVinci().Simulation = True DaVinci().Lumi = False DaVinci().CondDBtag = ThisMCCondDBtag if 'Turbo' in Type: from Configurables import DstConf, TurboConf from PhysConf.Filters import LoKi_Filters hlt = LoKi_Filters( HLT2_Code="HLT_PASS_RE('.*Hlt2Exotica.*TurboDecision.*')") DstConf().Turbo = True TurboConf().PersistReco = True DaVinci().EventPreFilters = hlt.filters('TriggerFilters') # Tag configuration. TrkCats = [('ve', 1), ('tt', 2), ('it', 3), ('ot', 4), ('mu', 7)] #TrgLocs = ['Hlt2ExoticaPrmptDiMuonSSTurbo', # 'Hlt2ExoticaPrmptDiMuonTurbo', # 'Hlt2ExoticaDiMuonNoIPTurbo', # 'Hlt2ExoticaQuadMuonNoIP', # 'Hlt2ExoticaDisplDiMuon'] TrgLocs = [] #TrgLocs = ['Hlt2ExoticaDisplDiE']
def __init__( self, name, config ): LineBuilder.__init__( self, name, config ) ####################################################################### ### ### ### VELO BASED VERTEXING SEQUENCE ### ### ### ####################################################################### bestTracks = AutomaticData("Rec/Track/Best") withVeloTracksForVertexing = bestTracks if self.configurationParameter("VeloGEC")["Apply"]: from GaudiConfUtils.ConfigurableGenerators import VeloEventShapeCutsS20p3 veloGEC = VeloEventShapeCutsS20p3() self.validatedSetProps( "VeloGEC", DisplVerticesConf.veloGECCuts, veloGEC ) withVeloTracksForVertexing = PassThroughSelection( "%sVeloGEC" % self.name() , RequiredSelection = withVeloTracksForVertexing , Algorithm = veloGEC ) if self.configurationParameter("FilterVelo")["Apply"]: from GaudiConfUtils.ConfigurableGenerators import SelectVeloTracksNotFromPVS20p3 veloWithIP = SelectVeloTracksNotFromPVS20p3() self.validatedSetProps( "FilterVelo", DisplVerticesConf.veloWithIPCuts, veloWithIP ) withVeloTracksForVertexing = Selection( "%sVeloFilteredTracks" % self.name() , RequiredSelections = [ withVeloTracksForVertexing ] , Algorithm = veloWithIP ) # Displaced Vertex reconstruction with best tracks (dominated by those with a Velo segment) from Configurables import PatPV3D, PVOfflineTool, PVSeed3DTool, LSAdaptPV3DFitter, LSAdaptPVFitter withVeloVertexAlg = PatPV3D( "%sWithVeloVertexAlg" % self.name() ) withVeloVertexFinder = addPrivateToolAndGet(withVeloVertexAlg, PVOfflineTool) withVeloVertexFinder.PVsChi2Separation = 0 withVeloVertexFinder.PVsChi2SeparationLowMult = 0 withVeloSeeder = addPrivateToolAndGet(withVeloVertexFinder, PVSeed3DTool ) withVeloVertexFinder.PVSeedingName = withVeloSeeder.getTitleName() withVeloSeeder.MinCloseTracks = 3 withVeloFitter = addPrivateToolAndGet(withVeloVertexFinder, LSAdaptPV3DFitter) withVeloVertexFinder.PVFitterName = withVeloFitter.getTitleName() withVeloFitter.MinTracks = 4 withVeloVertexing = SelectionPatPV3DWrapper( "%sWithVeloVertexing" % self.name() , withVeloVertexAlg , RequiredSelections = [ withVeloTracksForVertexing ] ) # Make Particles out of the RecVertices from GaudiConfUtils.ConfigurableGenerators import LLParticlesFromRecVertices rv2pWithVelo = LLParticlesFromRecVertices( VerticesFromVeloOnly = False , RequireUpstreamPV = False , WriteP2PVRelations = False , ForceP2PVBuild = False , VeloProtoParticlesLocation = "Phys/%s/VeloProtoP" % self.name() ) self.validatedSetProps( "RV2PWithVelo", DisplVerticesConf.recoCuts + DisplVerticesConf.singleCuts, rv2pWithVelo ) withVeloCandidates = Selection( "%sWithVeloCandidates" % self.name() , RequiredSelections = [ withVeloVertexing ] , Algorithm = rv2pWithVelo , InputDataSetter = "RecVertexLocations" ) ####################################################################### ### ### ### DOWNSTREAM VERTEXING SEQUENCE ### ### ### ####################################################################### from GaudiConfUtils.ConfigurableGenerators import CopyDownstreamTracks downTracks = Selection( "%sDownstreamTracks" % self.name() , RequiredSelections = [ bestTracks ] , Algorithm = CopyDownstreamTracks() ) # Displaced Vertex reconstruction from downstream tracks downVertexAlg = PatPV3D( "%sDownVertexAlg" % self.name() ) downVertexFinder = addPrivateToolAndGet( downVertexAlg, PVOfflineTool ) downVertexFinder.RequireVelo = False downVertexFinder.PVsChi2Separation = 0 downVertexFinder.PVsChi2SeparationLowMult = 0 downSeeder = addPrivateToolAndGet( downVertexFinder, PVSeed3DTool ) downVertexFinder.PVSeedingName = downSeeder.getTitleName() downSeeder.TrackPairMaxDistance = 2.0*units.mm downSeeder.zMaxSpread = 20.0*units.mm downSeeder.MinCloseTracks = 4 downFitter = addPrivateToolAndGet( downVertexFinder, LSAdaptPVFitter ) downVertexFinder.PVFitterName = downFitter.getTitleName() downFitter.MinTracks = 4 downFitter.maxChi2 = 400.0 downFitter.maxDeltaZ = 0.0005 *units.mm downFitter.maxDeltaChi2NDoF = 0.002 downFitter.acceptTrack = 0.000000001 downFitter.trackMaxChi2 = 9 downFitter.trackMaxChi2Remove = 64 downVertexing = SelectionPatPV3DWrapper( "%sDownVertexing" % self.name() , downVertexAlg , RequiredSelections = [ downTracks ] ) # Make Particles out of the RecVertices rv2pDown = LLParticlesFromRecVertices( VerticesFromVeloOnly = False , RequireUpstreamPV = False , WriteP2PVRelations = False , ForceP2PVBuild = False #, OutputLevel = VERBOSE ) self.validatedSetProps( "RV2PDown", DisplVerticesConf.recoCuts + DisplVerticesConf.singleCuts, rv2pDown ) downCandidates = Selection( "%sDownCandidates" % self.name() , RequiredSelections = [ downVertexing ] , Algorithm = rv2pDown , InputDataSetter = "RecVertexLocations" ) ####################################################################### ### ### ### HLT JET SEQUENCE ### ### ### ####################################################################### # timing is already fine, so one algo with loose JetID is sufficient # Hlt prefilter and vertex candidates from Hlt2 from Configurables import HltVertexConverterS20p3 revivedHlt2Candidates = "Phys/%sHlt2Cand/Particles" % self.name() hltCandReviver = GaudiSequenceroid(ModeOR = True, ShortCircuit = False, Members = [ GaudiSequencer( "%sHlt2CandFilterTCK%s-%s" % (self.name(), tckBegin, tckEnd), Members = ( LoKi_Filters(HLT2_Code="in_range( {begin}, HLT_TCK % 0x40000000 , {end} ) & ( {decisions} )".format(begin=tckBegin, end=tckEnd, decisions=" | ".join("HLT_PASS('%s')" % ln for ln in hltLines))).filters("%sHlt2DecisionFilterTCK%s-%s" % (self.name(), tckBegin, tckEnd)) + [ HltVertexConverterS20p3("%sHltConverter%s-%s" % (self.name(), tckBegin, tckEnd), HltSelReports="Hlt2/SelReports", HltLines=hltLines, Recursive=True, Output=revivedHlt2Candidates, WriteP2PVRelations=False, ForceP2PVBuild=False) ] ) ) for (tckBegin, tckEnd), hltLines in self.configurationParameter("HLT")["SignalLines"] ] ) hltCandSelection = EventSelection( "%sHltCandidates" % self.name() , Algorithm = hltCandReviver ) hltVeloGEC = VeloEventShapeCutsS20p3() self.validatedSetProps( "VeloGEC", DisplVerticesConf.veloGECCuts, hltVeloGEC ) hltVeloGEC.HistoProduce = False hltVeloGECSel = EventSelection( "%sHltVeloGEC" % self.name(), Algorithm=hltVeloGEC ) hlt2CandAndGECSelection = Selection( "".join(( self.name(), "Hlt2CandVertices" )) , RequiredSelections = [ hltCandSelection, AutomaticData(revivedHlt2Candidates), hltVeloGECSel ] , Algorithm = FilterDesktop( Code = "( ABSID == '{pid}' )".format(pid=LLPLHCbName) , WriteP2PVRelations = False , ForceP2PVBuild = False ) ) ####################################################################### ### ### ### LINE DEFINITIONS ### ### ### ####################################################################### # one line for every configuratoin key of the format # "Single.*Selection" # "JetSingle.*Selection" # "JetHltSingle.*Selection" # "Double.*Selection" # ".*HLTPS" # "HltEff.*Selection" ##============================== Single ===================================## singleLineNames = [ p.split("Single")[1].split("Selection")[0] for p in self.configKeys() if p.startswith("Single") and p.endswith("Selection") ] for lAcroName in singleLineNames: lShortName = "Single%s" % lAcroName # SingleMedium lSelName = "%sSelection" % lShortName # SingleMediumSelection lLineName = "%s%s" % (self.name(), lShortName) # DisplVerticesSingleMedium # Choose between Velo-based and downstream vertexing input candidates = withVeloCandidates code = None if "Down" in lAcroName: candidates = downCandidates code = self.getLLPSelection( self.validatedGetProps(lSelName, DisplVerticesConf.singleCuts + DisplVerticesConf.downCuts) ) else: code = self.getLLPSelection( self.validatedGetProps(lSelName, DisplVerticesConf.singleCuts) ) lineFilter = FilterDesktop( DecayDescriptor = LLPLHCbName , Preambulo = DisplVerticesConf.llpSelectionPreambulo , Code = code , WriteP2PVRelations = False , ForceP2PVBuild = False #, OutputLevel = VERBOSE ) lineSel = Selection( "".join(( self.name(), lSelName )) , RequiredSelections = [ candidates ] , Algorithm = lineFilter ) line = StrippingLine(lLineName , prescale = self.validatedGetProps(lSelName, ["PreScale"])["PreScale"] , selection = lineSel , RequiredRawEvents = [ "Calo" ] , RelatedInfoTools = [ { "Type" : "AddVeloEventShapeS21", "TopSelection" : lineSel, "Location" : "P2VES" } ] ) if lShortName in self.configurationParameter("HLT"): line.HLT2 = self.configurationParameter("HLT")[lShortName] self.registerLine(line) ##========================= Single with jets ==============================## jetSingleLineNames = [ p.split("JetSingle")[1].split("Selection")[0] for p in self.configKeys() if p.startswith("JetSingle") and p.endswith("Selection") ] for lAcroName in jetSingleLineNames: lShortName = "JetSingle%s" % lAcroName # JetSingleMedium lSelName = "%sSelection" % lShortName # JetSingleMediumSelection lLineName = "%s%s" % (self.name(), lShortName) # DisplVerticesJetSingleMedium # Choose between Velo-based and downstream vertexing input vertexCandidates = withVeloCandidates code = self.getLLPSelection( self.validatedGetProps(lSelName, DisplVerticesConf.singleCuts) ) vertexFilter = FilterDesktop( DecayDescriptor = LLPLHCbName , Preambulo = DisplVerticesConf.llpSelectionPreambulo , Code = code , WriteP2PVRelations = False , ForceP2PVBuild = False #, OutputLevel = VERBOSE ) goodVertices = Selection( "".join(( self.name(), lSelName, "Vertices" )) , RequiredSelections = [ vertexCandidates ] , Algorithm = vertexFilter ) jetProps = self.validatedGetProps(lSelName, DisplVerticesConf.jetCuts) vertWithJets = Selection( "".join(( self.name(), lSelName, "Jets" )) , RequiredSelections = [ goodVertices ] , Algorithm = self.makeJetCandidateAlg("".join((self.name(), lSelName, "JetAlg")) , MinNumJets = jetProps["MinNumJets"] , ConeSize = jetProps["ConeSize"] , JetIDCut = jetProps["JetIDCut"] , MinDOCABL = jetProps["MinDOCABL"] ) ) jetCode = self.getLLPJetSelection(jetProps) jetCandFilter = FilterDesktop( DecayDescriptor = LLPLHCbName , Preambulo = self.jetSelectionPreambulo , Code = jetCode , WriteP2PVRelations = False , ForceP2PVBuild = False ) lineSel = Selection( "".join(( self.name(), lSelName )) , RequiredSelections = [ vertWithJets ] , Algorithm = jetCandFilter ) line = StrippingLine(lLineName , prescale = self.validatedGetProps(lSelName, ["PreScale"])["PreScale"] , selection = lineSel , RequiredRawEvents = [ "Calo" ] , RelatedInfoTools = [ { "Type" : "AddVeloEventShapeS21", "TopSelection" : lineSel, "Location" : "P2VES" } ] ) if lShortName in self.configurationParameter("HLT"): line.HLT2 = self.configurationParameter("HLT")[lShortName] self.registerLine(line) ##============= Single with jets based on Hlt candidate ==================## jetHltSingleLineNames = [ p.split("JetHltSingle")[1].split("Selection")[0] for p in self.configKeys() if p.startswith("JetHltSingle") and p.endswith("Selection") ] for lAcroName in jetHltSingleLineNames: lShortName = "JetHltSingle%s" % lAcroName # JetHltSingleMedium lSelName = "%sSelection" % lShortName # JetHltSingleMediumSelection lLineName = "%s%s" % (self.name(), lShortName) # DisplVerticesJetHltSingleMedium jetProps = self.validatedGetProps(lSelName, DisplVerticesConf.jetCuts) vertWithJets = Selection( "".join(( self.name(), lSelName, "HltJets" )) , RequiredSelections = [ hlt2CandAndGECSelection ] , Algorithm = self.makeJetCandidateAlg("".join((self.name(), lSelName, "HltJetAlg")) , MinNumJets = jetProps["MinNumJets"] , ConeSize = jetProps["ConeSize"] , JetIDCut = jetProps["JetIDCut"] , MinDOCABL = jetProps["MinDOCABL"] ) ) jetCode = self.getLLPJetSelection(jetProps) jetCandFilter = FilterDesktop( DecayDescriptor = LLPLHCbName , Preambulo = self.jetSelectionPreambulo , Code = jetCode , WriteP2PVRelations = False , ForceP2PVBuild = False ) lineSel = Selection( "".join(( self.name(), lSelName )) , RequiredSelections = [ vertWithJets ] , Algorithm = jetCandFilter ) line = StrippingLine(lLineName , prescale = self.validatedGetProps(lSelName, ["PreScale"])["PreScale"] , selection = lineSel , RequiredRawEvents = [ "Calo" ] , RelatedInfoTools = [ { "Type" : "AddVeloEventShapeS21", "TopSelection" : lineSel, "Location" : "P2VES" } ] ) if lShortName in self.configurationParameter("HLT"): line.HLT2 = self.configurationParameter("HLT")[lShortName] self.registerLine(line) ##============================== Double ===================================## doubleLineNames = [ p.split("Double")[1].split("Selection")[0] for p in self.configKeys() if p.startswith("Double") and p.endswith("Selection") ] for lAcroName in doubleLineNames: lShortName = "Double%s" % lAcroName lSelName = "%sSelection" % lShortName lLineName = "%s%s" % (self.name(), lShortName) combinationCut, motherCut = self.getResonanceSelection( self.validatedGetProps(lSelName, DisplVerticesConf.doubleResonanceCuts) ) lineFilter = CombineParticles( DecayDescriptor = "H_10 -> %s %s" % (LLPLHCbName, LLPLHCbName) , Preambulo = DisplVerticesConf.llpSelectionPreambulo , DaughtersCuts = { LLPLHCbName : self.getLLPSelection( self.validatedGetProps(lSelName, DisplVerticesConf.singleCuts) ) } , CombinationCut = combinationCut , MotherCut = motherCut , WriteP2PVRelations = False , ForceP2PVBuild = False #, OutputLevel = VERBOSE ) lineSel = Selection( "".join(( self.name(), lSelName )) , RequiredSelections = [ withVeloCandidates ] , Algorithm = lineFilter ) line = StrippingLine(lLineName , prescale = self.validatedGetProps(lSelName, ["PreScale"])["PreScale"] , selection = lineSel , RequiredRawEvents = [ "Calo" ] , RelatedInfoTools = [ { "Type" : "AddVeloEventShapeS21", "TopSelection" : lineSel, "Location" : "P2VES" } ] ) if lShortName in self.configurationParameter("HLT"): line.HLT2 = self.configurationParameter("HLT")[lShortName] self.registerLine(line) ##============================== HLT PS ===================================## hltPSLineNames = [ p.split("HLTPS")[0] for p in self.configKeys() if p.endswith("HLTPS") ] for lAcroName in hltPSLineNames: lShortName = "%sHLTPS" % lAcroName lLineName = "%s%s" % (self.name(), lShortName) # DisplVerticesSingleMedium orFilters = [] for (tckBegin, tckEnd), hltFilter in self.validatedGetProps("HLT", [lShortName])[lShortName]: filters = LoKi_Filters(HLT2_Code="in_range( {begin}, HLT_TCK % 0x40000000, {end} ) & ( {decisions} )".format(begin=tckBegin, end=tckEnd, decisions=hltFilter)).filters("%sHlt2FilterTCK%s-%s" % (lLineName, tckBegin, tckEnd)) assert len(filters) == 1 orFilters.append(filters[0]) assert len(orFilters) == len(self.validatedGetProps("HLT", [lShortName])[lShortName]) hltSelection = EventSelection( "%sHltFilter" % lLineName , Algorithm = GaudiSequenceroid(ModeOR = True, ShortCircuit = False, Members=orFilters) ) line = StrippingLine(lLineName , prescale = self.validatedGetProps(lShortName, ["PreScale"])["PreScale"] , selection = hltSelection , RequiredRawEvents = ["Muon","Calo","Rich","Velo","Tracker"] ) self.registerLine(line) ##============================== OTHER ===================================## hltEffLineNames = [ p.split("HltEff")[1].split("Selection")[0] for p in self.configKeys() if p.startswith("HltEff") and p.endswith("Selection") ] for lShortName in hltEffLineNames: lSelName = "HltEff%sSelection" % lShortName lLineName = "%s%s" % (self.name(), lShortName) # HltEff lines are single, Velo-vertexing based lines lineFilter = FilterDesktop( DecayDescriptor = LLPLHCbName , Preambulo = DisplVerticesConf.llpSelectionPreambulo , Code = self.getLLPSelection( self.validatedGetProps(lSelName, DisplVerticesConf.singleCuts) ) , WriteP2PVRelations = False , ForceP2PVBuild = False #, OutputLevel = VERBOSE ) lineSel = Selection( "".join(( self.name(), lSelName )) , RequiredSelections = [ withVeloCandidates ] , Algorithm = lineFilter ) line = StrippingLine(lLineName , prescale = self.validatedGetProps(lSelName, ["PreScale"])["PreScale"] # these lines MUST have an HLT filter , HLT2 = self.configurationParameter("HLT")[lShortName] , selection = lineSel , RequiredRawEvents = ["Muon","Calo","Rich","Velo","Tracker"] , RelatedInfoTools = [ { "Type" : "AddVeloEventShapeS21", "TopSelection" : lineSel, "Location" : "P2VES" } ] ) self.registerLine(line)
StreamConf = SelDSTWriterConf , MicroDSTElements = SelDSTWriterElements , OutputFileSuffix = 'BandQ' , ## output PRE-fix! SelectionSequences = [ psi_x0 , ] ) # ## Read only fired events to speed up # from PhysConf.Filters import LoKi_Filters fltrs = LoKi_Filters ( STRIP_Code = """ HLT_PASS_RE ( 'Stripping.*DiMuonJpsi2MuMuDetached.*' ) | HLT_PASS_RE ( 'Stripping.*DiMuonPsi2MuMuDetached.*' ) | HLT_PASS_RE ( 'Stripping.*DiMuonDiMuonHighMass.*' ) """ ) # ## protection against ``corrupted'' Stripping 17b DIMUON.DST # obsolete? # also add protection against very busy events fltrs_0 = LoKi_Filters ( VOID_Code = """ ( EXISTS ( '/Event/DAQ/RawEvent' ) | EXISTS ( '/Event/Trigger/RawEvent' ) ) & EXISTS ( '/Event/Strip/Phys/DecReports') & ( RECSUMMARY ( 0 , -1 ) > 0.5 ) & ( RECSUMMARY ( 10 , -1 ) < 500 ) & ( RECSUMMARY ( 13 , -1 ) < 500 ) &
the_year = '2016' rootInTES = '/Event/Turbo' the_line = 'B2XMuMu_Line/Particles' ## use pre-filters to speedup from PhysConf.Filters import LoKi_Filters fltrs = LoKi_Filters(VOID_Code=""" 0 < CONTAINS('%s/%s') """ % (rootInTES, the_line)) from Configurables import DstConf, TurboConf DstConf().Turbo = True TurboConf().PersistReco = True ##################Resstrping################################### from Configurables import EventNodeKiller eventNodeKiller = EventNodeKiller('Stripkiller') eventNodeKiller.Nodes = ['/Event/AllStreams', '/Event/Strip'] from StrippingConf.Configuration import StrippingConf from StrippingConf.StrippingStream import StrippingStream from StrippingArchive.Stripping28.StrippingRD.StrippingB2XMuMu import B2XMuMuConf from StrippingSettings.Stripping28.LineConfigDictionaries_RD import B2XMuMu from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence #from Configurables import DstConf, TurboConf B2XMuMuConf = B2XMuMuConf("B2XMuMu", B2XMuMu['CONFIG'])