EmissionVetoHook1

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
#include "GeneratorInterface/Pythia8Interface/plugins/PowhegHooksBB4L.h"

class EmissionVetoHook1 : public Pythia8::UserHooks {
public:
  // Constructor and destructor.
  EmissionVetoHook1(int nFinalIn,
                    bool vetoOnIn,
                    int vetoCountIn,
                    int pThardModeIn,
                    int pTemtModeIn,
                    int emittedModeIn,
                    int pTdefModeIn,
                    bool MPIvetoOnIn,
                    int QEDvetoModeIn,
                    int nFinalModeIn,
                    int VerbosityIn)
      : nFinalExt(nFinalIn),
        vetoOn(vetoOnIn),
        vetoCount(vetoCountIn),
        pThardMode(pThardModeIn),
        pTemtMode(pTemtModeIn),
        emittedMode(emittedModeIn),
        pTdefMode(pTdefModeIn),
        MPIvetoOn(MPIvetoOnIn),
        QEDvetoMode(QEDvetoModeIn),
        nFinalMode(nFinalModeIn),
        nISRveto(0),
        nFSRveto(0),
        Verbosity(VerbosityIn) {}
  ~EmissionVetoHook1() override {
    std::cout << "Number of ISR vetoed = " << nISRveto << std::endl;
    std::cout << "Number of FSR vetoed = " << nFSRveto << std::endl;
  }

  //--------------------------------------------------------------------------

  bool canVetoMPIStep() override { return true; }
  int numberVetoMPIStep() override { return 1; }
  bool doVetoMPIStep(int nMPI, const Pythia8::Event &e) override;

  bool canVetoISREmission() override { return vetoOn; }
  bool doVetoISREmission(int, const Pythia8::Event &e, int iSys) override;

  bool canVetoFSREmission() override { return vetoOn; }
  bool doVetoFSREmission(int, const Pythia8::Event &e, int iSys, bool) override;

  bool canVetoMPIEmission() override { return MPIvetoOn; }
  bool doVetoMPIEmission(int, const Pythia8::Event &e) override;

  void fatalEmissionVeto(std::string message);

  double pTpythia(const Pythia8::Event &e, int RadAfterBranch, int EmtAfterBranch, int RecAfterBranch, bool FSR);

  double pTpowheg(const Pythia8::Event &e, int i, int j, bool FSR);

  double pTcalc(const Pythia8::Event &e, int i, int j, int k, int r, int xSRin);

  //--------------------------------------------------------------------------

private:
  int nFinalExt, vetoOn, vetoCount, pThardMode, pTemtMode, emittedMode, pTdefMode, MPIvetoOn, QEDvetoMode, nFinalMode;
  int nFinal;
  double pThard, pTMPI;
  bool accepted, isEmt;
  // The number of accepted emissions (in a row)
  int nAcceptSeq;
  // Statistics on vetos
  unsigned long int nISRveto, nFSRveto;
  int Verbosity;
};