-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45241 from Dominic-Stafford/hw_lhe_match_fix_13_0
Herwig LHE matching fix and Matchbox relval for 13_0
- Loading branch information
Showing
20 changed files
with
190 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
Configuration/Generator/python/DY_TuneCH3_13TeV_herwig_madgraph_matchbox_cff.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from Configuration.Generator.Herwig7Settings.Herwig7StableParticlesForDetector_cfi import * | ||
from Configuration.Generator.Herwig7Settings.Herwig7CH3TuneSettings_cfi import * | ||
|
||
generator = cms.EDFilter("Herwig7GeneratorFilter", | ||
herwig7StableParticlesForDetectorBlock, | ||
herwig7CH3SettingsBlock, | ||
run = cms.string('InterfaceMatchboxTest'), | ||
dumpConfig = cms.untracked.string('HerwigConfig.in'), | ||
repository = cms.string('${HERWIGPATH}/HerwigDefaults.rpo'), | ||
dataLocation = cms.string('${HERWIGPATH:-6}'), | ||
generatorModule = cms.string('/Herwig/Generators/EventGenerator'), | ||
eventHandlers = cms.string('/Herwig/EventHandlers'), | ||
configFiles = cms.vstring(), | ||
crossSection = cms.untracked.double(-1), | ||
filterEfficiency = cms.untracked.double(1.0), | ||
Matchbox = cms.vstring( 'read snippets/Matchbox.in', | ||
'read snippets/PPCollider.in', | ||
'cd /Herwig/EventHandlers', | ||
'set EventHandler:LuminosityFunction:Energy 13000*GeV', | ||
'## Model assumptions', | ||
'read Matchbox/StandardModelLike.in', | ||
'read Matchbox/DiagonalCKM.in', | ||
'## Set the order of the couplings', | ||
'cd /Herwig/MatrixElements/Matchbox', | ||
'set Factory:OrderInAlphaS 0', | ||
'set Factory:OrderInAlphaEW 2', | ||
'## Select the process', | ||
'do Factory:Process p p -> l+ l-', | ||
'# read Matchbox/MadGraph-GoSam.in', | ||
'# read Matchbox/MadGraph-MadGraph.in', | ||
'read Matchbox/MadGraph-OpenLoops.in', | ||
'set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 50*GeV', | ||
'set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 14000*GeV', | ||
'cd /Herwig/MatrixElements/Matchbox', | ||
'set Factory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/LeptonPairMassScale', | ||
'read Matchbox/MCatNLO-DefaultShower.in', | ||
'# read Matchbox/NLO-NoShower.in', | ||
'# read Matchbox/LO-NoShower.in', | ||
'read Matchbox/FiveFlavourScheme.in', | ||
'do /Herwig/MatrixElements/Matchbox/Factory:ProductionMode', | ||
), | ||
parameterSets = cms.vstring('herwig7StableParticlesForDetector', 'Matchbox','herwig7CH3PDF', 'herwig7CH3AlphaS','herwig7CH3MPISettings'), | ||
) | ||
|
||
ProductionFilterSequence = cms.Sequence(generator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from __future__ import print_function | ||
import logging | ||
import argparse | ||
import sys | ||
import os | ||
import re | ||
|
||
|
||
def number_events(input_file, output_file=None, offset=0): | ||
if output_file is None: | ||
output_file = input_file | ||
if not os.path.exists(os.path.dirname(os.path.realpath(output_file))): | ||
os.makedirs(os.path.dirname(os.path.realpath(output_file))) | ||
|
||
nevent = offset | ||
with open('tmp.txt', 'w') as fw: | ||
with open(input_file, 'r') as ftmp: | ||
for line in ftmp: | ||
if re.search('\s*</event>', line): | ||
nevent += 1 | ||
fw.write('<event_num num="' + str(nevent) + '"> ' + str(nevent) + '</event_num>\n') | ||
fw.write(line) | ||
if output_file is not None: | ||
os.rename("tmp.txt", output_file) | ||
else: | ||
os.rename("tmp.txt", input_file) | ||
return nevent | ||
|
||
|
||
if __name__=="__main__": | ||
|
||
parser = argparse.ArgumentParser( | ||
description="Add numbers to lhe") | ||
parser.add_argument("input_file", type=str, | ||
help="Input LHE file path.") | ||
parser.add_argument("-o", "--output-file", default=None, type=str, | ||
help="Output LHE file path. If not specified, output to input file") | ||
args = parser.parse_args() | ||
|
||
logging.info('>>> launch addLHEnumbers.py in %s' % os.path.abspath(os.getcwd())) | ||
|
||
logging.info('>>> Input file: [%s]' % args.input_file) | ||
logging.info('>>> Write to output: %s ' % args.output_file) | ||
|
||
number_events(args.input_file, args.output_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.