File indexing completed on 2025-04-19 09:10:13
0001 #ifndef REMNANTS_Main_Remnant_Handler_H
0002 #define REMNANTS_Main_Remnant_Handler_H
0003
0004 #include "REMNANTS/Main/Remnant_Base.H"
0005 #include "REMNANTS/Tools/Kinematics_Generator.H"
0006 #include "REMNANTS/Tools/Colour_Generator.H"
0007 #include "REMNANTS/Tools/Beam_Decorrelator.H"
0008 #include "PDF/Main/ISR_Handler.H"
0009 #include "YFS/Main/YFS_Handler.H"
0010 #include "ATOOLS/Phys/Blob_List.H"
0011 #include "ATOOLS/Math/Poincare.H"
0012 #include "ATOOLS/Org/Return_Value.H"
0013
0014 namespace BEAM {
0015 class Beam_Spectra_Handler;
0016 }
0017
0018 namespace REMNANTS {
0019 struct strat {
0020 enum code {
0021 none = 0,
0022 simple = 1,
0023 ll = 2,
0024 DIS1 = 4,
0025 DIS2 = 5,
0026 hh = 8
0027 };
0028 };
0029 class Primordial_KPerp;
0030
0031 class Remnant_Handler {
0032 private:
0033 PDF::isr::id m_id;
0034 Remnant_Base * p_remnants[2];
0035 size_t m_tags[2];
0036 strat::code m_type;
0037 Kinematics_Generator m_kinematics;
0038 Colour_Generator m_colours;
0039 Beam_Decorrelator m_decorrelator;
0040 ATOOLS::Blob * p_softblob;
0041
0042 std::set<ATOOLS::Blob *> m_treatedshowerblobs;
0043
0044 bool m_check, m_output;
0045 long int m_fails;
0046
0047 void InitializeRemnants(PDF::ISR_Handler * isr,
0048 YFS::YFS_Handler *yfs,
0049 BEAM::Beam_Spectra_Handler * beam,
0050 const std::vector<size_t> & tags);
0051 void DefineRemnantStrategy();
0052 void InitializeKinematicsAndColours();
0053 bool CheckBeamBreakup(ATOOLS::Blob_List * bloblist);
0054 void InitBeamAndSoftBlobs(ATOOLS::Blob_List *const blobs,
0055 const bool & isrescatter);
0056 ATOOLS::Blob_List::iterator FindInsertPositionForRescatter(ATOOLS::Blob_List *const bloblist,
0057 const bool & isrescatter);
0058 public:
0059 Remnant_Handler(PDF::ISR_Handler * isr, YFS::YFS_Handler *yfs, BEAM::Beam_Spectra_Handler * beam,
0060 const std::vector<size_t> & tags);
0061 ~Remnant_Handler();
0062
0063 bool ExtractShowerInitiators(ATOOLS::Blob *const showerblob);
0064 bool Extract(ATOOLS::Particle * part,const unsigned int beam);
0065 void ConnectColours(ATOOLS::Blob *const showerblob);
0066 void Reset();
0067
0068 ATOOLS::Return_Value::code MakeBeamBlobs(ATOOLS::Blob_List *const blobs,
0069 ATOOLS::Particle_List *const=nullptr,
0070 const bool & isrescatter=false);
0071
0072 void SetImpactParameter(const double & b);
0073
0074 inline bool NeedsToMakeBeamBlobs() {
0075 return (m_colours.HasColours(0) || m_colours.HasColours(0));
0076 }
0077 inline void SetScale2(const double & scale2) {
0078 for (size_t i=0;i<2;i++) p_remnants[i]->SetScale2(scale2);
0079 }
0080 inline const PDF::isr::id Id() const { return m_id; }
0081 inline const strat::code Type() const { return m_type; }
0082
0083 inline Remnant_Base * GetRemnant(const unsigned short int & beam) const {
0084 return (beam<2)?p_remnants[beam]:nullptr;
0085 }
0086 inline Primordial_KPerp * GetKPerp() { return m_kinematics.GetKPerp(); }
0087 };
0088
0089 typedef std::map<PDF::isr::id, Remnant_Handler*> Remnant_Handler_Map;
0090 }
0091
0092 #endif