1 import FWCore.ParameterSet.Config
as cms
2 from Configuration.StandardSequences.Eras
import eras
5 directSimPPSTask = cms.Task(
6 beamDivergenceVtxGenerator,
7 ppsDirectProtonSimulation
10 directSimPPS = cms.Sequence(directSimPPSTask)
13 """Undo vertex smearing using the parameters used for the sample production""" 14 if not hasattr(process,
'ctppsBeamParametersFromLHCInfoESSource'):
16 from importlib
import import_module
17 _params = import_module(
'IOMC.EventVertexGenerators.VtxSmearedParameters_cfi')
18 if not hasattr(_params, smearingParams):
19 raise ImportError(
'Failed to import {} from vertex smearing parameters!'.
format(smearingParams))
20 _params = getattr(_params, smearingParams)
21 process.ctppsBeamParametersFromLHCInfoESSource.vtxOffsetX45 = cms.double(-_params.X0.value())
22 process.ctppsBeamParametersFromLHCInfoESSource.vtxOffsetY45 = cms.double(-_params.Y0.value())
23 process.ctppsBeamParametersFromLHCInfoESSource.vtxOffsetZ45 = cms.double(-_params.Z0.value())
28 print(
'Process customised for 2016 PPS era')
29 process.load(
'SimPPS.DirectSimProducer.simPPS2016_cfi')
30 unshiftVertex(process,
'Realistic25ns13TeV2016CollisionVtxSmearingParameters')
33 print(
'Process customised for 2017 PPS era')
34 process.load(
'SimPPS.DirectSimProducer.simPPS2017_cfi')
35 unshiftVertex(process,
'Realistic25ns13TeVEarly2017CollisionVtxSmearingParameters')
38 print(
'Process customised for 2018 PPS era')
39 process.load(
'SimPPS.DirectSimProducer.simPPS2018_cfi')
40 unshiftVertex(process,
'Realistic25ns13TeVEarly2018CollisionVtxSmearingParameters')
43 print(
'Process customised for 2022 PPS era')
44 process.load(
'SimPPS.DirectSimProducer.simPPS2022_cfi')
45 if hasattr(process,
'generator'):
46 process.generator.energy = process.profile_2022_default.ctppsLHCInfo.beamEnergy
47 if hasattr(process,
'ctppsGeometryESModule'):
49 delattr(process,
'ctppsGeometryESModule')
51 modifyConfigurationStandardSequencesFor2016_ = eras.ctpps_2016.makeProcessModifier(_modify2016)
52 modifyConfigurationStandardSequencesFor2017_ = eras.ctpps_2017.makeProcessModifier(_modify2017)
53 modifyConfigurationStandardSequencesFor2018_ = eras.ctpps_2018.makeProcessModifier(_modify2018)
54 modifyConfigurationStandardSequencesFor2022_ = eras.ctpps_2022.makeProcessModifier(_modify2022)
def unshiftVertex(process, smearingParams)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)