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

[PRO] adding new PPS conditions for 2023 #46331

Closed
wants to merge 3 commits into from
Closed
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
21 changes: 11 additions & 10 deletions CalibPPS/ESProducers/python/ctppsOpticalFunctions_non_DB_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@

ctppsOpticalFunctionsESSource.configuration.append(optics_2018)

optics_2021 = cms.PSet(
validityRange = cms.EventRange("1234:1 - 1234:max"), # NB: a fake IOV, this optics was never used for LHC
optics_2022 = cms.PSet(
validityRange = cms.EventRange("343890:min - 357101:max"),

opticalFunctions = cms.VPSet(
cms.PSet( xangle = cms.double(110.444), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2021/version_pre3/110.444urad.root") ),
cms.PSet( xangle = cms.double(184.017), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2021/version_pre3/184.017urad.root") )
cms.PSet( xangle = cms.double(144.974), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2022/version_pre1/144.974urad.root") ),
cms.PSet( xangle = cms.double(160.000), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2022/version_pre1/160.000urad.root") )
),

scoringPlanes = cms.VPSet(
Expand All @@ -109,14 +109,15 @@
)
)

# NB: do not append the 2021 config - not used for any LHC data
ctppsOpticalFunctionsESSource.configuration.append(optics_2022)

optics_2022 = cms.PSet(
validityRange = cms.EventRange("343890:min - 999999:max"),
optics_2023 = cms.PSet(
validityRange = cms.EventRange("366403:min - 370790:max"),

opticalFunctions = cms.VPSet(
cms.PSet( xangle = cms.double(144.974), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2022/version_pre1/144.974urad.root") ),
cms.PSet( xangle = cms.double(160.000), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2022/version_pre1/160.000urad.root") )
cms.PSet( xangle = cms.double(135.000), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2023/version_pre1/135.000urad_calib.root") ),
cms.PSet( xangle = cms.double(144.974), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2023/version_pre1/144.974urad_calib.root") ),
cms.PSet( xangle = cms.double(160.000), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2023/version_pre1/160.000urad_calib.root") )
),

scoringPlanes = cms.VPSet(
Expand All @@ -133,7 +134,7 @@
)
)

ctppsOpticalFunctionsESSource.configuration.append(optics_2022)
ctppsOpticalFunctionsESSource.configuration.append(optics_2023)

# optics interpolation between crossing angles
from CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cfi import *
4 changes: 3 additions & 1 deletion Configuration/Eras/python/Era_Run3_2023_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

from Configuration.Eras.Era_Run3_cff import Run3
from Configuration.Eras.Modifier_run3_egamma_2023_cff import run3_egamma_2023
from Configuration.Eras.Modifier_ctpps_2022_cff import ctpps_2022
from Configuration.Eras.Modifier_ctpps_2023_cff import ctpps_2023

Run3_2023 = cms.ModifierChain(Run3, run3_egamma_2023)
Run3_2023 = cms.ModifierChain(Run3.copyAndExclude([ctpps_2022]), run3_egamma_2023, ctpps_2023)
4 changes: 4 additions & 0 deletions Configuration/Eras/python/Modifier_ctpps_2023_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

ctpps_2023 = cms.Modifier()

2 changes: 1 addition & 1 deletion Configuration/StandardSequences/python/Eras.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self):
'phase2_trigger',
'phase2_squarePixels', 'phase2_3DPixels',
'trackingLowPU', 'trackingPhase1',
'ctpps', 'ctpps_2016', 'ctpps_2017', 'ctpps_2018', 'ctpps_2022',
'ctpps', 'ctpps_2016', 'ctpps_2017', 'ctpps_2018', 'ctpps_2022', 'ctpps_2023',
'trackingPhase2PU140','highBetaStar',
'tracker_apv_vfp30_2016', 'pf_badHcalMitigationOff',
'run2_nanoAOD_106Xv2',
Expand Down
4 changes: 4 additions & 0 deletions SimPPS/Configuration/python/GenPPS_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@
#from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018
#ctpps_2018.toReplaceWith(PPSTransportTask, cms.Task(LHCTransport))

# on hold until proper conditions in place
from Configuration.Eras.Modifier_ctpps_2022_cff import ctpps_2022
ctpps_2022.toReplaceWith(PPSTransportTask, cms.Task(LHCTransport))

from Configuration.Eras.Modifier_ctpps_2023_cff import ctpps_2023
ctpps_2023.toReplaceWith(PPSTransportTask, cms.Task(LHCTransport))
4 changes: 4 additions & 0 deletions SimPPS/Configuration/python/SimPPS_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@
#from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018
#ctpps_2018.toReplaceWith(ctppsDigiTask, RPixDetDigitizerTask)

# on hold until proper conditions in place
from Configuration.Eras.Modifier_ctpps_2022_cff import ctpps_2022
ctpps_2022.toReplaceWith(ctppsDigiTask, RPixDetDigitizerTask)

from Configuration.Eras.Modifier_ctpps_2023_cff import ctpps_2023
ctpps_2023.toReplaceWith(ctppsDigiTask, RPixDetDigitizerTask)
12 changes: 12 additions & 0 deletions SimPPS/Configuration/python/directSimPPS_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,19 @@ def _modify2022(process):
# replaced by the composite ESSource
delattr(process, 'ctppsGeometryESModule')

def _modify2023(process):
print('Process customised for 2023 PPS era')
process.load('SimPPS.DirectSimProducer.simPPS2023_cfi')
unshiftVertex(process, 'Realistic25ns13p6TeVEarly2023CollisionVtxSmearingParameters')
if hasattr(process, 'generator'):
process.generator.energy = process.profile_2023_PostTS1.ctppsLHCInfo.beamEnergy
if hasattr(process, 'ctppsGeometryESModule'):
# replaced by the composite ESSource
delattr(process, 'ctppsGeometryESModule')

modifyConfigurationStandardSequencesFor2016_ = eras.ctpps_2016.makeProcessModifier(_modify2016)
modifyConfigurationStandardSequencesFor2017_ = eras.ctpps_2017.makeProcessModifier(_modify2017)
modifyConfigurationStandardSequencesFor2018_ = eras.ctpps_2018.makeProcessModifier(_modify2018)
modifyConfigurationStandardSequencesFor2022_ = eras.ctpps_2022.makeProcessModifier(_modify2022)
modifyConfigurationStandardSequencesFor2023_ = eras.ctpps_2023.makeProcessModifier(_modify2023)

2 changes: 1 addition & 1 deletion SimPPS/DirectSimProducer/python/profiles_2022_cff.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FWCore.ParameterSet.Config as cms
from SimPPS.DirectSimProducer.profile_base_cff import profile_base as _base
from CalibPPS.ESProducers.ctppsOpticalFunctions_non_DB_cff import optics_2021 as _optics
from CalibPPS.ESProducers.ctppsOpticalFunctions_non_DB_cff import optics_2022 as _optics

# base profile settings for 2022
_base_2022 = _base.clone(
Expand Down
64 changes: 64 additions & 0 deletions SimPPS/DirectSimProducer/python/profiles_2023_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import FWCore.ParameterSet.Config as cms
from SimPPS.DirectSimProducer.profile_base_cff import profile_base as _base
from CalibPPS.ESProducers.ctppsOpticalFunctions_non_DB_cff import optics_2023 as _optics

# base profile settings for 2023
_base_2023 = _base.clone(
ctppsOpticalFunctions = _base.ctppsOpticalFunctions.clone(
opticalFunctions = _optics.opticalFunctions,
scoringPlanes = _optics.scoringPlanes,
),
ctppsDirectSimuData = _base.ctppsDirectSimuData.clone(
empiricalAperture45 = "1.e3*([xi] - 0.20)",
empiricalAperture56 = "1.e3*([xi] - 0.20)"
)
)

profile_2023_PreTS1A = _base_2023.clone(
L_int = 1.,
ctppsLHCInfo = _base_2023.ctppsLHCInfo.clone(
# NB: until a dedicated 2022 distributions are issued, it is OK to use 2021 ones here
xangleBetaStarHistogramObject = "2021/h2_betaStar_vs_xangle"
),
ctppsRPAlignmentCorrectionsDataXML = _base_2023.ctppsRPAlignmentCorrectionsDataXML.clone(
MisalignedFiles = ["Validation/CTPPS/alignment/alignment_2023_PreTS1_366403_367840.xml"],
RealFiles = ["Validation/CTPPS/alignment/alignment_2023_PreTS1_366403_367840.xml"]
),
ctppsDirectSimuData = _base_2023.ctppsDirectSimuData.clone(
timeResolutionDiamonds45 = "0.200",
timeResolutionDiamonds56 = "0.200"
)
)

profile_2023_PreTS1B = _base_2023.clone(
L_int = 1.,
ctppsLHCInfo = _base_2023.ctppsLHCInfo.clone(
# NB: until a dedicated 2022 distributions are issued, it is OK to use 2021 ones here
xangleBetaStarHistogramObject = "2021/h2_betaStar_vs_xangle"
),
ctppsRPAlignmentCorrectionsDataXML = _base_2023.ctppsRPAlignmentCorrectionsDataXML.clone(
MisalignedFiles = ["Validation/CTPPS/alignment/alignment_2023_PreTS1_367881_368765.xml"],
RealFiles = ["Validation/CTPPS/alignment/alignment_2023_PreTS1_367881_368765.xml"]
),
ctppsDirectSimuData = _base_2023.ctppsDirectSimuData.clone(
timeResolutionDiamonds45 = "0.200",
timeResolutionDiamonds56 = "0.200"
)
)

profile_2023_PostTS1 = _base_2023.clone(
L_int = 1.,
ctppsLHCInfo = _base_2023.ctppsLHCInfo.clone(
# NB: until a dedicated 2022 distributions are issued, it is OK to use 2021 ones here
xangleBetaStarHistogramObject = "2021/h2_betaStar_vs_xangle"
),
ctppsRPAlignmentCorrectionsDataXML = _base_2023.ctppsRPAlignmentCorrectionsDataXML.clone(
MisalignedFiles = ["Validation/CTPPS/alignment/alignment_2023_PostTS1.xml"],
RealFiles = ["Validation/CTPPS/alignment/alignment_2023_PostTS1.xml"]
),
ctppsDirectSimuData = _base_2023.ctppsDirectSimuData.clone(
timeResolutionDiamonds45 = "0.200",
timeResolutionDiamonds56 = "0.200"
)
)

20 changes: 20 additions & 0 deletions SimPPS/DirectSimProducer/python/simPPS2023_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import FWCore.ParameterSet.Config as cms
from CalibPPS.ESProducers.ctppsCompositeESSource_cfi import ctppsCompositeESSource as _esComp
from CalibPPS.ESProducers.ppsAssociationCuts_non_DB_cff import use_single_infinite_iov_entry, p2022
from CalibPPS.ESProducers.ppsAssociationCuts_non_DB_cff import ppsAssociationCutsESSource as _esAssCuts
from Geometry.VeryForwardGeometry.commons_cff import cloneGeometry
from SimPPS.DirectSimProducer.profiles_2023_cff import profile_2023_PostTS1, profile_2023_PreTS1A, profile_2023_PreTS1B
from SimPPS.DirectSimProducer.simPPS2017_cfi import rpIds

ppsAssociationCutsESSource = _esAssCuts.clone()
use_single_infinite_iov_entry(ppsAssociationCutsESSource, p2022)
XMLIdealGeometryESSource_CTPPS, _ctppsGeometryESModule = cloneGeometry('Geometry.VeryForwardGeometry.geometryRPFromDD_2022_cfi')
# not cloning the ctppsGeometryESModule, as it is replaced by the composite ES source

ctppsCompositeESSource = _esComp.clone(
generateEveryNEvents = 100,
periods = [profile_2023_PostTS1,profile_2023_PreTS1A,profile_2023_PreTS1B],
compactViewTag = _ctppsGeometryESModule.compactViewTag,
isRun2 = _ctppsGeometryESModule.isRun2
)

45 changes: 38 additions & 7 deletions SimPPS/DirectSimProducer/test/test_miniAOD_cfg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
process = cms.Process('PPS', eras.Run2_2018)
from Configuration.Eras.Modifier_ctpps_directSim_cff import ctpps_directSim
process = cms.Process('PPS', ctpps_directSim, eras.Run3_2023)

detailedLog=True
Year="2023"
Period="PreTS1B"
Profile="profile_"+Year+"_"+Period
print(Profile)

process.load('Configuration.StandardSequences.Services_cff')
process.load('Configuration.EventContent.EventContent_cff')
Expand All @@ -17,15 +24,28 @@
process.MessageLogger.cerr.threshold = cms.untracked.string('')
process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(100)

if detailedLog:
process.MessageLogger = cms.Service("MessageLogger",
destinations = cms.untracked.vstring('detailedInfo','cerr'),
detailedInfo = cms.untracked.PSet(
threshold = cms.untracked.string('INFO')
),
cerr = cms.untracked.PSet(
threshold = cms.untracked.string('WARNING')
)
)

# period
process.ctppsCompositeESSource.periods = [process.profile_2023_PreTS1B]

# global tag
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '106X_upgrade2018_realistic_v16_L1v1', '')
process.GlobalTag = GlobalTag(process.GlobalTag, '140X_mcRun3_2024_realistic_v20', '')

# raw data source
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
#'/store/mc/RunIISummer20UL16MiniAODAPVv2/GGToMuMu_Pt-25_Elastic_13TeV-lpair/MINIAODSIM/106X_mcRun2_asymptotic_preVFP_v11-v1/280000/3870E880-4A47-7440-B122-C76062D2290F.root',
'/store/mc/RunIISummer20UL18MiniAODv2/GGToMuMu_Pt-25_Elastic_13TeV-lpair/MINIAODSIM/106X_upgrade2018_realistic_v16_L1v1-v2/260000/6EC2EE65-77C0-3C43-A51B-7B94FE441894.root',
"/store/mc/Run3Summer23DRPremix/GGToMuMu_PT-25_El-El_13p6TeV_lpair/AODSIM/130X_mcRun3_2023_realistic_v14-v2/2560000/94caefe9-1efd-4c9e-99ca-9861a85c11ea.root"
),
)

Expand All @@ -38,8 +58,13 @@
ppsDirectProtonSimulation = cms.PSet(initialSeed = cms.untracked.uint32(4981))
)

from SimPPS.DirectSimProducer.matching_cff import matchDirectSimOutputsMiniAOD
matchDirectSimOutputsMiniAOD(process)
from SimPPS.DirectSimProducer.matching_cff import matchDirectSimOutputsAOD
matchDirectSimOutputsAOD(process)

if detailedLog:
print('Verbosity of DirectSimProducer = '+str(process.ppsDirectProtonSimulation.verbosity))
process.ppsDirectProtonSimulation.verbosity = cms.untracked.uint32(1)
print('beamEnergy from profile = '+str(process.profile_2023_PreTS1B.ctppsLHCInfo.beamEnergy))

process.p = cms.Path(
process.directSimPPS
Expand All @@ -48,8 +73,14 @@

# output configuration
from RecoPPS.Configuration.RecoCTPPS_EventContent_cff import RecoCTPPSAOD
RecoCTPPSAOD.outputCommands.extend(cms.untracked.vstring(
'keep *_genPUProtons_*_*',
'keep *_genParticles_*_*'
)
)

process.output = cms.OutputModule('PoolOutputModule',
fileName = cms.untracked.string('file:output.root'),
fileName = cms.untracked.string('file:output'+'_'+Year+'_'+Period+'.root'),
outputCommands = RecoCTPPSAOD.outputCommands
)

Expand Down
21 changes: 21 additions & 0 deletions Validation/CTPPS/alignment/alignment_2023_PostTS1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
Shifts in um, rotations in mrad.

For more details see RPAlignmentCorrections::LoadXMLFile in
TotemAlignment/RPDataFormats/src/RPAlignmentCorrectionsSequence.cc
<iov first="369873" last="370890">
-->
<xml DocumentType="AlignmentDescription">
<!-- pixel, RP 3 -->
<rp id="2014838784" sh_x=" -599.29" sh_y=" 1936.20" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- diamond, RP 16 -->
<rp id="2054160384" sh_x=" 0.00" sh_y=" 0.00" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- pixel, RP 23 -->
<rp id="2023227392" sh_x=" 150.06" sh_y=" 2141.96" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- pixel, RP 103 -->
<rp id="2031616000" sh_x=" 76.95" sh_y=" 574.67" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- diamond, RP 116 -->
<rp id="2070937600" sh_x=" 0.00" sh_y=" 0.00" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- pixel, RP 123 -->
<rp id="2040004608" sh_x=" 136.90" sh_y=" 2019.47" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
</xml>
21 changes: 21 additions & 0 deletions Validation/CTPPS/alignment/alignment_2023_PreTS1_366403_367840.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
Shifts in um, rotations in mrad.

For more details see RPAlignmentCorrections::LoadXMLFile in
TotemAlignment/RPDataFormats/src/RPAlignmentCorrectionsSequence.cc
<iov first="366403" last="367840">
-->
<xml DocumentType="AlignmentDescription">
<!-- pixel, RP 3 -->
<rp id="2014838784" sh_x=" -923.95" sh_y=" 3099.22" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- diamond, RP 16 -->
<rp id="2054160384" sh_x=" 0.00" sh_y=" 0.00" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- pixel, RP 23 -->
<rp id="2023227392" sh_x=" -159.96" sh_y=" 3470.95" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- pixel, RP 103 -->
<rp id="2031616000" sh_x=" -166.21" sh_y=" 1654.16" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- diamond, RP 116 -->
<rp id="2070937600" sh_x=" 0.00" sh_y=" 0.00" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- pixel, RP 123 -->
<rp id="2040004608" sh_x=" 70.34" sh_y=" 2856.93" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
</xml>
21 changes: 21 additions & 0 deletions Validation/CTPPS/alignment/alignment_2023_PreTS1_367881_368765.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
Shifts in um, rotations in mrad.

For more details see RPAlignmentCorrections::LoadXMLFile in
TotemAlignment/RPDataFormats/src/RPAlignmentCorrectionsSequence.cc
<iov first="367881" last="368765">
-->
<xml DocumentType="AlignmentDescription">
<!-- pixel, RP 3 -->
<rp id="2014838784" sh_x=" -846.88" sh_y=" 2448.57" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- diamond, RP 16 -->
<rp id="2054160384" sh_x=" 0.00" sh_y=" 0.00" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- pixel, RP 23 -->
<rp id="2023227392" sh_x=" -105.83" sh_y=" 2856.95" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- pixel, RP 103 -->
<rp id="2031616000" sh_x=" -178.29" sh_y=" 1151.84" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- diamond, RP 116 -->
<rp id="2070937600" sh_x=" 0.00" sh_y=" 0.00" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
<!-- pixel, RP 123 -->
<rp id="2040004608" sh_x=" -33.06" sh_y=" 2497.08" sh_z=" +0.000" rot_x=" +0.000" rot_y=" +0.000" rot_z=" +0.000"/>
</xml>