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

Integrating PPS full sim in Run3 (only) #30575

Merged
merged 4 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion Configuration/Eras/python/Era_Phase2_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
from Configuration.Eras.Modifier_phase2_trigger_cff import phase2_trigger
from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021

Phase2 = cms.ModifierChain(Run3.copyAndExclude([phase1Pixel,trackingPhase1]), phase2_common, phase2_tracker, trackingPhase2PU140, phase2_ecal, phase2_hcal, phase2_hgcal, phase2_muon, phase2_GEM, hcalHardcodeConditions, phase2_timing, phase2_timing_layer, phase2_trigger)
Phase2 = cms.ModifierChain(Run3.copyAndExclude([phase1Pixel,trackingPhase1,ctpps_2021]), phase2_common, phase2_tracker, trackingPhase2PU140, phase2_ecal, phase2_hcal, phase2_hgcal, phase2_muon, phase2_GEM, hcalHardcodeConditions, phase2_timing, phase2_timing_layer, phase2_trigger)
4 changes: 3 additions & 1 deletion Configuration/StandardSequences/python/DigiToRaw_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +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, ctppsRawData, castorRawData, rawDataCollector)
DigiToRawTask = cms.Task(L1TDigiToRawTask, siPixelRawData, SiStripDigiToRaw, ecalPacker, esDigiToRaw, hcalRawDataTask, cscpacker, dtpacker, rpcpacker, castorRawData, rawDataCollector)
DigiToRaw = cms.Sequence(DigiToRawTask)

Expand Down Expand Up @@ -52,4 +54,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
20 changes: 20 additions & 0 deletions EventFilter/CTPPSRawToDigi/python/ctppsDigiToRaw_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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()
# The comment lines below will be included in the next PR for Run2

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

from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021
ctpps_2021.toReplaceWith(ctppsRawData, cms.Task(ctppsPixelRawData))
4 changes: 4 additions & 0 deletions EventFilter/RawDataCollector/python/rawDataCollector_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@

from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM
run3_GEM.toModify( rawDataCollector.RawCollectionList, func = lambda list: list.append(cms.InputTag("gemPacker")) )

# For Run2 it is needed to include the general ctpps era ctpps_2016
from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021
ctpps_2021.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')
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really want to use TRandom3 engine? @civanch

),
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
9 changes: 9 additions & 0 deletions SimGeneral/MixingModule/python/mixObjects_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,12 @@
crossingFrames = theMixObjects.mixSH.crossingFrames + [ 'FastTimerHitsBarrel','FastTimerHitsEndcap' ]
)
)

from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021
ctpps_2021.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()

# The 2016-2018 commented line below need to be activated to integrate the simulation into Run2

#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))
26 changes: 26 additions & 0 deletions SimPPS/Configuration/python/SimPPS_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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()

# The commented lines below NEED to be activated in order to insert PPS into Run2
# 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)

from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021
ctpps_2021.toReplaceWith(ctppsDigiTask, RPixDetDigitizerTask)
112 changes: 112 additions & 0 deletions SimPPS/Configuration/test/gluglu_step1_GEN_SIM_2016.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
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.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.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()


from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')
#process.GlobalTag = GlobalTag(process.GlobalTag, "106X_dataRun2_v26")

# Production Info
process.configurationMetadata = cms.untracked.PSet(
annotation = cms.untracked.string('GeneratorInterface/ExhumeInterface/python/ExHuME_CEPDijetsGG_M100_7TeV_cff.py nevts:1'),
name = cms.untracked.string('Applications'),
version = cms.untracked.string('$Revision: 1.19 $')
)

# generator

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)

############
process.o1 = cms.OutputModule("PoolOutputModule",
outputCommands = cms.untracked.vstring('keep *'),
fileName = cms.untracked.string('gluglu_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

Loading