text: import FWCore.ParameterSet.Config as cms
  
  process = cms.Process('SIM')
  
  # import of standard configurations
  process.load('Configuration.StandardSequences.Services_cff')
  process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
  process.load('Configuration.EventContent.EventContent_cff')
  process.load('SimGeneral.MixingModule.mixNoPU_cfi')
  process.load('SimG4CMS.HGCalTestBeam.HGCalTB160Module16XML_cfi')
  process.load('Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi')
  process.load('Geometry.HGCalCommonData.hgcalParametersInitialization_cfi')
  process.load('Configuration.StandardSequences.MagneticField_0T_cff')
  process.load('Configuration.StandardSequences.Generator_cff')
  process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi')
  process.load('GeneratorInterface.Core.genFilterSummary_cff')
  process.load('Configuration.StandardSequences.SimIdeal_cff')
  process.load('Configuration.StandardSequences.EndOfProcess_cff')
  process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
  process.load('SimG4CMS.HGCalTestBeam.HGCalTBAnalyzer_cfi')
  
  process.maxEvents = cms.untracked.PSet(
      input = cms.untracked.int32(1000)
  )
  
  process.MessageLogger = cms.Service("MessageLogger",
      cout = cms.untracked.PSet(
          HGCSim = cms.untracked.PSet(
              limit = cms.untracked.int32(-1)
          ),
          default = cms.untracked.PSet(
              limit = cms.untracked.int32(0)
          ),
          enable = cms.untracked.bool(True)
      )
  )
  
  # Input source
  process.source = cms.Source("EmptySource")
  
  process.options = cms.untracked.PSet(
  
  )
  
  # Production Info
  process.configurationMetadata = cms.untracked.PSet(
      annotation = cms.untracked.string('SingleElectronE4_cfi'),
      name = cms.untracked.string('Applications'),
      version = cms.untracked.string('$Revision: 1.19 $')
  )
  
  # Output definition
  
  process.RAWSIMoutput = cms.OutputModule("PoolOutputModule",
      SelectEvents = cms.untracked.PSet(
          SelectEvents = cms.vstring('generation_step')
      ),
      dataset = cms.untracked.PSet(
          dataTier = cms.untracked.string('GEN-SIM'),
          filterName = cms.untracked.string('')
      ),
      eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
      fileName = cms.untracked.string('file:gensim.root'),
      outputCommands = process.RAWSIMEventContent.outputCommands,
      splitLevel = cms.untracked.int32(0)
  )
  
  # Additional output definition
  process.TFileService = cms.Service("TFileService",
                                     fileName = cms.string('TBGenSim.root')
                                     )
  
  # Other statements
  process.genstepfilter.triggerConditions=cms.vstring("generation_step")
  from Configuration.AlCa.GlobalTag import GlobalTag
  process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')
  
  process.generator = cms.EDProducer("GaussRandomPThetaGunProducer",
      AddAntiParticle = cms.bool(False),
      PGunParameters = cms.PSet(
          MeanP    = cms.double(4.0),
          SigmaP   = cms.double(0.108),
          MinTheta = cms.double(0.0),
          MaxTheta = cms.double(0.0),
          MinPhi = cms.double(-3.14159265359),
          MaxPhi = cms.double(3.14159265359),
          PartID = cms.vint32(11)
      ),
      Verbosity = cms.untracked.int32(0),
      firstRun = cms.untracked.uint32(1),
      psethack = cms.string('single electron E 4')
  )
  process.VtxSmeared.MeanX  = 0.0
  process.VtxSmeared.SigmaX = 0.55
  process.VtxSmeared.MeanY  = 0.0
  process.VtxSmeared.SigmaY = 0.65
  process.VtxSmeared.MeanZ  = -3500.0
  process.VtxSmeared.SigmaZ = 0
  process.HGCalTBAnalyzer.doDigis = False
  process.HGCalTBAnalyzer.doRecHits = False
  process.g4SimHits.OnlySDs = ['HGCSensitiveDetector',
                               'HGCalTB1601SensitiveDetector']
  process.g4SimHits.HGCSD.Detectors = 1
  process.g4SimHits.HGCSD.UseDetector = 1
  
  # Path and EndPath definitions
  process.generation_step = cms.Path(process.pgen)
  process.simulation_step = cms.Path(process.psim)
  process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
  process.analysis_step = cms.Path(process.HGCalTBAnalyzer)
  process.endjob_step = cms.EndPath(process.endOfProcess)
  process.RAWSIMoutput_step = cms.EndPath(process.RAWSIMoutput)
  
  # Schedule definition
  process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.analysis_step,process.endjob_step,process.RAWSIMoutput_step)
  # filter all path with the production filter sequence
  for path in process.paths:
  	getattr(process,path)._seq = process.generator * getattr(process,path)._seq 
  
  
  