diff --git a/README.md b/README.md index e9d7d42..6710c73 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ The [runSVJ](./test/runSVJ.py) script is a wrapper that can customize and run an * `config=[str]`: config file to customize and run (default = step_GEN) * `useFolders=[bool]`: read input files written with `--use-folders` option (see [Condor submission](#condor-submission)) * `printEvents=[num]`: number of Pythia events to print (default = 1) +* `quiet=[bool]`: suppress all Pythia printouts (default = False) * `threads=[num]`: number of threads to run (default = 1) * `streams=[num]`: number of streams to run (default = 0 -> streams = threads) * `redir=[dir]`: xrootd redirector for input file diff --git a/python/optSVJ.py b/python/optSVJ.py index cf9127e..9cb4e5e 100644 --- a/python/optSVJ.py +++ b/python/optSVJ.py @@ -38,6 +38,7 @@ options.register("maxEventsIn", -1, VarParsing.multiplicity.singleton, VarParsing.varType.int) options.register("useFolders", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool) options.register("printEvents", 1, VarParsing.multiplicity.singleton, VarParsing.varType.int) +options.register("quiet", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool) options.register("threads", 1, VarParsing.multiplicity.singleton, VarParsing.varType.int) options.register("streams", 0, VarParsing.multiplicity.singleton, VarParsing.varType.int) options.register("redir", "", VarParsing.multiplicity.singleton, VarParsing.varType.string) diff --git a/test/runSVJ.py b/test/runSVJ.py index f8f8f15..8fbc120 100644 --- a/test/runSVJ.py +++ b/test/runSVJ.py @@ -140,8 +140,29 @@ def fix_inname(inname,options,lhe=False): ) process.ProductionFilterSequence.insert(0,process.nmedfilter) -if hasattr(process,'generator') and hasattr(process.generator,'maxEventsToPrint'): - process.generator.maxEventsToPrint = options.printEvents +def set_if_has(obj,attr,val): + if hasattr(obj,attr): setattr(obj,attr,val) + +if hasattr(process,'generator'): + if options.quiet: + set_if_has(process.generator,'maxEventsToPrint',0) + set_if_has(process.generator,'pythiaHepMCVerbosity',False) + set_if_has(process.generator,'pythiaPylistVerbosity',0) + if hasattr(process.generator,'PythiaParameters'): + pythia_quiet_settings = [ + 'Print:quiet = on', + 'Init:showProcesses = off', + 'Init:showMultipartonInteractions = off', + 'Init:showChangedSettings = off', + 'init:showChangedParticleData = off', + ] + set_if_has( + process.generator.PythiaParameters, + 'pythia8CommonSettings', + getattr(process.generator.PythiaParameters,'pythia8CommonSettings',[])+pythia_quiet_settings + ) + elif hasattr(process.generator,'maxEventsToPrint'): + process.generator.maxEventsToPrint = options.printEvents # genjet/met settings - treat DM stand-ins as invisible _particles = ["genParticlesForJetsNoMuNoNu","genParticlesForJetsNoNu","genCandidatesForMET","genParticlesForMETAllVisible"]