Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-01 23:47:13

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 # load standard files (on top so as settings can be overwritten below)
0004 from RecoPPS.ProtonReconstruction.ctppsProtons_cff import *
0005 
0006 # configuration for composite source of alignment, optics, ...
0007 from CalibPPS.ESProducers.ctppsCompositeESSource_cfi import *
0008 ctppsCompositeESSource.generateEveryNEvents = 100
0009 
0010 profile_base = cms.PSet(
0011   L_int = cms.double(1),
0012 
0013   # LHCInfo
0014   ctppsLHCInfo = cms.PSet(
0015     xangle = cms.double(-1),
0016     betaStar = cms.double(-1),
0017     beamEnergy  =  cms.double(0),
0018     xangleBetaStarHistogramFile = cms.string("CalibPPS/ESProducers/data/xangle_beta_distributions/version1.root"),
0019     xangleBetaStarHistogramObject = cms.string("")
0020   ),
0021 
0022   # optics
0023   ctppsOpticalFunctions = cms.PSet(
0024     opticalFunctions = cms.VPSet(),
0025     scoringPlanes = cms.VPSet()
0026   ),
0027 
0028   # alignment
0029   ctppsRPAlignmentCorrectionsDataXML = cms.PSet(
0030     MeasuredFiles = cms.vstring(),
0031     RealFiles = cms.vstring(),
0032     MisalignedFiles = cms.vstring()
0033   ),
0034 
0035   # direct simu data
0036   ctppsDirectSimuData = cms.PSet(
0037     empiricalAperture45 = cms.string(""),
0038     empiricalAperture56 = cms.string(""),
0039 
0040     timeResolutionDiamonds45 = cms.string("999"),
0041     timeResolutionDiamonds56 = cms.string("999"),
0042 
0043     efficienciesPerRP = cms.VPSet(),
0044     efficienciesPerPlane = cms.VPSet()
0045   )
0046 )
0047 
0048 # beam parameters as determined by PPS
0049 ctppsBeamParametersFromLHCInfoESSource = cms.ESProducer("CTPPSBeamParametersFromLHCInfoESSource",
0050   lhcInfoLabel = cms.string(""),
0051 
0052   #  beam divergence  (rad)
0053   beamDivX45 = cms.double(30E-6),
0054   beamDivX56 = cms.double(30E-6),
0055   beamDivY45 = cms.double(30E-6),
0056   beamDivY56 = cms.double(30E-6),
0057 
0058   #  vertex offset  (cm)
0059   vtxOffsetX45 = cms.double(0.),
0060   vtxOffsetX56 = cms.double(0.),
0061   vtxOffsetY45 = cms.double(0.),
0062   vtxOffsetY56 = cms.double(0.),
0063   vtxOffsetZ45 = cms.double(0.),
0064   vtxOffsetZ56 = cms.double(0.),
0065 
0066   #  vertex sigma  (cm)
0067   vtxStddevX = cms.double(10E-4),
0068   vtxStddevY = cms.double(10E-4),
0069   vtxStddevZ = cms.double(5)
0070 )
0071 
0072 # particle-data table
0073 from SimGeneral.HepPDTESSource.pythiapdt_cfi import *
0074 
0075 # random seeds
0076 RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
0077   sourceSeed = cms.PSet(initialSeed = cms.untracked.uint32(98765)),
0078   generator = cms.PSet(initialSeed = cms.untracked.uint32(98766)),
0079   beamDivergenceVtxGenerator = cms.PSet(initialSeed = cms.untracked.uint32(3849)),
0080   ctppsDirectProtonSimulation = cms.PSet(initialSeed = cms.untracked.uint32(4981))
0081 )
0082 
0083 # default source
0084 source = cms.Source("EmptySource",
0085   firstRun = cms.untracked.uint32(1),
0086   numberEventsInLuminosityBlock = ctppsCompositeESSource.generateEveryNEvents
0087 )
0088 
0089 # particle generator
0090 from Configuration.Generator.randomXiThetaGunProducer_cfi import *
0091 generator.xi_max = 0.25
0092 generator.theta_x_sigma = 60E-6
0093 generator.theta_y_sigma = 60E-6
0094 
0095 # beam smearing
0096 from IOMC.EventVertexGenerators.beamDivergenceVtxGenerator_cfi import *
0097 
0098 # direct simulation
0099 from Validation.CTPPS.ctppsDirectProtonSimulation_cfi import *
0100 ctppsDirectProtonSimulation.verbosity = 0
0101 ctppsDirectProtonSimulation.hepMCTag = cms.InputTag('beamDivergenceVtxGenerator')
0102 ctppsDirectProtonSimulation.roundToPitch = True
0103 ctppsDirectProtonSimulation.pitchStrips = 66E-3 * 12 / 19 # effective value to reproduce real RP resolution
0104 ctppsDirectProtonSimulation.pitchPixelsHor = 50E-3
0105 ctppsDirectProtonSimulation.pitchPixelsVer = 80E-3
0106 ctppsDirectProtonSimulation.useEmpiricalApertures = True
0107 ctppsDirectProtonSimulation.produceHitsRelativeToBeam = True
0108 ctppsDirectProtonSimulation.produceScoringPlaneHits = False
0109 ctppsDirectProtonSimulation.produceRecHits = True
0110 
0111 # local reconstruction
0112 from CalibPPS.ESProducers.ppsTopology_cff import *
0113 
0114 from RecoPPS.Local.totemRPLocalReconstruction_cff import *
0115 from RecoPPS.Local.ctppsPixelLocalReconstruction_cff import *
0116 from RecoPPS.Local.ctppsDiamondLocalReconstruction_cff import *
0117 from RecoPPS.Local.ctppsLocalTrackLiteProducer_cff import *
0118 
0119 totemRPUVPatternFinder.tagRecHit = cms.InputTag('ctppsDirectProtonSimulation')
0120 ctppsPixelLocalTracks.tag = cms.InputTag('ctppsDirectProtonSimulation')
0121 ctppsDiamondLocalTracks.recHitsTag = cms.InputTag('ctppsDirectProtonSimulation')
0122 
0123 ctppsLocalTrackLiteProducer.includeDiamonds = False
0124 
0125 # proton reconstruction
0126 ctppsProtons.tagLocalTrackLite = cms.InputTag('ctppsLocalTrackLiteProducer')
0127 
0128 #----------------------------------------------------------------------------------------------------
0129 # utility functions
0130 
0131 def SetSmearingLevel1(obj):
0132   obj.vtxStddevX = 0E-4
0133   obj.vtxStddevZ = 0
0134 
0135   obj.beamDivX45 = 0E-6
0136   obj.beamDivX56 = 0E-6
0137   obj.beamDivY45 = 0E-6
0138   obj.beamDivY56 = 0E-6
0139 
0140 def SetLevel1(process):
0141   SetSmearingLevel1(process.ctppsBeamParametersFromLHCInfoESSource)
0142 
0143   process.ctppsDirectProtonSimulation.roundToPitch = False
0144 
0145 def SetSmearingLevel2(obj):
0146   obj.beamDivX45 = 0E-6
0147   obj.beamDivX56 = 0E-6
0148   obj.beamDivY45 = 0E-6
0149   obj.beamDivY56 = 0E-6
0150 
0151 def SetLevel2(process):
0152   SetSmearingLevel2(process.ctppsBeamParametersFromLHCInfoESSource)
0153 
0154   process.ctppsDirectProtonSimulation.roundToPitch = False
0155 
0156 def SetLevel3(process):
0157   process.ctppsDirectProtonSimulation.roundToPitch = False
0158 
0159 def SetLevel4(process):
0160   pass
0161 
0162 def SetLowTheta(process):
0163   process.generator.theta_x_sigma = 0E-6
0164   process.generator.theta_y_sigma = 0E-6
0165 
0166 def SetLargeTheta(process):
0167   pass
0168 
0169 def UseConstantXangleBetaStar(process, xangle, betaStar):
0170   for p in ctppsCompositeESSource.periods:
0171     p.ctppsLHCInfo.xangle = xangle
0172     p.ctppsLHCInfo.betaStar = betaStar
0173 
0174 def UseXangleBetaStarHistogram(process, f="", obj=""):
0175   for p in ctppsCompositeESSource.periods:
0176     p.ctppsLHCInfo.xangle = -1 # negative value indicates to use the xangle/beta* histogram
0177 
0178     if f:
0179       p.ctppsLHCInfo.xangleBetaStarHistogramFile = f
0180     if obj:
0181       p.ctppsLHCInfo.xangleBetaStarHistogramObject = obj