This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
gauss:gauss [2011/10/29 15:22] – created decianm | gauss:gauss [2012/04/10 16:16] (current) – che | ||
---|---|---|---|
Line 2: | Line 2: | ||
===== How to write out MCParticles in Gauss ===== | ===== How to write out MCParticles in Gauss ===== | ||
It can be very useful to let Gauss write out MCParticles in the Generation directly (without the detector simulation), | It can be very useful to let Gauss write out MCParticles in the Generation directly (without the detector simulation), | ||
- | This can be achieved the following way: | + | This can be achieved the following way (write this at the end of your version of Gauss-Job.py): |
<code python> | <code python> | ||
gtos = GenerationToSimulation() | gtos = GenerationToSimulation() | ||
Line 14: | Line 14: | ||
The root file can then be run over with an MCTupleTool in DaVinci (with certain restrictions, | The root file can then be run over with an MCTupleTool in DaVinci (with certain restrictions, | ||
+ | |||
+ | To avoid error messages like: | ||
+ | |||
+ | MainEventGaussSim | ||
+ | |||
+ | you have to make sure that you have included | ||
+ | <code python> | ||
+ | Gauss().Phases = [" | ||
+ | Gauss().Output = ' | ||
+ | Gauss().Histograms = ' | ||
+ | </ | ||
+ | in your Gauss-Job.py file. | ||
+ | |||
+ | ===== Running EvtGen standalone ===== | ||
+ | You can run EvtGen standalone, letting the particles decay at rest. This is very fast, as no underlying event has to be generated. | ||
+ | A prototype file could look like (Gauss v41r1): | ||
+ | <code python> | ||
+ | #Event Type: 11114001 | ||
+ | from Configurables import Generation | ||
+ | Generation().EventType = 11114001 | ||
+ | from Configurables import StandAloneDecayTool | ||
+ | Generation().SampleGenerationTool = " | ||
+ | Generation().addTool( StandAloneDecayTool ) | ||
+ | Generation().StandAloneDecayTool.ProductionTool = " | ||
+ | |||
+ | from Configurables import ToolSvc | ||
+ | from Configurables import EvtGenDecay | ||
+ | |||
+ | ToolSvc().addTool( EvtGenDecay ) | ||
+ | ToolSvc().EvtGenDecay.UserDecayFile =" | ||
+ | Generation().StandAloneDecayTool.SignalPIDList = [ 511,-511 ] | ||
+ | </ | ||
+ | |||
+ | These both things (running EvtGen standalone and writing out MCParticles) can of course be combined. | ||
+ | |||
+ | ===== Running Particle Gun ===== | ||
+ | If you want to run a particle gun producing a particle type which should decay in EvtGen you have to change your options file accordingly to this prototype file (Gauss v41r1): | ||
+ | <code python> | ||
+ | # file / | ||
+ | # | ||
+ | # Event Type: 27876001 | ||
+ | # | ||
+ | # ASCII decay Descriptor: { [ D*+ -> pi+ pi+ pi- ]cc } | ||
+ | # | ||
+ | from Configurables import ParticleGun | ||
+ | from Configurables import MomentumRange | ||
+ | ParticleGun().addTool( MomentumRange ) | ||
+ | from GaudiKernel import SystemOfUnits | ||
+ | ParticleGun().MomentumRange.MomentumMin = 150.0*SystemOfUnits.GeV | ||
+ | from GaudiKernel import SystemOfUnits | ||
+ | ParticleGun().MomentumRange.MomentumMax = 1000.0*SystemOfUnits.GeV | ||
+ | ParticleGun().EventType = 27876001 | ||
+ | ParticleGun().ParticleGunTool = " | ||
+ | ParticleGun().NumberOfParticlesTool = " | ||
+ | ParticleGun().MomentumRange.PdgCodes = [ 413,-413 ] | ||
+ | |||
+ | from Configurables import ToolSvc | ||
+ | from Configurables import EvtGenDecay | ||
+ | ToolSvc().addTool( EvtGenDecay ) | ||
+ | ToolSvc().EvtGenDecay.UserDecayFile = " | ||
+ | from Gaudi.Configuration import * | ||
+ | importOptions( " | ||
+ | ParticleGun().DecayTool = " | ||
+ | </ | ||
+ | |||
+ | The numbering is incorrect as options file for Particle Guns start with 5. As the numbering scheme in case of Particle Guns aims at stable particles the official numbering scheme does not make much sense in this case. Anyhow, the numbering does not affect the performance of the option file for Particle Guns. | ||
+ | In addition you have to add the line | ||
+ | <code python> | ||
+ | Gauss().Production = ' | ||
+ | </ | ||
+ | to your Gauss Job file. | ||