EvtGenInterface

Macros

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 71 72 73 74
// Class Based on EvtGenInterface(LHC).
//
// Created March 2014
//
// This class is a modification of the original EvtGenInterface which was developed for EvtGenLHC 9.1.
// The modifications for EvtGen 1.3.0 are implemented by Ian M. Nugent
// I would like to thank the EvtGen developers, in particular John Black, and Mikhail Kirsanov for their assistance.
//

#ifndef gen_EvtGenInterface_h
#define gen_EvtGenInterface_h

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include <memory>
#include <string>
#include <vector>

#include "EvtGenBase/EvtParticle.hh"
// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"

#include "FWCore/AbstractServices/interface/RandomNumberGenerator.h"
#include "GeneratorInterface/EvtGenInterface/interface/EvtGenInterfaceBase.h"

class myEvtRandomEngine;

namespace HepMC {
  class GenParticle;
  class GenEvent;
}  // namespace HepMC

class EvtId;
class EvtGen;

namespace gen {
  class EvtGenInterface : public EvtGenInterfaceBase {
  public:
    // ctor & dtor
    EvtGenInterface(const edm::ParameterSet&);
    ~EvtGenInterface() override;

    void init() override;
    const std::vector<int>& operatesOnParticles() override { return m_PDGs; }
    HepMC::GenEvent* decay(HepMC::GenEvent*) override;
    void setRandomEngine(CLHEP::HepRandomEngine* v) override;
    static double flat();

  private:
    bool addToHepMC(HepMC::GenParticle* partHep, const EvtId& idEvt, HepMC::GenEvent* theEvent, bool del_daug);
    void update_particles(HepMC::GenParticle* partHep, HepMC::GenEvent* theEvent, HepMC::GenParticle* p);
    void SetDefault_m_PDGs();
    bool findLastinChain(HepMC::GenParticle*& p);
    bool hasnoDaughter(HepMC::GenParticle* p);
    void go_through_daughters(EvtParticle* part);

    EvtGen* m_EvtGen;  // EvtGen main  object

    std::vector<EvtId> forced_id;    // EvtGen Id's of particles  which are to be forced by EvtGen
    std::vector<int> forced_pdgids;  // PDG Id's of particles which are to be forced by EvtGen

    std::vector<int> ignore_pdgids;  // HepId's of particles  which are to be ignroed by EvtGen

    // Adding parameters for polarization of spin-1/2 particles
    std::vector<int> polarize_ids;
    std::vector<double> polarize_pol;
    std::map<int, float> polarizations;
    int BmixingOption = 1;
    edm::ParameterSet* fPSet;

    static CLHEP::HepRandomEngine* fRandomEngine;
    myEvtRandomEngine* the_engine;
  };
}  // namespace gen
#endif