Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-16 22:52:40

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