6 classByHitsTM = cms.EDProducer(
"MuonMCClassifier",
7 muons = cms.InputTag(
"muons"),
8 muonPreselection = cms.string(
"muonID('TrackerMuonArbitrated')"),
9 trackType = cms.string(
"segments"),
10 trackingParticles = cms.InputTag(
"mix",
"MergedTrackTruth"),
11 associatorLabel = cms.InputTag(
"muonAssociatorByHitsNoSimHitsHelper"),
12 decayRho = cms.double(200),
13 decayAbsZ = cms.double(400),
14 linkToGenParticles = cms.bool(
True),
15 genParticles = cms.InputTag(
"genParticles"),
17 classByHitsTMLSAT = classByHitsTM.clone(
18 muonPreselection = cms.string(
"muonID('TMLastStationAngTight')")
20 classByHitsGlb = classByHitsTM.clone(
21 muonPreselection = cms.string(
"isGlobalMuon"),
24 classByHitsSta = classByHitsTM.clone(
25 muonPreselection = cms.string(
"isStandAloneMuon"),
28 classByHitsGlbOrTrk = classByHitsTM.clone(
29 muonPreselection = cms.string(
"isGlobalMuon || muonID('TrackerMuonArbitrated')"),
30 trackType =
"glb_or_trk"
34 muonClassificationByHits = cms.Sequence(
35 muonAssociatorByHitsNoSimHitsHelper +
45 def addUserData(patMuonProducer,labels=['classByHitsGlbOrTrk'], extraInfo = False):
47 patMuonProducer.userData.userInts.src.append( cms.InputTag(label) )
48 patMuonProducer.userData.userInts.src.append( cms.InputTag(label,
"ext") )
50 for ints
in (
"flav",
"hitsPdgId",
"G4processType",
"momPdgId",
"gmomPdgId",
"momFlav",
"gmomFlav",
"hmomFlav",
"tpId",
"tpBx",
"tpEv",
"momStatus"):
51 patMuonProducer.userData.userInts.src.append(cms.InputTag(label, ints))
52 for ins
in (
"signp",
"pt",
"eta",
"phi",
"prodRho",
"prodZ",
"tpAssoQuality",
"momRho",
"momZ"):
54 patMuonProducer.userData.userFloats.src.append(cms.InputTag(label, ins))
57 patMuonProducer.addGenMatch =
True
58 patMuonProducer.genParticleMatch = cms.VInputTag(cms.InputTag(label,
"toPrimaries"), cms.InputTag(label,
"toSecondaries"))