 |
Version: SMASH-2.0
|
|
Go to the documentation of this file.
14 #include <boost/filesystem.hpp>
102 file_{path /
"SMASH_IC.dat",
"w"},
106 "# %s initial conditions: hypersurface of constant proper time\n",
108 std::fprintf(file_.get(),
"# tau x y eta mt px py Rap pdg charge\n");
109 std::fprintf(file_.get(),
"# fm fm fm none GeV GeV GeV none none e\n");
116 std::fprintf(
file_.
get(),
"# event %i start\n", event_number);
121 std::fprintf(
file_.
get(),
"# event %i end\n", event_number);
125 if (particles.
size() != 0) {
127 "End time might be too small for initial conditions output. "
128 "Hypersurface has not yet been crossed by ",
129 particles.
size(),
" particle(s).");
134 const std::unique_ptr<Clock> &,
147 const double m_trans =
148 std::sqrt(particle.type().mass() * particle.type().mass() +
149 particle.momentum()[1] * particle.momentum()[1] +
150 particle.momentum()[2] * particle.momentum()[2]);
152 const double rapidity =
153 0.5 * std::log((particle.momentum()[0] + particle.momentum()[3]) /
154 (particle.momentum()[0] - particle.momentum()[3]));
158 bool is_spectator = particle.get_history().collisions_per_particle == 0;
162 std::fprintf(
file_.
get(),
"%g %g %g %g %g %g %g %g %s %i \n",
163 particle.position().tau(), particle.position()[1],
164 particle.position()[2], particle.position().eta(), m_trans,
165 particle.momentum()[1], particle.momentum()[2], rapidity,
166 particle.pdgcode().string().c_str(), particle.type().charge());
174 const double next_proper_time = particle.position().tau();
176 throw std::runtime_error(
177 "Hypersurface proper time changed during evolution.");
virtual ProcessType get_type() const
Get the process type.
void at_interaction(const Action &action, const double) override
Write particle data at the hypersurface crossing point to the IC output.
A class to pre-calculate and store parameters relevant for density calculation.
ICOutput(const bf::path &path, const std::string &name, const OutputParameters &out_par)
Create a new IC output.
void at_intermediate_time(const Particles &, const std::unique_ptr< Clock > &, const DensityParameters &, const EventInfo &) override
Unused, but needed since virtually declared in mother class.
Structure to contain custom data for output.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
constexpr double really_small
Numerical error tolerance.
FILE * get()
Get the underlying FILE* pointer.
void at_eventstart(const Particles &, const int event_number, const EventInfo &) override
Write event start line.
Helper structure for Experiment to hold output options and parameters.
Abstraction of generic output.
static constexpr int LHyperSurfaceCrossing
double IC_proper_time_
Proper time of the particles removed when extracting initial conditions.
void at_eventend(const Particles &particles, const int event_number, const EventInfo &) override
Write event end line.
RenamingFilePtr file_
Pointer to output file.
Hypersurface crossing Particles are removed from the evolution and printed to a separate output to se...
const ParticleList & incoming_particles() const
Get the list of particles that go into the action.