File indexing completed on 2025-04-19 09:10:13
0001 #ifndef SHERPA_Initialization_Initialization_Handler_H
0002 #define SHERPA_Initialization_Initialization_Handler_H
0003
0004 #include "ATOOLS/Org/CXXFLAGS.H"
0005 #include "ATOOLS/Org/Terminator_Objects.H"
0006 #include "ATOOLS/Org/Exception.H"
0007
0008 #include "MODEL/Main/Model_Base.H"
0009 #include "BEAM/Main/Beam_Spectra_Handler.H"
0010 #include "PDF/Main/ISR_Handler.H"
0011 #include "REMNANTS/Main/Remnant_Handler.H"
0012 #include "SHERPA/SoftPhysics/Soft_Collision_Handler.H"
0013 #include "SHERPA/PerturbativePhysics/MI_Handler.H"
0014 #include "SHERPA/PerturbativePhysics/Shower_Handler.H"
0015 #include "SHERPA/PerturbativePhysics/Matrix_Element_Handler.H"
0016 #include "SHERPA/Tools/Analysis_Interface.H"
0017 #include "SHERPA/Tools/Output_Base.H"
0018 #include "SHERPA/Tools/Definitions.H"
0019 #include "YFS/Main/YFS_Handler.H"
0020
0021 #include <map>
0022 #include <string>
0023 #include <iostream>
0024
0025 namespace ATOOLS {
0026 class Variations;
0027 class Fragmentation_Base;
0028 class Settings;
0029 }
0030
0031 namespace SHERPA {
0032
0033 class Matrix_Element_Handler;
0034 class Hard_Decay_Handler;
0035 class Beam_Remnant_Handler;
0036 class Colour_Reconnection_Handler;
0037 class Decay_Handler_Base;
0038 class Soft_Photon_Handler;
0039 class Event_Reader_Base;
0040 class Analysis_Interface;
0041 class Filter;
0042
0043 class Initialization_Handler: public ATOOLS::Terminator_Object {
0044 private :
0045 std::string m_evtform;
0046 std::set<std::string> m_pdflibs;
0047 std::map<PDF::isr::id, std::array<std::string, 2> > m_defsets;
0048 std::map<PDF::isr::id, std::vector<size_t> > m_bunchtags;
0049
0050 ATOOLS::Flavour m_bunch_particles[2];
0051
0052 eventtype::code m_mode;
0053 bool m_savestatus;
0054
0055 MODEL::Model_Base * p_model;
0056 BEAM::Beam_Spectra_Handler * p_beamspectra;
0057 PDF::ISR_Handler_Map m_isrhandlers;
0058 REMNANTS::Remnant_Handler_Map m_remnanthandlers;
0059 Matrix_Element_Handler * p_mehandler;
0060 Hard_Decay_Handler * p_harddecays;
0061 Shower_Handler_Map m_showerhandlers;
0062 Beam_Remnant_Handler * p_beamremnants;
0063 Colour_Reconnection_Handler * p_reconnections;
0064 ATOOLS::Fragmentation_Base * p_fragmentation;
0065 Soft_Collision_Handler_Map m_schandlers;
0066 Decay_Handler_Base * p_hdhandler;
0067 MI_Handler_Map m_mihandlers;
0068 Soft_Photon_Handler * p_softphotons;
0069 Event_Reader_Base * p_evtreader;
0070 Analysis_Vector m_analyses;
0071 Output_Vector m_outputs;
0072 ATOOLS::Variations * p_variations;
0073 Filter * p_filter;
0074 YFS::YFS_Handler * p_yfshandler;
0075
0076 void ShowParameterSyntax();
0077 void CheckVersion();
0078 bool CompareVersions(const size_t& a1,const size_t& b1,const size_t& c1,
0079 const size_t& a2,const size_t& b2,const size_t& c2);
0080 void LoadLibraries();
0081 private :
0082 bool InitializeTheIO();
0083 bool InitializeTheModel();
0084 bool InitializeTheBeams();
0085 bool InitializeThePDFs();
0086 bool InitializeTheRemnants();
0087 bool InitializeTheMatrixElements();
0088 bool InitializeTheUnderlyingEvents();
0089 bool InitializeTheHardDecays();
0090 bool InitializeTheShowers();
0091 bool InitializeTheBeamRemnants();
0092 bool InitializeTheColourReconnections();
0093 bool InitializeTheFragmentation();
0094 bool InitializeTheSoftCollisions();
0095 bool InitializeTheHadronDecays();
0096 bool InitializeTheSoftPhotons();
0097 bool InitializeTheFilter();
0098 bool InitializeTheAnalyses();
0099 bool InitializeTheReweighting(ATOOLS::Variations_Mode);
0100 bool InitializeTheYFS();
0101
0102 void RegisterDefaults();
0103 bool CheckBeamISRConsistency();
0104 void LoadPDFLibraries(ATOOLS::Settings& settings);
0105 void InitISRHandler(const PDF::isr::id & pid,ATOOLS::Settings& settings);
0106 void DefineBunchFlavours(ATOOLS::Settings& settings);
0107 void SetGlobalVariables();
0108 void PrepareTerminate();
0109
0110 public :
0111
0112 Initialization_Handler();
0113 ~Initialization_Handler();
0114
0115 bool InitializeTheFramework(int =-1);
0116 bool CalculateTheHardProcesses();
0117 inline const bool AddBeamRescatters() const {
0118 return m_isrhandlers.find(PDF::isr::bunch_rescatter)!=m_isrhandlers.end();
0119 }
0120 Matrix_Element_Handler * GetMatrixElementHandler() const { return p_mehandler; }
0121 Decay_Handler_Base * GetHDHandler() { return p_hdhandler; }
0122 Analysis_Vector * GetAnalyses() { return &m_analyses; }
0123 Output_Vector * GetOutputs() { return &m_outputs; }
0124 MODEL::Model_Base * GetModel() const { return p_model; }
0125 PDF::ISR_Handler_Map * GetISRHandlers() { return &m_isrhandlers; }
0126 YFS::YFS_Handler * GetYFSHandler() { return p_yfshandler; }
0127 BEAM::Beam_Spectra_Handler * GetBeamSpectraHandler() const { return p_beamspectra; }
0128 Hard_Decay_Handler * GetHardDecayHandler() const { return p_harddecays; }
0129 const Shower_Handler_Map & GetShowerHandlers() const { return m_showerhandlers; }
0130 Beam_Remnant_Handler * GetBeamRemnantHandler() const { return p_beamremnants; }
0131 Colour_Reconnection_Handler * GetColourReconnectionHandler() const { return p_reconnections; }
0132 ATOOLS::Fragmentation_Base * GetFragmentation() const { return p_fragmentation; }
0133 Soft_Collision_Handler_Map * GetSoftCollisionHandlers() { return &m_schandlers; }
0134 ATOOLS::Flavour * GetBunches() { return m_bunch_particles; }
0135 MI_Handler_Map * GetMIHandlers() { return &m_mihandlers; }
0136 REMNANTS::Remnant_Handler_Map & GetRemnantHandlers() { return m_remnanthandlers; }
0137 Soft_Photon_Handler * GetSoftPhotonHandler() const { return p_softphotons; }
0138 Event_Reader_Base * GetEventReader() const { return p_evtreader; }
0139 ATOOLS::Variations * GetVariations() const { return p_variations; }
0140 Filter * GetFilter() const { return p_filter; }
0141 inline PDF::ISR_Handler * GetISRHandler(const PDF::isr::id id) { return m_isrhandlers[id]; }
0142 inline Soft_Collision_Handler * GetSCHandler(const PDF::isr::id id) { return m_schandlers[id]; }
0143 inline MI_Handler * GetMIHandler(const PDF::isr::id id) { return m_mihandlers[id]; }
0144
0145 eventtype::code Mode() const { return m_mode; };
0146
0147 };
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238
0239
0240
0241 }
0242
0243
0244 #endif