Version: SMASH-1.6
customnucleus.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2019
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 #ifndef SRC_INCLUDE_CUSTOMNUCLEUS_H_
8 #define SRC_INCLUDE_CUSTOMNUCLEUS_H_
9 
10 #include <fstream>
11 #include <map>
12 #include <vector>
13 
14 #include "collidermodus.h"
15 #include "nucleus.h"
16 #include "pdgcode.h"
17 #include "threevector.h"
18 namespace smash {
19 
23 struct Nucleoncustom {
25  double x;
27  double y;
29  double z;
33  bool isospin;
34 };
35 
40 class CustomNucleus : public Nucleus {
41  public:
51  CustomNucleus(Configuration& config, int testparticles);
58  void fill_from_list(const std::vector<Nucleoncustom>& vec);
60  ThreeVector distribute_nucleon() override;
69  std::vector<Nucleoncustom> readfile(std::ifstream& infile,
70  int particle_number) const;
87  int number_of_nucleons_ = 0;
89  std::vector<Nucleoncustom> custom_nucleon_;
91  size_t index = 0;
92 
93  private:
99  static std::string streamfile(const std::string& file_directory,
100  const std::string& file_name);
102  /*
103  * The unique_ptr is only required to work around a bug in GCC 4.8, because it
104  * seems to be trying to use the non-existing copy-constructor of
105  * `std::ifstream`. Newer compilers don't require this unneccessary
106  * indirection.
107  */
108  static std::unique_ptr<std::ifstream> filestream_;
114  static bool checkfileopen_;
115 };
116 
117 } // namespace smash
118 
119 #endif // SRC_INCLUDE_CUSTOMNUCLEUS_H_
double x
x-coordinate
Definition: customnucleus.h:25
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:30
double y
y-coordinate
Definition: customnucleus.h:27
std::vector< Nucleoncustom > custom_nucleon_
Vector contianing Data for one nucleus given in the particlelist.
Definition: customnucleus.h:89
bool isospin
to differentiate between protons isospin=1 and neutrons isospin=0
Definition: customnucleus.h:33
static bool checkfileopen_
Bool variable to check if the file was already opened.
A nucleus is a collection of particles that are initialized, before the beginning of the simulation a...
Definition: nucleus.h:27
Interface to the SMASH configuration files.
Inheriting from Nucleus-Class using modified Nucleon configurations.
Definition: customnucleus.h:40
Contains data for one nucleon that is read in from the list.
Definition: customnucleus.h:23
static std::unique_ptr< std::ifstream > filestream_
Variable carrying the output of the streamfile function.
bool spinprojection
spinprojection of the nucleon
Definition: customnucleus.h:31
std::string particle_list_file_directory_
Directory where the nucleon configurations are located.
Definition: customnucleus.h:75
std::string particle_list_file_name_
File name of the nucleon configurations.
Definition: customnucleus.h:80
Definition: action.h:24
double z
z-coordinate
Definition: customnucleus.h:29