|
[Rivet] alpgen+herwig in agile 1.2.2Andy Buckley andy.buckley at ed.ac.ukMon May 9 14:05:46 BST 2011
Hi Gavin et al. Thanks for the patches... now applied on the AGILe trunk. Sorry about the delay! Since I know virtually nothing about the mechanics of how AlpGen interfaces to shower generators (although I'm getting quite familiar with HERWIG/JIMMY!), can someone in the know please confirm for me that I shouldn't be worried that there is no similar vetoing loop in the AlpGenFPythia interface? Cheers, Andy On 28/04/11 17:54, Gavin Hesketh wrote: > Hello, > Although I'm a bit worried I might be gaining a reputation as an alpgen > defender, there is a bug in the new agile which means alpgen+herwig will > not run correctly. > > There are two small tweaks, calling: > > FC_HWEVNT.IERROR = -1; > and > > continue; (instead of return) > when UPVETO fails. > > Calling IERROR ensures the event count is correct at the end of the run > (mostly cosmetic, unless people use this to normalise). Calling continue > ensures agile does not spit out empty events if upveto fails (which can > be very often) - this is more serious, and basically makes it unusable > as (eg) rivet aborts on seeing an empty event. > > The two patched files are attached, the diff is below. > > cheers, > Gavin > > > > > > > diff AlpGenFHerwigJimmy.cc > build/AGILe-1.2.2/src/AlpGen/AlpGenFHerwigJimmy.cc > 70d70 > < FC_HWEVNT.IERROR = -1; > 72c72 > < continue; > --- > > return; > > > > > > > > > > diff AlpGenFHerwig.cc build/AGILe-1.2.2/src/AlpGen/AlpGenFHerwig.cc > 57,70c57,65 > < > < while (true) { > < FC_HWUINE(); // Initialize event > < FC_HWEPRO(); // Generate hard subprocess > < // Call the matching routine > < int imatch = 0; > < FC_UPVETO(&imatch); > < if (imatch != 0) { > < MSG_DEBUG("Event killed by UPVETO"); > < FC_HWEVNT.IERROR = -1; > < FC_HWUFNE(); > < continue; > < } > < break; > --- > > FC_HWUINE(); // Initialize event > > FC_HWEPRO(); // Generate hard subprocess > > // Call the matching routine > > int imatch = 0; > > FC_UPVETO(&imatch); > > if (imatch != 0) { > > MSG_DEBUG("Event killed by UPVETO"); > > FC_HWUFNE(); > > return; > > AlpGenFHerwig.cc > > > // -*- C++ -*- > #include "AGILe/AlpGen/AlpGenFHerwig.hh" > #include "AGILe/AlpGen/AlpGenWrapper.hh" > #include "AGILe/FHerwig/FHerwigWrapper65.hh" > #include "AGILe/Utils.hh" > #include "HepMC/HEPEVT_Wrapper.h" > > > //----------------------------------------------------------------------------- > // Implementation file for class : AlpGenFHerwig > // This is the file-reading interface wrapper only. It contains an instance of > // FHerwig which does most of the work. This class is only to provide access to > // the parameter > // settings. > // > // Authors: Jon Butterworth > // Andy Buckley > //----------------------------------------------------------------------------- > > > namespace AGILe { > > > // Standard constructor > AlpGenFHerwig::AlpGenFHerwig() { > _myName = "AlpGenHerwig"; > > // Set flag to read from LHA event file > FC_HWPROC.IPROC = -100; > _iprocset = true; > > // Set the ALPGEN filename to "zhjj" by default > FC_AHIO.FILENAME[0] = 'z'; > FC_AHIO.FILENAME[1] = 'h'; > FC_AHIO.FILENAME[2] = 'j'; > FC_AHIO.FILENAME[3] = 'j'; > } > > > // Set string parameters > bool AlpGenFHerwig::setParam(const string& name, const string& value) { > // Try AlpGen param handling first > bool ok = _alpgen.setParam(name, value); > if (ok) return SUCCESS; > // Fall back to Herwig param handling > ok = FHerwig::setParam(name, value); > if (ok) return SUCCESS; > // Fail > MSG_ERROR("AlpGenHerwig doesn't have a parameter called "<< name); > return FAILURE; > } > > > // Call event generation with veto routine for MLM matching > void AlpGenFHerwig::makeEvent(HepMC::GenEvent& evt) { > Generator::makeEvent(evt); > > while (true) { > FC_HWUINE(); // Initialize event > FC_HWEPRO(); // Generate hard subprocess > // Call the matching routine > int imatch = 0; > FC_UPVETO(&imatch); > if (imatch != 0) { > MSG_DEBUG("Event killed by UPVETO"); > FC_HWEVNT.IERROR = -1; > FC_HWUFNE(); > continue; > } > break; > } > FC_HWBGEN(); // Generate parton cascade > FC_HWDHOB(); // Do heavy quark decays > FC_HWCFOR(); // Do cluster formation > FC_HWCDEC(); // Do cluster decays > FC_HWDHAD(); // Do unstable particle decays > FC_HWDHVY(); // Do heavy flavor decays > FC_HWMEVT(); // Add soft underlying event > FC_HWUFNE(); // Finish event > fillEvent(evt); > return; > } > > > } > > > // Class factory > extern "C" { > AGILe::Generator* create() { return new AGILe::AlpGenFHerwig(); } > void destroy(AGILe::Generator* gen) { delete gen; } > } > > > AlpGenFHerwigJimmy.cc > > > // -*- C++ -*- > #include "AGILe/AlpGen/AlpGenFHerwigJimmy.hh" > #include "AGILe/AlpGen/AlpGenWrapper.hh" > #include "AGILe/FHerwig/FHerwigWrapper65.hh" > #include "AGILe/FHerwig/JimmyWrapper.hh" > #include "AGILe/Utils.hh" > #include "HepMC/HEPEVT_Wrapper.h" > > > //----------------------------------------------------------------------------- > // Implementation file for class : AlpGenFHerwigJimmy > // This is the file-reading interface wrapper only. It contains an instance of > // FHerwigJimmy which does most of the work. This class is only to provide access to > // the parameter > // settings. > // > // Authors: Jon Butterworth > // Andy Buckley > //----------------------------------------------------------------------------- > > > namespace AGILe { > > > // Standard constructor > AlpGenFHerwigJimmy::AlpGenFHerwigJimmy() { > // Set flag to read from LHA event file > FC_HWPROC.IPROC = -100; > _iprocset = true; > > // Set the ALPGEN filename to "zhjj" by default > FC_AHIO.FILENAME[0] = 'z'; > FC_AHIO.FILENAME[1] = 'h'; > FC_AHIO.FILENAME[2] = 'j'; > FC_AHIO.FILENAME[3] = 'j'; > } > > > // Set string parameters > bool AlpGenFHerwigJimmy::setParam(const string& name, const string& value) { > // Try AlpGen param handling first > bool ok = _alpgen.setParam(name, value); > if (ok) return SUCCESS; > // Fall back to Herwig+Jimmy param handling > ok = FHerwigJimmy::setParam(name, value); > if (ok) return SUCCESS; > // Fail > MSG_ERROR("AlpGenHerwigJimmy doesn't have a parameter called "<< name); > return FAILURE; > } > > > // Call event generation with veto routine for MLM matching > void AlpGenFHerwigJimmy::makeEvent(HepMC::GenEvent& evt) { > Generator::makeEvent(evt); > while (true) { > int counter(0); > // Repeat the first stages of event generation until multiple > // scattering succeeds (or isn't run at all). > while (true) { > > FC_HWUINE(); // Initialize event > FC_HWEPRO(); // Generate hard subprocess > > // Call the AlpGen matching routine > int imatch = 0; > FC_UPVETO(&imatch); > if (imatch != 0) { > MSG_DEBUG("Event killed by UPVETO"); > FC_HWEVNT.IERROR = -1; > FC_HWUFNE(); > continue; > } > > counter += 1; > > FC_HWBGEN(); // Generate parton cascade > > // Call the multiple scattering routine with the abort flag. > // If abort is returned with value 1 (true), then abandon the > // event. This implementation makes sure that the event generation > // continues if multiple scattering is disabled (MSFLAG != 1) > int abort(0); > if (FC_JMPARM.MSFLAG == 1) FC_HWMSCT(&abort); > // If MS is okay or disabled, escape the loop and > // continue with the decays and hadronisation. > if (abort == 0) { > MSG_DEBUG("Num attempts to make MPI = "<< counter); > break; > } > > // Check for too many attempts to make MPI scatters > if (counter> 100) { > throw runtime_error("Too many attempts to make MPI in FHerwigJimmy"); > } > } > FC_HWDHOB(); // Do heavy quark decays > if (_doHadronise) { > FC_HWCFOR(); // Do cluster formation > FC_HWCDEC(); // Do cluster decays > FC_HWDHAD(); // Do unstable particle decays > FC_HWDHVY(); // Do heavy flavor decays > } > FC_HWMEVT(); // Add soft underlying event > FC_HWUFNE(); // Finish event > if (FC_HWEVNT.IERROR == 0) break; > } > clearEvent(evt); > fillEvent(evt); > } > > > } > > > // Class factory > extern "C" { > AGILe::Generator* create() { return new AGILe::AlpGenFHerwigJimmy(); } > void destroy(AGILe::Generator* gen) { delete gen; } > } > > > > _______________________________________________ > Rivet mailing list > Rivet at projects.hepforge.org > http://www.hepforge.org/lists/listinfo/rivet -- Dr Andy Buckley SUPA Advanced Research Fellow Particle Physics Experiment Group, University of Edinburgh The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
More information about the Rivet mailing list |