Finished DCS_Ionization Container.
Removed Energy Cut off for T2+ Ions. Tested Population loggers.
This commit is contained in:
@@ -15,10 +15,10 @@ using namespace std;
|
||||
Pop3_Container::Pop3_Container(int num_z_bins, int num_r_bins, int num_phi_bins) {
|
||||
z_scale = Lin_Scale(Katrin_Geo::get_z_RW_m(), Katrin_Geo::get_z_WGTSend_m(), num_z_bins);
|
||||
r_scale = Lin_Scale(0,Katrin_Geo::get_radius_m(), num_r_bins);
|
||||
phi_scale = Lin_Scale(0, 180, num_phi_bins);
|
||||
int z_dimension = z_scale.get_dimension();
|
||||
int r_dimension = r_scale.get_dimension();
|
||||
int phi_dimension = phi_scale.get_dimension();
|
||||
phi_scale = Lin_Scale(0, 2*pi, num_phi_bins);
|
||||
int z_dimension = z_scale.get_number_bins();
|
||||
int r_dimension = r_scale.get_number_bins();
|
||||
int phi_dimension = phi_scale.get_number_bins();
|
||||
|
||||
data = new double **[z_dimension];
|
||||
for (int i = 0; i < z_dimension; i++) {
|
||||
@@ -33,8 +33,8 @@ Pop3_Container::Pop3_Container(int num_z_bins, int num_r_bins, int num_phi_bins)
|
||||
}
|
||||
|
||||
Pop3_Container::~Pop3_Container() {
|
||||
int z_dimension = z_scale.get_dimension();
|
||||
int r_dimension = r_scale.get_dimension();
|
||||
int z_dimension = z_scale.get_number_bins();
|
||||
int r_dimension = r_scale.get_number_bins();
|
||||
for (int i = 0; i < z_dimension; i++) {
|
||||
for(int j = 0; j < r_dimension; j++) {
|
||||
delete[] data[i][j];
|
||||
@@ -49,9 +49,9 @@ Pop3_Container::Pop3_Container(const Pop3_Container& other) {
|
||||
z_scale = other.z_scale;
|
||||
r_scale = other.r_scale;
|
||||
phi_scale = other.phi_scale;
|
||||
int z_dimension = z_scale.get_dimension();
|
||||
int r_dimension = r_scale.get_dimension();
|
||||
int phi_dimension = phi_scale.get_dimension();
|
||||
int z_dimension = z_scale.get_number_bins();
|
||||
int r_dimension = r_scale.get_number_bins();
|
||||
int phi_dimension = phi_scale.get_number_bins();
|
||||
|
||||
data = new double **[z_dimension];
|
||||
for (int i = 0; i < z_dimension; i++) {
|
||||
@@ -65,7 +65,6 @@ Pop3_Container::Pop3_Container(const Pop3_Container& other) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Pop3_Container& Pop3_Container::operator=(const Pop3_Container& other) {
|
||||
Pop3_Container tmp(other);
|
||||
swap(z_scale, tmp.z_scale);
|
||||
@@ -80,6 +79,7 @@ void Pop3_Container::increase_value(const double &value, const vec3 &loc_m) {
|
||||
int zbin = z_scale.calc_index(get_z_m(loc_m));
|
||||
int rbin = r_scale.calc_index(get_r_m(loc_m));
|
||||
int phibin = phi_scale.calc_index(get_phi(loc_m));
|
||||
|
||||
data[zbin][rbin][phibin] += value;
|
||||
}
|
||||
|
||||
@@ -92,10 +92,12 @@ void Pop3_Container::increase_value(const double &value, const vec3 &loc1_m, con
|
||||
int min_z_index = z_scale.calc_index(z_min_m);
|
||||
int max_z_index = z_scale.calc_index(z_max_m);
|
||||
// No r/phi movement, else need to calculate more exactly
|
||||
int rbin = r_scale.calc_index(get_r_m(loc1_m));
|
||||
int phibin = phi_scale.calc_index(get_phi(loc1_m));
|
||||
double r = get_r_m(loc1_m);
|
||||
int rbin = r_scale.calc_index(get_r_m(r));
|
||||
double phi = get_phi(loc1_m);
|
||||
int phibin = phi_scale.calc_index(phi);
|
||||
|
||||
for (int i = min_z_index; i<max_z_index; i++) {
|
||||
for (int i = min_z_index; i<=max_z_index; i++) {
|
||||
data[i][rbin][phibin] += value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user