Skip to content

Commit

Permalink
clean-up python configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Apr 11, 2021
1 parent 009da7e commit 43d60b9
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@
)
)

import copy

OutALCARECOSiPixelCalSingleMuonLoose=copy.deepcopy(OutALCARECOSiPixelCalSingleMuonLoose_noDrop)
OutALCARECOSiPixelCalSingleMuonLoose=OutALCARECOSiPixelCalSingleMuonLoose_noDrop.clone()
OutALCARECOSiPixelCalSingleMuonLoose.outputCommands.insert(0, "drop *")

Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
import FWCore.ParameterSet.Config as cms

import copy
##################################################################
# AlCaReco for track based calibration using single muon events
##################################################################
from HLTrigger.HLTfilters.hltHighLevel_cfi import *
# AlCaReco for track based calibration using min. bias events
ALCARECOSiPixelCalSingleMuonLooseHLTFilter = copy.deepcopy(hltHighLevel)
#seqALCARECOSiPixelCalSingleMuonLoose = cms.Sequence(ALCARECOSiPixelCalSingleMuonLooseHLTFilter)
ALCARECOSiPixelCalSingleMuonLooseHLTFilter = hltHighLevel.clone()
ALCARECOSiPixelCalSingleMuonLooseHLTFilter.andOr = True ## choose logical OR between Triggerbits
ALCARECOSiPixelCalSingleMuonLooseHLTFilter.throw = False ## dont throw on unknown path names
ALCARECOSiPixelCalSingleMuonLooseHLTFilter.eventSetupPathsKey = 'SiPixelCalSingleMuon'

##################################################################
# Basic track selection
##################################################################
import Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi
ALCARECOSiPixelCalSingleMuonLoose = Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi.AlignmentTrackSelector.clone()

ALCARECOSiPixelCalSingleMuonLoose.filter = True ##do not store empty events
ALCARECOSiPixelCalSingleMuonLoose.applyBasicCuts = True
ALCARECOSiPixelCalSingleMuonLoose.ptMin = 3.0 #GeV
ALCARECOSiPixelCalSingleMuonLoose.etaMin = -3.5
ALCARECOSiPixelCalSingleMuonLoose.etaMax = 3.5

# # define the Prescaler service, and set the scale factors
# thPrescaleService = cms.Service('PrescaleService',
# prescaleTable = cms.VPSet(cms.PSet(pathName = cms.string('pathALCARECOSiPixelCalSingleMuonLoose'),
# prescales = cms.vuint32( 100 ) # retain 1 event out of 100
# ))
# )
# scalerForSiPixelCalSingleMuonLoose = cms.EDFilter('HLTPrescaler')

##################################################################
# Prescale events
##################################################################
import CalibTracker.SiStripCommon.prescaleEvent_cfi
scalerForSiPixelCalSingleMuonLoose = CalibTracker.SiStripCommon.prescaleEvent_cfi.prescaleEvent.clone(prescale = 100)

# Loose Sequence #
##################################################################
# Loose Sequence
##################################################################
seqALCARECOSiPixelCalSingleMuonLoose = cms.Sequence(ALCARECOSiPixelCalSingleMuonLooseHLTFilter+
scalerForSiPixelCalSingleMuonLoose+
ALCARECOSiPixelCalSingleMuonLoose)
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
'keep *_muons__*',
'keep *_offlinePrimaryVertices_*_*',
'keep *_*riggerResults_*_HLT',
'keep *_*close*_*_*'
'keep *_*closebyPixelClusters*_*_*'
)
)
import copy

OutALCARECOSiPixelCalSingleMuonTight=copy.deepcopy(OutALCARECOSiPixelCalSingleMuonTight_noDrop)
OutALCARECOSiPixelCalSingleMuonTight=OutALCARECOSiPixelCalSingleMuonTight_noDrop.clone()
OutALCARECOSiPixelCalSingleMuonTight.outputCommands.insert(0, "drop *")
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import FWCore.ParameterSet.Config as cms

