Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 from SimGeneral.MixingModule.mixNoPU_cfi import *
00008 from SimGeneral.TrackingAnalysis.trackingParticlesNoSimHits_cfi import *
00009 from SimMuon.MCTruth.MuonAssociatorByHitsESProducer_NoSimHits_cfi import *
00010
00011 classByHitsTM = cms.EDProducer("MuonMCClassifier",
00012 muons = cms.InputTag("muons"),
00013 muonPreselection = cms.string("isTrackerMuon"),
00014
00015 trackType = cms.string("segments"),
00016 trackingParticles = cms.InputTag("mergedtruthNoSimHits"),
00017 associatorLabel = cms.string("muonAssociatorByHits_NoSimHits"),
00018 decayRho = cms.double(200),
00019 decayAbsZ = cms.double(400),
00020 linkToGenParticles = cms.bool(True),
00021 genParticles = cms.InputTag("genParticles"),
00022 )
00023 classByHitsTMLSAT = classByHitsTM.clone(
00024 muonPreselection = cms.string("muonID('TMLastStationAngTight')")
00025 )
00026 classByHitsGlb = classByHitsTM.clone(
00027 muonPreselection = cms.string("isGlobalMuon"),
00028 trackType = "global"
00029 )
00030 classByHitsSta = classByHitsTM.clone(
00031 muonPreselection = cms.string("isStandAloneMuon"),
00032 trackType = "outer"
00033 )
00034
00035
00036 muonClassificationByHits = cms.Sequence(
00037 mix +
00038 trackingParticlesNoSimHits +
00039 ( classByHitsTM +
00040 classByHitsTMLSAT +
00041 classByHitsGlb +
00042 classByHitsSta )
00043 )
00044 def addUserData(patMuonProducer,labels=['classByHitsGlb', 'classByHitsTM', 'classByHitsTMLSAT', 'classByHitsSta'], extraInfo = False):
00045 for label in labels:
00046 patMuonProducer.userData.userInts.src.append( cms.InputTag(label) )
00047 patMuonProducer.userData.userInts.src.append( cms.InputTag(label, "ext") )
00048 if extraInfo:
00049 for ints in ("flav", "hitsPdgId", "momPdgId", "gmomPdgId", "momFlav", "gmomFlav", "hmomFlav", "tpId", "momStatus"):
00050 patMuonProducer.userData.userInts.src.append(cms.InputTag(label, ints))
00051 for ins in ("prodRho", "prodZ", "tpAssoQuality", "momRho", "momZ"):
00052 patMuonProducer.userData.userFloats.src.append(cms.InputTag(label, ins))
00053 def addGenParticleRef(patMuonProducer, label = 'classByHitsGlb'):
00054 patMuonProducer.addGenMatch = True
00055 patMuonProducer.genParticleMatch = cms.VInputTag(cms.InputTag(label, "toPrimaries"), cms.InputTag(label, "toSecondaries"))
00056