Back to home page

Project CMSSW displayed by LXR

 
 

    


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