Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:27

0001 //--------------------------------------------------------------------------
0002 #ifndef HEPMC_IO_EPOS_H
0003 #define HEPMC_IO_EPOS_H
0004 //THIS IS A BRUTAL COPY OF EPOS g_Wrapper from HEPMC
0005 //We need it because the EPOS generator needs a largeer version of EPOS g to store the event
0006 #include <map>
0007 #include <vector>
0008 #include "HepMC/IO_BaseClass.h"
0009 #include "GeneratorInterface/ReggeGribovPartonMCInterface/interface/EPOS_Wrapper.h"
0010 
0011 namespace EPOS {
0012   /*
0013     namespace HepMC{
0014       class GenEvent;
0015       class GenVertex;
0016       class GenParticle;
0017     }  
0018 */
0019 
0020   class IO_EPOS : public HepMC::IO_BaseClass {
0021   public:
0022     IO_EPOS();
0023     ~IO_EPOS() override;
0024     bool fill_next_event(HepMC::GenEvent*) override;
0025     void write_event(const HepMC::GenEvent*) override;
0026     void print(std::ostream& ostr = std::cout) const override;
0027 
0028     // see comments below for these switches.
0029     bool trust_both_mothers_and_daughters() const;
0030     bool trust_mothers_before_daughters() const;
0031     bool print_inconsistency_errors() const;
0032     bool trust_beam_particles() const;
0033     void set_trust_mothers_before_daughters(bool b = true);
0034     void set_trust_both_mothers_and_daughters(bool b = false);
0035     void set_print_inconsistency_errors(bool b = true);
0036     void set_trust_beam_particles(bool b = true);
0037     void set_skip_nuclear_fragments(bool b = true);
0038 
0039   protected:  // for internal use only
0040     HepMC::GenParticle* build_particle(int index);
0041     void build_production_vertex(int i, std::vector<HepMC::GenParticle*>& hepevt_particle, HepMC::GenEvent* evt);
0042     void build_end_vertex(int i, std::vector<HepMC::GenParticle*>& hepevt_particle, HepMC::GenEvent* evt);
0043     int find_in_map(const std::map<HepMC::GenParticle*, int>& m, HepMC::GenParticle* p) const;
0044 
0045   private:  // use of copy constructor is not allowed
0046     IO_EPOS(const IO_EPOS&) : HepMC::IO_BaseClass() {}
0047 
0048   private:  // data members
0049     bool m_trust_mothers_before_daughters;
0050     bool m_trust_both_mothers_and_daughters;
0051     bool m_print_inconsistency_errors;
0052     bool m_trust_beam_particles;
0053     bool m_skip_nucl_frag;
0054   };
0055 
0056   // INLINES access methods //
0057   inline bool IO_EPOS::trust_both_mothers_and_daughters() const { return m_trust_both_mothers_and_daughters; }
0058 
0059   inline bool IO_EPOS::trust_mothers_before_daughters() const { return m_trust_mothers_before_daughters; }
0060 
0061   inline bool IO_EPOS::print_inconsistency_errors() const { return m_print_inconsistency_errors; }
0062 
0063   inline void IO_EPOS::set_trust_both_mothers_and_daughters(bool b) { m_trust_both_mothers_and_daughters = b; }
0064 
0065   inline void IO_EPOS::set_trust_mothers_before_daughters(bool b) { m_trust_mothers_before_daughters = b; }
0066 
0067   inline void IO_EPOS::set_print_inconsistency_errors(bool b) { m_print_inconsistency_errors = b; }
0068 
0069   inline bool IO_EPOS::trust_beam_particles() const { return m_trust_beam_particles; }
0070 
0071   inline void IO_EPOS::set_trust_beam_particles(bool b) { m_trust_beam_particles = b; }
0072 
0073   //!!!MODIFICATION
0074   inline void IO_EPOS::set_skip_nuclear_fragments(bool b) { m_skip_nucl_frag = b; }
0075 
0076 }  // namespace EPOS
0077 
0078 #endif  // HEPMC_IO_EPOS_H
0079 //--------------------------------------------------------------------------