11 classByHitsTM = cms.EDProducer(
"MuonMCClassifier",
12 muons = cms.InputTag(
"muons"),
13 muonPreselection = cms.string(
"isTrackerMuon"),
15 trackType = cms.string(
"segments"),
16 trackingParticles = cms.InputTag(
"mergedtruthNoSimHits"),
17 associatorLabel = cms.string(
"muonAssociatorByHits_NoSimHits"),
18 decayRho = cms.double(200),
19 decayAbsZ = cms.double(400),
20 linkToGenParticles = cms.bool(
True),
21 genParticles = cms.InputTag(
"genParticles"),
23 classByHitsTMLSAT = classByHitsTM.clone(
24 muonPreselection = cms.string(
"muonID('TMLastStationAngTight')")
26 classByHitsGlb = classByHitsTM.clone(
27 muonPreselection = cms.string(
"isGlobalMuon"),
30 classByHitsSta = classByHitsTM.clone(
31 muonPreselection = cms.string(
"isStandAloneMuon"),
36 muonClassificationByHits = cms.Sequence(
38 trackingParticlesNoSimHits +
44 def addUserData(patMuonProducer,labels=['classByHitsGlb', 'classByHitsTM', 'classByHitsTMLSAT', 'classByHitsSta'], extraInfo = False):
46 patMuonProducer.userData.userInts.src.append( cms.InputTag(label) )
47 patMuonProducer.userData.userInts.src.append( cms.InputTag(label,
"ext") )
49 for ints
in (
"flav",
"hitsPdgId",
"momPdgId",
"gmomPdgId",
"momFlav",
"gmomFlav",
"hmomFlav",
"tpId",
"momStatus"):
50 patMuonProducer.userData.userInts.src.append(cms.InputTag(label, ints))
51 for ins
in (
"prodRho",
"prodZ",
"tpAssoQuality",
"momRho",
"momZ"):
52 patMuonProducer.userData.userFloats.src.append(cms.InputTag(label, ins))
54 patMuonProducer.addGenMatch =
True
55 patMuonProducer.genParticleMatch = cms.VInputTag(cms.InputTag(label,
"toPrimaries"), cms.InputTag(label,
"toSecondaries"))