11 from .
import Herwig7Config
as hw7Config
12 from .
import Herwig7Control
as hw7Control
13 from .
import Herwig7Utils
as hw7Utils
15 from AthenaCommon
import Logging
16 athMsgLog = Logging.logging.getLogger(
'Herwig7Control')
26 def __init__(self, genSeq, runArgs, run_name="Herwig", beams="pp"):
29 if beams
not in [
"EE",
"EP" ,
"PP"]:
30 raise RuntimeError(hw7Utils.ansi_format_error(
"Parameter 'beams' must be one of the following: ['EE', 'EP' , 'PP']"))
33 super(Hw7ConfigFxFx, self).
__init__(genSeq, runArgs, run_name)
43 ## ============================================
44 ## Local Pre-Commands from Herwig7ConfigFxFx.py
45 ## ============================================
47 # > no local pre-commands at the moment
54 ## =============================================
55 ## Local Post-Commands from Herwig7ConfigFxFx.py
56 ## =============================================
58 saverun {} /Herwig/Generators/EventGenerator
72 self.default_commands += self.beam_commands()
73 self.default_commands += self.random_seed_commands()
75 if not self.set_printout_commands:
76 self.default_commands += self.printout_commands()
77 if not self.set_physics_parameter_commands:
78 self.default_commands += self.physics_parameter_commands()
79 if not self.set_technical_parameter_commands:
80 self.default_commands += self.technical_parameter_commands()
85 raise RuntimeError(hw7Utils.ansi_format_error(
"Please use 'fxfx_commands()' in the JobOptions!"))
111 lhe_filename = "events.lhe",
112 me_pdf_order = "NLO",
116 automatic_process_detection = True,
120 if me_pdf_order
not in [
"LO",
"NLO"]:
121 raise RuntimeError(hw7Utils.ansi_format_error(
"Herwig7ConfigLHEF.py:__lhef_commands: Parameter 'me_pdf_order' must either be 'LO' or 'NLO'!"))
125 process_selection =
""
126 if not automatic_process_detection:
127 process_selection =
"""
128 ## The ihrd and ihvy parameters are Alpgen parameters to identify the hard process
129 set /Herwig/Shower/FxFxShowerHandler:ihrd {}
130 set /Herwig/Shower/FxFxShowerHandler:ihvy {}
134 ## ----------------------------
135 ## Read in Events from LHE File
136 ## ----------------------------
138 #library LesHouches.so
139 #create ThePEG::LesHouchesFileReader /Herwig/EventHandlers/LHEReader
142 ## Create the Handler and Reader
144 create Herwig::FxFxEventHandler /Herwig/EventHandlers/FxFxLHEHandler
145 create Herwig::FxFxFileReader /Herwig/EventHandlers/FxFxLHEReader
147 library FxFxHandler.so
148 create Herwig::FxFxHandler /Herwig/Shower/FxFxShowerHandler
149 set /Herwig/Shower/FxFxShowerHandler:ShowerModel /Herwig/Shower/ShowerModel
150 set /Herwig/Shower/FxFxShowerHandler:SplittingGenerator /Herwig/Shower/SplittingGenerator
153 ## Set up the LHE reader
154 set /Herwig/EventHandlers/FxFxLHEReader:WeightWarnings false
155 set /Herwig/EventHandlers/FxFxLHEReader:FileName {FileName}
156 set /Herwig/EventHandlers/FxFxLHEReader:MomentumTreatment RescaleEnergy
157 # set /Herwig/EventHandlers/FxFxLHEReader:IgnoreIDPRUP Yes
159 # Don't use any cuts on LHE files
160 create ThePEG::Cuts /Herwig/Cuts/NoCuts
161 set /Herwig/EventHandlers/FxFxLHEReader:Cuts /Herwig/Cuts/NoCuts
165 insert /Herwig/EventHandlers/FxFxLHEHandler:FxFxReaders 0 /Herwig/EventHandlers/FxFxLHEReader
166 set /Herwig/EventHandlers/FxFxLHEHandler:PartonExtractor /Herwig/Partons/PPExtractor
167 set /Herwig/EventHandlers/FxFxLHEHandler:CascadeHandler /Herwig/Shower/FxFxShowerHandler
168 set /Herwig/EventHandlers/FxFxLHEHandler:HadronizationHandler /Herwig/Hadronization/ClusterHadHandler
169 set /Herwig/EventHandlers/FxFxLHEHandler:DecayHandler /Herwig/Decays/DecayHandler
171 set /Herwig/EventHandlers/FxFxLHEHandler:WeightOption VarNegWeight
176 #set /Herwig/Shower/KinematicsReconstructor:ReconstructionOption General
177 #set /Herwig/Shower/KinematicsReconstructor:InitialInitialBoostOption LongTransBoost
178 #set /Herwig/Shower/KinematicsReconstructor:FinalStateReconOption Default
179 #set /Herwig/Shower/KinematicsReconstructor:InitialStateReconOption Rapidity
180 set /Herwig/Shower/ShowerHandler:MaxPtIsMuF Yes
181 set /Herwig/Shower/ShowerHandler:RestrictPhasespace Yes
182 #set /Herwig/Shower/ShowerHandler:ReconstructionOption OffShell4
184 set /Herwig/Shower/PartnerFinder:PartnerMethod Random
185 set /Herwig/Shower/PartnerFinder:ScaleChoice Partner
186 set /Herwig/Shower/ShowerHandler:SpinCorrelations No
188 set /Herwig/Shower/ShowerHandler:MaxTry 100
191 ## Set up the FxFxShowerHandler
193 set /Herwig/Shower/FxFxShowerHandler:MPIHandler /Herwig/UnderlyingEvent/MPIHandler
194 set /Herwig/Shower/FxFxShowerHandler:RemDecayer /Herwig/Partons/RemnantDecayer
195 set /Herwig/Shower/FxFxShowerHandler:ShowerAlpha /Herwig/Shower/AlphaQCD
197 ## Use the automatic process detection
198 set /Herwig/Shower/FxFxShowerHandler:HardProcessDetection {AutomaticProcessDetection}{ProcessSelection}
200 # Number of (Born-level) light jets in maximum-multiplicity FxFx process
201 set /Herwig/Shower/FxFxShowerHandler:njetsmax {NjetsMax} # Make sure this is set correctly!
203 # Mimimum parton-parton R-sep used for generation.
204 # (legacy from MLM merging, should stay fixed to zero in FxFx as this is NLO)
205 set /Herwig/Shower/FxFxShowerHandler:drjmin 0.0
207 ## Recommended key MLM merging parameters below
209 # turn the Vetoing On or Off completely
210 set /Herwig/Shower/FxFxShowerHandler:VetoIsTurnedOff VetoingIsOn
212 set /Herwig/Shower/FxFxShowerHandler:ETClus {MergingScale}*GeV
213 # jet radius used in clustering in merging.
214 set /Herwig/Shower/FxFxShowerHandler:RClus {RClus}
215 # factor to multiply RClus (if DR(parton,jet)<rclusfactor*rclus
216 # the parton and jet are said to have been matched)
217 set /Herwig/Shower/FxFxShowerHandler:RClusFactor 1.0
218 # Max |eta| for jets in clustering in merging.
219 set /Herwig/Shower/FxFxShowerHandler:EtaClusMax {EtaClusMax}
221 ## Setup event handlers
222 set /Herwig/Generators/EventGenerator:EventHandler /Herwig/EventHandlers/FxFxLHEHandler
225 ## UNSURE ABOUT THESE ---------------------------------------------------------
227 # set /Herwig/EventHandlers/FxFxLHEReader:IncludeSpin {IncludeSpin}
228 # set /Herwig/EventHandlers/FxFxLHEReader:AllowedToReOpen No
230 ## Set the PDF for the LHE reader.
231 set /Herwig/EventHandlers/FxFxLHEReader:PDFA /Herwig/Partons/Hard{MEPDFOrder}PDF
232 set /Herwig/EventHandlers/FxFxLHEReader:PDFB /Herwig/Partons/Hard{MEPDFOrder}PDF
233 # The PDF for beam particles A/B - overrides particle's own PDF above
234 set /Herwig/Shower/FxFxShowerHandler:PDFA /Herwig/Partons/Hard{MEPDFOrder}PDF
235 set /Herwig/Shower/FxFxShowerHandler:PDFB /Herwig/Partons/Hard{MEPDFOrder}PDF
236 """.
format(MergingScale = merging_scale,
237 NjetsMax = njets_max,
238 FileName = lhe_filename,
239 MEPDFOrder = me_pdf_order,
241 EtaClusMax = eta_clus_max,
242 IncludeSpin =
"Yes" if usespin
is True else "No",
243 AutomaticProcessDetection =
"Automatic" if automatic_process_detection
else "Manual",
244 ProcessSelection = process_selection)