Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:33:48

0001 #import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("TkVal")
0004 process.load("FWCore.MessageService.MessageLogger_cfi")
0005 
0006 ### standard includes
0007 process.load('Configuration/StandardSequences/GeometryPilot2_cff')
0008 process.load("Configuration.StandardSequences.RawToDigi_cff")
0009 process.load("Configuration.EventContent.EventContent_cff")
0010 process.load("Configuration.StandardSequences.Reconstruction_cff")
0011 process.load("Configuration.StandardSequences.MagneticField_cff")
0012 process.load("SimGeneral.MixingModule.mixNoPU_cfi")
0013 
0014 ### conditions
0015 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0016 #process.GlobalTag.globaltag = 'STARTUP_V1::All'
0017 process.GlobalTag.globaltag = 'GLOBALTAG::All'
0018 
0019 
0020 process.maxEvents = cms.untracked.PSet(
0021     input = cms.untracked.int32(NEVENT)
0022 )
0023 process.source = source
0024 
0025 ### validation-specific includes
0026 #process.load("SimTracker.TrackAssociatorProducers.trackAssociatorByChi2_cfi")
0027 process.load("SimTracker.TrackAssociatorProducers.trackAssociatorByHits_cfi")
0028 process.load("Validation.RecoTrack.cuts_cff")
0029 process.load("Validation.RecoMuon.MuonTrackValidator_cff")
0030 process.load("SimGeneral.TrackingAnalysis.trackingParticles_cfi")
0031 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0032 
0033 process.load("Validation.RecoMuon.muonValidation_cff")
0034 process.load("Validation.RecoMuon.muonValidationHLT_cff")
0035 
0036 
0037 process.endjob_step = cms.Path(process.endOfProcess)
0038 
0039 process.load("DQMServices.Components.EDMtoMEConverter_cff")
0040 
0041 process.load("Validation.Configuration.postValidation_cff")
0042 process.load("HLTriggerOffline.Muon.HLTMuonPostVal_cff")
0043 
0044 
0045 process.cutsRecoTracks.algorithm = cms.string('ALGORITHM')
0046 process.cutsRecoTracks.quality = cms.string('QUALITY')
0047 
0048 process.muonTrackValidator.associators = ['trackAssociatorByHits']
0049 
0050 process.muonTrackValidator.label = ['TRACKS']
0051 if (process.muonTrackValidator.label[0] == 'generalTracks'):
0052     process.muonTrackValidator.UseAssociators = cms.bool(True)
0053 else:
0054     process.muonTrackValidator.UseAssociators = cms.bool(True)
0055 ######
0056 
0057 
0058 #process.source = cms.Source("PoolSource",
0059 #    fileNames = cms.untracked.vstring (
0060 #    FILENAMES
0061 #    )
0062 #)
0063 #process.extend("RelValTTbar_cff")
0064 
0065 process.options = cms.untracked.PSet(
0066     wantSummary = cms.untracked.bool(True)
0067 )
0068 
0069 
0070 process.digi2track = cms.Sequence(process.siPixelDigis
0071                                   *process.SiStripRawToDigis
0072                                   *(process.trackerlocalreco
0073                                     +process.muonlocalreco)
0074                                   *(process.ckftracks
0075                                     *process.muonreco_plus_isolation)
0076                                   *process.cutsRecoTracks
0077                                   ##process.cutsTPEffic*process.cutsTPFake* these modules are now useless
0078                                   *process.trackAssociatorByHits
0079                                   *process.muonTrackValidator
0080                                   *process.recoMuonValidation
0081                                    *process.recoMuonValidationHLT_seq
0082 #                                  *process.endOfProcess
0083                                   )
0084 #redo also tracking particles
0085 process.digi2track_and_TP = cms.Sequence(process.mix
0086                                          *process.trackingParticles
0087                                          *process.siPixelDigis
0088                                          *process.SiStripRawToDigis
0089                                          *(process.trackerlocalreco
0090                                            +process.muonlocalreco)
0091                                          *(process.ckftracks
0092                                            *process.muonreco_plus_isolation)
0093                                          *process.cutsRecoTracks
0094                                          ##process.cutsTPEffic*process.cutsTPFake* these modules are now useless
0095                                          *process.trackAssociatorByHits
0096                                          *process.muonTrackValidator
0097                                          *process.recoMuonValidation
0098                                          *process.recoMuonValidationHLT_seq
0099 #                                         *process.endOfProcess
0100                                          )
0101 
0102 process.re_tracking = cms.Sequence(process.siPixelRecHits
0103                                    *process.siStripMatchedRecHits
0104                                    *(process.ckftracks
0105                                      *process.muonreco_plus_isolation)
0106                                    *process.cutsRecoTracks
0107                                    ##process.cutsTPEffic*process.cutsTPFake* these modules are now useless
0108                                    *process.trackAssociatorByHits
0109                                    *process.muonTrackValidator
0110                                    *process.recoMuonValidation
0111                                    *process.recoMuonValidationHLT_seq
0112 #                                   *process.endOfProcess
0113                                    )
0114 
0115 process.re_tracking_and_TP = cms.Sequence(process.mix
0116                                           *process.trackingParticles
0117                                           *process.siPixelRecHits
0118                                           *process.siStripMatchedRecHits
0119                                           *(process.ckftracks
0120                                             *process.muonreco_plus_isolation)
0121                                           *process.cutsRecoTracks
0122                                           ##process.cutsTPEffic*process.cutsTPFake* these modules are now useless
0123                                           *process.trackAssociatorByHits
0124                                           *process.muonTrackValidator
0125                                           *process.recoMuonValidation
0126                                           *process.recoMuonValidationHLT_seq
0127 #                                          *process.endOfProcess
0128                                           )
0129 
0130 if (process.muonTrackValidator.label[0] == 'generalTracks'):
0131     process.only_validation = cms.Sequence(##process.cutsTPEffic*process.cutsTPFake* these modules are now useless
0132                                            process.trackAssociatorByHits
0133                                            *process.muonTrackValidator
0134                                            *process.recoMuonValidation
0135                                            *process.recoMuonValidationHLT_seq
0136 #                                           *process.endOfProcess
0137                                            )
0138 else:
0139     process.only_validation = cms.Sequence(process.cutsRecoTracks
0140                                            ##process.cutsTPEffic*process.cutsTPFake* these modules are now useless
0141                                            *process.trackAssociatorByHits
0142                                            *process.muonTrackValidator
0143                                            *process.recoMuonValidation
0144                                            *process.recoMuonValidationHLT_seq
0145 #                                           *process.endOfProcess
0146                                            )
0147     
0148 if (process.muonTrackValidator.label[0] == 'generalTracks'):
0149     process.only_validation_and_TP = cms.Sequence(process.mix
0150                                                   *process.trackingParticles
0151                                                   *process.trackAssociatorByHits
0152                                                   *process.muonTrackValidator
0153                                                   *process.recoMuonValidation
0154                                                   *process.recoMuonValidationHLT_seq
0155 #                                                  *process.endOfProcess
0156                                                   )
0157 else:
0158     process.only_validation_and_TP = cms.Sequence(process.mix
0159                                                   *process.trackingParticles
0160                                                   *process.cutsRecoTracks
0161                                                   *process.trackAssociatorByHits
0162                                                   *process.muonTrackValidator
0163                                                   *process.recoMuonValidation
0164                                                   *process.recoMuonValidationHLT_seq
0165 #                                                  *process.endOfProcess
0166                                                   )
0167 
0168 ### customized versoin of the OutputModule
0169 ### it save the mininal information which is necessary to perform tracking validation (tracks, tracking particles, 
0170 ### digiSimLink,etc..)
0171 
0172 process.customEventContent = cms.PSet(
0173      outputCommands = cms.untracked.vstring('drop *')
0174  )
0175 
0176 process.customEventContent.outputCommands.extend(process.RecoTrackerRECO.outputCommands)
0177 process.customEventContent.outputCommands.extend(process.BeamSpotRECO.outputCommands)
0178 process.customEventContent.outputCommands.extend(process.SimGeneralFEVTDEBUG.outputCommands)
0179 process.customEventContent.outputCommands.extend(process.RecoLocalTrackerRECO.outputCommands)
0180 process.customEventContent.outputCommands.append('keep *_simSiStripDigis_*_*')
0181 process.customEventContent.outputCommands.append('keep *_simSiPixelDigis_*_*')
0182 process.customEventContent.outputCommands.append('drop SiStripDigiedmDetSetVector_simSiStripDigis_*_*')
0183 process.customEventContent.outputCommands.append('drop PixelDigiedmDetSetVector_simSiPixelDigis_*_*')
0184 
0185 
0186 
0187 process.OUTPUT = cms.OutputModule("PoolOutputModule",
0188                                   process.customEventContent,
0189                                   fileName = cms.untracked.string('fullOutput.SAMPLE.root')
0190                                   )
0191 
0192 process.VALOUTPUT = cms.OutputModule("PoolOutputModule",
0193                                      outputCommands = cms.untracked.vstring('drop *', "keep *_MEtoEDMConverter_*_*"),
0194 
0195                                      fileName = cms.untracked.string('output.SAMPLE.root')
0196 )
0197 
0198 ValidationSequence="SEQUENCE"
0199 
0200 if ValidationSequence=="harvesting":
0201 
0202     process.dqmSaver.convention = 'Offline'
0203 
0204     process.dqmSaver.saveByRun = cms.untracked.int32(-1)
0205     process.dqmSaver.saveAtJobEnd = cms.untracked.bool(True)
0206     process.dqmSaver.forceRunNumber = cms.untracked.int32(1)
0207 
0208 
0209     process.dqmSaver.workflow = "/GLOBALTAG/SAMPLE/Validation"
0210     process.DQMStore.verbose=3
0211 
0212     process.options = cms.untracked.PSet(
0213         fileMode = cms.untracked.string('FULLMERGE')
0214         )
0215     for filter in (getattr(process,f) for f in process.filters_()):
0216         if hasattr(filter,"outputFile"):
0217             filter.outputFile=""
0218 
0219 process.harvesting= cms.Sequence(
0220     process.EDMtoMEConverter
0221     *process.postValidation
0222     +process.HLTMuonPostVal
0223     *process.dqmSaver)
0224 
0225 
0226 
0227 
0228 ### final path and endPath
0229 process.p = cms.Path(process.SEQUENCE)
0230 if ValidationSequence!="harvesting":
0231     process.outpath = cms.EndPath(process.VALOUTPUT)
0232 
0233 if ValidationSequence!="harvesting":
0234     process.schedule = cms.Schedule(
0235         process.p,
0236         process.endjob_step,
0237         process.outpath
0238         )
0239 else:
0240     process.schedule = cms.Schedule(
0241         process.p
0242         )
0243