CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
directSimPPS_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from Configuration.StandardSequences.Eras import eras
4 
5 directSimPPSTask = cms.Task(
6  beamDivergenceVtxGenerator,
7  ppsDirectProtonSimulation
8 )
9 
10 directSimPPS = cms.Sequence(directSimPPSTask)
11 
12 def unshiftVertex(process, smearingParams):
13  """Undo vertex smearing using the parameters used for the sample production"""
14  if not hasattr(process, 'ctppsBeamParametersFromLHCInfoESSource'):
15  return
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())
24 
25 # modify according to era
26 
27 def _modify2016(process):
28  print('Process customised for 2016 PPS era')
29  process.load('SimPPS.DirectSimProducer.simPPS2016_cfi')
30  unshiftVertex(process, 'Realistic25ns13TeV2016CollisionVtxSmearingParameters')
31 
32 def _modify2017(process):
33  print('Process customised for 2017 PPS era')
34  process.load('SimPPS.DirectSimProducer.simPPS2017_cfi')
35  unshiftVertex(process, 'Realistic25ns13TeVEarly2017CollisionVtxSmearingParameters')
36 
37 def _modify2018(process):
38  print('Process customised for 2018 PPS era')
39  process.load('SimPPS.DirectSimProducer.simPPS2018_cfi')
40  unshiftVertex(process, 'Realistic25ns13TeVEarly2018CollisionVtxSmearingParameters')
41 
42 def _modify2022(process):
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'):
48  # replaced by the composite ESSource
49  delattr(process, 'ctppsGeometryESModule')
50 
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 _modify2017(process)
def unshiftVertex(process, smearingParams)
def _modify2022(process)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def _modify2018(process)
def _modify2016(process)