CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/SimCalorimetry/EcalTestBeam/python/ecalTB2006H4_GenSimDigiReco_cfg.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 import os
00003 
00004 mySample = "g4"
00005 mySection = "0"
00006 myEvent = "100"
00007 mySeed = "32789"
00008 myEnergy = "20"
00009 
00010 # condor_output_vtx50 -------------------------------------
00011 # vertex sigma 5.0 : not much different at this time.
00012 myParList = cms.vdouble(1.006, 1.0, 0.0, 1.82790e+00, 3.66237e+00, 0.965, 1.0)
00013 myNameTag = mySample + "_" + myEnergy + "_" + mySection
00014 
00015 process = cms.Process("TBSim")
00016 
00017 
00018 
00019 
00020 process.load("FWCore.MessageLogger.MessageLogger_cfi")
00021 
00022     
00023 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
00024 
00025 process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
00026     saveFileName = cms.untracked.string(''),
00027     theSource = cms.PSet(
00028         initialSeed = cms.untracked.uint32(7824367),      
00029         engineName = cms.untracked.string('HepJamesRandom') 
00030     ),                                                      
00031     generator = cms.PSet(
00032         initialSeed = cms.untracked.uint32(int(mySeed)),      
00033         engineName = cms.untracked.string('HepJamesRandom') 
00034     ),                                                      
00035     VtxSmeared = cms.PSet(
00036         initialSeed = cms.untracked.uint32(98765432),
00037         engineName = cms.untracked.string('HepJamesRandom')
00038     ),
00039     g4SimHits = cms.PSet(
00040         initialSeed = cms.untracked.uint32(11),
00041         engineName = cms.untracked.string('HepJamesRandom')
00042     ),
00043     SimEcalTBG4Object = cms.PSet(
00044         initialSeed = cms.untracked.uint32(12),
00045         engineName = cms.untracked.string('HepJamesRandom')
00046     ),
00047     mix = cms.PSet(
00048         initialSeed = cms.untracked.uint32(12345),
00049         engineName = cms.untracked.string('HepJamesRandom')
00050     ),
00051     simEcalUnsuppressedDigis = cms.PSet(
00052         initialSeed = cms.untracked.uint32(1234567),
00053         engineName = cms.untracked.string('HepJamesRandom')
00054     ),
00055 )
00056 
00057 process.RandomEngineStateProducer = cms.EDProducer("RandomEngineStateProducer")
00058 
00059 
00060 process.maxEvents = cms.untracked.PSet(
00061     input = cms.untracked.int32(int(myEvent)*10)
00062 )
00063 
00064 #Geometry
00065 
00066 #process.load("SimG4CMS.EcalTestBeam.crystal248_cff")
00067 process.common_beam_direction_parameters = cms.PSet(
00068     BeamMeanY = cms.double(0.0),
00069     BeamMeanX = cms.double(0.0),
00070     MinEta = cms.double(0.221605),
00071     MaxEta = cms.double(0.221605),
00072     MinPhi = cms.double(0.0467487),
00073     MaxPhi = cms.double(0.0467487),
00074 #    Psi    = cms.double(999.9),
00075     BeamPosition = cms.double(-26733.5)
00076 )
00077 
00078 
00079 
00080 #process.load("Geometry.EcalTestBeam.TBH4GeometryXML_cfi")
00081 process.MuonNumberingInitialization = cms.ESProducer("MuonNumberingInitialization")
00082 process.XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
00083     geomXMLFiles = cms.vstring('Geometry/CMSCommonData/data/materials.xml', 
00084         'Geometry/CMSCommonData/data/rotations.xml', 
00085         'Geometry/EcalTestBeam/data/ebcon.xml', 
00086         'Geometry/EcalCommonData/data/ebrot.xml', 
00087         'Geometry/EcalTestBeam/data/eregalgo.xml', 
00088         'Geometry/EcalCommonData/data/ebalgo.xml', 
00089         'Geometry/EcalTestBeam/data/tbrot.xml',
00090         'Geometry/EcalTestBeam/data/TBH4.xml', 
00091         'Geometry/EcalTestBeam/data/TBH4ecalsens.xml', 
00092         'Geometry/HcalSimData/data/CaloUtil.xml', 
00093         #'Geometry/EcalSimData/data/EcalProdCuts.xml', 
00094         #'Geometry/EcalTestBeam/data/TBH4ProdCuts.xml',
00095         'SimG4Core/GFlash/TB/gflashTBH4ProdCuts.xml',
00096         'Geometry/CMSCommonData/data/FieldParameters.xml'),
00097     rootNodeName = cms.string('TBH4:OCMS')
00098 )
00099 
00100 
00101 process.load("Geometry.CaloEventSetup.CaloGeometry_cff")
00102 process.load("Geometry.CaloEventSetup.CaloTopology_cfi")
00103 process.load("Geometry.EcalMapping.EcalMapping_cfi")
00104 process.load("Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi")
00105 process.CaloGeometryBuilder.SelectedCalos = ['EcalBarrel', 'EcalEndcap']
00106 
00107 
00108 # No magnetic field
00109 
00110 process.load("MagneticField.Engine.uniformMagneticField_cfi")
00111 
00112 process.source = cms.Source("EmptySource")
00113 
00114 process.generator = cms.EDProducer("FlatRandomEGunProducer",
00115     PGunParameters = cms.PSet(
00116         process.common_beam_direction_parameters,
00117         PartID = cms.vint32(11),
00118         MinE = cms.double(float(myEnergy)),
00119         MaxE = cms.double(float(myEnergy))
00120     ),
00121     Verbosity = cms.untracked.int32(0), ## set to 1 (or greater)  for printouts
00122 
00123     psethack = cms.string('single electron'),
00124     AddAntiParticle = cms.bool(False),
00125 )
00126 
00127 process.ProductionFilterSequence = cms.Sequence(process.generator)
00128 
00129 from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import *
00130 
00131 #
00132 # this module takes input in the units of *cm* and *radian*!!!
00133 #
00134 
00135 process.VtxSmeared = cms.EDFilter("BeamProfileVtxGenerator",
00136     process.common_beam_direction_parameters,
00137     VtxSmearedCommon,
00138 #    BeamSigmaX = cms.double(2.4),
00139 #    BeamSigmaY = cms.double(2.4),
00140 #    GaussianProfile = cms.bool(False),
00141     BeamSigmaX = cms.double(5.0),
00142     BeamSigmaY = cms.double(5.0),
00143     Psi             = cms.double(999.9),
00144     GaussianProfile = cms.bool(True),
00145     BinX = cms.int32(50),
00146     BinY = cms.int32(50),
00147     File       = cms.string('beam.profile'),
00148     UseFile    = cms.bool(False),
00149     TimeOffset = cms.double(0.)                      
00150 )
00151 
00152 # Geant4, ECAL test beam specific OscarProducer Configuration
00153 
00154 process.load("SimG4Core.Application.g4SimHits_cfi")
00155 
00156 process.g4SimHits.UseMagneticField = cms.bool(False)
00157 process.g4SimHits.Physics.DefaultCutValue = 1.
00158 process.g4SimHits.NonBeamEvent = cms.bool(True)
00159 process.g4SimHits.generator.HepMCProductLabel = cms.string('generator')
00160 process.g4SimHits.generator.ApplyPCuts = cms.bool(False)
00161 process.g4SimHits.generator.ApplyEtaCuts = cms.bool(True)
00162 process.g4SimHits.generator.ApplyPhiCuts = cms.bool(False)
00163 process.g4SimHits.generator.MaxEtaCut = cms.double(1.5)
00164 process.g4SimHits.generator.MinEtaCut = cms.double(0.0)
00165 process.g4SimHits.CaloSD.CorrectTOFBeam = cms.bool(True)
00166 process.g4SimHits.CaloSD.BeamPosition = cms.double(-26733.5)
00167 process.g4SimHits.CaloTrkProcessing.TestBeam = cms.bool(True)
00168 process.g4SimHits.StackingAction.MaxTrackTime = cms.double(10000.)
00169 process.g4SimHits.SteppingAction.MaxTrackTime = cms.double(10000.)
00170 process.g4SimHits.CaloSD.TmaxHit = cms.double(10000.)
00171 process.g4SimHits.CaloSD.TmaxHits = cms.vdouble(10000.,10000.,10000.,10000.,10000.)
00172 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
00173     type = cms.string('EcalTBH4Trigger'),
00174     verbose = cms.untracked.bool(False),
00175     #IMPORTANT    #    #    #    #    #    #    #    # NUMBER OF EVENTS TO BE TRIGGERED 
00176     trigEvents = cms.untracked.int32(int(myEvent))
00177 ))
00178 
00179 
00180 # Test Beam ECAL specific MC info
00181 
00182 process.SimEcalTBG4Object = cms.EDProducer("EcalTBMCInfoProducer",
00183     process.common_beam_direction_parameters,
00184     CrystalMapFile = cms.FileInPath('Geometry/EcalTestBeam/data/BarrelSM1CrystalCenterElectron120GeV.dat'),
00185     moduleLabelVtx = cms.untracked.string('generator')
00186 )
00187 
00188 # Test Beam ECAL hodoscope raw data simulation
00189 
00190 process.SimEcalTBHodoscope = cms.EDProducer("TBHodoActiveVolumeRawInfoProducer")
00191 
00192 # Test Beam ECAL Event header filling
00193 
00194 process.SimEcalEventHeader = cms.EDProducer("FakeTBEventHeaderProducer",
00195     EcalTBInfoLabel = cms.untracked.string('SimEcalTBG4Object')
00196 )
00197 
00198 # Digitization
00199 
00200 # no pileup
00201 
00202 process.load("SimGeneral.MixingModule.mixNoPU_cfi")
00203 
00204 # fake TB conditions
00205 
00206 process.load("CalibCalorimetry.EcalTrivialCondModules.EcalTrivialCondRetrieverTB_cfi")
00207 
00208 # Test beam unsuppressed digis
00209 
00210 process.load("SimCalorimetry.EcalTestBeam.ecaldigi_testbeam_cfi")
00211 
00212 # local reco
00213 process.load("Configuration.EcalTB.localReco_tbsim_cff")
00214 
00215 # ntuplizer for TB data format
00216 #process.TreeProducerCalibSimul = cms.EDFilter("TreeProducerCalibSimul",
00217 #    rootfile = cms.untracked.string("treeTB_"+myNameTag+".root"),
00218 #    eventHeaderCollection = cms.string(''),
00219 #    eventHeaderProducer = cms.string('SimEcalEventHeader'),
00220 #    txtfile = cms.untracked.string("treeTB_"+myNameTag+".txt"),
00221 #    EBRecHitCollection = cms.string('EcalRecHitsEB'),
00222 #    tdcRecInfoCollection = cms.string('EcalTBTDCRecInfo'),
00223 #    xtalInBeam = cms.untracked.int32(248),
00224 #    hodoRecInfoProducer = cms.string('ecalTBSimHodoscopeReconstructor'),
00225 #    hodoRecInfoCollection = cms.string('EcalTBHodoscopeRecInfo'),
00226 #    RecHitProducer = cms.string('ecalTBSimRecHit'),
00227 #    tdcRecInfoProducer = cms.string('ecalTBSimTDCReconstructor')
00228 #)
00229 
00230 # turning on/off Gflash
00231 if mySample == "gf":
00232     process.ecal_notCont_sim.EBs25notContainment = 1.0
00233     process.ecal_notCont_sim.EEs25notContainment = 1.0
00234     process.g4SimHits.Physics.type = 'SimG4Core/Physics/GFlash'
00235     process.g4SimHits.Physics.GFlash = cms.PSet(
00236         bField = cms.double(0.0),
00237         GflashEMShowerModel = cms.bool(True),
00238         GflashHadronShowerModel = cms.bool(True),
00239         GflashHistogram = cms.bool(True),
00240         GflashHistogramName = cms.string("gflash_histogram_"+myNameTag+".root"),
00241         GflashHadronPhysics = cms.string('QGSP_BERT'),
00242         GflashHcalOuter = cms.bool(True),
00243         GflashExportToFastSim = cms.bool(False),
00244         watcherOn = cms.bool(False),
00245         Verbosity = cms.untracked.int32(0),
00246         tuning_pList = myParList
00247     )
00248 
00249 print "physics type : ", process.g4SimHits.Physics.type
00250 
00251 # sequences
00252 process.doSimHits = cms.Sequence(process.ProductionFilterSequence*process.VtxSmeared*process.g4SimHits)
00253 process.doSimTB = cms.Sequence(process.SimEcalTBG4Object*process.SimEcalTBHodoscope*process.SimEcalEventHeader)
00254 process.doEcalDigis = cms.Sequence(process.mix*process.simEcalUnsuppressedDigis)
00255 #process.p1 = cms.Path(process.doSimHits*process.doSimTB*process.doEcalDigis*process.localReco_tbsim*process.TreeProducerCalibSimul)
00256 process.p1 = cms.Path(process.doSimHits*process.doSimTB*process.doEcalDigis*process.localReco_tbsim)
00257 
00258 
00259 
00260 # modify the default behavior of the MessageLogger
00261     
00262 process.MessageLogger.destinations=cms.untracked.vstring('cout'
00263                                                          ,'cerr'
00264                                                          ,'G4msg'
00265                                                          )
00266 process.MessageLogger.categories=cms.untracked.vstring('FwkJob'
00267                                                        ,'FwkReport'
00268                                                        ,'FwkSummary'
00269                                                        ,'Root_NoDictionary'
00270                                                        ,'TimeReport'
00271                                                        ,'TimeModule'
00272                                                        ,'TimeEvent'
00273                                                        ,'MemoryCheck'
00274                                                        ,'PhysicsList'
00275                                                        ,'G4cout'
00276                                                        ,'G4cerr'
00277                                                        ,'BeamProfileVtxGenerator'
00278                                                        )
00279 
00280 #process.MessageLogger.debugModule = cms.untracked.vstring('g4SimHits','VtxSmeared')
00281 
00282 #Configuring the G4msg.log output
00283 process.MessageLogger.G4msg =  cms.untracked.PSet(
00284     noTimeStamps = cms.untracked.bool(True)
00285     #First eliminate unneeded output
00286     ,threshold = cms.untracked.string('INFO')
00287     #,DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0))
00288     ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
00289     ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
00290     ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
00291     ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
00292     ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
00293     ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
00294     ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
00295     ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
00296     ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
00297     #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
00298     #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
00299     #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
00300     #
00301     #Then add the wanted ones:
00302     ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00303     ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00304     ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00305     ,BeamProfileVtxGenerator = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00306     )
00307 
00308 #Add these 3 lines to put back the summary for timing information at the end of the logfile
00309 #(needed for TimeReport report)
00310 process.options = cms.untracked.PSet(
00311     wantSummary = cms.untracked.bool(True)
00312 )
00313 
00314 
00315 #if not hasattr(process,"options") :
00316 process.options = cms.untracked.PSet()
00317 process.options.SkipEvent = cms.untracked.vstring('EventCorruption')
00318 
00319