Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-15 01:08:01

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from SimG4Core.Application.hectorParameter_cfi import *
0004 
0005 ## HF Raddam Dose Class in /SimG4CMS/Calo
0006 from SimG4CMS.Calo.HFDarkeningParams_cff import *
0007 
0008 ## HF shower parameters
0009 from Geometry.HcalSimData.HFParameters_cff import *
0010 
0011 ## Modification needed for H2 TestBeam studies
0012 from Configuration.Eras.Modifier_h2tb_cff import h2tb
0013 
0014 ## This object is used to customise g4SimHits for different running scenarios
0015 
0016 common_heavy_suppression = cms.PSet(
0017     NeutronThreshold = cms.double(30.0),
0018     ProtonThreshold = cms.double(30.0),
0019     IonThreshold = cms.double(30.0)
0020 )
0021 
0022 common_maximum_time = cms.PSet(
0023     MaxTrackTime  = cms.double(500.0), # ns
0024     MaxTrackTimeForward = cms.double(2000.0), # ns
0025     MaxTimeNames  = cms.vstring(),
0026     MaxTrackTimes = cms.vdouble(),     # ns
0027     MaxZCentralCMS = cms.double(50.0), # m
0028     DeadRegions   = cms.vstring('QuadRegion','InterimRegion'),
0029     CriticalEnergyForVacuum = cms.double(2.0),   # MeV
0030     CriticalDensity         = cms.double(1e-15)  # g/cm3
0031 )
0032 
0033 h2tb.toModify(common_maximum_time,
0034     MaxTrackTime = cms.double(1000.0),
0035     DeadRegions  = cms.vstring()
0036 )
0037 
0038 common_UsePMT = cms.PSet(
0039     UseR7600UPMT  = cms.bool(False)
0040 )
0041 
0042 common_UseHF = cms.PSet(
0043     Lambda1       = cms.double(280.0),
0044     Lambda2       = cms.double(700.0),
0045     Gain          = cms.double(0.33),
0046     CheckSurvive  = cms.bool(False),
0047     FibreR        = cms.double(0.3)
0048 )
0049 
0050 common_UseLuminosity = cms.PSet(
0051     InstLuminosity  = cms.double(0.),
0052     DelivLuminosity = cms.double(5000.)
0053 )
0054 
0055 common_MCtruth = cms.PSet(
0056     DoFineCalo = cms.bool(False),
0057     SaveCaloBoundaryInformation = cms.bool(False),
0058     # currently unused; left in place for future studies
0059     EminFineTrack = cms.double(10000.0),
0060     FineCaloNames = cms.vstring('ECAL', 'HCal', 'HGCal', 'HFNoseVol', 'VCAL'),
0061     FineCaloLevels = cms.vint32(4, 4, 8, 3, 3),
0062     UseFineCalo = cms.vint32(2, 3),
0063 )
0064 
0065 ## enable fine calorimeter functionality: must occur *before* common PSet is used below
0066 from Configuration.ProcessModifiers.fineCalo_cff import fineCalo
0067 fineCalo.toModify(common_MCtruth,
0068     DoFineCalo = True
0069 )
0070 
0071 ## enable CaloBoundary information for all Phase2 workflows
0072 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
0073 phase2_hgcal.toModify(common_MCtruth,
0074         SaveCaloBoundaryInformation = True
0075 )
0076 
0077 g4SimHits = cms.EDProducer("OscarMTProducer",
0078     g4GeometryDD4hepSource = cms.bool(False),
0079     NonBeamEvent = cms.bool(False),
0080     EventVerbose = cms.int32(0),
0081     UseMagneticField = cms.bool(True),
0082     UseCommandBaseScorer = cms.bool(False),
0083     StoreRndmSeeds = cms.bool(False),
0084     RestoreRndmSeeds = cms.bool(False),
0085     PhysicsTablesDirectory = cms.untracked.string('PhysicsTables'),
0086     StorePhysicsTables = cms.untracked.bool(False),
0087     RestorePhysicsTables = cms.untracked.bool(False),
0088     UseParametrisedEMPhysics = cms.untracked.bool(True),
0089     ThresholdForGeometryExceptions = cms.double(0.1), ## in GeV
0090     TraceExceptions = cms.bool(False),
0091     CheckGeometry = cms.untracked.bool(False),
0092     OnlySDs = cms.vstring('ZdcSensitiveDetector', 'TotemT2ScintSensitiveDetector', 'TotemSensitiveDetector', 'RomanPotSensitiveDetector', 'PLTSensitiveDetector', 'MuonSensitiveDetector', 'MtdSensitiveDetector', 'BCM1FSensitiveDetector', 'EcalSensitiveDetector', 'CTPPSSensitiveDetector', 'BSCSensitiveDetector', 'CTPPSDiamondSensitiveDetector', 'FP420SensitiveDetector', 'BHMSensitiveDetector', 'CastorSensitiveDetector', 'CaloTrkProcessing', 'HcalSensitiveDetector', 'TkAccumulatingSensitiveDetector'),
0093     G4CheckOverlap = cms.untracked.PSet(
0094         OutputBaseName = cms.string('2021'),
0095         MaterialFlag = cms.bool(True),
0096         GeomFlag = cms.bool(True),
0097         OverlapFlag = cms.bool(False),
0098         RegionFlag = cms.bool(True),  # if true - selection by G4Region name
0099         gdmlFlag = cms.bool(False),   # if true - dump gdml file
0100         Verbose = cms.bool(True),
0101         Tolerance = cms.double(0.0),
0102         Resolution = cms.int32(10000),
0103         ErrorThreshold = cms.int32(1),
0104         Level = cms.int32(1),
0105         Depth = cms.int32(3),        # -1 means check whatever depth
0106         PVname = cms.string(''),
0107         LVname = cms.string(''),
0108         NodeNames = cms.vstring('World')
0109     ),
0110     G4Commands = cms.vstring(),
0111     G4CommandsEndRun = cms.vstring(),
0112     SteppingVerbosity = cms.untracked.int32(0),
0113     StepVerboseThreshold = cms.untracked.double(0.1), # in GeV
0114     VerboseEvents = cms.untracked.vint32(),
0115     VertexNumber  = cms.untracked.vint32(),
0116     VerboseTracks = cms.untracked.vint32(),
0117     FileNameField = cms.untracked.string(''),
0118     FileNameGDML = cms.untracked.string(''),
0119     FileNameRegions = cms.untracked.string(''),
0120     Watchers = cms.VPSet(),
0121     HepMCProductLabel = cms.InputTag("generatorSmeared"),
0122     theLHCTlinkTag = cms.InputTag("LHCTransport"),
0123     LHCTransport = cms.bool(False),
0124     CustomUIsession = cms.untracked.PSet(
0125         Type = cms.untracked.string("MessageLogger"), # alternatives: MessageLoggerThreadPrefix, FilePerThread
0126         ThreadPrefix = cms.untracked.string("W"),     # for MessageLoggerThreadPrefix
0127         ThreadFile = cms.untracked.string("sim_output_thread"), # for FilePerThread
0128     ),
0129     MagneticField = cms.PSet(
0130         UseLocalMagFieldManager = cms.bool(False),
0131         Verbosity = cms.bool(False),
0132         ConfGlobalMFM = cms.PSet(
0133             Volume = cms.string('OCMS'),
0134             OCMS = cms.PSet(
0135                 Stepper = cms.string('G4TDormandPrince45'),
0136                 Type = cms.string('CMSIMField'),
0137                 StepperParam = cms.PSet(
0138                     VacRegions = cms.vstring(),
0139 #                   VacRegions = cms.vstring('DefaultRegionForTheWorld','BeamPipeVacuum','BeamPipeOutside'),
0140                     EnergyThTracker = cms.double(0.2),     ## in GeV
0141                     RmaxTracker = cms.double(8000),        ## in mm
0142                     ZmaxTracker = cms.double(11000),       ## in mm
0143                     MaximumEpsilonStep = cms.untracked.double(0.01),
0144                     DeltaOneStep = cms.double(0.001),      ## in mm
0145                     DeltaOneStepTracker = cms.double(1e-4),## in mm
0146                     MaximumLoopCounts = cms.untracked.double(1000.0),
0147                     DeltaChord = cms.double(0.002),        ## in mm
0148                     DeltaChordTracker = cms.double(0.001), ## in mm
0149                     MinStep = cms.double(0.1),             ## in mm
0150                     DeltaIntersectionAndOneStep = cms.untracked.double(-1.0),
0151                     DeltaIntersection = cms.double(0.0001),     ## in mm
0152                     DeltaIntersectionTracker = cms.double(1e-6),## in mm
0153                     MaxStep = cms.double(150.),            ## in cm
0154                     MinimumEpsilonStep = cms.untracked.double(1e-05),
0155                     EnergyThSimple = cms.double(0.015),    ## in GeV
0156                     DeltaChordSimple = cms.double(0.1),    ## in mm
0157                     DeltaOneStepSimple = cms.double(0.1),  ## in mm
0158                     DeltaIntersectionSimple = cms.double(0.01), ## in mm
0159                     MaxStepSimple = cms.double(50.),       ## in cm
0160                 )
0161             )
0162         ),
0163         delta = cms.double(1.0) ## in mm
0164     ),
0165     Physics = cms.PSet(
0166         common_maximum_time,
0167         # NOTE : if you want EM Physics only,
0168         #        please select "SimG4Core/Physics/DummyPhysics" for type
0169         #        and turn ON DummyEMPhysics
0170         #
0171         type = cms.string('SimG4Core/Physics/FTFP_BERT_EMM'),
0172         DummyEMPhysics = cms.bool(False),
0173         CutsPerRegion = cms.bool(True),
0174         CutsOnProton  = cms.bool(True),
0175         DefaultCutValue = cms.double(1.0), ## cuts in cm
0176         G4BremsstrahlungThreshold = cms.double(0.5), ## cut in GeV
0177         G4MuonBremsstrahlungThreshold = cms.double(10000.), ## cut in GeV
0178         G4TrackingCut = cms.double(0.001), ## cut in MeV
0179         G4MscRangeFactor = cms.double(0.04),
0180         G4MscGeomFactor = cms.double(2.5), 
0181         G4MscSafetyFactor = cms.double(0.6), 
0182         G4MscLambdaLimit = cms.double(1.0), # in mm 
0183         G4MscStepLimit = cms.string("UseSafety"),
0184         G4GeneralProcess = cms.bool(False),
0185         ReadMuonData = cms.bool(False), 
0186         Verbosity = cms.untracked.int32(0),
0187         # 1 will print cuts as they get set from DD
0188         # 2 will do as 1 + will dump Geant4 table of cuts
0189         MonopoleCharge       = cms.untracked.int32(1),
0190         MonopoleDeltaRay     = cms.untracked.bool(True),
0191         MonopoleMultiScatter = cms.untracked.bool(False),
0192         MonopoleTransport    = cms.untracked.bool(True),
0193         MonopoleMass         = cms.untracked.double(0),
0194         ExoticaTransport     = cms.untracked.bool(False),
0195         ExoticaPhysicsSS     = cms.untracked.bool(False),
0196         RhadronPhysics       = cms.bool(False),
0197         DarkMPFactor         = cms.double(1.0),
0198         Region      = cms.string(''),
0199         TrackingCut = cms.bool(False),
0200         SRType      = cms.bool(True),
0201         FlagMuNucl  = cms.bool(False),
0202         FlagFluo    = cms.bool(False),
0203         EMPhysics   = cms.untracked.bool(True),
0204         HadPhysics  = cms.untracked.bool(True),
0205         FlagBERT    = cms.untracked.bool(False),
0206         EminFTFP    = cms.double(3.), # in GeV
0207         EmaxBERT    = cms.double(6.), # in GeV
0208         EminQGSP    = cms.double(12.), # in GeV
0209         EmaxFTFP    = cms.double(25.), # in GeV
0210         EmaxBERTpi  = cms.double(12.), # in GeV
0211         LowEnergyGflashEcal = cms.bool(False),
0212         LowEnergyGflashEcalEmax = cms.double(0.02), # in GeV
0213         GflashEcal    = cms.bool(False),
0214         GflashHcal    = cms.bool(False),
0215         GflashEcalHad = cms.bool(False),
0216         GflashHcalHad = cms.bool(False),
0217         bField        = cms.double(3.8),
0218         energyScaleEB = cms.double(1.032),
0219         energyScaleEE = cms.double(1.024),
0220         ThermalNeutrons = cms.untracked.bool(False),
0221         RusRoElectronEnergyLimit  = cms.double(0.0),
0222         RusRoEcalElectron         = cms.double(1.0),
0223         RusRoHcalElectron         = cms.double(1.0),
0224         RusRoMuonIronElectron     = cms.double(1.0),
0225         RusRoPreShowerElectron    = cms.double(1.0),
0226         RusRoCastorElectron       = cms.double(1.0),
0227         RusRoWorldElectron        = cms.double(1.0),
0228         ElectronStepLimit         = cms.bool(False),
0229         ElectronRangeTest         = cms.bool(False),
0230         PositronStepLimit         = cms.bool(False),
0231         ProtonRegionLimit         = cms.bool(False),
0232         PionRegionLimit           = cms.bool(False),
0233         LimitsPerRegion = cms.vstring('EcalRegion','HcalRegion'),
0234         EnergyLimitsE   = cms.vdouble(0.,0.0),
0235         EnergyLimitsH   = cms.vdouble(0.,0.0),
0236         EnergyFactorsE  = cms.vdouble(1.,0.0),
0237         EnergyRMSE      = cms.vdouble(0.0,0.0),
0238         MinStepLimit              = cms.double(1.0),
0239         ModifyTransportation      = cms.bool(False),
0240         ThresholdWarningEnergy    = cms.untracked.double(100.0), #in MeV
0241         ThresholdImportantEnergy  = cms.untracked.double(250.0), #in MeV
0242         ThresholdTrials           = cms.untracked.int32(10)
0243     ),
0244     Generator = cms.PSet(
0245         common_maximum_time,
0246         HectorEtaCut,
0247         HepMCProductLabel = cms.InputTag('generatorSmeared'),
0248         ApplyPCuts = cms.bool(True),
0249         ApplyPtransCut = cms.bool(False),
0250         MinPCut = cms.double(0.04), ## the cut is in GeV 
0251         MaxPCut = cms.double(99999.0), ## the pmax=99.TeV 
0252         ApplyEtaCuts = cms.bool(True),
0253         MinEtaCut = cms.double(-5.5),
0254         MaxEtaCut = cms.double(5.5),
0255         RDecLenCut = cms.double(2.9), ## (cm) the cut on vertex radius
0256         LDecLenCut = cms.double(30.0), ## (cm) decay volume length
0257         ApplyPhiCuts = cms.bool(False),
0258         MinPhiCut = cms.double(-3.14159265359), ## (radians)
0259         MaxPhiCut = cms.double(3.14159265359),  ## according to CMS conventions
0260         ApplyLumiMonitorCuts = cms.bool(False), ## primary for lumi monitors
0261         Verbosity = cms.untracked.int32(0),
0262         PDGselection = cms.PSet(
0263             PDGfilterSel = cms.bool(False),        ## filter out unwanted particles
0264             PDGfilter = cms.vint32(21,1,2,3,4,5,6) ## list of unwanted particles (gluons and quarks)
0265         )
0266     ),
0267     RunAction = cms.PSet(
0268         StopFile = cms.string('')
0269     ),
0270     EventAction = cms.PSet(
0271         debug = cms.untracked.bool(False),
0272         StopFile = cms.string(''),
0273         PrintRandomSeed = cms.bool(False),
0274         CollapsePrimaryVertices = cms.bool(False)
0275     ),
0276     StackingAction = cms.PSet(
0277         common_heavy_suppression,
0278         common_maximum_time,
0279         KillDeltaRay  = cms.bool(False),
0280         TrackNeutrino = cms.bool(False),
0281         KillHeavy     = cms.bool(False),
0282         KillGamma     = cms.bool(True),
0283         GammaThreshold = cms.double(0.0001), ## (MeV)
0284         SaveFirstLevelSecondary = cms.untracked.bool(False),
0285         SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(False),
0286         SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(False),
0287         SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(False),
0288         SaveAllPrimaryDecayProductsAndConversions = cms.untracked.bool(True),
0289         RusRoGammaEnergyLimit  = cms.double(5.0), ## (MeV)
0290         RusRoEcalGamma         = cms.double(0.3),
0291         RusRoHcalGamma         = cms.double(0.3),
0292         RusRoMuonIronGamma     = cms.double(0.3),
0293         RusRoPreShowerGamma    = cms.double(0.3),
0294         RusRoCastorGamma       = cms.double(0.3),
0295         RusRoWorldGamma        = cms.double(0.3),
0296         RusRoNeutronEnergyLimit  = cms.double(10.0), ## (MeV)
0297         RusRoEcalNeutron         = cms.double(0.1),
0298         RusRoHcalNeutron         = cms.double(0.1),
0299         RusRoMuonIronNeutron     = cms.double(0.1),
0300         RusRoPreShowerNeutron    = cms.double(0.1),
0301         RusRoCastorNeutron       = cms.double(0.1),
0302         RusRoWorldNeutron        = cms.double(0.1),
0303         RusRoProtonEnergyLimit  = cms.double(0.0),
0304         RusRoEcalProton         = cms.double(1.0),
0305         RusRoHcalProton         = cms.double(1.0),
0306         RusRoMuonIronProton     = cms.double(1.0),
0307         RusRoPreShowerProton    = cms.double(1.0),
0308         RusRoCastorProton       = cms.double(1.0),
0309         RusRoWorldProton        = cms.double(1.0)
0310     ),
0311     TrackingAction = cms.PSet(
0312         common_MCtruth,
0313         DetailedTiming = cms.untracked.bool(False),
0314         CheckTrack = cms.untracked.bool(False),
0315     ),
0316     SteppingAction = cms.PSet(
0317         common_maximum_time,
0318         MaxNumberOfSteps        = cms.int32(20000),
0319         EkinNames               = cms.vstring(),
0320         EkinThresholds          = cms.vdouble(),
0321         EkinParticles           = cms.vstring()
0322     ),
0323     TrackerSD = cms.PSet(
0324         ZeroEnergyLoss = cms.bool(False),
0325         PrintHits = cms.bool(False),
0326         ElectronicSigmaInNanoSeconds = cms.double(12.06),
0327         NeverAccumulate = cms.bool(False),
0328         EnergyThresholdForPersistencyInGeV = cms.double(0.2),
0329         EnergyThresholdForHistoryInGeV = cms.double(0.05)
0330     ),
0331     MuonSD = cms.PSet(
0332         EnergyThresholdForPersistency = cms.double(1.0),
0333         PrintHits = cms.bool(False),
0334         AllMuonsPersistent = cms.bool(True),
0335         UseDemoHitRPC = cms.bool(True),
0336         UseDemoHitGEM = cms.bool(True),
0337         HaveDemoChambers = cms.bool(True)
0338     ),
0339     CaloSD = cms.PSet(
0340         common_heavy_suppression,
0341         common_MCtruth,
0342         SuppressHeavy = cms.bool(False),
0343         EminTrack = cms.double(1.0),
0344         TmaxHit   = cms.double(1000.0),
0345         HCNames   = cms.vstring('EcalHitsEB','EcalHitsEE','EcalHitsES','HcalHits','ZDCHITS'),
0346         EminHits  = cms.vdouble(0.015,0.010,0.0,0.0,0.0),
0347         EminHitsDepth = cms.vdouble(0.0,0.0,0.0,0.0,0.0),
0348         TmaxHits  = cms.vdouble(500.0,500.0,500.0,500.0,2000.0),
0349         UseResponseTables = cms.vint32(0,0,0,0,0),
0350         BeamPosition      = cms.double(0.0),
0351         CorrectTOFBeam    = cms.bool(False),
0352         DetailedTiming    = cms.untracked.bool(False),
0353         UseMap            = cms.untracked.bool(False),
0354         Verbosity         = cms.untracked.int32(0),
0355         CheckHits         = cms.untracked.int32(25)
0356     ),
0357     CaloResponse = cms.PSet(
0358         UseResponseTable  = cms.bool(True),
0359         ResponseScale     = cms.double(1.0),
0360         ResponseFile      = cms.FileInPath('SimG4CMS/Calo/data/responsTBpim50.dat')
0361     ),
0362     ECalSD = cms.PSet(
0363         common_UseLuminosity,
0364         UseBirkLaw      = cms.bool(True),
0365         BirkL3Parametrization = cms.bool(True),
0366         BirkSlope       = cms.double(0.253694),
0367         BirkCut         = cms.double(0.1),
0368         BirkC1          = cms.double(0.03333),
0369         BirkC3          = cms.double(1.0),
0370         BirkC2          = cms.double(0.0),
0371         SlopeLightYield = cms.double(0.02),
0372         StoreSecondary  = cms.bool(False),
0373         TimeSliceUnit   = cms.double(1),
0374         IgnoreTrackID   = cms.bool(False),
0375         XtalMat         = cms.untracked.string('E_PbWO4'),
0376         TestBeam        = cms.untracked.bool(False),
0377         NullNumbering   = cms.untracked.bool(False),
0378         StoreRadLength  = cms.untracked.bool(False),
0379         ScaleRadLength  = cms.untracked.double(1.0),
0380         StoreLayerTimeSim = cms.untracked.bool(False),
0381         AgeingWithSlopeLY = cms.untracked.bool(False),
0382         Detectors         = cms.untracked.int32(3),
0383         DumpGeometry      = cms.untracked.int32(0)
0384         ),
0385     HCalSD = cms.PSet(
0386         common_UseLuminosity,
0387         UseBirkLaw                = cms.bool(True),
0388         BirkC3                    = cms.double(1.75),
0389         BirkC2                    = cms.double(0.142),
0390         BirkC1                    = cms.double(0.0060),
0391         UseShowerLibrary          = cms.bool(True),
0392         UseParametrize            = cms.bool(False),
0393         UsePMTHits                = cms.bool(False),
0394         UseFibreBundleHits        = cms.bool(False),
0395         TestNumberingScheme       = cms.bool(False),
0396         doNeutralDensityFilter    = cms.bool(False),
0397         EminHitHB                 = cms.double(0.0),
0398         EminHitHE                 = cms.double(0.0),
0399         EminHitHO                 = cms.double(0.0),
0400         EminHitHF                 = cms.double(0.0),
0401         BetaThreshold             = cms.double(0.7),
0402         TimeSliceUnit             = cms.double(1),
0403         IgnoreTrackID             = cms.bool(False),
0404         HBDarkening               = cms.bool(False),
0405         HEDarkening               = cms.bool(False),
0406         HFDarkening               = cms.bool(False),
0407         UseHF                     = cms.untracked.bool(True),
0408         ForTBH2                   = cms.untracked.bool(False),
0409         ForTBHCAL                 = cms.untracked.bool(False),
0410         UseLayerWt                = cms.untracked.bool(False),
0411         WtFile                    = cms.untracked.string('None'),
0412         TestNS                    = cms.untracked.bool(False),
0413         DumpGeometry              = cms.untracked.bool(False),
0414         HFDarkeningParameterBlock = HFDarkeningParameterBlock
0415     ),
0416     CaloTrkProcessing = cms.PSet(
0417         common_MCtruth,
0418         TestBeam   = cms.bool(False),
0419         EminTrack  = cms.double(0.01),
0420         PutHistory = cms.bool(False),
0421     ),
0422     HFShower = cms.PSet(
0423         common_UsePMT,
0424         common_UseHF,
0425         PEPerGeV          = cms.double(0.31),
0426         TrackEM           = cms.bool(False),
0427         UseShowerLibrary  = cms.bool(True),
0428         UseHFGflash       = cms.bool(False),
0429         EminLibrary       = cms.double(0.0),
0430         LambdaMean        = cms.double(350.0),
0431         ApplyFiducialCut  = cms.bool(True),
0432         RefIndex          = cms.double(1.459),
0433         Aperture          = cms.double(0.33),
0434         ApertureTrapped   = cms.double(0.22),
0435         CosApertureTrapped= cms.double(0.5),
0436         SinPsiMax         = cms.untracked.double(0.5),
0437         ParametrizeLast   = cms.untracked.bool(False),
0438         HFShowerBlock     = cms.PSet(refToPSet_ = cms.string("HFShowerBlock"))
0439     ),
0440     HFShowerLibrary = cms.PSet(
0441         HFLibraryFileBlock = cms.PSet(refToPSet_ = cms.string("HFLibraryFileBlock"))
0442     ),
0443     HFShowerPMT = cms.PSet(
0444         common_UsePMT,
0445         common_UseHF,
0446         PEPerGeVPMT       = cms.double(1.0),
0447         RefIndex          = cms.double(1.52),
0448         Aperture          = cms.double(0.99),
0449         ApertureTrapped   = cms.double(0.22),
0450         CosApertureTrapped= cms.double(0.5),
0451         SinPsiMax         = cms.untracked.double(0.5)
0452     ),
0453     HFShowerStraightBundle = cms.PSet(
0454         common_UsePMT,
0455         common_UseHF,
0456         FactorBundle      = cms.double(1.0),
0457         RefIndex          = cms.double(1.459),
0458         Aperture          = cms.double(0.33),
0459         ApertureTrapped   = cms.double(0.22),
0460         CosApertureTrapped= cms.double(0.5),
0461         SinPsiMax         = cms.untracked.double(0.5)
0462     ),
0463     HFShowerConicalBundle = cms.PSet(
0464         common_UsePMT,
0465         common_UseHF,
0466         FactorBundle      = cms.double(1.0),
0467         RefIndex          = cms.double(1.459),
0468         Aperture          = cms.double(0.33),
0469         ApertureTrapped   = cms.double(0.22),
0470         CosApertureTrapped= cms.double(0.5),
0471         SinPsiMax         = cms.untracked.double(0.5)
0472     ),
0473     HFGflash = cms.PSet(
0474         BField          = cms.untracked.double(3.8),
0475         WatcherOn       = cms.untracked.bool(True),
0476         FillHisto       = cms.untracked.bool(True)
0477     ),
0478     CastorSD = cms.PSet(
0479         useShowerLibrary               = cms.bool(True),
0480         minEnergyInGeVforUsingSLibrary = cms.double(1.0),
0481         nonCompensationFactor          = cms.double(0.817),
0482         Verbosity                      = cms.untracked.int32(0)
0483     ),
0484     CastorShowerLibrary =  cms.PSet(
0485         FileName  = cms.FileInPath('SimG4CMS/Forward/data/CastorShowerLibrary_CMSSW500_Standard.root'),
0486         BranchEvt = cms.untracked.string('hadShowerLibInfo.'),
0487         BranchEM  = cms.untracked.string('emParticles.'),
0488         BranchHAD = cms.untracked.string('hadParticles.'),
0489         Verbosity = cms.untracked.bool(False)
0490     ),
0491     BHMSD = cms.PSet(
0492          Verbosity = cms.untracked.int32(0)
0493     ),
0494     MtdSD = cms.PSet(
0495         Verbosity = cms.untracked.int32(0),
0496         TimeSliceUnit    = cms.double(0.01), #stepping = 10 ps (for timing)
0497         IgnoreTrackID    = cms.bool(False),
0498         EminHit          = cms.double(0.0),
0499         CheckID          = cms.untracked.bool(True),
0500     ),
0501     HGCSD = cms.PSet(
0502         Verbosity        = cms.untracked.int32(0),
0503         TimeSliceUnit    = cms.double(0.001), #stepping = 1 ps (for timing)
0504         IgnoreTrackID    = cms.bool(False),
0505         EminHit          = cms.double(0.0),
0506         FiducialCut      = cms.bool(False),
0507         DistanceFromEdge = cms.double(1.0),
0508         StoreAllG4Hits   = cms.bool(False),
0509         RejectMouseBite  = cms.bool(False),
0510         RotatedWafer     = cms.bool(False),
0511         CornerMinMask    = cms.int32(0),
0512         WaferAngles      = cms.untracked.vdouble(90.0,30.0),
0513         WaferSize        = cms.untracked.double(123.7),
0514         MouseBite        = cms.untracked.double(2.5),
0515         CheckID          = cms.untracked.bool(True),
0516         UseDetector      = cms.untracked.int32(3),
0517         Detectors        = cms.untracked.int32(2),
0518         MissingWaferFile = cms.untracked.string("")
0519     ),
0520     HGCScintSD = cms.PSet(
0521         Verbosity        = cms.untracked.int32(0),
0522         EminHit          = cms.double(0.0),
0523         UseBirkLaw       = cms.bool(True),
0524         BirkC3           = cms.double(1.75),
0525         BirkC2           = cms.double(0.142),
0526         BirkC1           = cms.double(0.0052),
0527         FiducialCut      = cms.bool(False),
0528         DistanceFromEdge = cms.double(1.0),
0529         StoreAllG4Hits   = cms.bool(False),
0530     ),
0531     HFNoseSD = cms.PSet(
0532         Verbosity        = cms.untracked.int32(0),
0533         TimeSliceUnit    = cms.double(0.001), #stepping = 1 ps (for timing)
0534         IgnoreTrackID    = cms.bool(False),
0535         EminHit          = cms.double(0.0),
0536         FiducialCut      = cms.bool(False),
0537         DistanceFromEdge = cms.double(1.0),
0538         StoreAllG4Hits   = cms.bool(False),
0539         RejectMouseBite  = cms.bool(False),
0540         RotatedWafer     = cms.bool(False),
0541         CornerMinMask    = cms.int32(0),
0542         WaferAngles      = cms.untracked.vdouble(90.0,30.0),
0543         CheckID          = cms.untracked.bool(True),
0544     ),
0545     TotemRPSD = cms.PSet(
0546         Verbosity = cms.int32(0)
0547     ),
0548     TotemSD = cms.PSet(
0549         Verbosity = cms.untracked.int32(0)
0550     ),
0551     TotemT2ScintSD = cms.PSet(
0552         UseBirkLaw    = cms.bool(True),
0553         BirkC3        = cms.double(1.75),
0554         BirkC2        = cms.double(0.142),
0555         BirkC1        = cms.double(0.006),
0556         TimeSliceUnit = cms.double(1),
0557         IgnoreTrackID = cms.bool(False),
0558     ),
0559     PPSDiamondSD = cms.PSet(
0560         Verbosity = cms.int32(0)
0561     ),
0562     PPSPixelSD = cms.PSet(
0563         Verbosity = cms.untracked.int32(0)
0564     ),
0565     ZdcSD = cms.PSet(
0566         Verbosity = cms.int32(0),
0567         UseShowerLibrary = cms.bool(True),
0568         UseShowerHits = cms.bool(False),
0569         FiberDirection = cms.double(45.0),
0570         ZdcHitEnergyCut = cms.double(10.0)
0571     ),
0572     ZdcShowerLibrary = cms.PSet(
0573         Verbosity = cms.untracked.int32(0)
0574     ),
0575     FP420SD = cms.PSet(
0576         Verbosity = cms.untracked.int32(2)
0577     ),
0578     BscSD = cms.PSet(
0579         Verbosity = cms.untracked.int32(0)
0580     ),
0581     PltSD = cms.PSet(
0582         EnergyThresholdForPersistencyInGeV = cms.double(0.2),
0583         EnergyThresholdForHistoryInGeV = cms.double(0.05)
0584     ),
0585     Bcm1fSD = cms.PSet(
0586         EnergyThresholdForPersistencyInGeV = cms.double(0.010),
0587         EnergyThresholdForHistoryInGeV = cms.double(0.005)
0588     ),
0589     HcalTB02SD = cms.PSet(
0590         UseBirkLaw = cms.untracked.bool(False),
0591         BirkC1 = cms.untracked.double(0.013),
0592         BirkC3 = cms.untracked.double(1.75),
0593         BirkC2 = cms.untracked.double(0.0568)
0594     ),
0595     EcalTBH4BeamSD = cms.PSet(
0596         UseBirkLaw = cms.bool(False),
0597         BirkC1 = cms.double(0.013),
0598         BirkC3 = cms.double(1.75),
0599         BirkC2 = cms.double(0.0568)
0600     ),
0601     HGCalTestBeamSD = cms.PSet(
0602         Material   = cms.string('Scintillator'),
0603         UseBirkLaw = cms.bool(False),
0604         BirkC1 = cms.double(0.013),
0605         BirkC3 = cms.double(1.75),
0606         BirkC2 = cms.double(0.0568),
0607     ),
0608     HcalTB06BeamSD = cms.PSet(
0609         UseBirkLaw = cms.bool(False),
0610         BirkC1 = cms.double(0.013),
0611         BirkC3 = cms.double(1.75),
0612         BirkC2 = cms.double(0.0568)
0613     ),
0614     AHCalSD = cms.PSet(
0615         UseBirkLaw      = cms.bool(True),
0616         BirkC3          = cms.double(1.75),
0617         BirkC2          = cms.double(0.142),
0618         BirkC1          = cms.double(0.0052),
0619         EminHit         = cms.double(0.0),
0620         TimeSliceUnit   = cms.double(1),
0621         IgnoreTrackID   = cms.bool(False),
0622     ),
0623 )
0624 ##
0625 ## Change the HFShowerLibrary file from Run 2
0626 ##
0627 from Configuration.Eras.Modifier_run2_common_cff import run2_common
0628 
0629 ##
0630 ## Change HCAL numbering scheme in 2017
0631 ##
0632 from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
0633 run2_HCAL_2017.toModify( g4SimHits, HCalSD = dict( TestNumberingScheme = True ) )
0634 
0635 ##
0636 ## Disable Castor from Run 3, enable PPS (***temporarily disable PPS***)
0637 ##
0638 from Configuration.Eras.Modifier_run3_common_cff import run3_common
0639 run3_common.toModify( g4SimHits, CastorSD = dict( useShowerLibrary = False ) ) 
0640 run3_common.toModify( g4SimHits, LHCTransport = True )
0641 
0642 ##
0643 ## Disable PPS from Run 3 PbPb runs
0644 ##
0645 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3
0646 pp_on_PbPb_run3.toModify( g4SimHits, LHCTransport = False )
0647 
0648 ##
0649 ## Change ECAL time slices
0650 ##
0651 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
0652 phase2_timing.toModify( g4SimHits, ECalSD = dict(
0653                              StoreLayerTimeSim = True,
0654                              TimeSliceUnit = 0.001 )
0655 )
0656 
0657 ##
0658 ## Change CALO Thresholds
0659 ##
0660 from Configuration.Eras.Modifier_h2tb_cff import h2tb
0661 h2tb.toModify(g4SimHits,
0662               OnlySDs = ['EcalSensitiveDetector', 'CaloTrkProcessing', 'HcalTB06BeamDetector', 'HcalSensitiveDetector'],
0663               CaloSD = dict(
0664                   EminHits  = [0.0, 0.0, 0.0, 0.0, 0.0],
0665                   TmaxHits  = [1000.0, 1000.0, 1000.0, 1000.0, 2000.0] ),
0666               CaloTrkProcessing = dict(
0667                   TestBeam = True ),
0668               HCalSD = dict(
0669                   ForTBHCAL = True )
0670 )
0671 
0672 ##
0673 ## DD4hep migration
0674 ##
0675 from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
0676 dd4hep.toModify( g4SimHits, g4GeometryDD4hepSource = True )
0677 
0678 ##
0679 ## Selection of SD's for Phase2, exclude PPS
0680 ##
0681 
0682 from Configuration.Eras.Modifier_phase2_common_cff import phase2_common
0683 phase2_common.toModify(g4SimHits,
0684                        OnlySDs = ['ZdcSensitiveDetector', 'TotemT2ScintSensitiveDetector', 'TotemSensitiveDetector', 'RomanPotSensitiveDetector', 'PLTSensitiveDetector', 'MuonSensitiveDetector', 'MtdSensitiveDetector', 'BCM1FSensitiveDetector', 'EcalSensitiveDetector', 'CTPPSSensitiveDetector', 'HGCalSensitiveDetector', 'BSCSensitiveDetector', 'CTPPSDiamondSensitiveDetector', 'FP420SensitiveDetector', 'BHMSensitiveDetector', 'HFNoseSensitiveDetector', 'HGCScintillatorSensitiveDetector', 'CastorSensitiveDetector', 'CaloTrkProcessing', 'HcalSensitiveDetector', 'TkAccumulatingSensitiveDetector'],
0685                        LHCTransport = False, 
0686                        MuonSD = dict( 
0687                        HaveDemoChambers = False ) 
0688 )
0689 
0690 from Configuration.Eras.Modifier_hgcaltb_cff import hgcaltb
0691 hgcaltb.toModify(g4SimHits,
0692                  OnlySDs = ['AHcalSensitiveDetector', 'HGCSensitiveDetector', 'HGCalTB1601SensitiveDetector', 'HcalTB06BeamDetector']
0693 )