Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPS Full simulation integration #29916

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Configuration/StandardSequences/python/DigiToRaw_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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]))
8 changes: 5 additions & 3 deletions Configuration/StandardSequences/python/Digi_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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]))
Expand Down Expand Up @@ -79,5 +83,3 @@ def _modifyEnableHcalHardcode( theProcess ):

from Configuration.Eras.Modifier_hcalHardcodeConditions_cff import hcalHardcodeConditions
modifyEnableHcalHardcode_ = hcalHardcodeConditions.makeProcessModifier( _modifyEnableHcalHardcode )


3 changes: 2 additions & 1 deletion Configuration/StandardSequences/python/Generator_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
GeneInfo = cms.Sequence(GeneInfoTask)
genJetMET = cms.Sequence(genJetMETTask)

pgen = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+VertexSmearing+GenSmeared+GeneInfo+genJetMET)
from SimPPS.Configuration.GenPPS_cff import *
pgen = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+VertexSmearing+GenSmeared+GeneInfo+genJetMET, PPSTransportTask)

# sequence for bare generator result only, without vertex smearing and analysis objects added

Expand Down
17 changes: 17 additions & 0 deletions EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py
Original file line number Diff line number Diff line change
@@ -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.Task()

from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016
ctpps_2016.toReplaceWith(ctppsRawData, cms.Task(ctppsTotemRawData))

from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017
ctpps_2017.toReplaceWith(ctppsRawData, cms.Task(ctppsTotemRawData,ctppsPixelRawData))

from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018
ctpps_2018.toReplaceWith(ctppsRawData, cms.Task(ctppsPixelRawData))

3 changes: 3 additions & 0 deletions EventFilter/RawDataCollector/python/rawDataCollector_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")]) )
12 changes: 11 additions & 1 deletion IOMC/RandomEngine/python/IOMC_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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('')
Expand Down
17 changes: 17 additions & 0 deletions SimG4Core/Application/python/g4SimHits_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,23 @@
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 = dict(
HepMCProductLabel = 'LHCTransport',
MinEtaCut = -13.0,
MaxEtaCut = 13.0
),
SteppingAction = dict(
MaxTrackTime = 2000.0
),
StackingAction = dict(
MaxTrackTime = 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
Expand Down
2 changes: 0 additions & 2 deletions SimGeneral/MixingModule/python/mixNoPU_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
useCurrentProcessOnly = cms.bool(False),
mixObjects = cms.PSet(theMixObjects)
)


9 changes: 9 additions & 0 deletions SimGeneral/MixingModule/python/mixObjects_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
)
)
19 changes: 19 additions & 0 deletions SimPPS/Configuration/python/GenPPS_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import FWCore.ParameterSet.Config as cms
from SimTransport.PPSProtonTransport.PPSTransport_cff import LHCTransport


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))

from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021
ctpps_2021.toReplaceWith(PPSTransportTask, cms.Task(LHCTransport))
20 changes: 20 additions & 0 deletions SimPPS/Configuration/python/PPSTransport_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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)
mundim marked this conversation as resolved.
Show resolved Hide resolved

from IOMC.RandomEngine.IOMC_cff import *
RandomNumberGeneratorService.LHCTransport.engineName = cms.untracked.string('TRandom3')
Comment on lines +9 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove, the RandomNumberGeneratorService should be fully defined in IOMC.RandomEngin.IOMC_cff.

Suggested change
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

LHCTransport.VtxMeanX = Realistic25ns13TeV2016CollisionVtxSmearingParameters.X0
LHCTransport.VtxMeanY = Realistic25ns13TeV2016CollisionVtxSmearingParameters.Y0
LHCTransport.VtxMeanZ = Realistic25ns13TeV2016CollisionVtxSmearingParameters.Z0
24 changes: 24 additions & 0 deletions SimPPS/Configuration/python/SimPPS_cff.py
Original file line number Diff line number Diff line change
@@ -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)

140 changes: 140 additions & 0 deletions SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2017.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# 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
import random

from Configuration.StandardSequences.Eras import eras
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.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('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))

nEvent_ = 100
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(nEvent_)
)

# Input source
process.source = cms.Source("EmptySource")

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(
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)
)

# 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
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)

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.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
Loading