Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-12 22:34:54

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 # TrackingParticle selectors
0004 from Validation.RecoMuon.selectors_cff import *
0005 # reco::Track selectors 
0006 from Validation.RecoMuon.track_selectors_cff import *
0007 
0008 # quickTrackAssociatorByHits on probeTracks used as monitor wrt MuonAssociatorByHits
0009 import SimTracker.TrackAssociatorProducers.quickTrackAssociatorByHits_cfi
0010 trackAssociatorByHits = SimTracker.TrackAssociatorProducers.quickTrackAssociatorByHits_cfi.quickTrackAssociatorByHits.clone()
0011 
0012 from SimTracker.TrackAssociation.trackingParticleRecoTrackAsssociation_cfi import trackingParticleRecoTrackAsssociation as _trackingParticleRecoTrackAsssociation
0013 tpToTkmuTrackAssociation = _trackingParticleRecoTrackAsssociation.clone(
0014     associator = 'trackAssociatorByHits',
0015 #    label_tr = 'generalTracks',
0016     label_tr = 'probeTracks'
0017 )
0018 
0019 #
0020 # MuonAssociatorByHits used for all track collections
0021 #
0022 import SimMuon.MCTruth.MuonAssociatorByHits_cfi
0023 MABH = SimMuon.MCTruth.MuonAssociatorByHits_cfi.muonAssociatorByHits.clone(
0024 # DEFAULTS ###################################
0025 #    EfficiencyCut_track = 0.,
0026 #    PurityCut_track = 0.,
0027 #    EfficiencyCut_muon = 0.,
0028 #    PurityCut_muon = 0.,
0029 #    includeZeroHitMuons = True,
0030 #    acceptOneStubMatchings = False,
0031 #    rejectBadGlobal = True,
0032 #    tpTag = "mix","MergedTrackTruth",
0033 #    tpRefVector = False
0034 ##############################################
0035     EfficiencyCut_track = 0.5,
0036     PurityCut_track = 0.75,
0037     EfficiencyCut_muon = 0.5,
0038     PurityCut_muon = 0.75,
0039     includeZeroHitMuons = False,
0040     tpTag = ("TPmu"),
0041     tpRefVector = True
0042 ##############################################
0043 )
0044 tpToTkMuonAssociation = MABH.clone(
0045     #tracksTag = 'generalTracks',
0046     tracksTag ='probeTracks',
0047     UseTracker = True,
0048     UseMuon = False,
0049     tpTag = ("TPtrack")
0050 )
0051 tpToStaSeedAssociation = MABH.clone(
0052     tracksTag = 'seedsOfSTAmuons',
0053     UseTracker = False,
0054     UseMuon = True,
0055     EfficiencyCut_muon = 0.
0056 )
0057 tpToStaMuonAssociation = MABH.clone(
0058     tracksTag = 'standAloneMuons',
0059     UseTracker = False,
0060     UseMuon = True
0061 )
0062 tpToStaUpdMuonAssociation = MABH.clone(
0063     tracksTag = 'standAloneMuons:UpdatedAtVtx',
0064     UseTracker = False,
0065     UseMuon = True
0066 )
0067 tpToGlbMuonAssociation = MABH.clone(
0068     tracksTag = 'globalMuons',
0069     UseTracker = True,
0070     UseMuon = True
0071 )
0072 tpToStaRefitMuonAssociation = MABH.clone(
0073     tracksTag = 'refittedStandAloneMuons',
0074     UseTracker = False,
0075     UseMuon = True
0076 )
0077 tpToStaRefitUpdMuonAssociation = MABH.clone(
0078     tracksTag = 'refittedStandAloneMuons:UpdatedAtVtx',
0079     UseTracker = False,
0080     UseMuon = True
0081 )
0082 tpToDisplacedTrkMuonAssociation = MABH.clone(
0083     tracksTag = 'displacedTracks',
0084     UseTracker = True,
0085     UseMuon = False,
0086     tpTag = ("TPtrack")
0087 )
0088 tpToDisplacedStaSeedAssociation = MABH.clone(
0089     tracksTag = 'seedsOfDisplacedSTAmuons',
0090     UseTracker = False,
0091     UseMuon = True,
0092     EfficiencyCut_muon = 0.
0093 )
0094 tpToDisplacedStaMuonAssociation = MABH.clone(
0095     tracksTag = 'displacedStandAloneMuons',
0096     UseTracker = False,
0097     UseMuon = True
0098 )
0099 tpToDisplacedGlbMuonAssociation = MABH.clone(
0100     tracksTag = 'displacedGlobalMuons',
0101     UseTracker = True,
0102     UseMuon = True
0103 )
0104 tpToTevFirstMuonAssociation = MABH.clone(
0105     tracksTag = 'tevMuons:firstHit',
0106     UseTracker = True,
0107     UseMuon = True,
0108     EfficiencyCut_muon = 0.
0109 )
0110 tpToTevPickyMuonAssociation = MABH.clone(
0111     tracksTag = 'tevMuons:picky',
0112     UseTracker = True,
0113     UseMuon = True,
0114     EfficiencyCut_muon = 0.
0115 )
0116 tpToTevDytMuonAssociation = MABH.clone(
0117     tracksTag = 'tevMuons:dyt',
0118     UseTracker = True,
0119     UseMuon = True,
0120     EfficiencyCut_muon = 0.,
0121     rejectBadGlobal = False
0122 )
0123 # tuneP (GlobalMuons with TuneP definition)
0124 tpToTunePMuonAssociation = MABH.clone(
0125     tracksTag = 'tunepMuonTracks',
0126     UseTracker = True,
0127     UseMuon = True,
0128     EfficiencyCut_muon = 0.,
0129     rejectBadGlobal = False
0130 )
0131 # PFMuons
0132 tpToPFMuonAssociation = MABH.clone(
0133     tracksTag = 'pfMuonTracks',
0134     UseTracker = True,
0135     UseMuon = True,
0136     tpTag = ("TPpfmu"),
0137     EfficiencyCut_muon = 0.,
0138     rejectBadGlobal = False
0139 )
0140 # all offline reco::Muons with loose cuts
0141 # note in this case muons can be of any type: set UseTracker=UseMuon=true and rejectBadGlobal=false,
0142 # then define the logic in the muon track producer, run beforehand.
0143 tpTorecoMuonMuonAssociation = MABH.clone(
0144     tracksTag = 'recoMuonTracks',
0145     UseTracker = True,
0146     UseMuon = True,
0147     EfficiencyCut_track = 0.,
0148     EfficiencyCut_muon = 0.,
0149     # matching to a skimmed TP collection needs a purity cut to avoid pathological cases
0150     #PurityCut_track = 0.,
0151     #PurityCut_muon = 0.,
0152     includeZeroHitMuons = True,
0153     rejectBadGlobal = False
0154 )
0155 # ME0Muons
0156 tpToME0MuonMuonAssociation = MABH.clone(
0157     tracksTag = 'extractMe0Muons',
0158     UseTracker = True,
0159     UseMuon = False
0160 )
0161 # GEMmuons
0162 tpToGEMMuonMuonAssociation = MABH.clone(
0163     tracksTag = 'extractGemMuons',
0164     UseTracker = True,
0165     UseMuon = False
0166 )
0167 # === HLT muon tracks 
0168 #
0169 MABHhlt = SimMuon.MCTruth.MuonAssociatorByHits_cfi.muonAssociatorByHits.clone(
0170 # DEFAULTS ###################################
0171 #    EfficiencyCut_track = cms.double(0.), # backup solution as UseGrouped/UseSplitting are always assumed to be true
0172 #    EfficiencyCut_muon = cms.double(0.),  # | loose matching requests for triggering
0173 #    includeZeroHitMuons = cms.bool(True), # |
0174 #    acceptOneStubMatchings = cms.bool(False),
0175 #    rejectBadGlobal = cms.bool(True),
0176 ##############################################
0177     PurityCut_track = 0.75,
0178     PurityCut_muon = 0.75,
0179     DTrechitTag = 'hltDt1DRecHits',
0180     ignoreMissingTrackCollection = True,
0181     tpTag = ("TPmu"),
0182     tpRefVector = True
0183 )
0184 ##############################################
0185 
0186 tpToL2MuonAssociation = MABHhlt.clone(
0187     tracksTag = 'hltL2Muons',
0188     UseTracker = False,
0189     UseMuon = True
0190 )
0191 tpToL2UpdMuonAssociation = MABHhlt.clone(
0192     tracksTag = 'hltL2Muons:UpdatedAtVtx',
0193     UseTracker = False,
0194     UseMuon = True
0195 )
0196 tpToL3OITkMuonAssociation = MABHhlt.clone(
0197     tracksTag = 'hltIterL3OIMuonTrackSelectionHighPurity',
0198     UseTracker = True,
0199     UseMuon = False
0200 )
0201 tpToL3TkMuonAssociation = MABHhlt.clone(
0202     tracksTag = 'hltIterL3MuonMerged',
0203     UseTracker = True,
0204     UseMuon = False
0205 )
0206 tpToL3FromL1TkMuonAssociation = MABHhlt.clone(
0207     tracksTag = 'hltIterL3MuonAndMuonFromL1Merged',
0208     UseTracker = True,
0209     UseMuon = False
0210 )
0211 tpToL0L3FromL1TkMuonAssociation = MABHhlt.clone(
0212     tracksTag = 'hltIter0IterL3FromL1MuonTrackSelectionHighPurity',
0213     UseTracker = True,
0214     UseMuon = False
0215 )
0216 tpToL3GlbMuonAssociation = MABHhlt.clone(
0217     tracksTag = 'hltIterL3GlbMuon',
0218     UseTracker = True,
0219     UseMuon = True
0220 )
0221 tpToL3NoIDMuonAssociation = MABHhlt.clone(
0222     tracksTag = 'hltIterL3MuonsNoIDTracks',
0223     UseTracker = True,
0224     UseMuon = True,
0225     rejectBadGlobal = False
0226 )
0227 tpToL3MuonAssociation = MABHhlt.clone(
0228     tracksTag = 'hltIterL3MuonsTracks',
0229     UseTracker = True,
0230     UseMuon = True,
0231     rejectBadGlobal = False
0232 )
0233 
0234 
0235 #
0236 # COSMICS reco
0237 MABHcosmic = SimMuon.MCTruth.MuonAssociatorByHits_cfi.muonAssociatorByHits.clone(
0238 # DEFAULTS ###################################
0239 #    acceptOneStubMatchings = False,
0240 #    rejectBadGlobal = True,
0241 #    tpTag = "mix:MergedTrackTruth",
0242 #    tpRefVector = False,
0243 ###############################################
0244     EfficiencyCut_track = 0.5,
0245     PurityCut_track = 0.75,
0246     EfficiencyCut_muon = 0.5,
0247     PurityCut_muon = 0.75,
0248     includeZeroHitMuons = False
0249 )
0250 ################################################
0251 #
0252 # 2-legs cosmics reco: simhits can be twice the reconstructed ones in any single leg
0253 # (Quality cut have to be set at 0.25, purity cuts can stay at default value 0.75)
0254 # T.B.D. upper and lower leg should be analyzed separately 
0255 #
0256 tpToTkCosmicSelMuonAssociation = MABHcosmic.clone(
0257     tracksTag = 'ctfWithMaterialTracksP5LHCNavigation',
0258     UseTracker = True,
0259     UseMuon = False,
0260     EfficiencyCut_track = 0.25
0261 )
0262 tpToStaCosmicSelMuonAssociation = MABHcosmic.clone(
0263     tracksTag = 'cosmicMuons',
0264     UseTracker = False,
0265     UseMuon = True,
0266     EfficiencyCut_muon = 0.25
0267 )
0268 tpToGlbCosmicSelMuonAssociation = MABHcosmic.clone(
0269     tracksTag = 'globalCosmicMuons',
0270     UseTracker = True,
0271     UseMuon = True,
0272     EfficiencyCut_track = 0.25,
0273     EfficiencyCut_muon = 0.25
0274 )
0275 # 1-leg cosmics reco
0276 tpToTkCosmic1LegSelMuonAssociation = MABHcosmic.clone(
0277     tracksTag = 'ctfWithMaterialTracksP5',
0278     UseTracker = True,
0279     UseMuon = False
0280 )
0281 tpToStaCosmic1LegSelMuonAssociation = MABHcosmic.clone(
0282     tracksTag = 'cosmicMuons1Leg',
0283     UseTracker = False,
0284     UseMuon = True
0285 )
0286 tpToGlbCosmic1LegSelMuonAssociation = MABHcosmic.clone(
0287     tracksTag = 'globalCosmicMuons1Leg',
0288     UseTracker = True,
0289     UseMuon = True
0290 )
0291 #
0292 # The full-sim association sequences
0293 #
0294 
0295 muonAssociation_seq = cms.Sequence(
0296     probeTracks_seq+tpToTkMuonAssociation
0297     +trackAssociatorByHits+tpToTkmuTrackAssociation
0298     +seedsOfSTAmuons_seq+tpToStaSeedAssociation+tpToStaMuonAssociation+tpToStaUpdMuonAssociation
0299     +tpToGlbMuonAssociation
0300     +pfMuonTracks_seq+tpToPFMuonAssociation
0301     +recoMuonTracks_seq+tpTorecoMuonMuonAssociation
0302     )
0303 
0304 muonAssociationTEV_seq = cms.Sequence(
0305     tpToTevFirstMuonAssociation+tpToTevPickyMuonAssociation+tpToTevDytMuonAssociation
0306     +tunepMuonTracks_seq+tpToTunePMuonAssociation
0307     )
0308 
0309 muonAssociationDisplaced_seq = cms.Sequence(
0310     seedsOfDisplacedSTAmuons_seq+tpToDisplacedStaSeedAssociation+tpToDisplacedStaMuonAssociation
0311     +tpToDisplacedTrkMuonAssociation+tpToDisplacedGlbMuonAssociation
0312     )
0313 
0314 muonAssociationRefit_seq = cms.Sequence(
0315     tpToStaRefitMuonAssociation+tpToStaRefitUpdMuonAssociation
0316     )
0317 
0318 muonAssociationCosmic_seq = cms.Sequence(
0319     tpToTkCosmicSelMuonAssociation+ tpToTkCosmic1LegSelMuonAssociation
0320     +tpToStaCosmicSelMuonAssociation+tpToStaCosmic1LegSelMuonAssociation
0321     +tpToGlbCosmicSelMuonAssociation+tpToGlbCosmic1LegSelMuonAssociation
0322     )
0323 
0324 muonAssociationHLT_seq = cms.Sequence(
0325     tpToL2MuonAssociation+tpToL2UpdMuonAssociation
0326     +tpToL3OITkMuonAssociation+tpToL3TkMuonAssociation+tpToL3FromL1TkMuonAssociation+tpToL0L3FromL1TkMuonAssociation
0327     +tpToL3GlbMuonAssociation
0328     +hltIterL3MuonsNoIDTracks_seq+tpToL3NoIDMuonAssociation
0329     +hltIterL3MuonsTracks_seq+tpToL3MuonAssociation
0330     )
0331 
0332 
0333 # fastsim has no hlt specific dt hit collection
0334 from Configuration.Eras.Modifier_fastSim_cff import fastSim
0335 _DTrechitTag = SimMuon.MCTruth.MuonAssociatorByHits_cfi.muonAssociatorByHits.DTrechitTag
0336 fastSim.toModify(tpToL2MuonAssociation, DTrechitTag = _DTrechitTag)
0337 fastSim.toModify(tpToL2UpdMuonAssociation, DTrechitTag = _DTrechitTag)
0338 fastSim.toModify(tpToL3OITkMuonAssociation, DTrechitTag = _DTrechitTag)
0339 fastSim.toModify(tpToL3TkMuonAssociation, DTrechitTag = _DTrechitTag)
0340 fastSim.toModify(tpToL3FromL1TkMuonAssociation, DTrechitTag = _DTrechitTag)
0341 fastSim.toModify(tpToL0L3FromL1TkMuonAssociation, DTrechitTag = _DTrechitTag)
0342 fastSim.toModify(tpToL3GlbMuonAssociation, DTrechitTag = _DTrechitTag)
0343 fastSim.toModify(tpToL3NoIDMuonAssociation, DTrechitTag = _DTrechitTag)
0344 fastSim.toModify(tpToL3MuonAssociation, DTrechitTag = _DTrechitTag)