import copy
##################################################################
# AlCaReco for track based monitoring using single muon events
##################################################################
from HLTrigger.HLTfilters.hltHighLevel_cfi import *
# AlCaReco for track based calibration using min. bias events
ALCARECOSiPixelCalSingleMuonTightHLTFilter = copy.deepcopy(hltHighLevel)
ALCARECOSiPixelCalSingleMuonTightHLTFilter = hltHighLevel.clone()
ALCARECOSiPixelCalSingleMuonTightHLTFilter.andOr = True ## choose logical OR between Triggerbits
ALCARECOSiPixelCalSingleMuonTightHLTFilter.throw = False ## dont throw on unknown path names
#ALCARECOSiPixelCalSingleMuonTightHLTFilter.eventSetupPathsKey = 'SiPixelCalSingleMuonTight'
ALCARECOSiPixelCalSingleMuonTightHLTFilter.HLTPaths = ["HLT_*"]
#ALCARECOSiPixelCalSingleMuonTightHLTFilter.eventSetupPathsKey = 'SiPixelCalSingleMuonTight' ## FIXME: to be changed once trigger bit is updated

##################################################################
# Filter on the DCS partitions
##################################################################
import DPGAnalysis.Skims.skim_detstatus_cfi
ALCARECOSiPixelCalSingleMuonTightDCSFilter = DPGAnalysis.Skims.skim_detstatus_cfi.dcsstatus.clone(
DetectorType = cms.vstring('TIBTID','TOB','TECp','TECm','BPIX','FPIX',
Expand All @@ -19,12 +22,18 @@
DebugOn = cms.untracked.bool(False)
)

##################################################################
# Isolated muons Track selector
##################################################################
import Alignment.CommonAlignmentProducer.TkAlMuonSelectors_cfi
ALCARECOSiPixelCalSingleMuonTightGoodMuons = Alignment.CommonAlignmentProducer.TkAlMuonSelectors_cfi.TkAlGoodIdMuonSelector.clone()
ALCARECOSiPixelCalSingleMuonTightRelCombIsoMuons = Alignment.CommonAlignmentProducer.TkAlMuonSelectors_cfi.TkAlRelCombIsoMuonSelector.clone(
src = 'ALCARECOSiPixelCalSingleMuonTightGoodMuons'
)

##################################################################
# Basic Track selection
##################################################################
import Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi
ALCARECOSiPixelCalSingleMuonTight = Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi.AlignmentTrackSelector.clone(
filter = True, ##do not store empty events
Expand All @@ -35,40 +44,48 @@
nHitMin = 0
)

##################################################################
# Muon selection
##################################################################
ALCARECOSiPixelCalSingleMuonTight.GlobalSelector.muonSource = 'ALCARECOSiPixelCalSingleMuonTightRelCombIsoMuons'
# Isolation is shifted to the muon preselection, and then applied intrinsically if applyGlobalMuonFilter = True
ALCARECOSiPixelCalSingleMuonTight.GlobalSelector.applyIsolationtest = False
ALCARECOSiPixelCalSingleMuonTight.GlobalSelector.minJetDeltaR = 0.1
ALCARECOSiPixelCalSingleMuonTight.GlobalSelector.applyGlobalMuonFilter = True

ALCARECOSiPixelCalSingleMuonTight.TwoBodyDecaySelector.applyMassrangeFilter = False
ALCARECOSiPixelCalSingleMuonTight.TwoBodyDecaySelector.applyChargeFilter = False
ALCARECOSiPixelCalSingleMuonTight.TwoBodyDecaySelector.applyAcoplanarityFilter = False

# unassociated close-by clusters
##################################################################
# Track refitter
##################################################################
from RecoVertex.BeamSpotProducer.BeamSpot_cff import *
from RecoTracker.IterativeTracking.InitialStep_cff import *
from RecoTracker.Configuration.RecoTrackerP5_cff import *
from RecoTracker.TrackProducer.TrackRefitter_cfi import *
from RecoTracker.TrackProducer.TrackRefitters_cff import *

ALCARECOSiPixelCalSingleMuonTightTracksRefit = TrackRefitter.clone(src = cms.InputTag("ALCARECOSiPixelCalSingleMuonTight"),
NavigationSchool = cms.string("")
)

closebyPixelClusters = cms.EDProducer('NearbyPixelClustersProducer',
clusterCollection = cms.InputTag('siPixelClusters'),
trajectoryInput = cms.InputTag('ALCARECOSiPixelCalSingleMuonTightTracksRefit')
)
##################################################################
# Producer or close-by-pixels
##################################################################
import Calibration.TkAlCaRecoProducers.NearbyPixelClustersProducer_cfi as NearbyPixelClusters
closebyPixelClusters = NearbyPixelClusters.NearbyPixelClustersProducer.clone(clusterCollection = 'siPixelClusters',
trajectoryInput = 'ALCARECOSiPixelCalSingleMuonTightTracksRefit')

##################################################################
# Sequence: track refit + close-by-pixel producer
##################################################################
ALCARECOSiPixelCalSingleMuonTightOffTrackClusters = cms.Sequence(ALCARECOSiPixelCalSingleMuonTightTracksRefit +
closebyPixelClusters)

##################################################################
# Final Tight sequence
##################################################################
seqALCARECOSiPixelCalSingleMuonTight = cms.Sequence(offlineBeamSpot+
ALCARECOSiPixelCalSingleMuonTightHLTFilter+
ALCARECOSiPixelCalSingleMuonTightDCSFilter+
ALCARECOSiPixelCalSingleMuonTightGoodMuons+
ALCARECOSiPixelCalSingleMuonTightRelCombIsoMuons+
ALCARECOSiPixelCalSingleMuonTight+
ALCARECOSiPixelCalSingleMuonTightOffTrackClusters)


Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@
)
)

