From e0580a0ea4786a944b8caa6e848888156741122d Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Wed, 16 Oct 2019 19:56:42 +0200 Subject: [PATCH 01/16] Remaining config files needed to implement PPS simulation into cmssw (and adapting PPSPixelDigiProducer to FileInPath standard;removing old test config) --- .../StandardSequences/python/DigiToRaw_cff.py | 5 +- .../StandardSequences/python/Digi_cff.py | 8 +- .../python/ctppsDigiToRaw_cff.py | 17 ++ .../python/rawDataCollector_cfi.py | 3 + IOMC/RandomEngine/python/IOMC_cff.py | 10 + .../MixingModule/python/mixNoPU_PPS_cfi.py | 58 ++++ .../MixingModule/python/mixObjects_cfi.py | 9 + SimPPS/Configuration/python/SimPPS_cff.py | 24 ++ .../test/gluglu_step1_GEN_SIM_2017.py | 146 ++++++++++ .../test/gluglu_step2_DIGI_DIGI2RAW_2017.py | 109 ++++++++ .../gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py | 128 +++++++++ .../test/pg_step1_GEN_SIM_2017.py | 112 ++++++++ .../test/pg_step2_DIGI_DIGI2RAW_2017.py | 138 ++++++++++ .../test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py | 109 ++++++++ .../src/RPixChargeShare.cc | 4 +- .../test/FromGun2DigiAnal_.py | 258 ------------------ SimPPS/PPSPixelDigiProducer/test/testDigi.py | 138 ++++++++++ SimPPS/PPSPixelDigiProducer/test/testDigi3.py | 58 ---- 18 files changed, 1012 insertions(+), 322 deletions(-) create mode 100644 EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py create mode 100644 SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py create mode 100644 SimPPS/Configuration/python/SimPPS_cff.py create mode 100644 SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py create mode 100644 SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py create mode 100644 SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py create mode 100644 SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py create mode 100644 SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py create mode 100644 SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py delete mode 100644 SimPPS/PPSPixelDigiProducer/test/FromGun2DigiAnal_.py create mode 100644 SimPPS/PPSPixelDigiProducer/test/testDigi.py delete mode 100644 SimPPS/PPSPixelDigiProducer/test/testDigi3.py diff --git a/Configuration/StandardSequences/python/DigiToRaw_cff.py b/Configuration/StandardSequences/python/DigiToRaw_cff.py index 0df921bc98efe..0a0896c59bda9 100644 --- a/Configuration/StandardSequences/python/DigiToRaw_cff.py +++ b/Configuration/StandardSequences/python/DigiToRaw_cff.py @@ -17,8 +17,9 @@ from EventFilter.CastorRawToDigi.CastorDigiToRaw_cfi import * from EventFilter.RawDataCollector.rawDataCollector_cfi import * from L1Trigger.Configuration.L1TDigiToRaw_cff import * +from EventFilter.CTPPSRawToDigi.ctppsDigiToRaw_cff import * -DigiToRawTask = cms.Task(L1TDigiToRawTask, siPixelRawData, SiStripDigiToRaw, ecalPacker, esDigiToRaw, hcalRawDataTask, cscpacker, dtpacker, rpcpacker, castorRawData, rawDataCollector) +DigiToRawTask = cms.Task(L1TDigiToRawTask, siPixelRawData, SiStripDigiToRaw, ecalPacker, esDigiToRaw, hcalRawDataTask, cscpacker, dtpacker, rpcpacker, ctppsRawData, castorRawData, rawDataCollector) DigiToRaw = cms.Sequence(DigiToRawTask) ecalPacker.Label = 'simEcalDigis' @@ -52,4 +53,4 @@ phase2_muon.toReplaceWith(DigiToRawTask, DigiToRawTask.copyAndExclude([rpcpacker])) from Configuration.Eras.Modifier_fastSim_cff import fastSim -fastSim.toReplaceWith(DigiToRawTask, DigiToRawTask.copyAndExclude([siPixelRawData,SiStripDigiToRaw,castorRawData])) +fastSim.toReplaceWith(DigiToRawTask, DigiToRawTask.copyAndExclude([siPixelRawData,SiStripDigiToRaw,castorRawData,ctppsRawData])) diff --git a/Configuration/StandardSequences/python/Digi_cff.py b/Configuration/StandardSequences/python/Digi_cff.py index 2f91db9464322..d36d10f4fba66 100644 --- a/Configuration/StandardSequences/python/Digi_cff.py +++ b/Configuration/StandardSequences/python/Digi_cff.py @@ -20,6 +20,10 @@ # from SimMuon.Configuration.SimMuon_cff import * # +# PPS Digis +# returns sequence "ctppsDigi" +from SimPPS.Configuration.SimPPS_cff import * +# # TrackingParticle Producer is now part of the mixing module, so # it is no longer run here. # @@ -29,7 +33,7 @@ from Configuration.StandardSequences.Generator_cff import * from GeneratorInterface.Core.generatorSmeared_cfi import * -doAllDigiTask = cms.Task(generatorSmeared, calDigiTask, muonDigiTask) +doAllDigiTask = cms.Task(generatorSmeared, calDigiTask, muonDigiTask, ctppsDigiTask) from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2 # premixing stage2 runs muon digis after PreMixingModule (configured in DataMixerPreMix_cff) premix_stage2.toReplaceWith(doAllDigiTask, doAllDigiTask.copyAndExclude([muonDigiTask])) @@ -79,5 +83,3 @@ def _modifyEnableHcalHardcode( theProcess ): from Configuration.Eras.Modifier_hcalHardcodeConditions_cff import hcalHardcodeConditions modifyEnableHcalHardcode_ = hcalHardcodeConditions.makeProcessModifier( _modifyEnableHcalHardcode ) - - diff --git a/EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py b/EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py new file mode 100644 index 0000000000000..23095b2877cc7 --- /dev/null +++ b/EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms +from EventFilter.RawDataCollector.rawDataCollector_cfi import * + +from EventFilter.CTPPSRawToDigi.ctppsPixelRawData_cfi import ctppsPixelRawData +from EventFilter.CTPPSRawToDigi.ctppsTotemRawData_cfi import ctppsTotemRawData + +ctppsRawData = cms.Sequence() + +from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 +ctpps_2016.toReplaceWith(ctppsRawData, cms.Sequence(ctppsTotemRawData)) + +from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017 +ctpps_2017.toReplaceWith(ctppsRawData, cms.Sequence(ctppsTotemRawData*ctppsPixelRawData)) + +from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 +ctpps_2018.toReplaceWith(ctppsRawData, cms.Sequence(ctppsPixelRawData)) + diff --git a/EventFilter/RawDataCollector/python/rawDataCollector_cfi.py b/EventFilter/RawDataCollector/python/rawDataCollector_cfi.py index 173d1eca02cfa..ee08036eff0c9 100644 --- a/EventFilter/RawDataCollector/python/rawDataCollector_cfi.py +++ b/EventFilter/RawDataCollector/python/rawDataCollector_cfi.py @@ -34,3 +34,6 @@ from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM run3_GEM.toModify( rawDataCollector.RawCollectionList, func = lambda list: list.append(cms.InputTag("gemPacker")) ) + +from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 +ctpps_2016.toModify(rawDataCollector.RawCollectionList, func = lambda list: list.extend([cms.InputTag("ctppsTotemRawData"),cms.InputTag("ctppsPixelRawData")]) ) diff --git a/IOMC/RandomEngine/python/IOMC_cff.py b/IOMC/RandomEngine/python/IOMC_cff.py index 5d3dd8101658b..5d85e86be585c 100644 --- a/IOMC/RandomEngine/python/IOMC_cff.py +++ b/IOMC/RandomEngine/python/IOMC_cff.py @@ -148,6 +148,16 @@ simBeamSpotFilter = cms.PSet( initialSeed = cms.untracked.uint32(87654321), engineName = FullSimEngine + ), + + RPixDetDigitizer = cms.PSet( + initialSeed = cms.untracked.uint32(137137), + engineName = FullSimEngine + ), + + RPSiDetDigitizer = cms.PSet( + initialSeed = cms.untracked.uint32(137137), + engineName = FullSimEngine ) # to save the status of the last event (useful for crashes) ,saveFileName = cms.untracked.string('') diff --git a/SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py b/SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py new file mode 100644 index 0000000000000..34520a95aca9b --- /dev/null +++ b/SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py @@ -0,0 +1,58 @@ +import FWCore.ParameterSet.Config as cms + +# this is a minimum configuration of the Mixing module, +# to run it in the zero-pileup mode +# + +from SimGeneral.MixingModule.mixObjects_cfi import * +from SimGeneral.MixingModule.pixelDigitizer_cfi import * +from SimGeneral.MixingModule.stripDigitizer_cfi import * +from SimGeneral.MixingModule.ecalDigitizer_cfi import * +from SimGeneral.MixingModule.hcalDigitizer_cfi import * +from SimGeneral.MixingModule.castorDigitizer_cfi import * +from SimGeneral.MixingModule.trackingTruthProducer_cfi import * +from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import hgceeDigitizer, hgchebackDigitizer, hgchefrontDigitizer, HGCAL_noise_fC, HGCAL_noise_heback, HGCAL_chargeCollectionEfficiencies, HGCAL_noises + +import FWCore.ParameterSet.Config as cms + +mix = cms.EDProducer("MixingModule", + digitizers = cms.PSet(), + LabelPlayback = cms.string(''), + maxBunch = cms.int32(3), + minBunch = cms.int32(-5), ## in terms of 25 ns + + bunchspace = cms.int32(25), + mixProdStep1 = cms.bool(False), + mixProdStep2 = cms.bool(False), + + playback = cms.untracked.bool(False), + useCurrentProcessOnly = cms.bool(False), + mixObjects = cms.PSet( + mixCH = cms.PSet( + mixCaloHits + ), + mixTracks = cms.PSet( + mixSimTracks + ) + , + mixVertices = cms.PSet( + mixSimVertices + ), + mixSH = cms.PSet( + mixSimHits + ), + mixHepMC = cms.PSet( + mixHepMCProducts + ) + ) +) +mix.mixObjects.mixSH.crossingFrames = cms.untracked.vstring('MuonCSCHits', +'MuonDTHits', +'MuonRPCHits', +'TotemHitsRP', +'CTPPSPixelHits') + +mix.mixObjects.mixSH.input = mix.mixObjects.mixSH.input + [ cms.InputTag("g4SimHits","TotemHitsRP"),cms.InputTag("g4SimHits","CTPPSPixelHits") ] +mix.mixObjects.mixSH.subdets= mix.mixObjects.mixSH.subdets + [ 'TotemHitsRP' , 'CTPPSPixelHits'] + + diff --git a/SimGeneral/MixingModule/python/mixObjects_cfi.py b/SimGeneral/MixingModule/python/mixObjects_cfi.py index ec097c34f8bf2..ffefadcf140d9 100644 --- a/SimGeneral/MixingModule/python/mixObjects_cfi.py +++ b/SimGeneral/MixingModule/python/mixObjects_cfi.py @@ -294,3 +294,12 @@ crossingFrames = theMixObjects.mixSH.crossingFrames + [ 'FastTimerHitsBarrel','FastTimerHitsEndcap' ] ) ) + +from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 +ctpps_2016.toModify( theMixObjects, + mixSH = dict( + input = theMixObjects.mixSH.input + [ cms.InputTag("g4SimHits","TotemHitsRP"),cms.InputTag("g4SimHits","CTPPSPixelHits") ], + subdets = theMixObjects.mixSH.subdets + [ 'TotemHitsRP', 'CTPPSPixelHits' ], + crossingFrames = theMixObjects.mixSH.crossingFrames + [ 'TotemHitsRP' , 'CTPPSPixelHits'] + ) +) diff --git a/SimPPS/Configuration/python/SimPPS_cff.py b/SimPPS/Configuration/python/SimPPS_cff.py new file mode 100644 index 0000000000000..0294aa71cb348 --- /dev/null +++ b/SimPPS/Configuration/python/SimPPS_cff.py @@ -0,0 +1,24 @@ +import FWCore.ParameterSet.Config as cms + +# PPS Digitization +from SimPPS.PPSPixelDigiProducer.RPixDetDigitizer_cfi import * +from SimPPS.RPDigiProducer.RPSiDetDigitizer_cfi import * +RPixDetDigitizerTask=cms.Task(RPixDetDigitizer) +RPSiDetDigitizerTask=cms.Task(RPSiDetDigitizer) + +ctppsDigiTask = cms.Task() +ctppsDigi = cms.Sequence(ctppsDigiTask) + +# add PPS 2016 digi modules +from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 +ctpps_2016.toReplaceWith( ctppsDigiTask, RPSiDetDigitizerTask) + +# add PPS 2017 digi modules +from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017 +ctpps_2017Task = cms.Task(RPixDetDigitizer,RPSiDetDigitizer) +ctpps_2017.toReplaceWith(ctppsDigiTask, ctpps_2017Task) + +# add PPS 2018 digi modules +from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 +ctpps_2018.toReplaceWith(ctppsDigiTask, RPixDetDigitizerTask) + diff --git a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py new file mode 100644 index 0000000000000..080da3f6c8cef --- /dev/null +++ b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py @@ -0,0 +1,146 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: GluGluTo2Jets_M_100_7TeV_exhume_cff.py --mc --eventcontent FEVTDEBUG --datatier GEN-SIM --conditions 80X_mcRun2_asymptotic_2016_v2 --step GEN,SIM --era Run2_25ns --geometry Extended2017dev --processName=CTPPS --no_exec +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('SIM',eras.Run2_2017) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic25ns13TeVEarly2017Collision_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.load('SimG4Core.Application.g4SimHits_cfi') +process.g4SimHits.Physics.DefaultCutValue = 100. +process.g4SimHits.UseMagneticField = False +process.g4SimHits.Generator.ApplyPCuts = False +process.g4SimHits.Generator.ApplyPhiCuts = False +process.g4SimHits.Generator.ApplyEtaCuts = False +process.g4SimHits.Generator.HepMCProductLabel = 'LHCTransport' +process.g4SimHits.Generator.MinEtaCut = -13.0 +process.g4SimHits.Generator.MaxEtaCut = 13.0 +process.g4SimHits.Generator.Verbosity = 0 +process.g4SimHits.Generator.EtaCutForHector = 7.0 + +process.g4SimHits.G4TrackingManagerVerbosity = cms.untracked.int32(3) +process.g4SimHits.SteppingAction.MaxTrackTime = cms.double(2000.0) +process.g4SimHits.StackingAction.MaxTrackTime = cms.double(2000.0) + +process.common_maximum_timex = cms.PSet( # need to be localy redefined + MaxTrackTime = cms.double(2000.0), # need to be localy redefined + MaxTimeNames = cms.vstring('ZDCRegion'), # need to be localy redefined + MaxTrackTimes = cms.vdouble(10000.0), # need to be localy redefined + DeadRegions = cms.vstring() +) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(100) +) + +# Input source +process.source = cms.Source("EmptySource") + +process.options = cms.untracked.PSet( +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('GluGluTo2Jets_M_100_7TeV_exhume_cff.py nevts:1'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('generation_step') + ), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('GluGlu_GEN_SIM_2017.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands, + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +process.genstepfilter.triggerConditions=cms.vstring("generation_step") + +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') + +process.load('PhysicsTools.HepMCCandAlgos.genParticles_cfi') +process.generator = cms.EDFilter("ExhumeGeneratorFilter", + ExhumeParameters = cms.PSet( + AlphaEw = cms.double(0.0072974), + B = cms.double(4.0), + BottomMass = cms.double(4.6), + CharmMass = cms.double(1.42), + HiggsMass = cms.double(120.0), + HiggsVev = cms.double(246.0), + LambdaQCD = cms.double(80.0), + MinQt2 = cms.double(0.64), + MuonMass = cms.double(0.1057), + PDF = cms.double(11000), + Rg = cms.double(1.2), + StrangeMass = cms.double(0.19), + Survive = cms.double(0.03), + TauMass = cms.double(1.77), + TopMass = cms.double(175.0), + WMass = cms.double(80.33), + ZMass = cms.double(91.187) + ), + ExhumeProcess = cms.PSet( + MassRangeHigh = cms.double(2000.0), + MassRangeLow = cms.double(300.0), + ProcessType = cms.string('GG'), + ThetaMin = cms.double(0.3) + ), + PythiaParameters = cms.PSet( + parameterSets = cms.vstring() + ), + comEnergy = cms.double(13000.0), + maxEventsToPrint = cms.untracked.int32(2), + pythiaHepMCVerbosity = cms.untracked.bool(False), + pythiaPylistVerbosity = cms.untracked.int32(1) +) + +process.ProductionFilterSequence = cms.Sequence(process.generator) + +# Path and EndPath definitions +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) +process.g4Simhits_step = cms.Path(process.g4SimHits) + +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) + + +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.g4Simhits_step,process.endjob_step,process.FEVTDEBUGoutput_step) + +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + + +from SimPPS.PPSSimTrackProducer.SimTrackProducerForFullSim_cff import customise +process = customise(process) diff --git a/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py b/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py new file mode 100644 index 0000000000000..ccbe225096df7 --- /dev/null +++ b/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py @@ -0,0 +1,109 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: step2 --filein=file:GluGluTo2Jets_M_300_2000_13TeV_exhume_cff_py_GEN_SIM_HECTOR_CTPPS.root --conditions auto:run2_mc -s DIGI:pdigi_valid,DIGI2RAW --datatier GEN-SIM-DIGI-RAW -n 10 --era Run2_2016 --eventcontent FEVTDEBUG --no_exec +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('DIGI2RAW',eras.Run2_2017, eras.pps_2017) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.Digi_cff') +process.load('Configuration.StandardSequences.SimL1Emulator_cff') +process.load('Configuration.StandardSequences.DigiToRaw_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") +process.load('CalibPPS.ESProducers.CTPPSPixelDAQMappingESSourceXML_cfi') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.load("IOMC.RandomEngine.IOMC_cff") +process.RandomNumberGeneratorService.generator.initialSeed = 456789 +process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 +process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 + + +# Input source +process.source = cms.Source("PoolSource", + dropDescendantsOfDroppedBranches = cms.untracked.bool(False), + fileNames = cms.untracked.vstring('file:GluGlu_GEN_SIM_2017.root'), + inputCommands = cms.untracked.vstring('keep *'), + secondaryFileNames = cms.untracked.vstring() +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step2 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('GluGlu_DIGI_DIGI2RAW_2017.root'), + outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands+['keep *_ctpps*_*_*',"keep *_*RP*_*_*",'keep *_LHCTransport_*_*'], + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') +process.GlobalTag.toGet = cms.VPSet( + cms.PSet( + record = cms.string('CTPPSPixelGainCalibrationsRcd'), + tag = cms.string("CTPPSPixelGainCalibrations_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelAnalysisMaskRcd'), + tag = cms.string("CTPPSPixelAnalysisMask_mc"), + label = cms.untracked.string(""), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("CTPPSPixelDAQMapping_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ) +) + +process.load("CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi") +process.totemDAQMappingESSourceXML.configuration = cms.VPSet( + cms.PSet( + validityRange = cms.EventRange("1:min - 999999999:max"), + mappingFileNames = cms.vstring("CondFormats/CTPPSReadoutObjects/xml/mapping_tracking_strip_2017.xml"), + maskFileNames = cms.vstring() + ) +) + + +# Path and EndPath definitions +process.digitisation_step = cms.Path(process.pdigi) +process.L1simulation_step = cms.Path(process.SimL1Emulator) +process.digi2raw_step = cms.Path(process.DigiToRaw) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGHLToutput_step = cms.EndPath(process.FEVTDEBUGHLToutput) + +# Schedule definition +process.schedule = cms.Schedule(process.digitisation_step,process.L1simulation_step,process.digi2raw_step) +process.schedule.extend([process.endjob_step,process.FEVTDEBUGHLToutput_step]) +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) diff --git a/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py b/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py new file mode 100644 index 0000000000000..8653e4358e425 --- /dev/null +++ b/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py @@ -0,0 +1,128 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: step3 --conditions auto:phase1_2017_realistic -n 10 --era Run2_2017 --eventcontent RECOSIM,MINIAODSIM,DQM --runUnscheduled -s RAW2DIGI,L1Reco,RECO,EI,PAT,VALIDATION:@standardValidation+@miniAODValidation,DQM:@standardDQM+@miniAODDQM --datatier GEN-SIM-RECO,MINIAODSIM,DQMIO --geometry DB:Extended --filein file:step2.root --fileout file:step3.root +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('RECO',eras.Run2_2017,eras.pps_2017) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.RawToDigi_cff') +process.load('Configuration.StandardSequences.L1Reco_cff') +process.load('Configuration.StandardSequences.Reconstruction_cff') +process.load('CommonTools.ParticleFlow.EITopPAG_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('file:GluGlu_DIGI_DIGI2RAW_2017.root'), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step3 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.output = cms.OutputModule("PoolOutputModule", + fileName = cms.untracked.string('file:GluGlu_RAW2DIGI_L1Reco_RECO_2017.root'), + outputCommands = cms.untracked.vstring("drop *","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*',"keep *_ak4*_*_*") +) + +# Additional output definition + +# Other statements +process.mix.playback = True +process.mix.digitizers = cms.PSet() +for a in process.aliases: delattr(process, a) +process.RandomNumberGeneratorService.restoreStateLabel=cms.untracked.string("randomEngineStateProducer") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') +process.GlobalTag.toGet = cms.VPSet( + cms.PSet( + record = cms.string('CTPPSPixelGainCalibrationsRcd'), + tag = cms.string("CTPPSPixelGainCalibrations_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelAnalysisMaskRcd'), + tag = cms.string("CTPPSPixelAnalysisMask_mc"), + label = cms.untracked.string(""), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("CTPPSPixelDAQMapping_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ) +) + +# modify Totem 2017 mapping +process.load('CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi') +process.totemDAQMappingESSourceXML.configuration = cms.VPSet( + cms.PSet( + validityRange = cms.EventRange("1:min - 999999999:max"), + mappingFileNames = cms.vstring("CondFormats/CTPPSReadoutObjects/xml/mapping_tracking_strip_2017.xml"), + maskFileNames = cms.vstring() + ) +) + +# do not make testID for simulation - keeping the frame +from EventFilter.CTPPSRawToDigi.totemRPRawToDigi_cfi import totemRPRawToDigi +totemRPRawToDigi.RawToDigi.testID = cms.uint32(1) + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +process.L1Reco_step = cms.Path(process.L1Reco) +process.reconstruction_step = cms.Path(process.reconstruction) +process.output_step = cms.EndPath(process.output) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.reconstruction_step,process.output_step) + +# customisation of the process. + +# Automatic addition of the customisation function from SimGeneral.MixingModule.fullMixCustomize_cff +from SimGeneral.MixingModule.fullMixCustomize_cff import setCrossingFrameOn + +#call to customisation function setCrossingFrameOn imported from SimGeneral.MixingModule.fullMixCustomize_cff +process = setCrossingFrameOn(process) + +# End of customisation functions +#do not add changes to your config after this point (unless you know what you are doing) +from FWCore.ParameterSet.Utilities import convertToUnscheduled +process=convertToUnscheduled(process) + +# customisation of the process. + +# End of customisation functions + +# Customisation from command line + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py new file mode 100644 index 0000000000000..01d7f844f67f6 --- /dev/null +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py @@ -0,0 +1,112 @@ +import FWCore.ParameterSet.Config as cms + +import math + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('SIM',eras.Run2_2017,eras.ctpps_2017) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic25ns13TeVEarly2017Collision_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +############### using only CTPPS geometry +from Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi import XMLIdealGeometryESSource_CTPPS +process.XMLIdealGeometryESSource = XMLIdealGeometryESSource_CTPPS.clone() + +process.load("SimG4Core.Application.g4SimHits_cfi") +process.g4SimHits.Generator.ApplyPCuts = False +process.g4SimHits.Generator.ApplyPhiCuts = False +process.g4SimHits.Generator.ApplyEtaCuts = False +process.g4SimHits.Generator.HepMCProductLabel = 'LHCTransport' +process.g4SimHits.Generator.MinEtaCut = -13.0 +process.g4SimHits.Generator.MaxEtaCut = 13.0 +process.g4SimHits.Generator.Verbosity = 0 + +process.g4SimHits.G4TrackingManagerVerbosity = cms.untracked.int32(3) +process.g4SimHits.SteppingAction.MaxTrackTime = cms.double(2000.0) +process.g4SimHits.StackingAction.MaxTrackTime = cms.double(2000.0) + +process.load("IOMC.RandomEngine.IOMC_cff") +process.RandomNumberGeneratorService.generator.initialSeed = 456789 +process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 +process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.RandomNumberGeneratorService.LHCTransport.engineName = cms.untracked.string('TRandom3') + +nEvent_ = 1000 +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(nEvent_) + ) + +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') +process.load('PhysicsTools.HepMCCandAlgos.genParticles_cfi') + +phi_min = -math.pi +phi_max = math.pi +t_min = 0. +t_max = 2. +xi_min = 0.01 +xi_max = 0.3 +ecms = 13000. + +process.generator = cms.EDProducer("RandomtXiGunProducer", + PGunParameters = cms.PSet( + PartID = cms.vint32(2212), + MinPhi = cms.double(phi_min), + MaxPhi = cms.double(phi_max), + ECMS = cms.double(ecms), + Mint = cms.double(t_min), + Maxt = cms.double(t_max), + MinXi = cms.double(xi_min), + MaxXi = cms.double(xi_max) + ), + Verbosity = cms.untracked.int32(0), + psethack = cms.string('single protons'), + FireBackward = cms.bool(True), + FireForward = cms.bool(True), + firstRun = cms.untracked.uint32(1), + ) + +process.source = cms.Source("EmptySource", +) + +process.ProductionFilterSequence = cms.Sequence(process.generator) + +############ +process.o1 = cms.OutputModule("PoolOutputModule", + outputCommands = cms.untracked.vstring('keep *'), + fileName = cms.untracked.string('step1_SIM2017.root') + ) + +process.common_maximum_timex = cms.PSet( # need to be localy redefined + MaxTrackTime = cms.double(2000.0), # need to be localy redefined + MaxTimeNames = cms.vstring('ZDCRegion'), # need to be localy redefined + MaxTrackTimes = cms.vdouble(10000.0), # need to be localy redefined + DeadRegions = cms.vstring() + ) +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) +process.g4Simhits_step = cms.Path(process.g4SimHits) + + +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) + +process.outpath = cms.EndPath(process.o1) + +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.g4Simhits_step,process.outpath) + +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + +from SimPPS.PPSSimTrackProducer.SimTrackProducerForFullSim_cff import customise +process = customise(process) + diff --git a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py new file mode 100644 index 0000000000000..694b02ccf8074 --- /dev/null +++ b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py @@ -0,0 +1,138 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('DIGI2RAW',eras.Run2_2017) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('SimGeneral.MixingModule.mixNoPU_PPS_cfi') +process.load('Configuration.StandardSequences.Digi_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('CalibPPS.ESProducers.CTPPSPixelDAQMappingESSourceXML_cfi') + +process.load('SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi') +############### using only CTPPS geometry +process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) +process.load("IOMC.RandomEngine.IOMC_cff") +process.RandomNumberGeneratorService.generator.initialSeed = 456789 +process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 +process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.RandomNumberGeneratorService.RPixDetDigitizer = cms.PSet(initialSeed =cms.untracked.uint32(137137)) +process.RandomNumberGeneratorService.RPSiDetDigitizer = cms.PSet(initialSeed =cms.untracked.uint32(137137)) + +# Input source +process.source = cms.Source("PoolSource", + dropDescendantsOfDroppedBranches = cms.untracked.bool(False), + fileNames = cms.untracked.vstring('file:step1_SIM2017.root'), + inputCommands = cms.untracked.vstring('keep *', + 'drop *_genParticles_*_*', + 'drop *_genParticlesForJets_*_*', + 'drop *_kt4GenJets_*_*', + 'drop *_kt6GenJets_*_*', + 'drop *_iterativeCone5GenJets_*_*', + 'drop *_ak4GenJets_*_*', + 'drop *_ak7GenJets_*_*', + 'drop *_ak8GenJets_*_*', + 'drop *_ak4GenJetsNoNu_*_*', + 'drop *_ak8GenJetsNoNu_*_*', + 'drop *_genCandidatesForMET_*_*', + 'drop *_genParticlesForMETAllVisible_*_*', + 'drop *_genMetCalo_*_*', + 'drop *_genMetCaloAndNonPrompt_*_*', + 'drop *_genMetTrue_*_*', + 'drop *_genMetIC5GenJs_*_*'), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + SkipEvent = cms.untracked.vstring('ProductNotFound') +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step2 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('step2_DIGI_DIGI2RAW2017.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands + ['keep *_CTPPS*_*_*',"keep *_*RP*_*_*",'keep *_LHCTransport_*_*'], + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') + +process.GlobalTag.toGet = cms.VPSet( + cms.PSet( + record = cms.string('CTPPSPixelGainCalibrationsRcd'), + tag = cms.string("CTPPSPixelGainCalibrations_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelAnalysisMaskRcd'), + tag = cms.string("CTPPSPixelAnalysisMask_mc"), + label = cms.untracked.string(""), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("CTPPSPixelDAQMapping_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ) +) + +# modify Totem 2017 mapping +process.load('CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi') +process.totemDAQMappingESSourceXML.configuration = cms.VPSet( + cms.PSet( + validityRange = cms.EventRange("1:min - 999999999:max"), + mappingFileNames = cms.vstring("CondFormats/CTPPSReadoutObjects/xml/mapping_tracking_strip_2017.xml"), + maskFileNames = cms.vstring() + ) +) + +process.load("EventFilter.CTPPSRawToDigi.ctppsDigiToRaw_cff") +process.load("EventFilter.RawDataCollector.rawDataCollector_cfi") + +# Path and EndPath definitions +process.mixedigi_step = cms.Path(process.mix*process.RPixDetDigitizer*process.RPSiDetDigitizer) +process.digi2raw_step = cms.Path(process.ctppsTotemRawData*process.ctppsPixelRawData*process.rawDataCollector) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.mixedigi_step,process.digi2raw_step,process.endjob_step,process.FEVTDEBUGoutput_step) +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) + + +# Customisation from command line + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py new file mode 100644 index 0000000000000..5db9566363100 --- /dev/null +++ b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py @@ -0,0 +1,109 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('RECO',eras.Run2_2017) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load("Configuration.EventContent.EventContent_cff") +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.source = cms.Source("EmptyIOVSource", + timetype = cms.string('runnumber'), + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + interval = cms.uint64(1) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('file:step2_DIGI_DIGI2RAW2017.root'), + secondaryFileNames = cms.untracked.vstring() +) + +# Track memory leaks +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",ignoreTotal = cms.untracked.int32(1) ) + +process.options = cms.untracked.PSet( + SkipEvent = cms.untracked.vstring('ProductNotFound') +) + +# Output definition + +process.output = cms.OutputModule("PoolOutputModule", + fileName = cms.untracked.string('step3_RAW2DIGI_RECO2017.root'), + outputCommands = cms.untracked.vstring("drop *","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*') +) + + +# Additional output definition +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') + +process.GlobalTag.toGet = cms.VPSet( + cms.PSet( + record = cms.string('CTPPSPixelGainCalibrationsRcd'), + tag = cms.string("CTPPSPixelGainCalibrations_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelAnalysisMaskRcd'), + tag = cms.string("CTPPSPixelAnalysisMask_mc"), + label = cms.untracked.string(""), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("CTPPSPixelDAQMapping_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ) +) + +# modify Totem 2017 mapping +process.load('CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi') +process.totemDAQMappingESSourceXML.configuration = cms.VPSet( + cms.PSet( + validityRange = cms.EventRange("1:min - 999999999:max"), + mappingFileNames = cms.vstring("CondFormats/CTPPSReadoutObjects/xml/mapping_tracking_strip_2017.xml"), + maskFileNames = cms.vstring() + ) +) + +# modify CTPPS 2017 raw-to-digi modules +process.load('Configuration.StandardSequences.RawToDigi_cff') + +# do not make testID for simulation - keeping the frame +from EventFilter.CTPPSRawToDigi.totemRPRawToDigi_cfi import totemRPRawToDigi +totemRPRawToDigi.RawToDigi.testID = cms.uint32(1) + +from RecoCTPPS.TotemRPLocal.totemRPLocalReconstruction_cff import totemRPLocalReconstruction +process.load('RecoCTPPS.TotemRPLocal.totemRPLocalReconstruction_cff') +from RecoCTPPS.PixelLocal.ctppsPixelLocalReconstruction_cff import ctppsPixelLocalReconstruction +process.load('RecoCTPPS.PixelLocal.ctppsPixelLocalReconstruction_cff') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.ctppsRawToDigi) +process.reco_step = cms.Path(process.totemRPLocalReconstruction*process.ctppsPixelLocalReconstruction) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.output_step = cms.EndPath(process.output) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.reco_step,process.endjob_step,process.output_step) + +# filter all path with the production filter sequence +for path in process.paths: + # getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + getattr(process,path)._seq = getattr(process,path)._seq + diff --git a/SimPPS/PPSPixelDigiProducer/src/RPixChargeShare.cc b/SimPPS/PPSPixelDigiProducer/src/RPixChargeShare.cc index 001b10668d293..3aeda02ff623e 100644 --- a/SimPPS/PPSPixelDigiProducer/src/RPixChargeShare.cc +++ b/SimPPS/PPSPixelDigiProducer/src/RPixChargeShare.cc @@ -1,4 +1,5 @@ #include "SimPPS/PPSPixelDigiProducer/interface/RPixChargeShare.h" +#include "FWCore/ParameterSet/interface/FileInPath.h" #include #include @@ -24,7 +25,8 @@ RPixChargeShare::RPixChargeShare(const edm::ParameterSet ¶ms, uint32_t det_i int yUpper[] = {50, 50, 100, 100}; int ix, iy; for (int i = 0; i < 4; i++) { - std::ifstream fChargeMap(ChargeMapFile2E_[i]); + edm::FileInPath filename(ChargeMapFile2E_[i].c_str()); + std::ifstream fChargeMap(filename.fullPath().c_str()); if (fChargeMap.is_open()) { while (fChargeMap >> xMap >> yMap >> chargeprobcollect) { ix = int((xMap + xUpper[i]) / 5); diff --git a/SimPPS/PPSPixelDigiProducer/test/FromGun2DigiAnal_.py b/SimPPS/PPSPixelDigiProducer/test/FromGun2DigiAnal_.py deleted file mode 100644 index 5df5480215484..0000000000000 --- a/SimPPS/PPSPixelDigiProducer/test/FromGun2DigiAnal_.py +++ /dev/null @@ -1,258 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("TestFlatGun") - -# Specify the maximum events to simulate -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(100) -) - -# Configure the output module (save the result in a file) -process.o1 = cms.OutputModule("PoolOutputModule", - outputCommands = cms.untracked.vstring('keep *','drop *_*mix*_*_*', 'drop *_*_*Muon*_*', 'drop *_*_*Ecal*_*', 'drop *_*_*Hcal*_*', 'drop *_*_*Calo*_*', 'drop *_*_*Castor*_*', 'drop *_*_*FP420SI_*', 'drop *_*_*ZDCHITS_*', 'drop *_*_*BSCHits_*', 'drop *_*_*ChamberHits_*', 'drop *_*_*FibreHits_*', 'drop *_*_*WedgeHits_*','drop Sim*_*_*_*','drop edm*_*_*_*'), - fileName = cms.untracked.string('file:MYtest44_.root') -) -process.outpath = cms.EndPath(process.o1) - -# Configure if you want to detail or simple log information. -# LoggerMax -- detail log info output including: errors.log, warnings.log, infos.log, debugs.log -# LoggerMin -- simple log info output to the standard output (e.g. screen) -#process.load("Configuration.TotemCommon.LoggerMax_cfi") -process.MessageLogger = cms.Service("MessageLogger", - destinations = cms.untracked.vstring('MYwarnings44', - 'MYerrors44', - # 'MYinfos44', - 'MYdebugs44'), - categories = cms.untracked.vstring('ForwardSim', - 'TotemRP'), - debugModules = cms.untracked.vstring('*'), - MYerrors44 = cms.untracked.PSet( - threshold = cms.untracked.string('ERROR') - ), - MYwarnings44 = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING') - ), - # MYinfos44 = cms.untracked.PSet( - # threshold = cms.untracked.string('INFO') - # ), - MYdebugs44 = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - INFO = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - DEBUG = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - TotemRP = cms.untracked.PSet( - limit = cms.untracked.int32(1000000) - ), - ForwardSim = cms.untracked.PSet( - limit = cms.untracked.int32(1000000) - ) - ) -) - -################## STEP 1 - process.generator -process.source = cms.Source("EmptySource") - -# Use random number generator service -process.load("Configuration.TotemCommon.RandomNumbers_cfi") -process.RandomNumberGeneratorService.RPixDetDigitizer = cms.PSet(initialSeed =cms.untracked.uint32(137137)) -# particle generator paramteres -process.load("IOMC.FlatProtonLogKsiLogTGun.Beta90Energy6500GeV_cfi") -process.generator.MinT = cms.untracked.double(-0.25) -process.generator.MaxT = cms.untracked.double(-0.55) -process.generator.MinPhi = cms.untracked.double(-2.099) -process.generator.MaxPhi = cms.untracked.double(-2.099) -process.generator.MinKsi = cms.untracked.double(-0.06) -process.generator.MaxKsi = cms.untracked.double(-0.065) - -process.generator.RightArm = cms.untracked.bool(True) -process.generator.LeftArm = cms.untracked.bool(True) - - -process.generator.Verbosity = cms.untracked.int32(0) -#process.generator.MinT = cms.untracked.double(-0.0001) -#process.generator.MaxT = cms.untracked.double(-20.0) -#process.generator.MinPhi = cms.untracked.double(-3.141592654) -#process.generator.MaxPhi = cms.untracked.double(3.141592654) -#process.generator.MinKsi = cms.untracked.double(-0.0001) -#process.generator.MaxKsi = cms.untracked.double(-0.3) - -################## STEP 2 process.SmearingGenerator - -# declare optics parameters -process.load("Configuration.TotemOpticsConfiguration.OpticsConfig_6500GeV_0p8_145urad_cfi") - -# Smearing -process.load("IOMC.SmearingGenerator.SmearingGenerator_cfi") - -################## STEP 3 process.g4SimHits - -# Geometry - beta* specific -process.load("Configuration.TotemCommon.geometryRP_CTPPS_cfi") - -# TODO Change to the LowBetaSettings -process.XMLIdealGeometryESSource.geomXMLFiles.append('Geometry/TotemRPData/data/RP_Beta_90/RP_Dist_Beam_Cent.xml') - -# misalignments -process.load("TotemAlignment.RPDataFormats.TotemRPIncludeAlignments_cfi") -process.TotemRPIncludeAlignments.MisalignedFiles = cms.vstring() - -# Magnetic Field, by default we have 3.8T -process.load("Configuration.StandardSequences.MagneticField_cff") - -# G4 simulation & proton transport -process.load("Configuration.TotemCommon.g4SimHits_cfi") -process.g4SimHits.Physics.BeamProtTransportSetup = process.BeamProtTransportSetup -process.g4SimHits.Generator.HepMCProductLabel = 'generator' # The input source for G4 module is connected to "process.source". -process.g4SimHits.G4TrackingManagerVerbosity = cms.untracked.int32(0) - -# Use particle table -process.load("SimGeneral.HepPDTESSource.pdt_cfi") - -process.g4SimHits.CTPPSSD = cms.PSet( - Verbosity = cms.untracked.int32(0) -) - -################## Step 3 - Magnetic field configuration -# todo declare in standard way (not as hardcoded raw config) - -process.magfield = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring('Geometry/CMSCommonData/data/normal/cmsextent.xml', - 'Geometry/CMSCommonData/data/cms.xml', - 'Geometry/CMSCommonData/data/cmsMagneticField.xml', - 'MagneticField/GeomBuilder/data/MagneticFieldVolumes_1103l.xml', - 'Geometry/CMSCommonData/data/materials.xml'), - rootNodeName = cms.string('cmsMagneticField:MAGF') -) -process.prefer("magfield") - -process.ParametrizedMagneticFieldProducer = cms.ESProducer("ParametrizedMagneticFieldProducer", - version = cms.string('OAE_1103l_071212'), - parameters = cms.PSet( - BValue = cms.string('3_8T') - ), - label = cms.untracked.string('parametrizedField') -) - -process.VolumeBasedMagneticFieldESProducer = cms.ESProducer("VolumeBasedMagneticFieldESProducer", - scalingVolumes = cms.vint32(14100, 14200, 17600, 17800, 17900, - 18100, 18300, 18400, 18600, 23100, - 23300, 23400, 23600, 23800, 23900, - 24100, 28600, 28800, 28900, 29100, - 29300, 29400, 29600, 28609, 28809, - 28909, 29109, 29309, 29409, 29609, - 28610, 28810, 28910, 29110, 29310, - 29410, 29610, 28611, 28811, 28911, - 29111, 29311, 29411, 29611), - scalingFactors = cms.vdouble(1, 1, 0.994, 1.004, 1.004, - 1.005, 1.004, 1.004, 0.994, 0.965, - 0.958, 0.958, 0.953, 0.958, 0.958, - 0.965, 0.918, 0.924, 0.924, 0.906, - 0.924, 0.924, 0.918, 0.991, 0.998, - 0.998, 0.978, 0.998, 0.998, 0.991, - 0.991, 0.998, 0.998, 0.978, 0.998, - 0.998, 0.991, 0.991, 0.998, 0.998, - 0.978, 0.998, 0.998, 0.991), - useParametrizedTrackerField = cms.bool(True), - label = cms.untracked.string(''), - version = cms.string('grid_1103l_090322_3_8t'), - debugBuilder = cms.untracked.bool(False), - paramLabel = cms.string('parametrizedField'), - geometryVersion = cms.int32(90322), - gridFiles = cms.VPSet(cms.PSet( - path = cms.string('grid.[v].bin'), - master = cms.int32(1), - volumes = cms.string('1-312'), - sectors = cms.string('0') - ), - cms.PSet( - path = cms.string('S3/grid.[v].bin'), - master = cms.int32(3), - volumes = cms.string('176-186,231-241,286-296'), - sectors = cms.string('3') - ), - cms.PSet( - path = cms.string('S4/grid.[v].bin'), - master = cms.int32(4), - volumes = cms.string('176-186,231-241,286-296'), - sectors = cms.string('4') - ), - cms.PSet( - path = cms.string('S9/grid.[v].bin'), - master = cms.int32(9), - volumes = cms.string('14,15,20,21,24-27,32,33,40,41,48,49,56,57,62,63,70,71,286-296'), - sectors = cms.string('9') - ), - cms.PSet( - path = cms.string('S10/grid.[v].bin'), - master = cms.int32(10), - volumes = cms.string('14,15,20,21,24-27,32,33,40,41,48,49,56,57,62,63,70,71,286-296'), - sectors = cms.string('10') - ), - cms.PSet( - path = cms.string('S11/grid.[v].bin'), - master = cms.int32(11), - volumes = cms.string('14,15,20,21,24-27,32,33,40,41,48,49,56,57,62,63,70,71,286-296'), - sectors = cms.string('11') - )), - cacheLastVolume = cms.untracked.bool(True) -) - -################## STEP 4 mix pdt_cfi - -process.load("Configuration.TotemCommon.mixNoPU_cfi") - -# Use particle table -process.load("SimGeneral.HepPDTESSource.pdt_cfi") - -################## STEP 5 RPDigiProducer & RPix - -process.load("SimTotem.RPDigiProducer.RPSiDetConf_cfi") -process.load("SimPPS.CTPPSPixelDigiProducer.RPixDetConf_cfi") - -################## STEP 6 reco - -process.load("Configuration.TotemStandardSequences.RP_Digi_and_TrackReconstruction_cfi") - -################## STEP 7 TotemNtuplizer - -process.load("TotemAnalysis.TotemNtuplizer.TotemNtuplizer_cfi") -process.TotemNtuplizer.outputFileName = "test.ntuple.root" -process.TotemNtuplizer.RawEventLabel = 'source' -process.TotemNtuplizer.RPReconstructedProtonCollectionLabel = cms.InputTag('RP220Reconst') -process.TotemNtuplizer.RPReconstructedProtonPairCollectionLabel = cms.InputTag('RP220Reconst') -process.TotemNtuplizer.RPMulFittedTrackCollectionLabel = cms.InputTag("RPMulTrackNonParallelCandCollFit") -process.TotemNtuplizer.includeDigi = cms.bool(True) -process.TotemNtuplizer.includePatterns = cms.bool(True) - -process.digiAnal = cms.EDAnalyzer("CTPPSPixelDigiAnalyzer", - label=cms.untracked.string("RPixDetDigitizer"), - Verbosity = cms.int32(0), - RPixVerbosity = cms.int32(0), - RPixActiveEdgeSmearing = cms.double(0.020), - RPixActiveEdgePosition = cms.double(0.150) -) -######## - -process.p1 = cms.Path( - process.generator -# *process.SmearingGenerator - *process.g4SimHits - *process.mix -# *process.RPSiDetDigitizer -*process.RPixDetDigitizer -#*process.digiAnal -# *process.RPClustProd -# *process.RPHecoHitProd -# *process.RPSinglTrackCandFind -# *process.RPSingleTrackCandCollFit - - -# *process.RP220Reconst -# *process.TotemNtuplizer - -) - - diff --git a/SimPPS/PPSPixelDigiProducer/test/testDigi.py b/SimPPS/PPSPixelDigiProducer/test/testDigi.py new file mode 100644 index 0000000000000..694b02ccf8074 --- /dev/null +++ b/SimPPS/PPSPixelDigiProducer/test/testDigi.py @@ -0,0 +1,138 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('DIGI2RAW',eras.Run2_2017) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('SimGeneral.MixingModule.mixNoPU_PPS_cfi') +process.load('Configuration.StandardSequences.Digi_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('CalibPPS.ESProducers.CTPPSPixelDAQMappingESSourceXML_cfi') + +process.load('SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi') +############### using only CTPPS geometry +process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) +process.load("IOMC.RandomEngine.IOMC_cff") +process.RandomNumberGeneratorService.generator.initialSeed = 456789 +process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 +process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.RandomNumberGeneratorService.RPixDetDigitizer = cms.PSet(initialSeed =cms.untracked.uint32(137137)) +process.RandomNumberGeneratorService.RPSiDetDigitizer = cms.PSet(initialSeed =cms.untracked.uint32(137137)) + +# Input source +process.source = cms.Source("PoolSource", + dropDescendantsOfDroppedBranches = cms.untracked.bool(False), + fileNames = cms.untracked.vstring('file:step1_SIM2017.root'), + inputCommands = cms.untracked.vstring('keep *', + 'drop *_genParticles_*_*', + 'drop *_genParticlesForJets_*_*', + 'drop *_kt4GenJets_*_*', + 'drop *_kt6GenJets_*_*', + 'drop *_iterativeCone5GenJets_*_*', + 'drop *_ak4GenJets_*_*', + 'drop *_ak7GenJets_*_*', + 'drop *_ak8GenJets_*_*', + 'drop *_ak4GenJetsNoNu_*_*', + 'drop *_ak8GenJetsNoNu_*_*', + 'drop *_genCandidatesForMET_*_*', + 'drop *_genParticlesForMETAllVisible_*_*', + 'drop *_genMetCalo_*_*', + 'drop *_genMetCaloAndNonPrompt_*_*', + 'drop *_genMetTrue_*_*', + 'drop *_genMetIC5GenJs_*_*'), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + SkipEvent = cms.untracked.vstring('ProductNotFound') +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step2 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('step2_DIGI_DIGI2RAW2017.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands + ['keep *_CTPPS*_*_*',"keep *_*RP*_*_*",'keep *_LHCTransport_*_*'], + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') + +process.GlobalTag.toGet = cms.VPSet( + cms.PSet( + record = cms.string('CTPPSPixelGainCalibrationsRcd'), + tag = cms.string("CTPPSPixelGainCalibrations_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelAnalysisMaskRcd'), + tag = cms.string("CTPPSPixelAnalysisMask_mc"), + label = cms.untracked.string(""), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("CTPPSPixelDAQMapping_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ) +) + +# modify Totem 2017 mapping +process.load('CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi') +process.totemDAQMappingESSourceXML.configuration = cms.VPSet( + cms.PSet( + validityRange = cms.EventRange("1:min - 999999999:max"), + mappingFileNames = cms.vstring("CondFormats/CTPPSReadoutObjects/xml/mapping_tracking_strip_2017.xml"), + maskFileNames = cms.vstring() + ) +) + +process.load("EventFilter.CTPPSRawToDigi.ctppsDigiToRaw_cff") +process.load("EventFilter.RawDataCollector.rawDataCollector_cfi") + +# Path and EndPath definitions +process.mixedigi_step = cms.Path(process.mix*process.RPixDetDigitizer*process.RPSiDetDigitizer) +process.digi2raw_step = cms.Path(process.ctppsTotemRawData*process.ctppsPixelRawData*process.rawDataCollector) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.mixedigi_step,process.digi2raw_step,process.endjob_step,process.FEVTDEBUGoutput_step) +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) + + +# Customisation from command line + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/SimPPS/PPSPixelDigiProducer/test/testDigi3.py b/SimPPS/PPSPixelDigiProducer/test/testDigi3.py deleted file mode 100644 index d1dae4e0a9be6..0000000000000 --- a/SimPPS/PPSPixelDigiProducer/test/testDigi3.py +++ /dev/null @@ -1,58 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("testDigi") - -# Specify the maximum events to simulate -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.load('FWCore.MessageService.MessageLogger_cfi') -process.MessageLogger.cerr.FwkReport.reportEvery=cms.untracked.int32(5000) - -################## STEP 1 - process.generator - -process.source = cms.Source("PoolSource", -duplicateCheckMode = cms.untracked.string("noDuplicateCheck"), - fileNames = - cms.untracked.vstring( -# 'file:/tmp/andriusj/6EC8FCC8-E2A8-E411-9506-002590596468.root' -# '/store/relval/CMSSW_7_4_0_pre6/RelValPhotonJets_Pt_10_13/GEN-SIM-RECO/MCRUN2_74_V1-v1/00000/6EC8FCC8-E2A8-E411-9506-002590596468.root' -# 'file:/home/ferro/ferroCMS/CMSSW_7_5_0/src/MYtest441_.root', -# 'file:/home/ferro/ferroCMS/CMSSW_7_5_0/src/MYtest442_.root', -# 'file:/home/ferro/ferroCMS/CMSSW_7_5_0/src/MYtest444_.root', -# 'file:/home/ferro/ferroCMS/CMSSW_7_5_0/src/MYtest445_.root', -# 'file:/home/ferro/ferroCMS/CMSSW_7_5_0/src/MYtest447_.root', -# 'file:/home/ferro/ferroCMS/CMSSW_7_5_0/src/MYtest448_.root', - 'file:/home/ferro/ferroCMS/CMSSW_7_5_0_myCTPPS/CMSSW_7_5_0/src/MYtest44_.root' - ) -) - - -# Use random number generator service -process.load("Configuration.TotemCommon.RandomNumbers_cfi") -process.RandomNumberGeneratorService.RPixDetDigitizer = cms.PSet(initialSeed =cms.untracked.uint32(137137)) - - -process.load("TotemAnalysis.TotemNtuplizer.TotemNtuplizer_cfi") -process.TotemNtuplizer.outputFileName = "test.ntuple.root" -process.TotemNtuplizer.RawEventLabel = 'source' -process.TotemNtuplizer.RPReconstructedProtonCollectionLabel = cms.InputTag('RP220Reconst') -process.TotemNtuplizer.RPReconstructedProtonPairCollectionLabel = cms.InputTag('RP220Reconst') -process.TotemNtuplizer.RPMulFittedTrackCollectionLabel = cms.InputTag("RPMulTrackNonParallelCandCollFit") -process.TotemNtuplizer.includeDigi = cms.bool(True) -process.TotemNtuplizer.includePatterns = cms.bool(True) - - -process.digiAnal = cms.EDAnalyzer("CTPPSPixelDigiAnalyzer", - label=cms.untracked.string("RPixDetDigitizer"), - Verbosity = cms.int32(0), - RPixVerbosity = cms.int32(0), - RPixActiveEdgeSmearing = cms.double(0.020), - RPixActiveEdgePosition = cms.double(0.150) - -) - -process.p1 = cms.Path( process.digiAnal ) - - From 296b09d2c5d998077eeb7cbd6c80af97400f145a Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Thu, 17 Oct 2019 16:10:27 +0200 Subject: [PATCH 02/16] Implementing PR review comments, removing unneeded Sequence usage instead of Task in the config --- EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py | 8 ++++---- SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py | 2 -- SimGeneral/MixingModule/python/mixNoPU_cfi.py | 2 -- SimPPS/Configuration/python/SimPPS_cff.py | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py b/EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py index 23095b2877cc7..f34e99fa078c7 100644 --- a/EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py +++ b/EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py @@ -4,14 +4,14 @@ from EventFilter.CTPPSRawToDigi.ctppsPixelRawData_cfi import ctppsPixelRawData from EventFilter.CTPPSRawToDigi.ctppsTotemRawData_cfi import ctppsTotemRawData -ctppsRawData = cms.Sequence() +ctppsRawData = cms.Task() from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 -ctpps_2016.toReplaceWith(ctppsRawData, cms.Sequence(ctppsTotemRawData)) +ctpps_2016.toReplaceWith(ctppsRawData, cms.Task(ctppsTotemRawData)) from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017 -ctpps_2017.toReplaceWith(ctppsRawData, cms.Sequence(ctppsTotemRawData*ctppsPixelRawData)) +ctpps_2017.toReplaceWith(ctppsRawData, cms.Task(ctppsTotemRawData,ctppsPixelRawData)) from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 -ctpps_2018.toReplaceWith(ctppsRawData, cms.Sequence(ctppsPixelRawData)) +ctpps_2018.toReplaceWith(ctppsRawData, cms.Task(ctppsPixelRawData)) diff --git a/SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py b/SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py index 34520a95aca9b..3d5e8fcccb6ed 100644 --- a/SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py +++ b/SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py @@ -13,8 +13,6 @@ from SimGeneral.MixingModule.trackingTruthProducer_cfi import * from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import hgceeDigitizer, hgchebackDigitizer, hgchefrontDigitizer, HGCAL_noise_fC, HGCAL_noise_heback, HGCAL_chargeCollectionEfficiencies, HGCAL_noises -import FWCore.ParameterSet.Config as cms - mix = cms.EDProducer("MixingModule", digitizers = cms.PSet(), LabelPlayback = cms.string(''), diff --git a/SimGeneral/MixingModule/python/mixNoPU_cfi.py b/SimGeneral/MixingModule/python/mixNoPU_cfi.py index 010e5a34e3e0b..912e1634c37b1 100644 --- a/SimGeneral/MixingModule/python/mixNoPU_cfi.py +++ b/SimGeneral/MixingModule/python/mixNoPU_cfi.py @@ -21,5 +21,3 @@ useCurrentProcessOnly = cms.bool(False), mixObjects = cms.PSet(theMixObjects) ) - - diff --git a/SimPPS/Configuration/python/SimPPS_cff.py b/SimPPS/Configuration/python/SimPPS_cff.py index 0294aa71cb348..0ebb409d753b6 100644 --- a/SimPPS/Configuration/python/SimPPS_cff.py +++ b/SimPPS/Configuration/python/SimPPS_cff.py @@ -7,7 +7,7 @@ RPSiDetDigitizerTask=cms.Task(RPSiDetDigitizer) ctppsDigiTask = cms.Task() -ctppsDigi = cms.Sequence(ctppsDigiTask) +#ctppsDigi = cms.Sequence(ctppsDigiTask) # add PPS 2016 digi modules from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 From 152e64026392e8b1a4db41ec82eba162a667b176 Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Fri, 18 Oct 2019 21:46:16 +0200 Subject: [PATCH 03/16] Rebasing to the last IB; adapting test config to the new pps ERAS; removing mixNoPU_PPS_cff --- .../MixingModule/python/mixNoPU_PPS_cfi.py | 56 ------------------- .../test/gluglu_step1_GEN_SIM_2017.py | 1 + .../test/gluglu_step2_DIGI_DIGI2RAW_2017.py | 2 +- .../gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py | 2 +- .../test/pg_step2_DIGI_DIGI2RAW_2017.py | 2 +- 5 files changed, 4 insertions(+), 59 deletions(-) delete mode 100644 SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py diff --git a/SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py b/SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py deleted file mode 100644 index 3d5e8fcccb6ed..0000000000000 --- a/SimGeneral/MixingModule/python/mixNoPU_PPS_cfi.py +++ /dev/null @@ -1,56 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# this is a minimum configuration of the Mixing module, -# to run it in the zero-pileup mode -# - -from SimGeneral.MixingModule.mixObjects_cfi import * -from SimGeneral.MixingModule.pixelDigitizer_cfi import * -from SimGeneral.MixingModule.stripDigitizer_cfi import * -from SimGeneral.MixingModule.ecalDigitizer_cfi import * -from SimGeneral.MixingModule.hcalDigitizer_cfi import * -from SimGeneral.MixingModule.castorDigitizer_cfi import * -from SimGeneral.MixingModule.trackingTruthProducer_cfi import * -from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import hgceeDigitizer, hgchebackDigitizer, hgchefrontDigitizer, HGCAL_noise_fC, HGCAL_noise_heback, HGCAL_chargeCollectionEfficiencies, HGCAL_noises - -mix = cms.EDProducer("MixingModule", - digitizers = cms.PSet(), - LabelPlayback = cms.string(''), - maxBunch = cms.int32(3), - minBunch = cms.int32(-5), ## in terms of 25 ns - - bunchspace = cms.int32(25), - mixProdStep1 = cms.bool(False), - mixProdStep2 = cms.bool(False), - - playback = cms.untracked.bool(False), - useCurrentProcessOnly = cms.bool(False), - mixObjects = cms.PSet( - mixCH = cms.PSet( - mixCaloHits - ), - mixTracks = cms.PSet( - mixSimTracks - ) - , - mixVertices = cms.PSet( - mixSimVertices - ), - mixSH = cms.PSet( - mixSimHits - ), - mixHepMC = cms.PSet( - mixHepMCProducts - ) - ) -) -mix.mixObjects.mixSH.crossingFrames = cms.untracked.vstring('MuonCSCHits', -'MuonDTHits', -'MuonRPCHits', -'TotemHitsRP', -'CTPPSPixelHits') - -mix.mixObjects.mixSH.input = mix.mixObjects.mixSH.input + [ cms.InputTag("g4SimHits","TotemHitsRP"),cms.InputTag("g4SimHits","CTPPSPixelHits") ] -mix.mixObjects.mixSH.subdets= mix.mixObjects.mixSH.subdets + [ 'TotemHitsRP' , 'CTPPSPixelHits'] - - diff --git a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py index 080da3f6c8cef..a76d7f5a2d385 100644 --- a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py +++ b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py @@ -22,6 +22,7 @@ process.load('Configuration.StandardSequences.SimIdeal_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('Geometry.HcalCommonData.hcalDDDSimConstants_cff') process.load('SimG4Core.Application.g4SimHits_cfi') process.g4SimHits.Physics.DefaultCutValue = 100. diff --git a/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py b/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py index ccbe225096df7..8b346b12b64fa 100644 --- a/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py +++ b/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py @@ -6,7 +6,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.StandardSequences.Eras import eras -process = cms.Process('DIGI2RAW',eras.Run2_2017, eras.pps_2017) +process = cms.Process('DIGI2RAW',eras.Run2_2017, eras.ctpps_2017) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') diff --git a/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py b/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py index 8653e4358e425..4bf0b05f0d9df 100644 --- a/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py +++ b/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py @@ -7,7 +7,7 @@ from Configuration.StandardSequences.Eras import eras -process = cms.Process('RECO',eras.Run2_2017,eras.pps_2017) +process = cms.Process('RECO',eras.Run2_2017,eras.ctpps_2017) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') diff --git a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py index 694b02ccf8074..e9c4f8fd8f8f6 100644 --- a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py +++ b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py @@ -13,7 +13,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.MagneticField_cff') -process.load('SimGeneral.MixingModule.mixNoPU_PPS_cfi') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.StandardSequences.Digi_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') From 1841b3052d6f9253a4cfd51c479be5b4faeeb973 Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Tue, 10 Mar 2020 17:29:44 +0100 Subject: [PATCH 04/16] Modifing Generator_cff to trigger the proton propagation at generator step --- .../StandardSequences/python/Generator_cff.py | 5 ++- SimPPS/Configuration/python/GenPPS_cff.py | 15 +++++++++ .../Configuration/python/PPSTransport_cff.py | 24 ++++++++++++++ .../test/gluglu_step1_GEN_SIM_2017.py | 33 ++----------------- .../test/pg_step1_GEN_SIM_2017.py | 29 +--------------- 5 files changed, 47 insertions(+), 59 deletions(-) create mode 100644 SimPPS/Configuration/python/GenPPS_cff.py create mode 100644 SimPPS/Configuration/python/PPSTransport_cff.py diff --git a/Configuration/StandardSequences/python/Generator_cff.py b/Configuration/StandardSequences/python/Generator_cff.py index 05fa303750296..418bf004df418 100644 --- a/Configuration/StandardSequences/python/Generator_cff.py +++ b/Configuration/StandardSequences/python/Generator_cff.py @@ -55,7 +55,10 @@ GeneInfo = cms.Sequence(GeneInfoTask) genJetMET = cms.Sequence(genJetMETTask) -pgen = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+VertexSmearing+GenSmeared+GeneInfo+genJetMET) +from SimPPS.Configuration.GenPPS_cff import * +PPSTransport = cms.Sequence(PPSTransportTask) + +pgen = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+VertexSmearing+GenSmeared+GeneInfo+genJetMET+PPSTransport) # sequence for bare generator result only, without vertex smearing and analysis objects added diff --git a/SimPPS/Configuration/python/GenPPS_cff.py b/SimPPS/Configuration/python/GenPPS_cff.py new file mode 100644 index 0000000000000..907267453c446 --- /dev/null +++ b/SimPPS/Configuration/python/GenPPS_cff.py @@ -0,0 +1,15 @@ +import FWCore.ParameterSet.Config as cms +from SimPPS.Configuration.PPSTransport_cff import * + +PPSTransportTask = cms.Task() + +# so far, it is not yet defined the optic for 2017 and 2018 + +from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 +ctpps_2016.toReplaceWith(PPSTransportTask, cms.Task(LHCTransport)) + +from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017 +ctpps_2017.toReplaceWith(PPSTransportTask, cms.Task(LHCTransport)) + +from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 +ctpps_2018.toReplaceWith(PPSTransportTask, cms.Task(LHCTransport)) diff --git a/SimPPS/Configuration/python/PPSTransport_cff.py b/SimPPS/Configuration/python/PPSTransport_cff.py new file mode 100644 index 0000000000000..bca1e0f175969 --- /dev/null +++ b/SimPPS/Configuration/python/PPSTransport_cff.py @@ -0,0 +1,24 @@ +import FWCore.ParameterSet.Config as cms +from SimG4Core.Application.g4SimHits_cfi import * +g4SimHits.Generator.MinEtaCut = cms.double(-13.0) +g4SimHits.Generator.MaxEtaCut = cms.double( 13.0) +g4SimHits.Generator.HepMCProductLabel = 'LHCTransport' +g4SimHits.SteppingAction.MaxTrackTime = cms.double(2000.0) +g4SimHits.StackingAction.MaxTrackTime = cms.double(2000.0) + +from IOMC.RandomEngine.IOMC_cff import * +RandomNumberGeneratorService.LHCTransport.engineName = cms.untracked.string('TRandom3') + +from SimTransport.PPSProtonTransport.TotemTransport_cfi import * + +from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import Realistic25ns13TeV2016CollisionVtxSmearingParameters +from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import Realistic25ns13TeVEarly2017CollisionVtxSmearingParameters +from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import Realistic25ns13TeVEarly2018CollisionVtxSmearingParameters + +print Realistic25ns13TeV2016CollisionVtxSmearingParameters.X0 +print Realistic25ns13TeVEarly2017CollisionVtxSmearingParameters.X0 +print Realistic25ns13TeVEarly2018CollisionVtxSmearingParameters.X0 + +LHCTransport.VtxMeanX = Realistic25ns13TeV2016CollisionVtxSmearingParameters.X0 +LHCTransport.VtxMeanY = Realistic25ns13TeV2016CollisionVtxSmearingParameters.Y0 +LHCTransport.VtxMeanZ = Realistic25ns13TeV2016CollisionVtxSmearingParameters.Z0 diff --git a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py index a76d7f5a2d385..148dd4024d008 100644 --- a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py +++ b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py @@ -6,7 +6,6 @@ import FWCore.ParameterSet.Config as cms from Configuration.StandardSequences.Eras import eras - process = cms.Process('SIM',eras.Run2_2017) # import of standard configurations @@ -14,6 +13,8 @@ process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.GeometrySimDB_cff') process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') @@ -24,29 +25,6 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('Geometry.HcalCommonData.hcalDDDSimConstants_cff') -process.load('SimG4Core.Application.g4SimHits_cfi') -process.g4SimHits.Physics.DefaultCutValue = 100. -process.g4SimHits.UseMagneticField = False -process.g4SimHits.Generator.ApplyPCuts = False -process.g4SimHits.Generator.ApplyPhiCuts = False -process.g4SimHits.Generator.ApplyEtaCuts = False -process.g4SimHits.Generator.HepMCProductLabel = 'LHCTransport' -process.g4SimHits.Generator.MinEtaCut = -13.0 -process.g4SimHits.Generator.MaxEtaCut = 13.0 -process.g4SimHits.Generator.Verbosity = 0 -process.g4SimHits.Generator.EtaCutForHector = 7.0 - -process.g4SimHits.G4TrackingManagerVerbosity = cms.untracked.int32(3) -process.g4SimHits.SteppingAction.MaxTrackTime = cms.double(2000.0) -process.g4SimHits.StackingAction.MaxTrackTime = cms.double(2000.0) - -process.common_maximum_timex = cms.PSet( # need to be localy redefined - MaxTrackTime = cms.double(2000.0), # need to be localy redefined - MaxTimeNames = cms.vstring('ZDCRegion'), # need to be localy redefined - MaxTrackTimes = cms.vdouble(10000.0), # need to be localy redefined - DeadRegions = cms.vstring() -) - process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) ) @@ -65,7 +43,6 @@ ) # Output definition - process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('generation_step') @@ -88,7 +65,6 @@ from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') -process.load('PhysicsTools.HepMCCandAlgos.genParticles_cfi') process.generator = cms.EDFilter("ExhumeGeneratorFilter", ExhumeParameters = cms.PSet( AlphaEw = cms.double(0.0072974), @@ -129,19 +105,16 @@ # Path and EndPath definitions process.generation_step = cms.Path(process.pgen) process.simulation_step = cms.Path(process.psim) -process.g4Simhits_step = cms.Path(process.g4SimHits) process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) process.endjob_step = cms.EndPath(process.endOfProcess) process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) - -process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.g4Simhits_step,process.endjob_step,process.FEVTDEBUGoutput_step) +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.endjob_step,process.FEVTDEBUGoutput_step) # filter all path with the production filter sequence for path in process.paths: getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq - from SimPPS.PPSSimTrackProducer.SimTrackProducerForFullSim_cff import customise process = customise(process) diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py index 01d7f844f67f6..58a65f0b16f07 100644 --- a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py @@ -3,7 +3,7 @@ import math from Configuration.StandardSequences.Eras import eras -process = cms.Process('SIM',eras.Run2_2017,eras.ctpps_2017) +process = cms.Process('SIM',eras.Run2_2017) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') @@ -21,25 +21,6 @@ from Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi import XMLIdealGeometryESSource_CTPPS process.XMLIdealGeometryESSource = XMLIdealGeometryESSource_CTPPS.clone() -process.load("SimG4Core.Application.g4SimHits_cfi") -process.g4SimHits.Generator.ApplyPCuts = False -process.g4SimHits.Generator.ApplyPhiCuts = False -process.g4SimHits.Generator.ApplyEtaCuts = False -process.g4SimHits.Generator.HepMCProductLabel = 'LHCTransport' -process.g4SimHits.Generator.MinEtaCut = -13.0 -process.g4SimHits.Generator.MaxEtaCut = 13.0 -process.g4SimHits.Generator.Verbosity = 0 - -process.g4SimHits.G4TrackingManagerVerbosity = cms.untracked.int32(3) -process.g4SimHits.SteppingAction.MaxTrackTime = cms.double(2000.0) -process.g4SimHits.StackingAction.MaxTrackTime = cms.double(2000.0) - -process.load("IOMC.RandomEngine.IOMC_cff") -process.RandomNumberGeneratorService.generator.initialSeed = 456789 -process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 -process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 -process.RandomNumberGeneratorService.LHCTransport.engineName = cms.untracked.string('TRandom3') - nEvent_ = 1000 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(nEvent_) @@ -47,7 +28,6 @@ from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') -process.load('PhysicsTools.HepMCCandAlgos.genParticles_cfi') phi_min = -math.pi phi_max = math.pi @@ -86,12 +66,6 @@ fileName = cms.untracked.string('step1_SIM2017.root') ) -process.common_maximum_timex = cms.PSet( # need to be localy redefined - MaxTrackTime = cms.double(2000.0), # need to be localy redefined - MaxTimeNames = cms.vstring('ZDCRegion'), # need to be localy redefined - MaxTrackTimes = cms.vdouble(10000.0), # need to be localy redefined - DeadRegions = cms.vstring() - ) process.generation_step = cms.Path(process.pgen) process.simulation_step = cms.Path(process.psim) process.g4Simhits_step = cms.Path(process.g4SimHits) @@ -109,4 +83,3 @@ from SimPPS.PPSSimTrackProducer.SimTrackProducerForFullSim_cff import customise process = customise(process) - From 934a3923b77a75202256cad58c5bc1c74a728680 Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Mon, 23 Mar 2020 22:23:40 +0100 Subject: [PATCH 05/16] Removing a print statement from a test config --- SimPPS/Configuration/python/PPSTransport_cff.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/SimPPS/Configuration/python/PPSTransport_cff.py b/SimPPS/Configuration/python/PPSTransport_cff.py index bca1e0f175969..eee9c002e4cca 100644 --- a/SimPPS/Configuration/python/PPSTransport_cff.py +++ b/SimPPS/Configuration/python/PPSTransport_cff.py @@ -15,10 +15,6 @@ from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import Realistic25ns13TeVEarly2017CollisionVtxSmearingParameters from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import Realistic25ns13TeVEarly2018CollisionVtxSmearingParameters -print Realistic25ns13TeV2016CollisionVtxSmearingParameters.X0 -print Realistic25ns13TeVEarly2017CollisionVtxSmearingParameters.X0 -print Realistic25ns13TeVEarly2018CollisionVtxSmearingParameters.X0 - LHCTransport.VtxMeanX = Realistic25ns13TeV2016CollisionVtxSmearingParameters.X0 LHCTransport.VtxMeanY = Realistic25ns13TeV2016CollisionVtxSmearingParameters.Y0 LHCTransport.VtxMeanZ = Realistic25ns13TeV2016CollisionVtxSmearingParameters.Z0 From 448e43c62ebc583a2fd4ff8d75a73224d9ecd70b Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Sat, 4 Apr 2020 17:23:04 +0200 Subject: [PATCH 06/16] Re-coding test config to minimize changes due to the missing DB sim geometry; Propagating changes due to renaming campaign (CTPPS->PPS) --- .../test/gluglu_step1_GEN_SIM_2017.py | 47 ++++++++++--------- .../test/gluglu_step2_DIGI_DIGI2RAW_2017.py | 24 ++++++---- .../gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py | 4 +- .../test/pg_step1_GEN_SIM_2017.py | 15 +++--- .../test/pg_step2_DIGI_DIGI2RAW_2017.py | 36 ++++++++------ .../test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py | 10 ++-- 6 files changed, 73 insertions(+), 63 deletions(-) diff --git a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py index 148dd4024d008..cae54c0647401 100644 --- a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py +++ b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py @@ -4,6 +4,7 @@ # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v # with command line options: GluGluTo2Jets_M_100_7TeV_exhume_cff.py --mc --eventcontent FEVTDEBUG --datatier GEN-SIM --conditions 80X_mcRun2_asymptotic_2016_v2 --step GEN,SIM --era Run2_25ns --geometry Extended2017dev --processName=CTPPS --no_exec import FWCore.ParameterSet.Config as cms +import random from Configuration.StandardSequences.Eras import eras process = cms.Process('SIM',eras.Run2_2017) @@ -13,9 +14,8 @@ process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') -process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.GeometrySimDB_cff') -process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') +#process.load('Configuration.StandardSequences.GeometryRecoDB_cff') # This line must be commented out while the pps sim geometry is not in the DB +#process.load('Configuration.StandardSequences.GeometrySimDB_cff') # This line must be commented out while the pps sim geometry is not in the DB process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic25ns13TeVEarly2017Collision_cfi') @@ -23,10 +23,13 @@ process.load('Configuration.StandardSequences.SimIdeal_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load('Geometry.HcalCommonData.hcalDDDSimConstants_cff') + +process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') # This line must be added to simulate PPS while its sim geometry is not in the DB + +process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(100) + input = cms.untracked.int32(1000) ) # Input source @@ -42,21 +45,6 @@ version = cms.untracked.string('$Revision: 1.19 $') ) -# Output definition -process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", - SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('generation_step') - ), - dataset = cms.untracked.PSet( - dataTier = cms.untracked.string('GEN-SIM'), - filterName = cms.untracked.string('') - ), - eventAutoFlushCompressedSize = cms.untracked.int32(5242880), - fileName = cms.untracked.string('GluGlu_GEN_SIM_2017.root'), - outputCommands = process.FEVTDEBUGEventContent.outputCommands, - splitLevel = cms.untracked.int32(0) -) - # Additional output definition # Other statements @@ -65,6 +53,7 @@ from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') + process.generator = cms.EDFilter("ExhumeGeneratorFilter", ExhumeParameters = cms.PSet( AlphaEw = cms.double(0.0072974), @@ -102,6 +91,21 @@ process.ProductionFilterSequence = cms.Sequence(process.generator) +# Output definition +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('generation_step') + ), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('GluGlu_GEN_SIM_2017.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands, + splitLevel = cms.untracked.int32(0) +) + # Path and EndPath definitions process.generation_step = cms.Path(process.pgen) process.simulation_step = cms.Path(process.psim) @@ -115,6 +119,3 @@ # filter all path with the production filter sequence for path in process.paths: getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq - -from SimPPS.PPSSimTrackProducer.SimTrackProducerForFullSim_cff import customise -process = customise(process) diff --git a/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py b/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py index 8b346b12b64fa..6f4f2b5d26dfa 100644 --- a/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py +++ b/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py @@ -4,34 +4,36 @@ # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v # with command line options: step2 --filein=file:GluGluTo2Jets_M_300_2000_13TeV_exhume_cff_py_GEN_SIM_HECTOR_CTPPS.root --conditions auto:run2_mc -s DIGI:pdigi_valid,DIGI2RAW --datatier GEN-SIM-DIGI-RAW -n 10 --era Run2_2016 --eventcontent FEVTDEBUG --no_exec import FWCore.ParameterSet.Config as cms +import random + from Configuration.StandardSequences.Eras import eras -process = cms.Process('DIGI2RAW',eras.Run2_2017, eras.ctpps_2017) +process = cms.Process('DIGI2RAW',eras.Run2_2017) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') -process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.StandardSequences.GeometryRecoDB_cff') process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.StandardSequences.Digi_cff') process.load('Configuration.StandardSequences.SimL1Emulator_cff') process.load('Configuration.StandardSequences.DigiToRaw_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") process.load('CalibPPS.ESProducers.CTPPSPixelDAQMappingESSourceXML_cfi') +# Since the PPS simulation geometry is not yet in the database, the line below is needed +process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) -process.load("IOMC.RandomEngine.IOMC_cff") -process.RandomNumberGeneratorService.generator.initialSeed = 456789 -process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 -process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.RandomNumberGeneratorService.g4SimHits.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) +process.RandomNumberGeneratorService.VtxSmeared.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) # Input source @@ -89,7 +91,7 @@ process.totemDAQMappingESSourceXML.configuration = cms.VPSet( cms.PSet( validityRange = cms.EventRange("1:min - 999999999:max"), - mappingFileNames = cms.vstring("CondFormats/CTPPSReadoutObjects/xml/mapping_tracking_strip_2017.xml"), + mappingFileNames = cms.vstring("CondFormats/PPSObjects/xml/mapping_tracking_strip_2017.xml"), maskFileNames = cms.vstring() ) ) @@ -107,3 +109,7 @@ process.schedule.extend([process.endjob_step,process.FEVTDEBUGHLToutput_step]) from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask associatePatAlgosToolsTask(process) + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) diff --git a/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py b/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py index 4bf0b05f0d9df..eace5613b1572 100644 --- a/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py +++ b/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py @@ -22,7 +22,7 @@ process.load('Configuration.StandardSequences.Reconstruction_cff') process.load('CommonTools.ParticleFlow.EITopPAG_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") +process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") # This line must be added while PPS sim geometry is not yet in the DB process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) @@ -85,7 +85,7 @@ process.totemDAQMappingESSourceXML.configuration = cms.VPSet( cms.PSet( validityRange = cms.EventRange("1:min - 999999999:max"), - mappingFileNames = cms.vstring("CondFormats/CTPPSReadoutObjects/xml/mapping_tracking_strip_2017.xml"), + mappingFileNames = cms.vstring("CondFormats/PPSObjects/xml/mapping_tracking_strip_2017.xml"), maskFileNames = cms.vstring() ) ) diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py index 58a65f0b16f07..ce39f9d9b8c74 100644 --- a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py @@ -1,5 +1,6 @@ import FWCore.ParameterSet.Config as cms +import random import math from Configuration.StandardSequences.Eras import eras @@ -17,9 +18,10 @@ process.load('Configuration.StandardSequences.SimIdeal_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -############### using only CTPPS geometry -from Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi import XMLIdealGeometryESSource_CTPPS -process.XMLIdealGeometryESSource = XMLIdealGeometryESSource_CTPPS.clone() + +process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') + +process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) nEvent_ = 1000 process.maxEvents = cms.untracked.PSet( @@ -68,18 +70,13 @@ process.generation_step = cms.Path(process.pgen) process.simulation_step = cms.Path(process.psim) -process.g4Simhits_step = cms.Path(process.g4SimHits) process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) - process.outpath = cms.EndPath(process.o1) - -process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.g4Simhits_step,process.outpath) +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.outpath) # filter all path with the production filter sequence for path in process.paths: getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq -from SimPPS.PPSSimTrackProducer.SimTrackProducerForFullSim_cff import customise -process = customise(process) diff --git a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py index e9c4f8fd8f8f6..989c28fe2f4f9 100644 --- a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py +++ b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py @@ -13,25 +13,21 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.StandardSequences.Digi_cff') +process.load('Configuration.StandardSequences.SimL1Emulator_cff') +process.load('Configuration.StandardSequences.DigiToRaw_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('CalibPPS.ESProducers.CTPPSPixelDAQMappingESSourceXML_cfi') -process.load('SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi') -############### using only CTPPS geometry +# Since the PPS simulation geometry is not yet in the database, the line below is needed process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) -process.load("IOMC.RandomEngine.IOMC_cff") -process.RandomNumberGeneratorService.generator.initialSeed = 456789 -process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 -process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 -process.RandomNumberGeneratorService.RPixDetDigitizer = cms.PSet(initialSeed =cms.untracked.uint32(137137)) -process.RandomNumberGeneratorService.RPSiDetDigitizer = cms.PSet(initialSeed =cms.untracked.uint32(137137)) # Input source process.source = cms.Source("PoolSource", @@ -110,26 +106,36 @@ process.totemDAQMappingESSourceXML.configuration = cms.VPSet( cms.PSet( validityRange = cms.EventRange("1:min - 999999999:max"), - mappingFileNames = cms.vstring("CondFormats/CTPPSReadoutObjects/xml/mapping_tracking_strip_2017.xml"), + mappingFileNames = cms.vstring("CondFormats/PPSObjects/xml/mapping_tracking_strip_2017.xml"), maskFileNames = cms.vstring() ) ) -process.load("EventFilter.CTPPSRawToDigi.ctppsDigiToRaw_cff") -process.load("EventFilter.RawDataCollector.rawDataCollector_cfi") +#process.load("EventFilter.CTPPSRawToDigi.ctppsDigiToRaw_cff") +#process.load("EventFilter.RawDataCollector.rawDataCollector_cfi") # Path and EndPath definitions -process.mixedigi_step = cms.Path(process.mix*process.RPixDetDigitizer*process.RPSiDetDigitizer) -process.digi2raw_step = cms.Path(process.ctppsTotemRawData*process.ctppsPixelRawData*process.rawDataCollector) +process.digitisation_step = cms.Path(process.pdigi) +process.L1simulation_step = cms.Path(process.SimL1Emulator) +process.digi2raw_step = cms.Path(process.DigiToRaw) process.endjob_step = cms.EndPath(process.endOfProcess) process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) +# Schedule definition +process.schedule = cms.Schedule(process.digitisation_step,process.L1simulation_step,process.digi2raw_step) +process.schedule.extend([process.endjob_step,process.FEVTDEBUGoutput_step]) + +#process.mixedigi_step = cms.Path(process.mix*process.RPixDetDigitizer*process.RPSiDetDigitizer) +#process.digi2raw_step = cms.Path(process.ctppsTotemRawData*process.ctppsPixelRawData*process.rawDataCollector) +#process.endjob_step = cms.EndPath(process.endOfProcess) +#process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) # Schedule definition -process.schedule = cms.Schedule(process.mixedigi_step,process.digi2raw_step,process.endjob_step,process.FEVTDEBUGoutput_step) +#process.schedule = cms.Schedule(process.mixedigi_step,process.digi2raw_step,process.endjob_step,process.FEVTDEBUGoutput_step) + + from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask associatePatAlgosToolsTask(process) - # Customisation from command line # Add early deletion of temporary data products to reduce peak memory need diff --git a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py index 5db9566363100..ef5b42bc979c2 100644 --- a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py +++ b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py @@ -76,7 +76,7 @@ process.totemDAQMappingESSourceXML.configuration = cms.VPSet( cms.PSet( validityRange = cms.EventRange("1:min - 999999999:max"), - mappingFileNames = cms.vstring("CondFormats/CTPPSReadoutObjects/xml/mapping_tracking_strip_2017.xml"), + mappingFileNames = cms.vstring("CondFormats/PPSObjects/xml/mapping_tracking_strip_2017.xml"), maskFileNames = cms.vstring() ) ) @@ -88,10 +88,10 @@ from EventFilter.CTPPSRawToDigi.totemRPRawToDigi_cfi import totemRPRawToDigi totemRPRawToDigi.RawToDigi.testID = cms.uint32(1) -from RecoCTPPS.TotemRPLocal.totemRPLocalReconstruction_cff import totemRPLocalReconstruction -process.load('RecoCTPPS.TotemRPLocal.totemRPLocalReconstruction_cff') -from RecoCTPPS.PixelLocal.ctppsPixelLocalReconstruction_cff import ctppsPixelLocalReconstruction -process.load('RecoCTPPS.PixelLocal.ctppsPixelLocalReconstruction_cff') +from RecoPPS.Local.totemRPLocalReconstruction_cff import totemRPLocalReconstruction +process.load('RecoPPS.Local.totemRPLocalReconstruction_cff') +from RecoPPS.Local.ctppsPixelLocalReconstruction_cff import ctppsPixelLocalReconstruction +process.load('RecoPPS.Local.ctppsPixelLocalReconstruction_cff') # Path and EndPath definitions process.raw2digi_step = cms.Path(process.ctppsRawToDigi) From 75b8a94438ddb35caabc78bbb9b93f22609d96c3 Mon Sep 17 00:00:00 2001 From: mundim Date: Tue, 21 Apr 2020 12:25:41 -0300 Subject: [PATCH 07/16] Update SimPPS/PPSPixelDigiProducer/src/RPixChargeShare.cc Co-Authored-By: Matti Kortelainen --- SimPPS/PPSPixelDigiProducer/src/RPixChargeShare.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimPPS/PPSPixelDigiProducer/src/RPixChargeShare.cc b/SimPPS/PPSPixelDigiProducer/src/RPixChargeShare.cc index 3aeda02ff623e..bae137e74bf1b 100644 --- a/SimPPS/PPSPixelDigiProducer/src/RPixChargeShare.cc +++ b/SimPPS/PPSPixelDigiProducer/src/RPixChargeShare.cc @@ -25,7 +25,7 @@ RPixChargeShare::RPixChargeShare(const edm::ParameterSet ¶ms, uint32_t det_i int yUpper[] = {50, 50, 100, 100}; int ix, iy; for (int i = 0; i < 4; i++) { - edm::FileInPath filename(ChargeMapFile2E_[i].c_str()); + edm::FileInPath filename(ChargeMapFile2E_[i]); std::ifstream fChargeMap(filename.fullPath().c_str()); if (fChargeMap.is_open()) { while (fChargeMap >> xMap >> yMap >> chargeprobcollect) { From dbbccadcbb43d438b710a590e3e515e41ac31892 Mon Sep 17 00:00:00 2001 From: mundim Date: Tue, 21 Apr 2020 12:25:51 -0300 Subject: [PATCH 08/16] Update Configuration/StandardSequences/python/Generator_cff.py Co-Authored-By: Matti Kortelainen --- Configuration/StandardSequences/python/Generator_cff.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Configuration/StandardSequences/python/Generator_cff.py b/Configuration/StandardSequences/python/Generator_cff.py index 418bf004df418..efebc7fed5b68 100644 --- a/Configuration/StandardSequences/python/Generator_cff.py +++ b/Configuration/StandardSequences/python/Generator_cff.py @@ -56,9 +56,7 @@ genJetMET = cms.Sequence(genJetMETTask) from SimPPS.Configuration.GenPPS_cff import * -PPSTransport = cms.Sequence(PPSTransportTask) - -pgen = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+VertexSmearing+GenSmeared+GeneInfo+genJetMET+PPSTransport) +pgen = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+VertexSmearing+GenSmeared+GeneInfo+genJetMET, PPSTransportTask) # sequence for bare generator result only, without vertex smearing and analysis objects added From f756341827cd0c7bd623392d626a7d24a6e834f0 Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Tue, 19 May 2020 20:18:00 +0200 Subject: [PATCH 09/16] Rebasing to new IB, implementing the new proton transport --- SimPPS/Configuration/python/GenPPS_cff.py | 6 +- .../test/gluglu_step1_GEN_SIM_2017.py | 63 ++++++--- .../test/gluglu_step2_DIGI_DIGI2RAW_2017.py | 6 +- .../gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py | 7 +- .../test/pg_step1_GEN_SIM_2016.py | 92 +++++++++++++ .../test/pg_step1_GEN_SIM_2017.py | 43 +++++- .../test/pg_step1_GEN_SIM_2018.py | 88 +++++++++++++ .../test/pg_step1_GEN_SIM_2021.py | 86 ++++++++++++ .../test/pg_step2_DIGI_DIGI2RAW_2016.py | 115 ++++++++++++++++ .../test/pg_step2_DIGI_DIGI2RAW_2017.py | 44 +------ .../test/pg_step2_DIGI_DIGI2RAW_2018.py | 123 ++++++++++++++++++ .../test/pg_step3_MCDB_RAW2DIGI_RECO_2016.py | 110 ++++++++++++++++ .../test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py | 14 +- .../test/pg_step3_MCDB_RAW2DIGI_RECO_2018.py | 101 ++++++++++++++ .../python/PPSTransport_cff.py | 10 +- 15 files changed, 835 insertions(+), 73 deletions(-) create mode 100644 SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py create mode 100644 SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py create mode 100644 SimPPS/Configuration/test/pg_step1_GEN_SIM_2021.py create mode 100644 SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2016.py create mode 100644 SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2018.py create mode 100644 SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2016.py create mode 100644 SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2018.py diff --git a/SimPPS/Configuration/python/GenPPS_cff.py b/SimPPS/Configuration/python/GenPPS_cff.py index 907267453c446..0653ae340df93 100644 --- a/SimPPS/Configuration/python/GenPPS_cff.py +++ b/SimPPS/Configuration/python/GenPPS_cff.py @@ -1,5 +1,6 @@ import FWCore.ParameterSet.Config as cms -from SimPPS.Configuration.PPSTransport_cff import * +from SimTransport.PPSProtonTransport.PPSTransport_cff import LHCTransport + PPSTransportTask = cms.Task() @@ -13,3 +14,6 @@ from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 ctpps_2018.toReplaceWith(PPSTransportTask, cms.Task(LHCTransport)) + +from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021 +ctpps_2021.toReplaceWith(PPSTransportTask, cms.Task(LHCTransport)) diff --git a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py index cae54c0647401..c868dd8712241 100644 --- a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py +++ b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py @@ -10,12 +10,11 @@ process = cms.Process('SIM',eras.Run2_2017) # import of standard configurations +process.load("CondCore.CondDB.CondDB_cfi") process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') -#process.load('Configuration.StandardSequences.GeometryRecoDB_cff') # This line must be commented out while the pps sim geometry is not in the DB -#process.load('Configuration.StandardSequences.GeometrySimDB_cff') # This line must be commented out while the pps sim geometry is not in the DB process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic25ns13TeVEarly2017Collision_cfi') @@ -24,35 +23,53 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') # This line must be added to simulate PPS while its sim geometry is not in the DB +#process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') # This line must be added to simulate PPS while its sim geometry is not in the DB +process.load('Configuration.StandardSequences.GeometryDB_cff') +process.GlobalTag.toGet = cms.VPSet( + cms.PSet(record = cms.string("GeometryFileRcd"), + tag = cms.string("XMLFILE_Geometry_110YV3_Extended2017CTPPS_mc"), + connect = cms.string("sqlite_file:PPS_geometry_DB.db") + ) +) +process.XMLFromDBSource.label='' process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) +nEvent_ = 100 process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(1000) + input = cms.untracked.int32(nEvent_) ) # Input source process.source = cms.Source("EmptySource") -process.options = cms.untracked.PSet( -) - -# Production Info -process.configurationMetadata = cms.untracked.PSet( - annotation = cms.untracked.string('GluGluTo2Jets_M_100_7TeV_exhume_cff.py nevts:1'), - name = cms.untracked.string('Applications'), - version = cms.untracked.string('$Revision: 1.19 $') -) - -# Additional output definition - -# Other statements -process.genstepfilter.triggerConditions=cms.vstring("generation_step") +process.options = cms.untracked.PSet() from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') +# beam optics +process.CondDB.connect = 'frontier://FrontierProd/CMS_CONDITIONS' +process.PoolDBESSource = cms.ESSource("PoolDBESSource", + process.CondDB + # timetype = cms.untracked.string('runnumber'), + # DumpStat=cms.untracked.bool(True), + #toGet = cms.VPSet( + #cms.PSet( + # record = cms.string('LHCInfoRcd'), + # tag = cms.string("LHCInfoEndFill_prompt_v2") # FrontierProd + #), + #cms.PSet( + #record = cms.string('CTPPSOpticsRcd'), + #tag = cms.string("PPSOpticalFunctions_offline_v5") + #), + #cms.PSet( + # record = cms.string("CTPPSBeamParametersRcd"), + # tag = cms.string("CTPPSBeamParameters_v1") + #) + #) +) + process.generator = cms.EDFilter("ExhumeGeneratorFilter", ExhumeParameters = cms.PSet( @@ -89,6 +106,16 @@ pythiaPylistVerbosity = cms.untracked.int32(1) ) +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('GluGluTo2Jets_M_100_7TeV_exhume_cff.py nevts:1'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Other statements +process.genstepfilter.triggerConditions=cms.vstring("generation_step") + process.ProductionFilterSequence = cms.Sequence(process.generator) # Output definition diff --git a/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py b/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py index 6f4f2b5d26dfa..41ae920f05fc9 100644 --- a/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py +++ b/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py @@ -16,7 +16,6 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.MagneticField_cff') -process.load('Configuration.StandardSequences.GeometryRecoDB_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.StandardSequences.Digi_cff') process.load('Configuration.StandardSequences.SimL1Emulator_cff') @@ -25,8 +24,9 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('CalibPPS.ESProducers.CTPPSPixelDAQMappingESSourceXML_cfi') -# Since the PPS simulation geometry is not yet in the database, the line below is needed -process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) diff --git a/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py b/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py index eace5613b1572..3dc6513edb4d1 100644 --- a/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py +++ b/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py @@ -7,7 +7,7 @@ from Configuration.StandardSequences.Eras import eras -process = cms.Process('RECO',eras.Run2_2017,eras.ctpps_2017) +process = cms.Process('RECO',eras.Run2_2017) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') @@ -15,14 +15,15 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.StandardSequences.GeometryRecoDB_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.RawToDigi_cff') process.load('Configuration.StandardSequences.L1Reco_cff') process.load('Configuration.StandardSequences.Reconstruction_cff') process.load('CommonTools.ParticleFlow.EITopPAG_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") # This line must be added while PPS sim geometry is not yet in the DB +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py new file mode 100644 index 0000000000000..8b8aa55ede8e4 --- /dev/null +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py @@ -0,0 +1,92 @@ +import FWCore.ParameterSet.Config as cms + +import random +import math + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('SIM',eras.Run2_2016) + +# import of standard configurations +process.load("CondCore.CondDB.CondDB_cfi") +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic25ns13TeV2016Collision_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.load('Configuration.Geometry.GeometryExtended2016_CTPPS_cff') +process.load('Configuration.StandardSequences.GeometrySimDB_cff') + +process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) + +nEvent_ = 1000 +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(nEvent_) + ) + +process.source = cms.Source("EmptySource") + +process.options = cms.untracked.PSet() + + +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '') +#process.GlobalTag = GlobalTag(process.GlobalTag, "106X_dataRun2_v26") + +# beam optics + +# generator + +phi_min = -math.pi +phi_max = math.pi +t_min = 0. +t_max = 2. +xi_min = 0.01 +xi_max = 0.3 +ecms = 13000. + +process.generator = cms.EDProducer("RandomtXiGunProducer", + PGunParameters = cms.PSet( + PartID = cms.vint32(2212), + MinPhi = cms.double(phi_min), + MaxPhi = cms.double(phi_max), + ECMS = cms.double(ecms), + Mint = cms.double(t_min), + Maxt = cms.double(t_max), + MinXi = cms.double(xi_min), + MaxXi = cms.double(xi_max) + ), + Verbosity = cms.untracked.int32(0), + psethack = cms.string('single protons'), + FireBackward = cms.bool(True), + FireForward = cms.bool(True), + firstRun = cms.untracked.uint32(1), + ) + + +process.ProductionFilterSequence = cms.Sequence(process.generator) + +############ +process.o1 = cms.OutputModule("PoolOutputModule", + outputCommands = cms.untracked.vstring('keep *'), + fileName = cms.untracked.string('step1_SIM2016.root') + ) + +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) + + +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) +process.outpath = cms.EndPath(process.o1) +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.outpath) + +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py index ce39f9d9b8c74..d477f53309c75 100644 --- a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py @@ -7,6 +7,7 @@ process = cms.Process('SIM',eras.Run2_2017) # import of standard configurations +process.load("CondCore.CondDB.CondDB_cfi") process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') @@ -19,6 +20,7 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('Configuration.StandardSequences.GeometrySimDB_cff') process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) @@ -28,9 +30,46 @@ input = cms.untracked.int32(nEvent_) ) +process.source = cms.Source("EmptySource", + firstRun = cms.untracked.uint32(297180) +) + +process.options = cms.untracked.PSet() + + from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') +# Optical functions +#process.load('CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cfi') +#process.ctppsInterpolatedOpticalFunctionsESSource.lhcInfoLabel = "" + +#process.load('CalibPPS.ESProducers.ctppsOpticalFunctionsESSource_cfi') +#print process.ctppsOpticalFunctionsESSource.label + +#process.load('CalibPPS.ESProducers.ctppsBeamParametersESSource_cfi') +#from SimTransport.PPSProtonTransport.PPSTransportESSources_cfi import * +""" +process.PoolDBESSource = cms.ESSource("PoolDBESSource", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + DumpStat=cms.untracked.bool(True), + toGet = cms.VPSet( + cms.PSet( + record = cms.string('LHCInfoRcd'), + tag = cms.string("LHCInfoEndFill_prompt_v2"), # FrontierProd + connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") + ), + cms.PSet( + record = cms.string('CTPPSOpticsRcd'), + tag = cms.string("PPSOpticalFunctions_offline_v6"), + connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"), + ) + ) +) +""" +# generator + phi_min = -math.pi phi_max = math.pi t_min = 0. @@ -57,8 +96,6 @@ firstRun = cms.untracked.uint32(1), ) -process.source = cms.Source("EmptySource", -) process.ProductionFilterSequence = cms.Sequence(process.generator) @@ -70,8 +107,6 @@ process.generation_step = cms.Path(process.pgen) process.simulation_step = cms.Path(process.psim) - - process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) process.outpath = cms.EndPath(process.o1) process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.outpath) diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py new file mode 100644 index 0000000000000..82a4b16a316e6 --- /dev/null +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py @@ -0,0 +1,88 @@ +import FWCore.ParameterSet.Config as cms + +import random +import math + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('SIM',eras.Run2_2018) + +# import of standard configurations +process.load("CondCore.CondDB.CondDB_cfi") +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.load('Configuration.Geometry.GeometryExtended2018_CTPPS_cff') + +process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) + +nEvent_ = 100000 +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(nEvent_) + ) + +process.source = cms.Source("EmptySource") + +process.options = cms.untracked.PSet() + +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_realistic', '') + + +# generator + +phi_min = -math.pi +phi_max = math.pi +t_min = 0. +t_max = 2. +xi_min = 0.01 +xi_max = 0.3 +ecms = 13000. + +process.generator = cms.EDProducer("RandomtXiGunProducer", + PGunParameters = cms.PSet( + PartID = cms.vint32(2212), + MinPhi = cms.double(phi_min), + MaxPhi = cms.double(phi_max), + ECMS = cms.double(ecms), + Mint = cms.double(t_min), + Maxt = cms.double(t_max), + MinXi = cms.double(xi_min), + MaxXi = cms.double(xi_max) + ), + Verbosity = cms.untracked.int32(0), + psethack = cms.string('single protons'), + FireBackward = cms.bool(True), + FireForward = cms.bool(True), + firstRun = cms.untracked.uint32(1), + ) + + +process.ProductionFilterSequence = cms.Sequence(process.generator) + +############ +process.o1 = cms.OutputModule("PoolOutputModule", + outputCommands = cms.untracked.vstring('keep *'), + fileName = cms.untracked.string('step1_SIM2018.root') + ) + +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) + + +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) +process.outpath = cms.EndPath(process.o1) +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.outpath) + +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2021.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2021.py new file mode 100644 index 0000000000000..0d65c4bcd844a --- /dev/null +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2021.py @@ -0,0 +1,86 @@ +import FWCore.ParameterSet.Config as cms + +import random +import math + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('SIM',eras.run3_common,eras.ctpps_2021) + +# import of standard configurations +process.load("CondCore.CondDB.CondDB_cfi") +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedHLLHC14TeV_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.load('Configuration.Geometry.GeometryExtended2021_CTPPS_cff') + +process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) + +nEvent_ = 1000 +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(nEvent_) + ) + +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '') +#process.GlobalTag = GlobalTag(process.GlobalTag, "106X_dataRun2_v26") + +# generator + +phi_min = -math.pi +phi_max = math.pi +t_min = 0. +t_max = 2. +xi_min = 0.01 +xi_max = 0.3 +ecms = 13000. + +process.generator = cms.EDProducer("RandomtXiGunProducer", + PGunParameters = cms.PSet( + PartID = cms.vint32(2212), + MinPhi = cms.double(phi_min), + MaxPhi = cms.double(phi_max), + ECMS = cms.double(ecms), + Mint = cms.double(t_min), + Maxt = cms.double(t_max), + MinXi = cms.double(xi_min), + MaxXi = cms.double(xi_max) + ), + Verbosity = cms.untracked.int32(0), + psethack = cms.string('single protons'), + FireBackward = cms.bool(True), + FireForward = cms.bool(True), + firstRun = cms.untracked.uint32(1), + ) + +process.source = cms.Source("EmptySource", +) + +process.ProductionFilterSequence = cms.Sequence(process.generator) + +############ +process.o1 = cms.OutputModule("PoolOutputModule", + outputCommands = cms.untracked.vstring('keep *'), + fileName = cms.untracked.string('step1_SIM2021.root') + ) + +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) + + +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) +process.outpath = cms.EndPath(process.o1) +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.outpath) + +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + diff --git a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2016.py b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2016.py new file mode 100644 index 0000000000000..2c4ced34ed29a --- /dev/null +++ b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2016.py @@ -0,0 +1,115 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('DIGI2RAW',eras.Run2_2016) + +# import of standard configurations +process.load("CondCore.CondDB.CondDB_cfi") +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.Digi_cff') +process.load('Configuration.StandardSequences.SimL1Emulator_cff') +process.load('Configuration.StandardSequences.DigiToRaw_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +#process.load('CalibPPS.ESProducers.CTPPSPixelDAQMappingESSourceXML_cfi') + +# Since the PPS simulation geometry is not yet in the database, the line below is needed +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +#process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2016_cfi") +process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +# Input source +process.source = cms.Source("PoolSource", + dropDescendantsOfDroppedBranches = cms.untracked.bool(False), + fileNames = cms.untracked.vstring('file:step1_SIM2016.root'), + inputCommands = cms.untracked.vstring('keep *', + 'drop *_genParticles_*_*', + 'drop *_genParticlesForJets_*_*', + 'drop *_kt4GenJets_*_*', + 'drop *_kt6GenJets_*_*', + 'drop *_iterativeCone5GenJets_*_*', + 'drop *_ak4GenJets_*_*', + 'drop *_ak7GenJets_*_*', + 'drop *_ak8GenJets_*_*', + 'drop *_ak4GenJetsNoNu_*_*', + 'drop *_ak8GenJetsNoNu_*_*', + 'drop *_genCandidatesForMET_*_*', + 'drop *_genParticlesForMETAllVisible_*_*', + 'drop *_genMetCalo_*_*', + 'drop *_genMetCaloAndNonPrompt_*_*', + 'drop *_genMetTrue_*_*', + 'drop *_genMetIC5GenJs_*_*'), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + SkipEvent = cms.untracked.vstring('ProductNotFound') +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step2 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('step2_DIGI_DIGI2RAW2016.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands + ['keep *_CTPPS*_*_*',"keep *_*RP*_*_*",'keep *_LHCTransport_*_*'], + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '') + +# modify Totem 2016 mapping +process.load('CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi') +process.totemDAQMappingESSourceXML.configuration = cms.VPSet( + cms.PSet( + validityRange = cms.EventRange("1:min - 999999999:max"), + mappingFileNames = cms.vstring("CondFormats/PPSObjects/xml/mapping_tracking_strip_2016_from_fill_5330.xml"), + maskFileNames = cms.vstring() + ) +) + +# Path and EndPath definitions +process.digitisation_step = cms.Path(process.pdigi) +process.L1simulation_step = cms.Path(process.SimL1Emulator) +process.digi2raw_step = cms.Path(process.DigiToRaw) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) +# Schedule definition +process.schedule = cms.Schedule(process.digitisation_step,process.L1simulation_step,process.digi2raw_step) +process.schedule.extend([process.endjob_step,process.FEVTDEBUGoutput_step]) + +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) + +# Customisation from command line + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py index 989c28fe2f4f9..62b4aa8476d01 100644 --- a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py +++ b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py @@ -8,22 +8,22 @@ process = cms.Process('DIGI2RAW',eras.Run2_2017) # import of standard configurations +process.load("CondCore.CondDB.CondDB_cfi") process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.MagneticField_cff') -process.load('Configuration.StandardSequences.GeometryRecoDB_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.StandardSequences.Digi_cff') process.load('Configuration.StandardSequences.SimL1Emulator_cff') process.load('Configuration.StandardSequences.DigiToRaw_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load('CalibPPS.ESProducers.CTPPSPixelDAQMappingESSourceXML_cfi') - -# Since the PPS simulation geometry is not yet in the database, the line below is needed -process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.GeometryDB_cff') +#process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") +process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) @@ -54,7 +54,7 @@ ) process.options = cms.untracked.PSet( - SkipEvent = cms.untracked.vstring('ProductNotFound') + #SkipEvent = cms.untracked.vstring('ProductNotFound') ) # Production Info @@ -82,25 +82,6 @@ from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') -process.GlobalTag.toGet = cms.VPSet( - cms.PSet( - record = cms.string('CTPPSPixelGainCalibrationsRcd'), - tag = cms.string("CTPPSPixelGainCalibrations_mc"), - connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') - ), - cms.PSet( - record = cms.string('CTPPSPixelAnalysisMaskRcd'), - tag = cms.string("CTPPSPixelAnalysisMask_mc"), - label = cms.untracked.string(""), - connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') - ), - cms.PSet( - record = cms.string('CTPPSPixelDAQMappingRcd'), - tag = cms.string("CTPPSPixelDAQMapping_mc"), - connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') - ) -) - # modify Totem 2017 mapping process.load('CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi') process.totemDAQMappingESSourceXML.configuration = cms.VPSet( @@ -111,9 +92,6 @@ ) ) -#process.load("EventFilter.CTPPSRawToDigi.ctppsDigiToRaw_cff") -#process.load("EventFilter.RawDataCollector.rawDataCollector_cfi") - # Path and EndPath definitions process.digitisation_step = cms.Path(process.pdigi) process.L1simulation_step = cms.Path(process.SimL1Emulator) @@ -123,16 +101,6 @@ # Schedule definition process.schedule = cms.Schedule(process.digitisation_step,process.L1simulation_step,process.digi2raw_step) process.schedule.extend([process.endjob_step,process.FEVTDEBUGoutput_step]) - -#process.mixedigi_step = cms.Path(process.mix*process.RPixDetDigitizer*process.RPSiDetDigitizer) -#process.digi2raw_step = cms.Path(process.ctppsTotemRawData*process.ctppsPixelRawData*process.rawDataCollector) -#process.endjob_step = cms.EndPath(process.endOfProcess) -#process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) - -# Schedule definition -#process.schedule = cms.Schedule(process.mixedigi_step,process.digi2raw_step,process.endjob_step,process.FEVTDEBUGoutput_step) - - from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask associatePatAlgosToolsTask(process) diff --git a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2018.py b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2018.py new file mode 100644 index 0000000000000..d111d145bdcaa --- /dev/null +++ b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2018.py @@ -0,0 +1,123 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('DIGI2RAW',eras.Run2_2018) + +# import of standard configurations +process.load("CondCore.CondDB.CondDB_cfi") +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.Digi_cff') +process.load('Configuration.StandardSequences.SimL1Emulator_cff') +process.load('Configuration.StandardSequences.DigiToRaw_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +# Since the PPS simulation geometry is not yet in the database, the line below is needed +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +#process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2018_cfi") +process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1000) +) +process.GlobalTag.toGet = cms.VPSet( + cms.PSet( + record = cms.string('CTPPSPixelGainCalibrationsRcd'), + tag = cms.string("CTPPSPixelGainCalibrations_v1_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelAnalysisMaskRcd'), + tag = cms.string("CTPPSPixelAnalysisMask_v1_mc"), + label = cms.untracked.string(""), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("CTPPSPixelDAQMapping_v1_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ) +) +# Input source +process.source = cms.Source("PoolSource", + dropDescendantsOfDroppedBranches = cms.untracked.bool(False), + fileNames = cms.untracked.vstring('file:step1_SIM2018.root'), + inputCommands = cms.untracked.vstring('keep *', + 'drop *_genParticles_*_*', + 'drop *_genParticlesForJets_*_*', + 'drop *_kt4GenJets_*_*', + 'drop *_kt6GenJets_*_*', + 'drop *_iterativeCone5GenJets_*_*', + 'drop *_ak4GenJets_*_*', + 'drop *_ak7GenJets_*_*', + 'drop *_ak8GenJets_*_*', + 'drop *_ak4GenJetsNoNu_*_*', + 'drop *_ak8GenJetsNoNu_*_*', + 'drop *_genCandidatesForMET_*_*', + 'drop *_genParticlesForMETAllVisible_*_*', + 'drop *_genMetCalo_*_*', + 'drop *_genMetCaloAndNonPrompt_*_*', + 'drop *_genMetTrue_*_*', + 'drop *_genMetIC5GenJs_*_*'), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + SkipEvent = cms.untracked.vstring('ProductNotFound') +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step2 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('step2_DIGI_DIGI2RAW2018.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands + ['keep *_CTPPS*_*_*',"keep *_*RP*_*_*",'keep *_LHCTransport_*_*'], + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +#process.GlobalTag = GlobalTag(process.GlobalTag, '110X_upgrade2018_realistic_v5') +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_realistic', '') + + +# Path and EndPath definitions +process.digitisation_step = cms.Path(process.pdigi) +process.L1simulation_step = cms.Path(process.SimL1Emulator) +process.digi2raw_step = cms.Path(process.DigiToRaw) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) +# Schedule definition +process.schedule = cms.Schedule(process.digitisation_step,process.L1simulation_step,process.digi2raw_step) +process.schedule.extend([process.endjob_step,process.FEVTDEBUGoutput_step]) + +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) + +# Customisation from command line + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2016.py b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2016.py new file mode 100644 index 0000000000000..73bb4efb1ecd4 --- /dev/null +++ b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2016.py @@ -0,0 +1,110 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('RECO',eras.Run2_2016) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load("Configuration.EventContent.EventContent_cff") +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2016_cfi') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.source = cms.Source("EmptyIOVSource", + timetype = cms.string('runnumber'), + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + interval = cms.uint64(1) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('file:step2_DIGI_DIGI2RAW2016.root'), + secondaryFileNames = cms.untracked.vstring() +) + +# Track memory leaks +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",ignoreTotal = cms.untracked.int32(1) ) + +process.options = cms.untracked.PSet( + SkipEvent = cms.untracked.vstring('ProductNotFound') +) + +# Output definition + +process.output = cms.OutputModule("PoolOutputModule", + fileName = cms.untracked.string('step3_RAW2DIGI_RECO2016.root'), + outputCommands = cms.untracked.vstring("drop *","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*') +) + + +# Additional output definition +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '') + +process.GlobalTag.toGet = cms.VPSet( + cms.PSet( + record = cms.string('CTPPSPixelGainCalibrationsRcd'), + tag = cms.string("CTPPSPixelGainCalibrations_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelAnalysisMaskRcd'), + tag = cms.string("CTPPSPixelAnalysisMask_mc"), + label = cms.untracked.string(""), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("CTPPSPixelDAQMapping_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ) +) + +# modify Totem 2016 mapping +process.load('CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi') +process.totemDAQMappingESSourceXML.configuration = cms.VPSet( + cms.PSet( + validityRange = cms.EventRange("1:min - 999999999:max"), + mappingFileNames = cms.vstring("CondFormats/PPSObjects/xml/mapping_tracking_strip_2016_from_fill_5330.xml"), + maskFileNames = cms.vstring() + ) +) + +# modify CTPPS 2016 raw-to-digi modules +process.load('Configuration.StandardSequences.RawToDigi_cff') + +# do not make testID for simulation - keeping the frame +from EventFilter.CTPPSRawToDigi.totemRPRawToDigi_cfi import totemRPRawToDigi +totemRPRawToDigi.RawToDigi.testID = cms.uint32(1) + +from RecoPPS.Local.totemRPLocalReconstruction_cff import totemRPLocalReconstruction +process.load('RecoPPS.Local.totemRPLocalReconstruction_cff') +from RecoPPS.Local.ctppsPixelLocalReconstruction_cff import ctppsPixelLocalReconstruction +process.load('RecoPPS.Local.ctppsPixelLocalReconstruction_cff') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.ctppsRawToDigi) +process.reco_step = cms.Path(process.totemRPLocalReconstruction*process.ctppsPixelLocalReconstruction) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.output_step = cms.EndPath(process.output) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.reco_step,process.endjob_step,process.output_step) + +# filter all path with the production filter sequence +for path in process.paths: + # getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + getattr(process,path)._seq = getattr(process,path)._seq + diff --git a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py index ef5b42bc979c2..3fee315f7cb45 100644 --- a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py +++ b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py @@ -13,7 +13,16 @@ process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load('Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi') +process.load('Configuration.StandardSequences.GeometryDB_cff') +process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") # totem frame +#process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") # CMS frame +process.GlobalTag.toGet = cms.VPSet( + cms.PSet(record = cms.string("GeometryFileRcd"), + tag = cms.string("XMLFILE_Geometry_110YV3_Extended2017CTPPS_mc"), + connect = cms.string("sqlite_file:PPS_geometry_DB.db") + ) +) +process.XMLFromDBSource.label='' process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) @@ -52,6 +61,7 @@ from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') +""" process.GlobalTag.toGet = cms.VPSet( cms.PSet( record = cms.string('CTPPSPixelGainCalibrationsRcd'), @@ -70,7 +80,7 @@ connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') ) ) - +""" # modify Totem 2017 mapping process.load('CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi') process.totemDAQMappingESSourceXML.configuration = cms.VPSet( diff --git a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2018.py b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2018.py new file mode 100644 index 0000000000000..37a634a89323b --- /dev/null +++ b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2018.py @@ -0,0 +1,101 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('RECO',eras.Run2_2018) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load("Configuration.EventContent.EventContent_cff") +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('Configuration.StandardSequences.GeometryDB_cff') +process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") +#process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2018_cfi") # CMS frame + + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.source = cms.Source("EmptyIOVSource", + timetype = cms.string('runnumber'), + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + interval = cms.uint64(1) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('file:step2_DIGI_DIGI2RAW2018.root'), + secondaryFileNames = cms.untracked.vstring() +) + +# Track memory leaks +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",ignoreTotal = cms.untracked.int32(1) ) + +process.options = cms.untracked.PSet( + SkipEvent = cms.untracked.vstring('ProductNotFound') +) + +# Output definition + +process.output = cms.OutputModule("PoolOutputModule", + fileName = cms.untracked.string('step3_RAW2DIGI_RECO2018.root'), + outputCommands = cms.untracked.vstring("drop *","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*') +) + + +# Additional output definition +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_realistic', '') +process.GlobalTag.toGet = cms.VPSet( + cms.PSet( + record = cms.string('CTPPSPixelGainCalibrationsRcd'), + #tag = cms.string("CTPPSPixelGainCalibrations_mc"), + tag = cms.string("CTPPSPixelGainCalibrations_v1_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelAnalysisMaskRcd'), + tag = cms.string("CTPPSPixelAnalysisMask_v1_mc"), + label = cms.untracked.string(""), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("CTPPSPixelDAQMapping_v1_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ) +) +# modify CTPPS 2018 raw-to-digi modules ONLY FOR PARTICLE GUN, TO AVOID RUN THIS FOR THE WHOLE CMS +process.load('Configuration.StandardSequences.RawToDigi_cff') + +# do not make testID for simulation - keeping the frame +from EventFilter.CTPPSRawToDigi.totemRPRawToDigi_cfi import totemRPRawToDigi +totemRPRawToDigi.RawToDigi.testID = cms.uint32(1) + +from RecoPPS.Local.totemRPLocalReconstruction_cff import totemRPLocalReconstruction +process.load('RecoPPS.Local.totemRPLocalReconstruction_cff') +from RecoPPS.Local.ctppsPixelLocalReconstruction_cff import ctppsPixelLocalReconstruction +process.load('RecoPPS.Local.ctppsPixelLocalReconstruction_cff') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.ctppsRawToDigi) +process.reco_step = cms.Path(process.totemRPLocalReconstruction*process.ctppsPixelLocalReconstruction) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.output_step = cms.EndPath(process.output) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.reco_step,process.endjob_step,process.output_step) + +# filter all path with the production filter sequence +for path in process.paths: + # getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + getattr(process,path)._seq = getattr(process,path)._seq + diff --git a/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py b/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py index c8f9d538cf75d..534dff982adad 100644 --- a/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py +++ b/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py @@ -25,14 +25,16 @@ # so far, it is not yet defined the optic for 2017 and 2018, if needed, change the config for these year to the 2016 one from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 -#ctpps_2016.toReplaceWith(LHCTransportPSet, _totemTransportSetup_2016) -ctpps_2016.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2016.optics_parameters) +ctpps_2016.toReplaceWith(_LHCTransportPSet, _totemTransportSetup_2016) +#ctpps_2016.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2016.optics_parameters) from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017 -ctpps_2017.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2017.optics_parameters) +ctpps_2017.toReplaceWith(_LHCTransportPSet, _totemTransportSetup_2016) +#ctpps_2017.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2017.optics_parameters) from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 -ctpps_2018.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2018.optics_parameters) +ctpps_2018.toReplaceWith(_LHCTransportPSet, _totemTransportSetup_2016) +#ctpps_2018.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2018.optics_parameters) from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021 ctpps_2021.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2021.optics_parameters) From 9f60f0642cb018c0c45f64c8c0889bdb2e30174b Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Thu, 21 May 2020 19:12:51 +0200 Subject: [PATCH 10/16] Moving redefinition of parameters from other packages to the respective place --- IOMC/RandomEngine/python/IOMC_cff.py | 2 +- SimG4Core/Application/python/g4SimHits_cfi.py | 9 ++++++ .../test/gluglu_step1_GEN_SIM_2017.py | 10 +------ .../test/gluglu_step2_DIGI_DIGI2RAW_2017.py | 29 ------------------- .../gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py | 28 ------------------ .../test/pg_step1_GEN_SIM_2016.py | 1 - .../test/pg_step1_GEN_SIM_2017.py | 2 +- .../test/pg_step1_GEN_SIM_2018.py | 2 +- .../python/PPSTransport_cff.py | 9 ------ 9 files changed, 13 insertions(+), 79 deletions(-) diff --git a/IOMC/RandomEngine/python/IOMC_cff.py b/IOMC/RandomEngine/python/IOMC_cff.py index 5d85e86be585c..c8c2b93668ca0 100644 --- a/IOMC/RandomEngine/python/IOMC_cff.py +++ b/IOMC/RandomEngine/python/IOMC_cff.py @@ -19,7 +19,7 @@ ), LHCTransport = cms.PSet( initialSeed = cms.untracked.uint32(87654321), - engineName = FastSimEngine + engineName = cms.untracked.string('TRandom3') ), hiSignalLHCTransport = cms.PSet( initialSeed = cms.untracked.uint32(88776655), diff --git a/SimG4Core/Application/python/g4SimHits_cfi.py b/SimG4Core/Application/python/g4SimHits_cfi.py index b945ba36a9a16..b34468ee156f7 100644 --- a/SimG4Core/Application/python/g4SimHits_cfi.py +++ b/SimG4Core/Application/python/g4SimHits_cfi.py @@ -575,6 +575,15 @@ run2_common.toModify( g4SimHits.HFShowerLibrary, FileName = 'SimG4CMS/Calo/data/HFShowerLibrary_npmt_noatt_eta4_16en_v4.root' ) run2_common.toModify( g4SimHits.HFShower, ProbMax = 0.5) + +from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 +ctpps_2016.toModify( g4SimHits.Generator, HepMCProductLabel = 'LHCTransport') +ctpps_2016.toModify( g4SimHits.Generator, MinEtaCut = cms.double(-13.0)) +ctpps_2016.toModify( g4SimHits.Generator, MaxEtaCut = cms.double( 13.0)) +ctpps_2016.toModify( g4SimHits.SteppingAction, MaxTrackTime = cms.double(2000.0)) +ctpps_2016.toModify( g4SimHits.StackingAction, MaxTrackTime = cms.double(2000.0)) + + from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017 run2_HCAL_2017.toModify( g4SimHits, HCalSD = dict( TestNumberingScheme = True ) ) from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing diff --git a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py index c868dd8712241..5bf2d78d5dbdf 100644 --- a/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py +++ b/SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py @@ -23,15 +23,7 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -#process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') # This line must be added to simulate PPS while its sim geometry is not in the DB -process.load('Configuration.StandardSequences.GeometryDB_cff') -process.GlobalTag.toGet = cms.VPSet( - cms.PSet(record = cms.string("GeometryFileRcd"), - tag = cms.string("XMLFILE_Geometry_110YV3_Extended2017CTPPS_mc"), - connect = cms.string("sqlite_file:PPS_geometry_DB.db") - ) -) -process.XMLFromDBSource.label='' +process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') # This line must be added to simulate PPS while its sim geometry is not in the DB process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) diff --git a/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py b/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py index 41ae920f05fc9..1972a2faa6cb5 100644 --- a/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py +++ b/SimPPS/Configuration/test/gluglu_step2_DIGI_DIGI2RAW_2017.py @@ -22,7 +22,6 @@ process.load('Configuration.StandardSequences.DigiToRaw_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load('CalibPPS.ESProducers.CTPPSPixelDAQMappingESSourceXML_cfi') process.load("CondCore.CondDB.CondDB_cfi") process.load('Configuration.StandardSequences.GeometryRecoDB_cff') @@ -68,34 +67,6 @@ from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') -process.GlobalTag.toGet = cms.VPSet( - cms.PSet( - record = cms.string('CTPPSPixelGainCalibrationsRcd'), - tag = cms.string("CTPPSPixelGainCalibrations_mc"), - connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') - ), - cms.PSet( - record = cms.string('CTPPSPixelAnalysisMaskRcd'), - tag = cms.string("CTPPSPixelAnalysisMask_mc"), - label = cms.untracked.string(""), - connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') - ), - cms.PSet( - record = cms.string('CTPPSPixelDAQMappingRcd'), - tag = cms.string("CTPPSPixelDAQMapping_mc"), - connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') - ) -) - -process.load("CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi") -process.totemDAQMappingESSourceXML.configuration = cms.VPSet( - cms.PSet( - validityRange = cms.EventRange("1:min - 999999999:max"), - mappingFileNames = cms.vstring("CondFormats/PPSObjects/xml/mapping_tracking_strip_2017.xml"), - maskFileNames = cms.vstring() - ) -) - # Path and EndPath definitions process.digitisation_step = cms.Path(process.pdigi) diff --git a/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py b/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py index 3dc6513edb4d1..efb52083b4014 100644 --- a/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py +++ b/SimPPS/Configuration/test/gluglu_step3_RAW2DIGI_L1Reco_RECO_2017.py @@ -62,35 +62,7 @@ process.RandomNumberGeneratorService.restoreStateLabel=cms.untracked.string("randomEngineStateProducer") from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') -process.GlobalTag.toGet = cms.VPSet( - cms.PSet( - record = cms.string('CTPPSPixelGainCalibrationsRcd'), - tag = cms.string("CTPPSPixelGainCalibrations_mc"), - connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') - ), - cms.PSet( - record = cms.string('CTPPSPixelAnalysisMaskRcd'), - tag = cms.string("CTPPSPixelAnalysisMask_mc"), - label = cms.untracked.string(""), - connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') - ), - cms.PSet( - record = cms.string('CTPPSPixelDAQMappingRcd'), - tag = cms.string("CTPPSPixelDAQMapping_mc"), - connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') - ) -) -# modify Totem 2017 mapping -process.load('CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi') -process.totemDAQMappingESSourceXML.configuration = cms.VPSet( - cms.PSet( - validityRange = cms.EventRange("1:min - 999999999:max"), - mappingFileNames = cms.vstring("CondFormats/PPSObjects/xml/mapping_tracking_strip_2017.xml"), - maskFileNames = cms.vstring() - ) -) - # do not make testID for simulation - keeping the frame from EventFilter.CTPPSRawToDigi.totemRPRawToDigi_cfi import totemRPRawToDigi totemRPRawToDigi.RawToDigi.testID = cms.uint32(1) diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py index 8b8aa55ede8e4..ffad8a6f6aa35 100644 --- a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py @@ -21,7 +21,6 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('Configuration.Geometry.GeometryExtended2016_CTPPS_cff') -process.load('Configuration.StandardSequences.GeometrySimDB_cff') process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py index d477f53309c75..b5c35d0cde361 100644 --- a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py @@ -20,7 +20,7 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load('Configuration.StandardSequences.GeometrySimDB_cff') +#process.load('Configuration.StandardSequences.GeometrySimDB_cff') process.load('Configuration.Geometry.GeometryExtended2017_CTPPS_cff') process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py index 82a4b16a316e6..4d4eac37f7da8 100644 --- a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py @@ -24,7 +24,7 @@ process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) -nEvent_ = 100000 +nEvent_ = 1000 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(nEvent_) ) diff --git a/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py b/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py index 534dff982adad..4cb917618d002 100644 --- a/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py +++ b/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py @@ -1,13 +1,4 @@ import FWCore.ParameterSet.Config as cms -from SimG4Core.Application.g4SimHits_cfi import * -g4SimHits.Generator.MinEtaCut = cms.double(-13.0) -g4SimHits.Generator.MaxEtaCut = cms.double( 13.0) -g4SimHits.Generator.HepMCProductLabel = 'LHCTransport' -g4SimHits.SteppingAction.MaxTrackTime = cms.double(2000.0) -g4SimHits.StackingAction.MaxTrackTime = cms.double(2000.0) - -from IOMC.RandomEngine.IOMC_cff import * -RandomNumberGeneratorService.LHCTransport.engineName = cms.untracked.string('TRandom3') # # to avoid higher level moodules to import uneeded objects, import module as _module From be785497693df0a629f3d55da599adbc5665ed9b Mon Sep 17 00:00:00 2001 From: mundim Date: Thu, 21 May 2020 15:01:05 -0300 Subject: [PATCH 11/16] Update SimG4Core/Application/python/g4SimHits_cfi.py Co-authored-by: Matti Kortelainen --- SimG4Core/Application/python/g4SimHits_cfi.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/SimG4Core/Application/python/g4SimHits_cfi.py b/SimG4Core/Application/python/g4SimHits_cfi.py index b34468ee156f7..29a3cb18a891b 100644 --- a/SimG4Core/Application/python/g4SimHits_cfi.py +++ b/SimG4Core/Application/python/g4SimHits_cfi.py @@ -577,11 +577,17 @@ from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 -ctpps_2016.toModify( g4SimHits.Generator, HepMCProductLabel = 'LHCTransport') -ctpps_2016.toModify( g4SimHits.Generator, MinEtaCut = cms.double(-13.0)) -ctpps_2016.toModify( g4SimHits.Generator, MaxEtaCut = cms.double( 13.0)) -ctpps_2016.toModify( g4SimHits.SteppingAction, MaxTrackTime = cms.double(2000.0)) -ctpps_2016.toModify( g4SimHits.StackingAction, MaxTrackTime = cms.double(2000.0)) +ctpps_2016.toModify(g4SimHits, + Generator = dict( + HepMCProductLabel = 'LHCTransport', + MinEtaCut = -13.0, + MaxEtaCut = 13.0 + ), + SteppingAction = dict( + MaxTrackTime = 2000.0, + MaxTrackTime = 2000.0 + ) +) from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017 From f0ec06447bb3bb63595d7497b9fd9aecd541c981 Mon Sep 17 00:00:00 2001 From: mundim Date: Wed, 3 Jun 2020 15:38:56 -0300 Subject: [PATCH 12/16] Update g4SimHits_cfi.py Moving the second MaxTrackTime redefinition from SteppintAction to StackingAction. --- SimG4Core/Application/python/g4SimHits_cfi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SimG4Core/Application/python/g4SimHits_cfi.py b/SimG4Core/Application/python/g4SimHits_cfi.py index 29a3cb18a891b..7b50795347365 100644 --- a/SimG4Core/Application/python/g4SimHits_cfi.py +++ b/SimG4Core/Application/python/g4SimHits_cfi.py @@ -584,7 +584,9 @@ MaxEtaCut = 13.0 ), SteppingAction = dict( - MaxTrackTime = 2000.0, + MaxTrackTime = 2000.0 + ), + StackingAction = dict( MaxTrackTime = 2000.0 ) ) From 4a2d4434aa656358c2e5c638d5268c505315e961 Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Tue, 9 Jun 2020 20:05:38 +0200 Subject: [PATCH 13/16] Resolving a bug in PPSProtonTransport; moving the propagator do use db saved optical functions --- .../test/pg_step1_GEN_SIM_2016.py | 16 +++- .../test/pg_step1_GEN_SIM_2017.py | 43 +++------ .../test/pg_step1_GEN_SIM_2018.py | 18 +++- .../test/pg_step2_DIGI_DIGI2RAW_2016.py | 6 +- .../test/pg_step2_DIGI_DIGI2RAW_2017.py | 5 +- .../test/pg_step2_DIGI_DIGI2RAW_2018.py | 5 +- .../test/pg_step3_MCDB_RAW2DIGI_RECO_2016.py | 2 +- .../test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py | 4 +- .../test/pg_step3_MCDB_RAW2DIGI_RECO_2018.py | 2 +- .../interface/OpticalFunctionsTransport.h | 2 + .../python/OpticalFunctionsConfig_cfi.py | 2 +- .../python/PPSTransport_cff.py | 9 +- .../src/OpticalFunctionsTransport.cc | 88 +++++++++++-------- 13 files changed, 104 insertions(+), 98 deletions(-) diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py index ffad8a6f6aa35..244d805a39536 100644 --- a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2016.py @@ -24,12 +24,20 @@ process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) -nEvent_ = 1000 +nEvent_ = 500000 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(nEvent_) ) -process.source = cms.Source("EmptySource") +process.source = cms.Source("EmptySource", + #firstRun = cms.untracked.uint32(306572), # 2016H data + #firstTime = cms.untracked.uint64(6487615523004612608) # this is needed because it lacks the MC tag, run based + #firstRun = cms.untracked.uint32(273730), # 2016H data + #firstTime = cms.untracked.uint64(6286859745043152896) # this is needed because it lacks the MC tag, run based + firstRun = cms.untracked.uint32(282730), # 2016H data + firstTime = cms.untracked.uint64(6339435345951588352) # this is needed because it lacks the MC tag, run based +) + process.options = cms.untracked.PSet() @@ -46,8 +54,8 @@ phi_max = math.pi t_min = 0. t_max = 2. -xi_min = 0.01 -xi_max = 0.3 +xi_min = 0.02 +xi_max = 0.2 ecms = 13000. process.generator = cms.EDProducer("RandomtXiGunProducer", diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py index b5c35d0cde361..9d4ca483bdab5 100644 --- a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2017.py @@ -25,13 +25,20 @@ process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) -nEvent_ = 1000 +nEvent_ = 500000 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(nEvent_) ) process.source = cms.Source("EmptySource", - firstRun = cms.untracked.uint32(297180) + firstRun = cms.untracked.uint32(297046), # 2017B data + firstTime = cms.untracked.uint64(6432299367889108992) + #firstRun = cms.untracked.uint32(298653), # 2017B data + #firstTime = cms.untracked.uint64(6440921708009357312) + #firstRun = cms.untracked.uint32(303719), # 2017E data + #firstTime = cms.untracked.uint64(6468633270794846208) + #firstRun = cms.untracked.uint32(306896), # 2017H data + #firstTime = cms.untracked.uint64(6490831126364422144) ) process.options = cms.untracked.PSet() @@ -40,42 +47,14 @@ from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') -# Optical functions -#process.load('CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cfi') -#process.ctppsInterpolatedOpticalFunctionsESSource.lhcInfoLabel = "" - -#process.load('CalibPPS.ESProducers.ctppsOpticalFunctionsESSource_cfi') -#print process.ctppsOpticalFunctionsESSource.label - -#process.load('CalibPPS.ESProducers.ctppsBeamParametersESSource_cfi') -#from SimTransport.PPSProtonTransport.PPSTransportESSources_cfi import * -""" -process.PoolDBESSource = cms.ESSource("PoolDBESSource", - process.CondDB, - timetype = cms.untracked.string('runnumber'), - DumpStat=cms.untracked.bool(True), - toGet = cms.VPSet( - cms.PSet( - record = cms.string('LHCInfoRcd'), - tag = cms.string("LHCInfoEndFill_prompt_v2"), # FrontierProd - connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") - ), - cms.PSet( - record = cms.string('CTPPSOpticsRcd'), - tag = cms.string("PPSOpticalFunctions_offline_v6"), - connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"), - ) - ) -) -""" # generator phi_min = -math.pi phi_max = math.pi t_min = 0. t_max = 2. -xi_min = 0.01 -xi_max = 0.3 +xi_min = 0.02 +xi_max = 0.20 ecms = 13000. process.generator = cms.EDProducer("RandomtXiGunProducer", diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py index 4d4eac37f7da8..45f4108118e7b 100644 --- a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2018.py @@ -24,12 +24,22 @@ process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) -nEvent_ = 1000 +nEvent_ = 500000 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(nEvent_) ) -process.source = cms.Source("EmptySource") +process.source = cms.Source("EmptySource", + firstRun = cms.untracked.uint32(315252), # 2018A + firstTime = cms.untracked.uint64(6548822380385402880) + #firstRun = cms.untracked.uint32(319337), # 2018C + #firstTime = cms.untracked.uint64(6575656846424539136) + #firstRun = cms.untracked.uint32(323363), # 2018D + #firstTime = cms.untracked.uint64(6604361306864615424) + #firstRun = cms.untracked.uint32(324612), #2018D + #firstTime = cms.untracked.uint64(6612348794983940096) +) + process.options = cms.untracked.PSet() @@ -43,8 +53,8 @@ phi_max = math.pi t_min = 0. t_max = 2. -xi_min = 0.01 -xi_max = 0.3 +xi_min = 0.02 +xi_max = 0.2 ecms = 13000. process.generator = cms.EDProducer("RandomtXiGunProducer", diff --git a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2016.py b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2016.py index 2c4ced34ed29a..c4ed2620a5e73 100644 --- a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2016.py +++ b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2016.py @@ -27,12 +27,10 @@ #process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2016_cfi") process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - # Input source +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1)) process.source = cms.Source("PoolSource", + skipEvents=cms.untracked.uint32(0), dropDescendantsOfDroppedBranches = cms.untracked.bool(False), fileNames = cms.untracked.vstring('file:step1_SIM2016.root'), inputCommands = cms.untracked.vstring('keep *', diff --git a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py index 62b4aa8476d01..bf29524e43457 100644 --- a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py +++ b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2017.py @@ -25,12 +25,11 @@ #process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) # Input source +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1)) process.source = cms.Source("PoolSource", + skipEvents= cms.untracked.uint32(0), dropDescendantsOfDroppedBranches = cms.untracked.bool(False), fileNames = cms.untracked.vstring('file:step1_SIM2017.root'), inputCommands = cms.untracked.vstring('keep *', diff --git a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2018.py b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2018.py index d111d145bdcaa..6f48043f524ea 100644 --- a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2018.py +++ b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2018.py @@ -26,9 +26,6 @@ #process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2018_cfi") process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(1000) -) process.GlobalTag.toGet = cms.VPSet( cms.PSet( record = cms.string('CTPPSPixelGainCalibrationsRcd'), @@ -48,7 +45,9 @@ ) ) # Input source +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1)) process.source = cms.Source("PoolSource", + skipEvents=cms.untracked.uint32(0), dropDescendantsOfDroppedBranches = cms.untracked.bool(False), fileNames = cms.untracked.vstring('file:step1_SIM2018.root'), inputCommands = cms.untracked.vstring('keep *', diff --git a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2016.py b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2016.py index 73bb4efb1ecd4..5923bfe4a8787 100644 --- a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2016.py +++ b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2016.py @@ -44,7 +44,7 @@ process.output = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string('step3_RAW2DIGI_RECO2016.root'), - outputCommands = cms.untracked.vstring("drop *","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*') + outputCommands = cms.untracked.vstring("drop *","keep SimVertexs_g4SimHits_*_*","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*') ) diff --git a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py index 3fee315f7cb45..f846ed0eb1fa9 100644 --- a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py +++ b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2017.py @@ -16,6 +16,7 @@ process.load('Configuration.StandardSequences.GeometryDB_cff') process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") # totem frame #process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2017_cfi") # CMS frame +""" process.GlobalTag.toGet = cms.VPSet( cms.PSet(record = cms.string("GeometryFileRcd"), tag = cms.string("XMLFILE_Geometry_110YV3_Extended2017CTPPS_mc"), @@ -23,6 +24,7 @@ ) ) process.XMLFromDBSource.label='' +""" process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) @@ -52,7 +54,7 @@ process.output = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string('step3_RAW2DIGI_RECO2017.root'), - outputCommands = cms.untracked.vstring("drop *","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*') + outputCommands = cms.untracked.vstring("drop *","keep SimVertexs_g4SimHits_*_*","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*') ) diff --git a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2018.py b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2018.py index 37a634a89323b..dd6f4235135e1 100644 --- a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2018.py +++ b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2018.py @@ -46,7 +46,7 @@ process.output = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string('step3_RAW2DIGI_RECO2018.root'), - outputCommands = cms.untracked.vstring("drop *","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*') + outputCommands = cms.untracked.vstring("drop *","keep SimVertexs_g4SimHits_*_*","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*') ) diff --git a/SimTransport/PPSProtonTransport/interface/OpticalFunctionsTransport.h b/SimTransport/PPSProtonTransport/interface/OpticalFunctionsTransport.h index 08bebbd7b1558..d1d596ef0b4c9 100644 --- a/SimTransport/PPSProtonTransport/interface/OpticalFunctionsTransport.h +++ b/SimTransport/PPSProtonTransport/interface/OpticalFunctionsTransport.h @@ -35,6 +35,8 @@ class OpticalFunctionsTransport : public BaseProtonTransport { edm::ESHandle lhcInfo_; edm::ESHandle beamParameters_; edm::ESHandle opticalFunctions_; + unsigned int optFunctionId45_; + unsigned int optFunctionId56_; bool useEmpiricalApertures_; double empiricalAperture45_xi0_int_, empiricalAperture45_xi0_slp_, empiricalAperture45_a_int_, diff --git a/SimTransport/PPSProtonTransport/python/OpticalFunctionsConfig_cfi.py b/SimTransport/PPSProtonTransport/python/OpticalFunctionsConfig_cfi.py index cb0e15c647d56..5869023d6e860 100644 --- a/SimTransport/PPSProtonTransport/python/OpticalFunctionsConfig_cfi.py +++ b/SimTransport/PPSProtonTransport/python/OpticalFunctionsConfig_cfi.py @@ -5,7 +5,7 @@ ApplyZShift = cms.bool(True), lhcInfoLabel = cms.string(""), opticsLabel = cms.string(""), - produceHitsRelativeToBeam = cms.bool(True), + produceHitsRelativeToBeam = cms.bool(False), useEmpiricalApertures = cms.bool(True) ) diff --git a/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py b/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py index 4cb917618d002..b1f1fc81c9242 100644 --- a/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py +++ b/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py @@ -16,16 +16,13 @@ # so far, it is not yet defined the optic for 2017 and 2018, if needed, change the config for these year to the 2016 one from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 -ctpps_2016.toReplaceWith(_LHCTransportPSet, _totemTransportSetup_2016) -#ctpps_2016.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2016.optics_parameters) +ctpps_2016.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2016.optics_parameters) from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017 -ctpps_2017.toReplaceWith(_LHCTransportPSet, _totemTransportSetup_2016) -#ctpps_2017.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2017.optics_parameters) +ctpps_2017.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2017.optics_parameters) from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 -ctpps_2018.toReplaceWith(_LHCTransportPSet, _totemTransportSetup_2016) -#ctpps_2018.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2018.optics_parameters) +ctpps_2018.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2018.optics_parameters) from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021 ctpps_2021.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2021.optics_parameters) diff --git a/SimTransport/PPSProtonTransport/src/OpticalFunctionsTransport.cc b/SimTransport/PPSProtonTransport/src/OpticalFunctionsTransport.cc index 4fca6556bca1e..cef0743e69b06 100644 --- a/SimTransport/PPSProtonTransport/src/OpticalFunctionsTransport.cc +++ b/SimTransport/PPSProtonTransport/src/OpticalFunctionsTransport.cc @@ -26,6 +26,20 @@ void OpticalFunctionsTransport::process(const HepMC::GenEvent* evt, iSetup.get().get(beamParameters_); iSetup.get().get(opticsLabel_, opticalFunctions_); +// Choose the optical function corresponding to the first station ono each side (it is in lhc ref. frame) + optFunctionId45_ = 0; + optFunctionId56_ = 0; + for (const auto& ofp:(*opticalFunctions_)) { + if (ofp.second.getScoringPlaneZ()<0) { + if (optFunctionId45_==0) optFunctionId45_=ofp.first; + if (opticalFunctions_->at(optFunctionId45_).getScoringPlaneZ()0) { + if (optFunctionId56_==0) optFunctionId56_= ofp.first; + if (opticalFunctions_->at(optFunctionId56_).getScoringPlaneZ()>ofp.second.getScoringPlaneZ()) optFunctionId56_=ofp.first; + } + } +// engine_ = _engine; // the engine needs to be updated for each event for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin(); @@ -59,15 +73,16 @@ bool OpticalFunctionsTransport::transportProton(const HepMC::GenParticle* in_trk HepMC::FourVector mom_lhc(-mom_cms.x(), mom_cms.y(), -mom_cms.z(), mom_cms.t()); // determine the LHC arm and related parameters - unsigned int arm = 3; + double urad = 1.e-6; double beamMomentum = 0.; double xangle = 0.; double empiricalAperture_xi0_int, empiricalAperture_xi0_slp; double empiricalAperture_a_int, empiricalAperture_a_slp; + unsigned int optFunctionId_; if (mom_lhc.z() < 0) // sector 45 { - arm = 0; + optFunctionId_ = optFunctionId45_; beamMomentum = beamParameters_->getBeamMom45(); xangle = beamParameters_->getHalfXangleX45(); empiricalAperture_xi0_int = empiricalAperture45_xi0_int_; @@ -75,7 +90,7 @@ bool OpticalFunctionsTransport::transportProton(const HepMC::GenParticle* in_trk empiricalAperture_a_int = empiricalAperture45_a_int_; empiricalAperture_a_slp = empiricalAperture45_a_slp_; } else { // sector 56 - arm = 1; + optFunctionId_ = optFunctionId56_; beamMomentum = beamParameters_->getBeamMom56(); xangle = beamParameters_->getHalfXangleX56(); empiricalAperture_xi0_int = empiricalAperture56_xi0_int_; @@ -83,7 +98,7 @@ bool OpticalFunctionsTransport::transportProton(const HepMC::GenParticle* in_trk empiricalAperture_a_int = empiricalAperture56_a_int_; empiricalAperture_a_slp = empiricalAperture56_a_slp_; } - + if (xangle>1.0) xangle*=urad; // calculate kinematics for optics parametrisation const double p = mom_lhc.rho(); const double xi = 1. - p / beamMomentum; @@ -93,14 +108,14 @@ bool OpticalFunctionsTransport::transportProton(const HepMC::GenParticle* in_trk const double vtx_lhc_eff_y = vtx_lhc.y() - vtx_lhc.z() * (mom_lhc.y() / mom_lhc.z()); if (verbosity_) { - LogDebug("OpticalFunctionsTransport") + LogDebug("OpticalFunctionsTransport") << "simu: xi = " << xi << ", th_x_phys = " << th_x_phys << ", th_y_phys = " << th_y_phys << ", vtx_lhc_eff_x = " << vtx_lhc_eff_x << ", vtx_lhc_eff_y = " << vtx_lhc_eff_y << std::endl; } // check empirical aperture if (useEmpiricalApertures_) { - const auto& xangle = lhcInfo_->crossingAngle(); + const auto& xangle = (lhcInfo_->crossingAngle()>1.0)?lhcInfo_->crossingAngle()*urad:lhcInfo_->crossingAngle(); const double xi_th = (empiricalAperture_xi0_int + xangle * empiricalAperture_xi0_slp) + (empiricalAperture_a_int + xangle * empiricalAperture_a_slp) * th_x_phys; @@ -112,58 +127,55 @@ bool OpticalFunctionsTransport::transportProton(const HepMC::GenParticle* in_trk } } - // transport the proton into each pot/scoring plane - for (const auto& ofp : (*opticalFunctions_)) { - CTPPSDetId rpId(ofp.first); - const unsigned int rpDecId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp(); - // first check the arm - if (rpId.arm() != arm) - continue; + // transport the proton into pot/scoring plane + auto ofp = opticalFunctions_->at(optFunctionId_); + CTPPSDetId rpId(optFunctionId_); + const unsigned int rpDecId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp(); - if (verbosity_) + if (verbosity_) LogDebug("OpticalFunctionsTransport") << " RP " << rpDecId << std::endl; // transport proton - LHCInterpolatedOpticalFunctionsSet::Kinematics k_in = { + LHCInterpolatedOpticalFunctionsSet::Kinematics k_in = { vtx_lhc_eff_x * 1E-1, th_x_phys, vtx_lhc_eff_y * 1E-1, th_y_phys, xi}; // conversions: mm -> cm - LHCInterpolatedOpticalFunctionsSet::Kinematics k_out; - ofp.second.transport(k_in, k_out, true); + LHCInterpolatedOpticalFunctionsSet::Kinematics k_out; + ofp.transport(k_in, k_out, true); - double b_x = k_out.x * 1E1, b_y = k_out.y * 1E1; // conversions: cm -> mm - double a_x = k_out.th_x, a_y = k_out.th_y; +// Original code uses mm, but CMS uses cm, so keep it in cm + double b_x = k_out.x * 1E1, b_y = k_out.y * 1E1; // conversions: cm -> mm + double a_x = k_out.th_x, a_y = k_out.th_y; - // if needed, subtract beam position and angle - if (produceHitsRelativeToBeam_) { + // if needed, subtract beam position and angle + if (produceHitsRelativeToBeam_) { // determine beam position LHCInterpolatedOpticalFunctionsSet::Kinematics k_be_in = {0., 0., 0., 0., 0.}; LHCInterpolatedOpticalFunctionsSet::Kinematics k_be_out; - ofp.second.transport(k_be_in, k_be_out, true); + ofp.transport(k_be_in, k_be_out, true); a_x -= k_be_out.th_x; a_y -= k_be_out.th_y; - b_x -= k_be_out.x * 1E1; + b_x -= k_be_out.x * 1E1; b_y -= k_be_out.y * 1E1; // conversions: cm -> mm - } + } - const double z_scoringPlane = ofp.second.getScoringPlaneZ() * 1E1; // conversion: cm --> mm + const double z_scoringPlane = ofp.getScoringPlaneZ() * 1E1; // conversion: cm --> mm - if (verbosity_) { + if (verbosity_) { LogDebug("OpticalFunctionsTransport") << " proton transported: a_x = " << a_x << " rad, a_y = " << a_y << " rad, b_x = " << b_x << " mm, b_y = " << b_y << " mm, z = " << z_scoringPlane << " mm" << std::endl; - } - unsigned int line = in_trk->barcode(); - double px = -p * a_x; - double py = p * a_y; - double pz = std::copysign(sqrt(p * p - px * px - py * py), mom_cms.z()); - double e = sqrt(px * px + py * py + pz * pz + ProtonMassSQ); - TLorentzVector p_out(px, py, pz, e); - m_beamPart[line] = p_out; - m_xAtTrPoint[line] = -b_x; - m_yAtTrPoint[line] = b_y; - return true; } - return false; + + unsigned int line = in_trk->barcode(); + double px = -p * a_x; + double py = p * a_y; + double pz = std::copysign(sqrt(p * p - px * px - py * py), mom_cms.z()); + double e = sqrt(px * px + py * py + pz * pz + ProtonMassSQ); + TLorentzVector p_out(px, py, pz, e); + m_beamPart[line] = p_out; + m_xAtTrPoint[line] = -b_x; + m_yAtTrPoint[line] = b_y; + return true; } From e4f9d2c592db5e05d8877d4cc6a3444fe2eeb75a Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Wed, 10 Jun 2020 00:31:14 +0200 Subject: [PATCH 14/16] bringing a file compliant with code-format option --- .../src/OpticalFunctionsTransport.cc | 69 ++++++++++--------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/SimTransport/PPSProtonTransport/src/OpticalFunctionsTransport.cc b/SimTransport/PPSProtonTransport/src/OpticalFunctionsTransport.cc index cef0743e69b06..4056f4cfd13f7 100644 --- a/SimTransport/PPSProtonTransport/src/OpticalFunctionsTransport.cc +++ b/SimTransport/PPSProtonTransport/src/OpticalFunctionsTransport.cc @@ -26,20 +26,24 @@ void OpticalFunctionsTransport::process(const HepMC::GenEvent* evt, iSetup.get().get(beamParameters_); iSetup.get().get(opticsLabel_, opticalFunctions_); -// Choose the optical function corresponding to the first station ono each side (it is in lhc ref. frame) + // Choose the optical function corresponding to the first station ono each side (it is in lhc ref. frame) optFunctionId45_ = 0; optFunctionId56_ = 0; - for (const auto& ofp:(*opticalFunctions_)) { - if (ofp.second.getScoringPlaneZ()<0) { - if (optFunctionId45_==0) optFunctionId45_=ofp.first; - if (opticalFunctions_->at(optFunctionId45_).getScoringPlaneZ()0) { - if (optFunctionId56_==0) optFunctionId56_= ofp.first; - if (opticalFunctions_->at(optFunctionId56_).getScoringPlaneZ()>ofp.second.getScoringPlaneZ()) optFunctionId56_=ofp.first; - } + for (const auto& ofp : (*opticalFunctions_)) { + if (ofp.second.getScoringPlaneZ() < 0) { + if (optFunctionId45_ == 0) + optFunctionId45_ = ofp.first; + if (opticalFunctions_->at(optFunctionId45_).getScoringPlaneZ() < ofp.second.getScoringPlaneZ()) + optFunctionId45_ = ofp.first; + } + if (ofp.second.getScoringPlaneZ() > 0) { + if (optFunctionId56_ == 0) + optFunctionId56_ = ofp.first; + if (opticalFunctions_->at(optFunctionId56_).getScoringPlaneZ() > ofp.second.getScoringPlaneZ()) + optFunctionId56_ = ofp.first; + } } -// + // engine_ = _engine; // the engine needs to be updated for each event for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin(); @@ -98,7 +102,8 @@ bool OpticalFunctionsTransport::transportProton(const HepMC::GenParticle* in_trk empiricalAperture_a_int = empiricalAperture56_a_int_; empiricalAperture_a_slp = empiricalAperture56_a_slp_; } - if (xangle>1.0) xangle*=urad; + if (xangle > 1.0) + xangle *= urad; // calculate kinematics for optics parametrisation const double p = mom_lhc.rho(); const double xi = 1. - p / beamMomentum; @@ -108,14 +113,15 @@ bool OpticalFunctionsTransport::transportProton(const HepMC::GenParticle* in_trk const double vtx_lhc_eff_y = vtx_lhc.y() - vtx_lhc.z() * (mom_lhc.y() / mom_lhc.z()); if (verbosity_) { - LogDebug("OpticalFunctionsTransport") + LogDebug("OpticalFunctionsTransport") << "simu: xi = " << xi << ", th_x_phys = " << th_x_phys << ", th_y_phys = " << th_y_phys << ", vtx_lhc_eff_x = " << vtx_lhc_eff_x << ", vtx_lhc_eff_y = " << vtx_lhc_eff_y << std::endl; } // check empirical aperture if (useEmpiricalApertures_) { - const auto& xangle = (lhcInfo_->crossingAngle()>1.0)?lhcInfo_->crossingAngle()*urad:lhcInfo_->crossingAngle(); + const auto& xangle = + (lhcInfo_->crossingAngle() > 1.0) ? lhcInfo_->crossingAngle() * urad : lhcInfo_->crossingAngle(); const double xi_th = (empiricalAperture_xi0_int + xangle * empiricalAperture_xi0_slp) + (empiricalAperture_a_int + xangle * empiricalAperture_a_slp) * th_x_phys; @@ -127,45 +133,44 @@ bool OpticalFunctionsTransport::transportProton(const HepMC::GenParticle* in_trk } } - // transport the proton into pot/scoring plane auto ofp = opticalFunctions_->at(optFunctionId_); CTPPSDetId rpId(optFunctionId_); const unsigned int rpDecId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp(); if (verbosity_) - LogDebug("OpticalFunctionsTransport") << " RP " << rpDecId << std::endl; + LogDebug("OpticalFunctionsTransport") << " RP " << rpDecId << std::endl; - // transport proton + // transport proton LHCInterpolatedOpticalFunctionsSet::Kinematics k_in = { - vtx_lhc_eff_x * 1E-1, th_x_phys, vtx_lhc_eff_y * 1E-1, th_y_phys, xi}; // conversions: mm -> cm + vtx_lhc_eff_x * 1E-1, th_x_phys, vtx_lhc_eff_y * 1E-1, th_y_phys, xi}; // conversions: mm -> cm LHCInterpolatedOpticalFunctionsSet::Kinematics k_out; ofp.transport(k_in, k_out, true); -// Original code uses mm, but CMS uses cm, so keep it in cm - double b_x = k_out.x * 1E1, b_y = k_out.y * 1E1; // conversions: cm -> mm + // Original code uses mm, but CMS uses cm, so keep it in cm + double b_x = k_out.x * 1E1, b_y = k_out.y * 1E1; // conversions: cm -> mm double a_x = k_out.th_x, a_y = k_out.th_y; // if needed, subtract beam position and angle if (produceHitsRelativeToBeam_) { - // determine beam position - LHCInterpolatedOpticalFunctionsSet::Kinematics k_be_in = {0., 0., 0., 0., 0.}; - LHCInterpolatedOpticalFunctionsSet::Kinematics k_be_out; - ofp.transport(k_be_in, k_be_out, true); - - a_x -= k_be_out.th_x; - a_y -= k_be_out.th_y; - b_x -= k_be_out.x * 1E1; - b_y -= k_be_out.y * 1E1; // conversions: cm -> mm + // determine beam position + LHCInterpolatedOpticalFunctionsSet::Kinematics k_be_in = {0., 0., 0., 0., 0.}; + LHCInterpolatedOpticalFunctionsSet::Kinematics k_be_out; + ofp.transport(k_be_in, k_be_out, true); + + a_x -= k_be_out.th_x; + a_y -= k_be_out.th_y; + b_x -= k_be_out.x * 1E1; + b_y -= k_be_out.y * 1E1; // conversions: cm -> mm } const double z_scoringPlane = ofp.getScoringPlaneZ() * 1E1; // conversion: cm --> mm if (verbosity_) { - LogDebug("OpticalFunctionsTransport") - << " proton transported: a_x = " << a_x << " rad, a_y = " << a_y << " rad, b_x = " << b_x - << " mm, b_y = " << b_y << " mm, z = " << z_scoringPlane << " mm" << std::endl; + LogDebug("OpticalFunctionsTransport") + << " proton transported: a_x = " << a_x << " rad, a_y = " << a_y << " rad, b_x = " << b_x + << " mm, b_y = " << b_y << " mm, z = " << z_scoringPlane << " mm" << std::endl; } unsigned int line = in_trk->barcode(); From a076a107f8ad1b7055bf620848ef2d7e4f2fb4eb Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Fri, 12 Jun 2020 23:23:21 +0200 Subject: [PATCH 15/16] Including PPS geometry into the extended one; removing the alternative es_source from PPSTransportESSources; Adding ctpps_2021 into Run3 Era to force using the proton propagation for 2021 --- Configuration/Eras/python/Era_Run3_cff.py | 3 +- .../python/cmsExtendedGeometry2021XML_cfi.py | 101 ++++++++++++++- .../VeryForwardData/data/pps/2021/v1/pps.xml | 120 ----------------- .../test/pg_step1_GEN_SIM_2021.py | 18 ++- .../test/pg_step2_DIGI_DIGI2RAW_2021.py | 122 ++++++++++++++++++ .../test/pg_step3_MCDB_RAW2DIGI_RECO_2021.py | 101 +++++++++++++++ .../python/PPSTransportESSources_cfi.py | 23 ---- .../python/PPSTransport_cff.py | 2 +- 8 files changed, 335 insertions(+), 155 deletions(-) delete mode 100644 Geometry/VeryForwardData/data/pps/2021/v1/pps.xml create mode 100644 SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2021.py create mode 100644 SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2021.py diff --git a/Configuration/Eras/python/Era_Run3_cff.py b/Configuration/Eras/python/Era_Run3_cff.py index 4bcade9f471c5..e2077eed3990d 100644 --- a/Configuration/Eras/python/Era_Run3_cff.py +++ b/Configuration/Eras/python/Era_Run3_cff.py @@ -6,6 +6,7 @@ from Configuration.Eras.Modifier_run3_HB_cff import run3_HB from Configuration.Eras.Modifier_run2_GEM_2017_cff import run2_GEM_2017 from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021 +from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021 -Run3 = cms.ModifierChain(Run2_2018.copyAndExclude([run2_GEM_2017]), run3_common, run3_GEM, run3_HB, stage2L1Trigger_2021) +Run3 = cms.ModifierChain(Run2_2018.copyAndExclude([run2_GEM_2017]), run3_common, run3_GEM, run3_HB, stage2L1Trigger_2021,ctpps_2021) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py index 9d951165d13c8..9497f00ea5033 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py @@ -4,7 +4,7 @@ XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials.xml', + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', 'Geometry/CMSCommonData/data/rotations.xml', 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', @@ -247,7 +247,7 @@ 'Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml', 'Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml', 'Geometry/ForwardCommonData/data/brmrotations.xml', - 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', + 'Geometry/ForwardCommonData/data/brm/2021/v1/brm.xml', 'Geometry/ForwardCommonData/data/zdcmaterials.xml', 'Geometry/ForwardCommonData/data/lumimaterials.xml', 'Geometry/ForwardCommonData/data/zdcrotations.xml', @@ -283,7 +283,102 @@ 'Geometry/MuonSimData/data/muonProdCuts/2021/v1/muonProdCuts.xml', 'Geometry/ForwardSimData/data/zdcProdCuts.xml', 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml'), + 'Geometry/CMSCommonData/data/FieldParameters.xml') +# Adding PPS geometry files + +cms.vstring( + 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', + 'Geometry/ForwardCommonData/data/totemRotations.xml', + 'Geometry/VeryForwardData/data/RP_Box.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Transformations.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_001.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_002.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_004.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_101.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_102.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_104.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', + 'Geometry/VeryForwardData/data/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Materials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', + 'Geometry/VeryForwardData/data/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_2018/RP_Dist_Beam_Cent.xml'), rootNodeName = cms.string('cms:OCMS') ) diff --git a/Geometry/VeryForwardData/data/pps/2021/v1/pps.xml b/Geometry/VeryForwardData/data/pps/2021/v1/pps.xml deleted file mode 100644 index 531fa8043f43e..0000000000000 --- a/Geometry/VeryForwardData/data/pps/2021/v1/pps.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - l - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2021.py b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2021.py index 0d65c4bcd844a..2e4acfd6f1de9 100644 --- a/SimPPS/Configuration/test/pg_step1_GEN_SIM_2021.py +++ b/SimPPS/Configuration/test/pg_step1_GEN_SIM_2021.py @@ -4,7 +4,7 @@ import math from Configuration.StandardSequences.Eras import eras -process = cms.Process('SIM',eras.run3_common,eras.ctpps_2021) +process = cms.Process('SIM',eras.Run3) # import of standard configurations process.load("CondCore.CondDB.CondDB_cfi") @@ -20,7 +20,7 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load('Configuration.Geometry.GeometryExtended2021_CTPPS_cff') +process.load('Configuration.Geometry.GeometryExtended2021_cff') process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000)) @@ -29,6 +29,13 @@ input = cms.untracked.int32(nEvent_) ) +process.source = cms.Source("EmptySource") +""" +process.source = cms.Source("EmptySource", + firstRun = cms.untracked.uint32(324612), #2018D + firstTime = cms.untracked.uint64(6612348794983940096) +) +""" from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '') #process.GlobalTag = GlobalTag(process.GlobalTag, "106X_dataRun2_v26") @@ -39,8 +46,8 @@ phi_max = math.pi t_min = 0. t_max = 2. -xi_min = 0.01 -xi_max = 0.3 +xi_min = 0.03 +xi_max = 0.15 ecms = 13000. process.generator = cms.EDProducer("RandomtXiGunProducer", @@ -61,9 +68,6 @@ firstRun = cms.untracked.uint32(1), ) -process.source = cms.Source("EmptySource", -) - process.ProductionFilterSequence = cms.Sequence(process.generator) ############ diff --git a/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2021.py b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2021.py new file mode 100644 index 0000000000000..69ff167a06408 --- /dev/null +++ b/SimPPS/Configuration/test/pg_step2_DIGI_DIGI2RAW_2021.py @@ -0,0 +1,122 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('DIGI2RAW',eras.Run3) + +# import of standard configurations +process.load("CondCore.CondDB.CondDB_cfi") +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.Digi_cff') +process.load('Configuration.StandardSequences.SimL1Emulator_cff') +process.load('Configuration.StandardSequences.DigiToRaw_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +# Since the PPS simulation geometry is not yet in the database, the line below is needed +process.load('Configuration.StandardSequences.GeometryDB_cff') +#process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2021_cfi") +process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") + +process.GlobalTag.toGet = cms.VPSet( + cms.PSet( + record = cms.string('CTPPSPixelGainCalibrationsRcd'), + tag = cms.string("CTPPSPixelGainCalibrations_v1_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelAnalysisMaskRcd'), + tag = cms.string("CTPPSPixelAnalysisMask_v1_mc"), + label = cms.untracked.string(""), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("CTPPSPixelDAQMapping_v1_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ) +) +# Input source +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100)) +process.source = cms.Source("PoolSource", + skipEvents=cms.untracked.uint32(0), + dropDescendantsOfDroppedBranches = cms.untracked.bool(False), + fileNames = cms.untracked.vstring('file:step1_SIM2021.root'), + inputCommands = cms.untracked.vstring('keep *', + 'drop *_genParticles_*_*', + 'drop *_genParticlesForJets_*_*', + 'drop *_kt4GenJets_*_*', + 'drop *_kt6GenJets_*_*', + 'drop *_iterativeCone5GenJets_*_*', + 'drop *_ak4GenJets_*_*', + 'drop *_ak7GenJets_*_*', + 'drop *_ak8GenJets_*_*', + 'drop *_ak4GenJetsNoNu_*_*', + 'drop *_ak8GenJetsNoNu_*_*', + 'drop *_genCandidatesForMET_*_*', + 'drop *_genParticlesForMETAllVisible_*_*', + 'drop *_genMetCalo_*_*', + 'drop *_genMetCaloAndNonPrompt_*_*', + 'drop *_genMetTrue_*_*', + 'drop *_genMetIC5GenJs_*_*'), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + SkipEvent = cms.untracked.vstring('ProductNotFound') +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step2 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('step2_DIGI_DIGI2RAW2021.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands + ['keep *_CTPPS*_*_*',"keep *_*RP*_*_*",'keep *_LHCTransport_*_*'], + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +#process.GlobalTag = GlobalTag(process.GlobalTag, '111X_mcRun3_2021_realistic_Candidate_2020_06_03_17_55_10', '') +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '') + + +# Path and EndPath definitions +process.digitisation_step = cms.Path(process.pdigi) +process.L1simulation_step = cms.Path(process.SimL1Emulator) +process.digi2raw_step = cms.Path(process.DigiToRaw) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) +# Schedule definition +process.schedule = cms.Schedule(process.digitisation_step,process.L1simulation_step,process.digi2raw_step) +process.schedule.extend([process.endjob_step,process.FEVTDEBUGoutput_step]) + +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) + +# Customisation from command line + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2021.py b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2021.py new file mode 100644 index 0000000000000..e81e205f530e5 --- /dev/null +++ b/SimPPS/Configuration/test/pg_step3_MCDB_RAW2DIGI_RECO_2021.py @@ -0,0 +1,101 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +process = cms.Process('RECO',eras.Run3) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load("Configuration.EventContent.EventContent_cff") +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('Configuration.StandardSequences.GeometryDB_cff') +process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") +#process.load("Geometry.VeryForwardGeometry.geometryPPS_CMSxz_fromDD_2021_cfi") # CMS frame + + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.source = cms.Source("EmptyIOVSource", + timetype = cms.string('runnumber'), + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + interval = cms.uint64(1) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('file:step2_DIGI_DIGI2RAW2021.root'), + secondaryFileNames = cms.untracked.vstring() +) + +# Track memory leaks +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",ignoreTotal = cms.untracked.int32(1) ) + +process.options = cms.untracked.PSet( + SkipEvent = cms.untracked.vstring('ProductNotFound') +) + +# Output definition + +process.output = cms.OutputModule("PoolOutputModule", + fileName = cms.untracked.string('step3_RAW2DIGI_RECO2021.root'), + outputCommands = cms.untracked.vstring("drop *","keep SimVertexs_g4SimHits_*_*","keep PSimHits*_*_*_*","keep CTPPS*_*_*_*","keep *_*RP*_*_*",'keep *_LHCTransport_*_*') +) + + +# Additional output definition +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '') +process.GlobalTag.toGet = cms.VPSet( + cms.PSet( + record = cms.string('CTPPSPixelGainCalibrationsRcd'), + #tag = cms.string("CTPPSPixelGainCalibrations_mc"), + tag = cms.string("CTPPSPixelGainCalibrations_v1_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelAnalysisMaskRcd'), + tag = cms.string("CTPPSPixelAnalysisMask_v1_mc"), + label = cms.untracked.string(""), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ), + cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("CTPPSPixelDAQMapping_v1_mc"), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') + ) +) +# modify CTPPS 2018 raw-to-digi modules ONLY FOR PARTICLE GUN, TO AVOID RUN THIS FOR THE WHOLE CMS +process.load('Configuration.StandardSequences.RawToDigi_cff') + +# do not make testID for simulation - keeping the frame +from EventFilter.CTPPSRawToDigi.totemRPRawToDigi_cfi import totemRPRawToDigi +totemRPRawToDigi.RawToDigi.testID = cms.uint32(1) + +from RecoPPS.Local.totemRPLocalReconstruction_cff import totemRPLocalReconstruction +process.load('RecoPPS.Local.totemRPLocalReconstruction_cff') +from RecoPPS.Local.ctppsPixelLocalReconstruction_cff import ctppsPixelLocalReconstruction +process.load('RecoPPS.Local.ctppsPixelLocalReconstruction_cff') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.ctppsRawToDigi) +process.reco_step = cms.Path(process.totemRPLocalReconstruction*process.ctppsPixelLocalReconstruction) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.output_step = cms.EndPath(process.output) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.reco_step,process.endjob_step,process.output_step) + +# filter all path with the production filter sequence +for path in process.paths: + # getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + getattr(process,path)._seq = getattr(process,path)._seq + diff --git a/SimTransport/PPSProtonTransport/python/PPSTransportESSources_cfi.py b/SimTransport/PPSProtonTransport/python/PPSTransportESSources_cfi.py index 768690b569b57..be77dd7528a68 100644 --- a/SimTransport/PPSProtonTransport/python/PPSTransportESSources_cfi.py +++ b/SimTransport/PPSProtonTransport/python/PPSTransportESSources_cfi.py @@ -10,29 +10,6 @@ from SimTransport.PPSProtonTransport.OpticalFunctionsConfig_cfi import * -from CondCore.CondDB.CondDB_cfi import * -ppsDBESSource = cms.ESSource("PoolDBESSource", - label = cms.string(""), - validityRange = cms.EventRange("0:min - 999999:max"), - beamEnergy = cms.double(6500), - xangle = cms.double(-1), - timetype = cms.untracked.string('runnumber'), - DumpStat=cms.untracked.bool(False), - toGet = cms.VPSet( - cms.PSet( - record = cms.string('LHCInfoRcd'), - tag = cms.string("LHCInfoEndFill_prompt_v2"), # FrontierProd - connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") - ), - cms.PSet( - record = cms.string('CTPPSOpticsRcd'), - tag = cms.string("PPSOpticalFunctions_offline_v6"), - connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"), - ) - ) -) -es_prefer_ppsDBESSource = cms.ESPrefer("PoolDBESSource","ppsDBESSource") - _opticsConfig = cms.PSet( defaultCrossingAngle=cms.double(0.0), es_source = cms.PSet() diff --git a/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py b/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py index b1f1fc81c9242..f6311ca423b12 100644 --- a/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py +++ b/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py @@ -25,6 +25,6 @@ ctpps_2018.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2018.optics_parameters) from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021 -ctpps_2021.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2021.optics_parameters) +ctpps_2021.toReplaceWith(_LHCTransportPSet, _totemTransportSetup_2016) LHCTransport = cms.EDProducer("PPSSimTrackProducer",_commonParameters,_LHCTransportPSet) From d90ea01bec762fc09af2718da8a9d5ff12a7e9b8 Mon Sep 17 00:00:00 2001 From: Luiz Mundim Date: Fri, 12 Jun 2020 23:25:45 +0200 Subject: [PATCH 16/16] including a remainder --- SimTransport/PPSProtonTransport/python/PPSTransport_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py b/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py index f6311ca423b12..e21c8fd51daff 100644 --- a/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py +++ b/SimTransport/PPSProtonTransport/python/PPSTransport_cff.py @@ -25,6 +25,6 @@ ctpps_2018.toReplaceWith(_LHCTransportPSet, _opticalfunctionsTransportSetup_2018.optics_parameters) from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021 -ctpps_2021.toReplaceWith(_LHCTransportPSet, _totemTransportSetup_2016) +ctpps_2021.toReplaceWith(_LHCTransportPSet, _totemTransportSetup_2016) # there is no LHCInfo tag for Run3 yet, force to use a nonDB propagation LHCTransport = cms.EDProducer("PPSSimTrackProducer",_commonParameters,_LHCTransportPSet)