from Gaudi.Configuration import * from PhysSelPython.Wrappers import Selection , SelectionSequence, DataOnDemand from Configurables import CombineParticles, FilterDesktop #from MakeMyParticles import * #makeMyProtoP("Best") #makeMyParticles("SmrdLoosePions", "Best", "pion") #makeMyKaons("SmrdLooseKaons", "Best", "kaon") #makeAllParticles("SmrdNoPIDPions", "Best", "pion") #makeAllParticles("SmrdNoPIDKaons", "Best", "kaon") from Configurables import TrackSmeared output = "Smeared" #/Rec/Track/Smeared TrackSmeared("TrackSmearing").OutputLocation = output TrackSmeared("TrackSmearing").smear = True TrackSmeared("TrackSmearing").makePlots = True TrackSmeared("TrackSmearing").OutputLevel = 2 TrackSmeared("TrackSmearing").smearProto = True TrackSmearingSeq = GaudiSequencer("TrackSmearingSeq") #Preserve MC from Configurables import TrackToDST, ChargedPP2MC, TrackAssociator assoctr = TrackAssociator(output+"AssocTr") assoctr.TracksInContainer = "Rec/Track/"+output assocpp=ChargedPP2MC(output+"AssocPP") assocpp.TrackLocations = [ "Rec/Track/"+output ] assocpp.InputData = [ "Rec/ProtoP/"+output+"ProtoPMaker" ] assocpp.OutputTable = "Relations/Rec/ProtoP/"+output+"ProtoPMaker" TrackSmearingSeq.Members = [ TrackSmeared("TrackSmearing") , assoctr, assocpp ]
# MC Options if not Data: DaVinci().DDDBtag = 'head-20101206' DaVinci().CondDBtag = "sim-20101210-vc-md100" if not Data: #importOptions("$User_release_area/DaVinci_v26r3p2/TrackSmearing/TrackSmearing/options/MakeMyParticles.py") #from MakeMyParticles import * #makeMyProtoP("Best") #makeMyParticles("SmrdLoosePions", "Best", "pion") #makeMyKaons("SmrdLooseKaons", "Best", "kaon") #makeAllParticles("SmrdNoPIDPions", "Best", "pion") #makeAllParticles("SmrdNoPIDKaons", "Best", "kaon") from Configurables import TrackSmeared TrackSmeared("TrackSmearing").InputLocation = "Rec/Track/Best" #TrackSmeared("TrackSmearing").OutputLocation = "Best" TrackSmeared("TrackSmearing").smear = True TrackSmeared("TrackSmearing").makePlots = True TrackSmeared("TrackSmearing").OutputLevel = 3 TrackSmeared("TrackSmearing").smearBest = True TrackSmeared("TrackSmearing").smearProto = True TrackSmearingSeq = GaudiSequencer("TrackSmearingSeq") TrackSmearingSeq.Members = [ TrackSmeared("TrackSmearing") ] DaVinci().UserAlgorithms += [ TrackSmearingSeq, _seqPions.sequence()
def makeMyProtoP(trackcont): unpacker = UnpackTrack(trackcont + "UnpackTrack") unpacker.InputName = "pRec/Track/" + trackcont unpacker.OutputName = "Rec/Track/" + trackcont refitter = TrackSmeared(trackcont + "TrackSmeared") refitter.InputLocation = "Rec/Track/" + trackcont refitter.OutputLocation = "Refit" refitter.smear = 1 #refitter.makePlots = 1 #refitter.OutputLevel = 2 #idalg = MuonIDAlg("BestIDalg") #idalg.OutputLevel = 0 #cm=ConfiguredMuonIDs.ConfiguredMuonIDs(data=DaVinci().getProp("DataType")) #cm.configureMuonIDAlg(idalg) #idalg.TrackLocation = "Rec/Track/Refit" #idalg.MuonIDLocation = "Rec/Muon/MuonPID/Refit" downprotoseq = GaudiSequencer(trackcont + "ProtoPSeq") downprotos = ChargedProtoParticleMaker(trackcont + "ProtoPMaker") downprotos.InputTrackLocation = ["Rec/Track/Refit"] downprotos.OutputProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker" downprotos.addTool(DelegatingTrackSelector, name="TrackSelector") #downprotos.OutputLevel = 0 tracktypes = ["Long", "Upstream", "Downstream", "Ttrack", "Velo", "VeloR"] downprotos.TrackSelector.TrackTypes = tracktypes selector = downprotos.TrackSelector for tsname in tracktypes: selector.addTool(TrackSelector, name=tsname) ts = getattr(selector, tsname) # Set Cuts ts.TrackTypes = [tsname] #set up associators #addmuonpid = ChargedProtoParticleAddMuonInfo("Bestaddmuoninfo") #addmuonpid.InputMuonPIDLocation = "Rec/Muon/MuonPID/Refit" #addmuonpid.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker" #addmuonpid.OutputLevel = 0 addrichpid = ChargedProtoParticleAddRichInfo("Bestaddrichinfo") addrichpid.InputRichPIDLocation = "Rec/Rich/Refit" #addrichpid.InputRichPIDLocation = "Rec/Rich/"+trackcont addrichpid.ProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker" #addcalopid = ChargedProtoParticleAddCaloInfo("Bestaddcaloinfo") #addcalopid.InputRichCALOLocation = "Rec/Rich/Refit" #addcalopid.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker" combinedll = ChargedProtoCombineDLLsAlg("BestCombineDLL") combinedll.ProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker" assoctr = TrackAssociator(trackcont + "AssocTr") #assoctr.TracksInContainer = "Rec/Track/"+trackcont assoctr.TracksInContainer = "Rec/Track/Refit" assocpp = ChargedPP2MC(trackcont + "AssocPP") #assocpp.TrackLocations = [ "Rec/Track/"+trackcont ] assocpp.TrackLocations = ["Rec/Track/Refit"] assocpp.InputData = ["Rec/ProtoP/" + trackcont + "ProtoPMaker"] #assocpp.InputData = [ "Rec/ProtoP/Refit" ] assocpp.OutputTable = "Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker" # DST post treatment TrackToDST(trackcont + "TrackToDST").TracksInContainer = "Rec/Track/" + trackcont #downprotoseq.Members += [ TrackToDST(trackcont+"TrackToDST"), assoctr, downprotos, assocpp,addrichpid,combinedll ] if not DaVinci().Simulation: downprotoseq.Members += [ TrackToDST(trackcont + "TrackToDST"), downprotos, addrichpid, combinedll ] DataOnDemandSvc().AlgMap.update({ "/Event/Rec/Track/" + trackcont: unpacker.getFullName(), "/Event/Rec/Track/Refit": refitter.getFullName(), "/Event/Rec/Rich/Refit": downprotoseq.getFullName(), "/Event/Rec/ProtoP/" + trackcont + "ProtoPMaker": downprotoseq.getFullName(), "/Event/Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker": downprotoseq.getFullName() }) else: if (DaVinci().Simulation): downprotoseq.Members += [ TrackToDST(trackcont + "TrackToDST"), assoctr, downprotos, addrichpid, combinedll, assocpp ] DataOnDemandSvc().AlgMap.update({ "/Event/Rec/Track/" + trackcont: unpacker.getFullName(), "/Event/Rec/Track/Refit": refitter.getFullName(), "/Event/Rec/Rich/Refit": downprotoseq.getFullName(), "/Event/Rec/ProtoP/" + trackcont + "ProtoPMaker": downprotoseq.getFullName(), "/Event/Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker": downprotoseq.getFullName() })
from Configurables import GaudiSequencer from Configurables import TrackSmeared # file to smear proto particles and their associated track smear = TrackSmeared("TrackSmeared") #smear.InputLocation = "Rec/Track/Best" output = "Smeared" smear.OutputLocation = output #smear.Scale = 1.0 smear.smearProto = True #smear.OutputLevel = 2 #get MC association back from Configurables import TrackToDST, ChargedPP2MC, TrackAssociator output = "Smeared" assoctr = TrackAssociator(output + "AssocTr") assoctr.TracksInContainer = "Rec/Track/" + output assocpp = ChargedPP2MC(output + "AssocPP") assocpp.TrackLocations = ["Rec/Track/" + output] assocpp.InputData = ["Rec/ProtoP/" + output + "ProtoPMaker"] assocpp.OutputTable = "Relations/Rec/ProtoP/" + output + "ProtoPMaker" # add smearProto to a DaVinci sequence before you make the selection smearProto = GaudiSequencer("SmearProto") smearProto.Members += [smear, assoctr, assocpp] #importOptions("$TRACKSMEARINGROOT/MyLoosePions.py")
from Gaudi.Configuration import * from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand, AutomaticData from Configurables import DecayTreeTuple, FitDecayTrees, TupleToolRecoStats, TupleToolTrigger, TupleToolTISTOS, CondDB, SelDSTWriter, FilterDesktop from DecayTreeTuple.Configuration import * from Configurables import TrackSmearState as SMEAR smear = SMEAR("StateSmear") from Configurables import TrackSmeared TrackSmeared("TrackSmearing").smearBest = True TrackSmeared("TrackSmearing").Scale = 0.5 TrackSmearingSeq = GaudiSequencer("TrackSmearingSeq") TrackSmearingSeq.Members = [ TrackSmeared("TrackSmearing") ] # Standard stripping20 name = 'bukmumu' """ Options for building Stripping20, with tight track chi2 cut (<3) """ from Configurables import EventNodeKiller eventNodeKiller = EventNodeKiller('Stripkiller') eventNodeKiller.Nodes = ['/Event/AllStreams','/Event/Strip']
def makeMyProtoP(trackcont): unpacker = UnpackTrack(trackcont + "UnpackTrack") unpacker.InputName = "pRec/Track/" + trackcont unpacker.OutputName = "Rec/Track/" + trackcont smeartracks = TrackSmeared(trackcont + "TrackSmeared") smeartracks.InputLocation = "Rec/Track/" + trackcont outputLocation = "Smeared" smeartracks.OutputLocation = outputLocation smeartracks.smearCopied = True smeartracks.smear = 1 #smeartracks.makePlots = 1 #smeartracks.OutputLevel = 2 protoseq = GaudiSequencer(trackcont + "ProtoPSeq") protos = ChargedProtoParticleMaker(trackcont + "ProtoPMaker") protos.InputTrackLocation = ["Rec/Track/" + outputLocation] protos.OutputProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker" protos.addTool(DelegatingTrackSelector, name="TrackSelector") #protos.OutputLevel = 0 tracktypes = ["Long", "Upstream", "Downstream", "Ttrack", "Velo", "VeloR"] protos.TrackSelector.TrackTypes = tracktypes selector = protos.TrackSelector for tsname in tracktypes: selector.addTool(TrackSelector, name=tsname) ts = getattr(selector, tsname) # Set Cuts ts.TrackTypes = [tsname] # Add PID information idalg = MuonIDAlg("BestIDalg") #idalg.OutputLevel = 5 cm = ConfiguredMuonIDs.ConfiguredMuonIDs( data=DaVinci().getProp("DataType")) cm.configureMuonIDAlg(idalg) idalg.TrackLocation = "Rec/Track/" + outputLocation idalg.MuonIDLocation = "Rec/Muon/MuonPID/" + outputLocation from Configurables import ( ChargedProtoParticleAddRichInfo, ChargedProtoParticleAddMuonInfo, ChargedProtoParticleAddEcalInfo, ChargedProtoParticleAddBremInfo, ChargedProtoParticleAddHcalInfo, ChargedProtoParticleAddPrsInfo, ChargedProtoParticleAddSpdInfo, ChargedProtoParticleAddVeloInfo, ChargedProtoCombineDLLsAlg) addmuonpid = ChargedProtoParticleAddMuonInfo("Bestaddmuoninfo") addmuonpid.InputMuonPIDLocation = "Rec/Muon/MuonPID/" + outputLocation addmuonpid.ProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker" addrichpid = ChargedProtoParticleAddRichInfo("Bestaddrichinfo") addrichpid.ProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker" # The rich pid is added to the track in TrackSmeared, thus only kaon pion pid is consistent # the others are not implemented. The modes smearBest and smearProto don't have the problems #addcalopid = ChargedProtoParticleAddCaloInfo("Bestaddcaloinfo") #addcalopid.InputRichCALOLocation = "Rec/Rich/"+outputLocation #addcalopid.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker" #ecal = ChargedProtoParticleAddEcalInfo("ChargedProtoPAddEcal") #ecal.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker" #brem = ChargedProtoParticleAddBremInfo("ChargedProtoPAddBrem") #brem.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker" #hcal = ChargedProtoParticleAddHcalInfo("ChargedProtoPAddHcal") #hcal.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker" #prs = ChargedProtoParticleAddPrsInfo("ChargedProtoPAddPrs") #prs.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker" #spd = ChargedProtoParticleAddSpdInfo("ChargedProtoPAddSpd") #spd.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker" #velo = ChargedProtoParticleAddVeloInfo("ChargedProtoPAddVeloDEDX") #velo.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker" combinedll = ChargedProtoCombineDLLsAlg("BestCombineDLL") combinedll.ProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker" #set up associators assoctr = TrackAssociator(trackcont + "AssocTr") assoctr.TracksInContainer = "Rec/Track/" + outputLocation assocpp = ChargedPP2MC(trackcont + "AssocPP") assocpp.TrackLocations = ["Rec/Track/" + outputLocation] assocpp.InputData = ["Rec/ProtoP/" + trackcont + "ProtoPMaker"] assocpp.OutputTable = "Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker" # DST post treatment TrackToDST(trackcont + "TrackToDST").TracksInContainer = "Rec/Track/" + trackcont if not DaVinci().Simulation: protoseq.Members += [TrackToDST(trackcont + "TrackToDST"), protos] protoseq.Members += [ ecal, brem, hcal, prs, spd, velo, addrichpid, addmuonpid, combinedll ] DataOnDemandSvc().AlgMap.update({ "/Event/Rec/Track/" + trackcont: unpacker.getFullName(), "/Event/Rec/Track/" + outputLocation: smeartracks.getFullName(), "/Event/Rec/Rich/" + outputLocation: protoseq.getFullName(), "/Event/Rec/Muon/MuonPID/" + outputLocation: idalg.getFullName(), "/Event/Rec/ProtoP/" + trackcont + "ProtoPMaker": protoseq.getFullName(), "/Event/Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker": protoseq.getFullName() }) else: if (DaVinci().Simulation): protoseq.Members += [ TrackToDST(trackcont + "TrackToDST"), assoctr, protos ] #protoseq.Members += [ ecal,brem,hcal,prs,spd,velo,addrichpid,addmuonpid,combinedll,assocpp ] protoseq.Members += [ idalg, addmuonpid, addrichpid, combinedll, assocpp ] DataOnDemandSvc().AlgMap.update({ "/Event/Rec/Track/" + trackcont: unpacker.getFullName(), "/Event/Rec/Track/" + outputLocation: smeartracks.getFullName(), "/Event/Rec/Rich/" + outputLocation: protoseq.getFullName(), "/Event/Rec/Muon/MuonPID/" + outputLocation: idalg.getFullName(), "/Event/Rec/ProtoP/" + trackcont + "ProtoPMaker": protoseq.getFullName(), "/Event/Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker": protoseq.getFullName() })