4 import FWCore.ParameterSet.Config as cms
6 process = cms.Process("OfflineValidator")
8 .oO[datasetDefinition]Oo.
10 process.options = cms.untracked.PSet(
11 wantSummary = cms.untracked.bool(False),
12 Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal
13 fileMode = cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries
17 ## Messages & Convenience
19 process.load("FWCore.MessageLogger.MessageLogger_cfi")
20 process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True))
21 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
22 reportEvery = cms.untracked.int32(1000) # every 1000th only
23 # limit = cms.untracked.int32(10) # or limit to 10 printouts...
25 process.MessageLogger.statistics.append('cout')
27 #############################################################
28 ##select trigger bits 40 OR 41
29 ##AND NOT (36 OR 37 OR 38 OR 39)
30 ##trigger bit 0 is selecting crossing bunches (not in MC)
31 ##########################################################
32 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
33 process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
36 process.bptxAnd = process.hltLevel1GTSeed.clone(L1TechTriggerSeeding = cms.bool(True), L1SeedsLogicalExpression = cms.string('0'))
38 #process.bit40 = process.hltLevel1GTSeed.clone(L1TechTriggerSeeding = cms.bool(True), L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39) AND NOT ((42 AND NOT 43) OR (43 AND NOT 42))'))
41 process.load('HLTrigger.special.hltPhysicsDeclared_cfi')
42 process.hltPhysicsDeclared.L1GtReadoutRecordTag = 'gtDigis'
45 #############################################################
46 ##select only high purity tracks
47 ##has to run first as necessary information
48 ##is only available in initial track selection
49 ##(Quality information is thrown away by the tracker refitters)
50 ##########################################################
51 import Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi
52 process.HighPuritySelector = Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi.AlignmentTrackSelector.clone(
53 applyBasicCuts = True,
55 src = '.oO[TrackCollection]Oo.',
56 trackQualities = ["highPurity"]
59 ###############################################################
60 ## Quality filters on the event (REAL DATA - FIRST COLLISIONS DEC09 ONLY!)
61 ## see https://twiki.cern.ch/twiki/bin/viewauth/CMS/TRKPromptFeedBack#Event_and_track_selection_recipe
62 ##NOT in PATH yet, to be commented in, if necessay
64 #########################################################
65 ############################################################################
66 ##Produce Primary Vertex Collection needed for later analysis
67 ############################################################################
68 #process.load('TrackingTools/TransientTrack/TransientTrackBuilder_cfi')
69 #process.load("RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi")
70 #process.offlinePrimaryVertices.TrackLabel = 'ALCARECOTkAlMinBias'
72 process.oneGoodVertexFilter = cms.EDFilter("VertexSelector",
73 src = cms.InputTag("offlinePrimaryVertices"),
74 cut = cms.string("!isFake && ndof > 4 && abs(z) <= 15 && position.Rho <= 2"), # tracksSize() > 3 for the older cut
75 filter = cms.bool(True), # otherwise it won't filter the events, just produce an empty vertex collection.
80 process.FilterGoodEvents=cms.Sequence(#process.HighPuritySelector*
81 process.oneGoodVertexFilter)
84 process.noScraping= cms.EDFilter("FilterOutScraping",
85 src=cms.InputTag("ALCARECOTkAlMinBias"),
86 applyfilter = cms.untracked.bool(True),
87 debugOn = cms.untracked.bool(False), ## Or 'True' to get some per-event info
88 numtrack = cms.untracked.uint32(10),
89 thresh = cms.untracked.double(0.25)
91 ####################################
98 # TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
99 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
100 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
102 #-- Alignment Track Selection
103 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
104 process.AlignmentTrackSelector.src = 'HitFilteredTracks'
105 process.AlignmentTrackSelector.filter = True
107 .oO[TrackSelectionTemplate]Oo.
109 #now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
110 import RecoTracker.TrackProducer.CTFFinalFitWithMaterial_cff
111 process.HitFilteredTracks = RecoTracker.TrackProducer.CTFFinalFitWithMaterial_cff.ctfWithMaterialTracks.clone(
112 src = 'TrackerTrackHitFilter',
113 NavigationSchool = "",
115 ### TrajectoryInEvent = True,
116 TTRHBuilder = "WithAngleAndTemplate"
120 ## Load and Configure TrackRefitter1
123 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
126 # parameters for TrackRefitter
127 #process.load("RecoTracker.TrackProducer.RefitterWithMaterial_cff")
128 import RecoTracker.TrackProducer.TrackRefitters_cff
129 process.TrackRefitter1 = process.TrackRefitter.clone(
130 src = 'HighPuritySelector',
131 TrajectoryInEvent = True,
132 TTRHBuilder = "WithAngleAndTemplate",
133 NavigationSchool = ""
135 process.TrackRefitter2 = process.TrackRefitter1.clone(
136 # src = 'HitFilteredTracks')
137 src = 'AlignmentTrackSelector'
144 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
147 ## GlobalTag Conditions (if needed)
149 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
150 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
153 .oO[LorentzAngleTemplate]Oo.
158 process.load("Configuration.Geometry.GeometryDB_cff")
163 process.load("Configuration/StandardSequences/.oO[magneticField]Oo._cff")
167 ## to apply misalignments
168 #TrackerDigiGeometryESModule.applyAlignment = True
171 ## Load and Configure OfflineValidation and Output File
173 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
174 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'TrackRefitter2'
175 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'TrackRefitter2'
176 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = .oO[offlineModuleLevelHistsTransient]Oo.
177 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelProfiles = .oO[offlineModuleLevelProfiles]Oo.
178 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..stripYResiduals = .oO[stripYResiduals]Oo.
179 .oO[offlineValidationFileOutput]Oo.
184 process.p = cms.Path(
185 #process.triggerSelection*
186 process.offlineBeamSpot*process.HighPuritySelector*process.TrackRefitter1*process.TrackerTrackHitFilter*process.HitFilteredTracks
187 *process.AlignmentTrackSelector*process.TrackRefitter2*process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo.)
194 mergeOfflineParJobsTemplate=
"""
195 #include "Alignment/OfflineValidation/scripts/merge_TrackerOfflineValidation.C"
197 int TkAlOfflineJobsMerge(TString pars, TString outFile)
199 // load framework lite just to find the CMSSW libs...
200 gSystem->Load("libFWCoreFWLite");
201 FWLiteEnabler::enable();
203 return hadd(pars, outFile);
210 offlineFileOutputTemplate =
"""
211 process.TFileService.fileName = '.oO[outputFile]Oo.'
216 offlineDqmFileOutputTemplate =
"""
217 process.TrackerOfflineValidationSummary.oO[offlineValidationMode]Oo..removeModuleLevelHists = .oO[offlineModuleLevelHistsTransient]Oo.
218 process.DqmSaverTkAl.workflow = '.oO[workflow]Oo.'
219 process.DqmSaverTkAl.dirName = '.oO[workdir]Oo./.'
220 process.DqmSaverTkAl.forceRunNumber = .oO[firstRunNumber]Oo.
231 LorentzAngleTemplate =
"#use lorentz angle from global tag"
236 TrackSelectionTemplate =
"""
237 #####default for MC tracks with now further corrections etc.
239 process.AlignmentTrackSelector.applyBasicCuts = True
240 # Note that pMin is overridden and set to zero in
241 # the offlineTemplate0T
242 process.AlignmentTrackSelector.pMin = 3
243 process.AlignmentTrackSelector.pMax = 9999.
244 process.AlignmentTrackSelector.ptMin = 0.65
245 process.AlignmentTrackSelector.ptMax = 9999.
246 process.AlignmentTrackSelector.etaMin = -999.
247 process.AlignmentTrackSelector.etaMax = 999.
248 process.AlignmentTrackSelector.nHitMin = 8
249 process.AlignmentTrackSelector.nHitMin2D = 2
250 process.AlignmentTrackSelector.chi2nMax = 999.
251 process.AlignmentTrackSelector.applyMultiplicityFilter = False
252 process.AlignmentTrackSelector.maxMultiplicity = 1
253 process.AlignmentTrackSelector.applyNHighestPt = False
254 process.AlignmentTrackSelector.nHighestPt = 1
255 process.AlignmentTrackSelector.seedOnlyFrom = 0
256 process.AlignmentTrackSelector.applyIsolationCut = False
257 process.AlignmentTrackSelector.minHitIsolation = 0.8
258 process.AlignmentTrackSelector.applyChargeCheck = False
259 process.AlignmentTrackSelector.minHitChargeStrip = 50.
260 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
261 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
264 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
265 process.TrackerTrackHitFilter.minimumHits = 8
266 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
267 process.TrackerTrackHitFilter.detsToIgnore = []
268 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
269 process.TrackerTrackHitFilter.stripAllInvalidHits = False
270 process.TrackerTrackHitFilter.rejectBadStoNHits = True
271 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 12.0")
272 process.TrackerTrackHitFilter.rejectLowAngleHits= True
273 process.TrackerTrackHitFilter.TrackAngleCut= 0.17 # in rads, starting from the module surface
274 process.TrackerTrackHitFilter.usePixelQualityFlag= True
279 #for MC only trigger bit 40 is simulated
280 #no triger on bunch crossing bit 0
283 # process.triggerSelection=cms.Sequence(process.bit40)