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