agile is hosted by Hepforge, IPPP Durham

AlpGenFHerwig.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "AGILe/AlpGen/AlpGenFHerwig.hh"
00003 #include "AGILe/AlpGen/AlpGenWrapper.hh"
00004 #include "AGILe/FHerwig/FHerwigWrapper65.hh"
00005 #include "AGILe/Utils.hh"
00006 #include "HepMC/HEPEVT_Wrapper.h"
00007 
00008 
00009 //-----------------------------------------------------------------------------
00010 // Implementation file for class : AlpGenFHerwig
00011 // This is the file-reading interface wrapper only. It contains an instance of
00012 // FHerwig which does most of the work. This class is only to provide access to
00013 // the parameter
00014 // settings.
00015 //
00016 // Authors: Jon Butterworth
00017 //          Andy Buckley
00018 //-----------------------------------------------------------------------------
00019 
00020 
00021 namespace AGILe {
00022 
00023 
00024   // Standard constructor
00025   AlpGenFHerwig::AlpGenFHerwig() {
00026     _myName = "AlpGenHerwig";
00027 
00028     // Set flag to read from LHA event file
00029     FC_HWPROC.IPROC = -100;
00030     _iprocset = true;
00031 
00032     // Set the ALPGEN filename to "zhjj" by default
00033     FC_AHIO.FILENAME[0] = 'z';
00034     FC_AHIO.FILENAME[1] = 'h';
00035     FC_AHIO.FILENAME[2] = 'j';
00036     FC_AHIO.FILENAME[3] = 'j';
00037   }
00038 
00039 
00040   // Set string parameters
00041   bool AlpGenFHerwig::setParam(const string& name, const string& value) {
00042     // Try AlpGen param handling first
00043     bool ok = _alpgen.setParam(name, value);
00044     if (ok) return SUCCESS;
00045     // Fall back to Herwig param handling
00046     ok = FHerwig::setParam(name, value);
00047     if (ok) return SUCCESS;
00048     // Fail
00049     MSG_ERROR("AlpGenHerwig doesn't have a parameter called " << name);
00050     return FAILURE;
00051   }
00052 
00053 
00054   // Call event generation with veto routine for MLM matching
00055   void AlpGenFHerwig::makeEvent(HepMC::GenEvent& evt) {
00056     Generator::makeEvent(evt);
00057     while (true) {
00058       FC_HWUINE();  // Initialize event
00059       FC_HWEPRO();  // Generate hard subprocess
00060       // Call the matching routine
00061       int imatch = 0;
00062       FC_UPVETO(&imatch);
00063       if (imatch != 0) {
00064         MSG_DEBUG("Event killed by UPVETO");
00065         FC_HWEVNT.IERROR = -1;
00066         FC_HWUFNE();
00067         continue;
00068       }
00069       break;
00070     }
00071     FC_HWBGEN();  // Generate parton cascade
00072     FC_HWDHOB();  // Do heavy quark decays
00073     if (_doHadronise) {
00074       FC_HWCFOR();  // Do cluster formation
00075       FC_HWCDEC();  // Do cluster decays
00076       FC_HWDHAD();  // Do unstable particle decays
00077       FC_HWDHVY();  // Do heavy flavor decays
00078       FC_HWMEVT();  // Add soft underlying event
00079     }
00080     FC_HWUFNE();  // Finish event
00081     fillEvent(evt);
00082     return;
00083   }
00084 
00085 
00086 }
00087 
00088 
00089 // Class factory
00090 extern "C" {
00091   AGILe::Generator* create() { return new AGILe::AlpGenFHerwig(); }
00092   void destroy(AGILe::Generator* gen) { delete gen; }
00093 }
Generated on Tue Mar 6 10:39:38 2012 for AGILe - A Generator Interface Library (+ executable) by  doxygen 1.6.3