File indexing completed on 2025-04-19 09:10:13
0001 #ifndef REMNANTS_Main_Remnant_Base_H
0002 #define REMNANTS_Main_Remnant_Base_H
0003
0004 #include "REMNANTS/Tools/Form_Factor.H"
0005 #include "BEAM/Main/Beam_Base.H"
0006 #include "ATOOLS/Phys/Particle_List.H"
0007 #include "ATOOLS/Phys/Blob.H"
0008 #include <vector>
0009
0010 namespace BEAM { class Beam_Base; }
0011
0012 namespace REMNANTS {
0013 struct rtp {
0014 enum code {
0015 none = 0,
0016 intact = 1,
0017 lepton = 2,
0018 hadron = 3,
0019 photon = 4
0020 };
0021 };
0022
0023 inline bool operator&(const rtp::code code1,const rtp::code code2) {
0024 return (rtp::code)((int)code1&(int)code2);
0025 }
0026 std::ostream &operator<<(std::ostream &ostr,rtp::code code);
0027 }
0028
0029 namespace REMNANTS {
0030 typedef std::list<ATOOLS::Flavour> FlavourList;
0031
0032 class Colour_Generator;
0033
0034 class Remnant_Base {
0035 protected:
0036 ATOOLS::Flavour m_beamflav;
0037 rtp::code m_type;
0038 size_t m_beam, m_tag;
0039 BEAM::Beam_Base * p_beam;
0040 Form_Factor * p_ff;
0041 ATOOLS::Blob * p_beamblob;
0042 ATOOLS::Vec4D m_position;
0043 ATOOLS::Part_List m_extracted, m_spectators;
0044 Colour_Generator * p_colours;
0045
0046 double m_residualE, m_scale2;
0047
0048 long int m_extractionErrors, m_resenergyWarnings;
0049 rtp::code FixType(ATOOLS::Flavour & flav);
0050 public:
0051 Remnant_Base(const ATOOLS::Flavour & flav,const size_t & beam,
0052 const size_t & tag=0);
0053 virtual ~Remnant_Base();
0054
0055 virtual bool Extract(ATOOLS::Particle *parton);
0056 virtual bool TestExtract(ATOOLS::Particle *parton);
0057 virtual bool TestExtract(const ATOOLS::Flavour &flav,
0058 const ATOOLS::Vec4D &mom)=0;
0059 virtual ATOOLS::Blob * MakeBlob();
0060 virtual bool FillBlob(ATOOLS::ParticleMomMap *ktmap=nullptr,
0061 const bool & copy=true)=0;
0062 virtual void MakeSpectator(ATOOLS::Particle * parton) {}
0063 virtual ATOOLS::Vec4D IncomingMomentum();
0064
0065 virtual void Reset(const bool & resc=false,const bool & DIS=false);
0066 virtual void SetResidualEnergy(const double & E=-1.) {
0067 m_residualE = (E>=0.) ? E : p_beam->OutMomentum(m_tag)[0];
0068 }
0069 virtual inline double MinRequiredEnergy(const double energy, const ATOOLS::Flavour &flav) { return 0.; }
0070
0071 inline rtp::code Type() const { return m_type; }
0072 inline size_t Beam() const { return m_beam; }
0073 inline const ATOOLS::Flavour & Flav() const { return m_beamflav; }
0074 inline const ATOOLS::Vec4D & Position() const { return m_position; }
0075 inline BEAM::Beam_Base * GetBeam() const { return p_beam; }
0076 inline Form_Factor * GetFF() const { return p_ff; }
0077 inline ATOOLS::Blob * GetBlob() { return p_beamblob; }
0078 inline const ATOOLS::Vec4D & InMomentum() const { return p_beam->OutMomentum(m_tag); }
0079 inline ATOOLS::Part_List * GetExtracted() { return &m_extracted; }
0080 inline ATOOLS::Part_List * GetSpectators() { return &m_spectators; }
0081 inline virtual ATOOLS::Particle * GetRecoiler() { return nullptr; }
0082 inline virtual ATOOLS::Particle * GetSpectator() { return nullptr; }
0083 inline void SetBeam(BEAM::Beam_Base * beam) { p_beam = beam; }
0084 inline void SetScale2(const double & scale2) { m_scale2 = scale2; }
0085 inline void SetColours(Colour_Generator * cgen) { p_colours = cgen; }
0086 inline void SetPosition(const ATOOLS::Vec4D & pos) { m_position = pos; }
0087 };
0088 }
0089
0090 #endif