import FWCore.ParameterSet.Config as cms

# configuration to model pileup for initial physics phase
from SimGeneral.MixingModule.aliases_cfi import *
from SimGeneral.MixingModule.pixelDigitizer_cfi import *
from SimGeneral.MixingModule.stripDigitizer_cfi import *
from SimGeneral.MixingModule.ecalDigitizer_cfi import *
from SimGeneral.MixingModule.hcalDigitizer_cfi import *
from SimGeneral.MixingModule.castorDigitizer_cfi import *
from SimGeneral.MixingModule.trackingTruthProducer_cfi import *

pixelDigitizer.TofLowerCut=cms.double(18.5)
pixelDigitizer.TofUpperCut=cms.double(43.5)
stripDigitizer.CosmicDelayShift = cms.untracked.double(31)

ecalDigitizer.cosmicsPhase = cms.bool(True)
ecalDigitizer.cosmicsShift = cms.double(1.)

theDigitizers = cms.PSet(
  pixel = cms.PSet(
    pixelDigitizer
  ),
  strip = cms.PSet(
    stripDigitizer
  ),
  ecal = cms.PSet(
    ecalDigitizer
  ),
  hcal = cms.PSet(
    hcalDigitizer
  ),
  castor  = cms.PSet(
    castorDigitizer
  )
)

theDigitizersValid = cms.PSet(
  pixel = cms.PSet(
    pixelDigitizer
  ),
  strip = cms.PSet(
    stripDigitizer
  ),
  ecal = cms.PSet(
    ecalDigitizer
  ),
  hcal = cms.PSet(
    hcalDigitizer
  ),
  castor  = cms.PSet(
    castorDigitizer
  ),
  mergedtruth = cms.PSet(
    trackingParticles
  )
)

from Configuration.Eras.Modifier_run3_common_cff import run3_common
run3_common.toModify( theDigitizers, castor = None )
run3_common.toModify( theDigitizersValid, castor = None )



