File indexing completed on 2025-08-05 08:19:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef SMASHWRAPPER_H
0020 #define SMASHWRAPPER_H
0021
0022 #include "smash/configuration.h"
0023 #include "smash/experiment.h"
0024 #include "smash/listmodus.h"
0025
0026 #include "Afterburner.h"
0027 #include "JetScapeWriter.h"
0028
0029 using namespace Jetscape;
0030
0031
0032
0033
0034
0035
0036 class AfterburnerModus : public smash::ListModus {
0037 public:
0038
0039 AfterburnerModus(smash::Configuration config, const smash::ExperimentParameters &) {
0040 JSINFO << "Constructing AfterburnerModus";
0041 config.clear();
0042 }
0043 void reset_event_numbering() { event_number_ = 0; }
0044
0045
0046
0047
0048 void JS_hadrons_to_smash_particles(
0049 const std::vector<shared_ptr<Hadron>> &JS_hadrons,
0050 smash::Particles &smash_particles);
0051
0052
0053 double initial_conditions(smash::Particles *particles,
0054 const smash::ExperimentParameters &) {
0055 JS_hadrons_to_smash_particles(jetscape_hadrons_[event_number_], *particles);
0056 backpropagate_to_same_time(*particles);
0057 event_number_++;
0058 return start_time_;
0059 }
0060 std::vector<std::vector<shared_ptr<Hadron>>> jetscape_hadrons_;
0061
0062 private:
0063 int event_number_ = 0;
0064 };
0065
0066 class SmashWrapper : public Afterburner {
0067 private:
0068 bool only_final_decays_ = false;
0069 double end_time_ = -1.0;
0070 shared_ptr<smash::Experiment<AfterburnerModus>> smash_experiment_;
0071
0072
0073 static RegisterJetScapeModule<SmashWrapper> reg;
0074
0075 public:
0076 void
0077 smash_particles_to_JS_hadrons(const smash::Particles &smash_particles,
0078 std::vector<shared_ptr<Hadron>> &JS_hadrons);
0079 SmashWrapper();
0080 void InitTask();
0081 void ExecuteTask();
0082 void WriteTask(weak_ptr<JetScapeWriter> w);
0083 };
0084
0085 #endif