CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
AlpgenHooks Class Reference

#include <GeneratorInput.h>

Inheritance diagram for AlpgenHooks:
JetMatchingAlpgenInputAlpgen JetMatchingMadgraphInputAlpgen

Public Member Functions

 AlpgenHooks (Pythia8::Pythia &pythia)
 
bool initAfterBeams ()
 
 ~AlpgenHooks ()
 

Private Attributes

LHAupAlpgenLHAagPtr
 

Detailed Description

Definition at line 134 of file GeneratorInput.h.

Constructor & Destructor Documentation

AlpgenHooks::AlpgenHooks ( Pythia8::Pythia &  pythia)

Definition at line 853 of file GeneratorInput.cc.

References LHAagPtr.

853  : LHAagPtr(NULL) {
854 
855  // If LHAupAlpgen needed, construct and pass to Pythia
856  string agFile = pythia.settings.word("Alpgen:file");
857  if (agFile != "void") {
858  LHAagPtr = new LHAupAlpgen(agFile.c_str(), &pythia.info);
859  pythia.settings.mode("Beams:frameType", 5);
860  pythia.setLHAupPtr(LHAagPtr);
861  }
862 }
LHAupAlpgen * LHAagPtr
#define NULL
Definition: scimark2.h:8
AlpgenHooks::~AlpgenHooks ( )
inline

Definition at line 140 of file GeneratorInput.h.

References LHAagPtr.

140 { if (LHAagPtr) delete LHAagPtr; }
LHAupAlpgen * LHAagPtr

Member Function Documentation

bool AlpgenHooks::initAfterBeams ( )

Definition at line 872 of file GeneratorInput.cc.

References AlpgenPar::getParam(), AlpgenPar::getParamAsInt(), AlpgenPar::haveParam(), max(), AlpgenPar::parse(), and AlpgenPar::printParams().

Referenced by JetMatchingAlpgenInputAlpgen::initAfterBeams(), and JetMatchingMadgraphInputAlpgen::initAfterBeams().

872  {
873 
874  // Read in ALPGEN specific configuration variables
875  bool setMasses = settingsPtr->flag("Alpgen:setMasses");
876  bool setNjet = settingsPtr->flag("Alpgen:setNjet");
877  bool setMLM = settingsPtr->flag("Alpgen:setMLM");
878 
879  // If ALPGEN parameters are present, then parse in AlpgenPar object
880  AlpgenPar par(infoPtr);
881  string parStr = infoPtr->header("AlpgenPar");
882  if (!parStr.empty()) {
883  par.parse(parStr);
884  par.printParams();
885  }
886 
887  // Set masses if requested
888  if (setMasses) {
889  if (par.haveParam("mc")) particleDataPtr->m0(4, par.getParam("mc"));
890  if (par.haveParam("mb")) particleDataPtr->m0(5, par.getParam("mb"));
891  if (par.haveParam("mt")) particleDataPtr->m0(6, par.getParam("mt"));
892  if (par.haveParam("mz")) particleDataPtr->m0(23, par.getParam("mz"));
893  if (par.haveParam("mw")) particleDataPtr->m0(24, par.getParam("mw"));
894  if (par.haveParam("mh")) particleDataPtr->m0(25, par.getParam("mh"));
895  }
896 
897  // Set MLM:nJets if requested
898  if (setNjet) {
899  if (par.haveParam("njets"))
900  settingsPtr->mode("JetMatching:nJet", par.getParamAsInt("njets"));
901  else
902  infoPtr->errorMsg("Warning in AlpgenHooks:init: "
903  "no ALPGEN nJet parameter found");
904  }
905 
906  // Set MLM merging parameters if requested
907  if (setMLM) {
908  if (par.haveParam("ptjmin") && par.haveParam("drjmin") &&
909  par.haveParam("etajmax")) {
910  double ptjmin = par.getParam("ptjmin");
911  ptjmin = max(ptjmin + 5., 1.2 * ptjmin);
912  settingsPtr->parm("JetMatching:eTjetMin", ptjmin);
913  settingsPtr->parm("JetMatching:coneRadius", par.getParam("drjmin"));
914  settingsPtr->parm("JetMatching:etaJetMax", par.getParam("etajmax"));
915 
916  // Warn if setMLM requested, but parameters not present
917  } else {
918  infoPtr->errorMsg("Warning in AlpgenHooks:init: "
919  "no ALPGEN merging parameters found");
920  }
921  }
922 
923  // Initialisation complete.
924  return true;
925 }
const T & max(const T &a, const T &b)

Member Data Documentation

LHAupAlpgen* AlpgenHooks::LHAagPtr
private

Definition at line 148 of file GeneratorInput.h.

Referenced by AlpgenHooks(), and ~AlpgenHooks().