import copy

OutALCARECOSiPixelCalSingleMuon=copy.deepcopy(OutALCARECOSiPixelCalSingleMuon_noDrop)
OutALCARECOSiPixelCalSingleMuon=OutALCARECOSiPixelCalSingleMuon_noDrop.clone()
OutALCARECOSiPixelCalSingleMuon.outputCommands.insert(0, "drop *")
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
import FWCore.ParameterSet.Config as cms

import copy
##################################################################
# AlCaReco for track based calibration using single muon events
##################################################################
from HLTrigger.HLTfilters.hltHighLevel_cfi import *
# AlCaReco for track based calibration using min. bias events
ALCARECOSiPixelCalSingleMuonHLTFilter = copy.deepcopy(hltHighLevel)
#seqALCARECOSiPixelCalSingleMuon = cms.Sequence(ALCARECOSiPixelCalSingleMuonHLTFilter)
ALCARECOSiPixelCalSingleMuonHLTFilter = hltHighLevel.clone()
ALCARECOSiPixelCalSingleMuonHLTFilter.andOr = True ## choose logical OR between Triggerbits
ALCARECOSiPixelCalSingleMuonHLTFilter.throw = False ## dont throw on unknown path names
ALCARECOSiPixelCalSingleMuonHLTFilter.eventSetupPathsKey = 'SiPixelCalSingleMuon'

##################################################################
# Basic track selection
##################################################################
import Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi
ALCARECOSiPixelCalSingleMuon = Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi.AlignmentTrackSelector.clone()

ALCARECOSiPixelCalSingleMuon.filter = True ##do not store empty events
ALCARECOSiPixelCalSingleMuon.applyBasicCuts = True
ALCARECOSiPixelCalSingleMuon.ptMin = 3.0 #GeV
ALCARECOSiPixelCalSingleMuon.etaMin = -3.5
ALCARECOSiPixelCalSingleMuon.etaMax = 3.5

# Sequence #
##################################################################
# Loose Sequence
##################################################################
seqALCARECOSiPixelCalSingleMuon = cms.Sequence(ALCARECOSiPixelCalSingleMuonHLTFilter+ALCARECOSiPixelCalSingleMuon)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import FWCore.ParameterSet.Config as cms

NearbyPixelClustersProducer = cms.EDProducer('NearbyPixelClustersProducer',
clusterCollection = cms.InputTag('siPixelClusters'), # input clusters
trajectoryInput = cms.InputTag('TrackerRefitter'), # input trajectories
throwBadComponents = cms.bool(False), # do not use bad components
dumpWholeDetIds = cms.bool(False) # write all clusters in Det
)

0 comments on commit 43d60b9

Please sign in to comment.