Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:29

0001 // Class Based on EvtGenInterface(LHC).
0002 //
0003 // Created March 2014
0004 //
0005 // This class is a modification of the original EvtGenInterface which was developed for EvtGenLHC 9.1.
0006 // The modifications for EvtGen 1.3.0 are implemented by Ian M. Nugent
0007 // I would like to thank the EvtGen developers, in particular John Black, and Mikhail Kirsanov for their assistance.
0008 //
0009 
0010 #ifndef gen_EvtGenInterface_h
0011 #define gen_EvtGenInterface_h
0012 
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include <memory>
0015 #include <string>
0016 #include <vector>
0017 
0018 #include "EvtGenBase/EvtParticle.hh"
0019 // user include files
0020 #include "FWCore/Framework/interface/Frameworkfwd.h"
0021 
0022 #include "FWCore/Utilities/interface/RandomNumberGenerator.h"
0023 #include "GeneratorInterface/EvtGenInterface/interface/EvtGenInterfaceBase.h"
0024 
0025 class myEvtRandomEngine;
0026 
0027 namespace HepMC {
0028   class GenParticle;
0029   class GenEvent;
0030 }  // namespace HepMC
0031 
0032 class EvtId;
0033 class EvtGen;
0034 
0035 namespace gen {
0036   class EvtGenInterface : public EvtGenInterfaceBase {
0037   public:
0038     // ctor & dtor
0039     EvtGenInterface(const edm::ParameterSet&);
0040     ~EvtGenInterface() override;
0041 
0042     void init() override;
0043     const std::vector<int>& operatesOnParticles() override { return m_PDGs; }
0044     HepMC::GenEvent* decay(HepMC::GenEvent*) override;
0045     void setRandomEngine(CLHEP::HepRandomEngine* v) override;
0046     static double flat();
0047 
0048   private:
0049     bool addToHepMC(HepMC::GenParticle* partHep, const EvtId& idEvt, HepMC::GenEvent* theEvent, bool del_daug);
0050     void update_particles(HepMC::GenParticle* partHep, HepMC::GenEvent* theEvent, HepMC::GenParticle* p);
0051     void SetDefault_m_PDGs();
0052     bool findLastinChain(HepMC::GenParticle*& p);
0053     bool hasnoDaughter(HepMC::GenParticle* p);
0054     void go_through_daughters(EvtParticle* part);
0055 
0056     EvtGen* m_EvtGen;  // EvtGen main  object
0057 
0058     std::vector<EvtId> forced_id;    // EvtGen Id's of particles  which are to be forced by EvtGen
0059     std::vector<int> forced_pdgids;  // PDG Id's of particles which are to be forced by EvtGen
0060 
0061     std::vector<int> ignore_pdgids;  // HepId's of particles  which are to be ignroed by EvtGen
0062 
0063     // Adding parameters for polarization of spin-1/2 particles
0064     std::vector<int> polarize_ids;
0065     std::vector<double> polarize_pol;
0066     std::map<int, float> polarizations;
0067     int BmixingOption = 1;
0068     edm::ParameterSet* fPSet;
0069 
0070     static CLHEP::HepRandomEngine* fRandomEngine;
0071     myEvtRandomEngine* the_engine;
0072   };
0073 }  // namespace gen
0074 #endif