Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ AUXFILES = VERSION

LIBS = $(shell gsl-config --libs)
LIBS += -lpthread
INC = $(shell gsl-config --cflags)
INC += -I./include
INC = -I./include
INC += $(shell gsl-config --cflags)

ifeq ($(CONDA_PREFIX),)
PREFIX = /usr/local
Expand Down
2 changes: 2 additions & 0 deletions include/trackcpp/accelerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "kicktable.h"
#include "elements.h"
#include <vector>
#include <string>

//struct Accelerator {
class Accelerator {
Expand All @@ -32,6 +33,7 @@ class Accelerator {
bool vchamber_on = false;
int harmonic_number = 0;
std::vector<Element> lattice;
std::string lattice_version = "";

bool operator==(const Accelerator& o) const;
bool operator!=(const Accelerator& o) const { return !(*this == o); };
Expand Down
2 changes: 1 addition & 1 deletion python_package/trackcpp/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.8.0
4.9.0
2 changes: 2 additions & 0 deletions src/accelerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ bool Accelerator::operator==(const Accelerator& o) const {
if (this->vchamber_on != o.vchamber_on) return false;
if (this->harmonic_number != o.harmonic_number) return false;
if (this->lattice != o.lattice) return false;
if (this->lattice_version != o.lattice_version) return false;

return true;

Expand All @@ -48,5 +49,6 @@ std::ostream& operator<< (std::ostream &out, const Accelerator& a) {
out << std::endl << "vchamber_on : " << a.vchamber_on;
out << std::endl << "harmonic_number: " << a.harmonic_number;
out << std::endl << "lattice : " << a.lattice.size() << " elements";
out << std::endl << "lattice_version: " << a.lattice_version;
return out;
}
2 changes: 2 additions & 0 deletions src/flat_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ void write_flat_file_trackcpp(std::ostream& fp, const Accelerator& accelerator)
fp << std::setw(hw) << "% cavity_on" << get_boolean_string(accelerator.cavity_on) << "\n";
fp << std::setw(hw) << "% radiation_on" << accelerator.radiation_on << "\n";
fp << std::setw(hw) << "% vchamber_on" << get_boolean_string(accelerator.vchamber_on) << "\n";
fp << std::setw(hw) << "% lattice_version" << accelerator.lattice_version << "\n";
fp << '\n';

fp.setf(std::ios_base::showpos);
Expand Down Expand Up @@ -187,6 +188,7 @@ Status::type read_flat_file_trackcpp(std::istream& fp, Accelerator& accelerator)
// radiation_on needs its own processing function due backward compatibility
if (cmd.compare("radiation_on") == 0){ accelerator.radiation_on = process_rad_property(ss); continue; }
if (cmd.compare("vchamber_on") == 0) { accelerator.vchamber_on = read_boolean_string(ss); continue; }
if (cmd.compare("lattice_version") == 0) { ss >> accelerator.lattice_version; continue; }
continue;
}
if (cmd.compare("fam_name") == 0) {
Expand Down