Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit ce08bbfc authored by kraus's avatar kraus
Browse files

remove StatisticalError tracker

parent 53a4670d
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,6 @@ set (_SRCS
ParallelTTracker.cpp
ParallelCyclotronTracker.cpp
ParallelSliceTracker.cpp
StatisticalErrors.cpp
StatisticalErrorsUtilities.cpp
ThickMapper.cpp
ThickTracker.cpp
TransportMapper.cpp
......@@ -52,8 +50,6 @@ set (HDRS
ParallelCyclotronTracker.h
ParallelSliceTracker.h
ParallelTTracker.h
StatisticalErrors.h
StatisticalErrorsUtilities.h
ThickMapper.h
ThickTracker.h
TransportMapper.h
......
This diff is collapsed.
#ifndef OPAL_STATISTICALERRORS_H
#define OPAL_STATISTICALERRORS_H
//
// Copyright & License: See Copyright.readme in src directory
//
/*!
Class documentation
*/
#define SE_VISITELEMENT(elem) virtual void visit##elem(const elem &) { }
#include "Algorithms/Tracker.h"
#ifdef WITH_UNIT_TESTS
#include <gtest/gtest_prod.h>
#endif
#include <iostream>
#include <list>
class BMultipoleField;
class PartBunch;
class AlignWrapper;
class BeamBeam;
class CCollimator;
class Corrector;
class CyclotronValley;
class Degrader;
class Diagnostic;
class Drift;
class ElementBase;
class FlexibleCollimator;
class Lambertson;
class Marker;
class Monitor;
class Multipole;
class ParallelPlate;
class Probe;
class RBend;
class RFCavity;
class RFQuadrupole;
class SBend;
class Separator;
class Septum;
class Solenoid;
class TravelingWave;
struct OpalInputInterpreter;
class StatisticalErrors: public Tracker {
public:
/// Constructor.
explicit StatisticalErrors(const Beamline &beamline,
const PartData &reference,
bool revBeam,
bool revTrack,
const std::string &method,
unsigned int nodesPerInstance,
unsigned int numInstances,
const std::vector<std::string> &objectives);
virtual ~StatisticalErrors();
SE_VISITELEMENT(AlignWrapper)
SE_VISITELEMENT(Beamline)
SE_VISITELEMENT(BeamBeam)
SE_VISITELEMENT(CCollimator)
SE_VISITELEMENT(Corrector)
SE_VISITELEMENT(CyclotronValley)
SE_VISITELEMENT(Degrader)
SE_VISITELEMENT(Diagnostic)
SE_VISITELEMENT(Drift)
SE_VISITELEMENT(FlexibleCollimator)
SE_VISITELEMENT(Lambertson)
SE_VISITELEMENT(Marker)
SE_VISITELEMENT(Monitor)
SE_VISITELEMENT(Multipole)
SE_VISITELEMENT(ParallelPlate)
SE_VISITELEMENT(Probe)
SE_VISITELEMENT(RBend)
SE_VISITELEMENT(RFCavity)
SE_VISITELEMENT(RFQuadrupole)
SE_VISITELEMENT(SBend)
SE_VISITELEMENT(Separator)
SE_VISITELEMENT(Septum)
SE_VISITELEMENT(Solenoid)
SE_VISITELEMENT(TravelingWave)
virtual void execute();
private:
StatisticalErrors();
StatisticalErrors(const StatisticalErrors &);
void operator=(const StatisticalErrors &);
void runSimulation(const std::string &inputFileName, MPI_Comm comm);
void stashEnvironment();
void popEnvironment();
static std::string getNextDirectoryName(bool reference);
void createDirectory(const std::string &name);
void linkFiles(const std::string &path);
void removeLinks(const std::string &path);
void calcIdealDivision(unsigned int numNodes);
void formGroups();
void shutReplicasDown(int tag,
const std::vector<std::string> &currentJobs);
std::pair<int, int> identifyFreeReplica(int tag);
std::string assignReplicaNewJob(const OpalInputInterpreter &interpreter,
const std::pair<int, int> &source,
bool referenceRun,
std::string nextDir,
int tag);
struct PRMessage {
int status;
std::string nextDirectory;
};
PRMessage getCrunchJobFromPrimary(int tag);
void collectOutputData(const std::string &directory);
void processOutputData(const std::string &directory);
// std::string readSDDSFile(const std::string &directory);
void writeSDDSFile();
void writeSDDSHeader(std::ofstream &out,
std::vector<std::string> &order);
void writeSDDSData(std::ofstream &out,
const std::map<std::string, std::vector<double> > &data,
const std::vector<std::string> &order);
std::vector<std::pair<double, double> > computeStatistics(const std::string &objective,
const std::vector<double> &referencePositions);
std::vector<double> getNextDataset(std::ifstream &dataStream,
std::ifstream &positionStream,
int dataType,
const std::vector<double> &referencePositions);
std::vector<double > interpolateSDDSData(const std::vector<double> &data,
const std::vector<double> &oldpositions,
const std::vector<double> &newpositions);
std::vector<double> readFloatData(std::ifstream &in);
std::vector<double> readDoubleData(std::ifstream &in);
std::vector<double> readShortData(std::ifstream &in);
std::vector<double> readLongData(std::ifstream &in);
// SDDS::file parseSDDSFile(std::string & contents);
void removeOldDataFiles();
void removeBinaryDataFiles();
std::map<std::string, std::vector<double> > distributeProcessingJobs();
void getProcessingJobFromPrimary();
std::vector<double> getReferenceSamplingPositions();
void sendReferenceSamplingPositions(std::vector<double> positionSampling);
void sendObjectiveForProcessing(int tag,
int source,
unsigned int i,
char* messageBuffer);
std::pair<int, int> getNextObjectiveToProcess(int tag, char *messageBuffer);
void sendProcessedDataToPrimary(int tag,
int objectiveID,
unsigned int length,
char *messageBuffer);
void copyDataToBuffer(char *messageBuffer,
const std::vector<std::pair<double, double> > &statistics);
struct DataSource {
int source;
int ID;
std::vector<double> data;
};
DataSource getProcessedDataFromReplica(int tag,
unsigned int i,
unsigned int length,
char* messageBuffer);
std::string method_m;
unsigned int nodesPerInstance_m;
unsigned int numInstances_m;
MPI_Comm subComm_m;
MPI_Group subGroup_m;
std::vector<int> groupIDs_m;
std::vector<int> groupRanks_m;
std::vector<int> localMasters_m;
std::vector<std::string> objectives_m;
std::string directoryBaseName_m;
};
#endif // OPAL_STATISTICALERRORS_H
\ No newline at end of file
......@@ -10,9 +10,7 @@ set (_SRCS
H5PartWrapperForPC.cpp
H5PartWrapperForPS.cpp
H5PartWrapperForPT.cpp
# SDDSParser.cpp
MultiBunchDump.cpp
OpalInputInterpreter.cpp
IpplInfoWrapper.cpp
)
......@@ -31,7 +29,6 @@ set (HDRS
H5PartWrapper.h
IpplInfoWrapper.h
MultiBunchDump.h
OpalInputInterpreter.h
OpalWake.h
SecondaryEmissionPhysics.h
ParticleMatterInteraction.h
......@@ -45,4 +42,4 @@ endif()
add_opal_sources(${_SRCS})
install (FILES ${HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/Structure")
install (FILES ${HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/Structure")
\ No newline at end of file
//
// Copyright & License: See Copyright.readme in src directory
//
#include "Structure/OpalInputInterpreter.h"
// #include "AbstractObjects/OpalData.h"
// #include "OpalConfigure/Configure.h"
// #include "OpalParser/OpalParser.h"
// #include "Parser/FileStream.h"
#include "Utilities/OpalException.h"
#include "Expressions/Expressions.h"
// #include "ValueDefinitions/StringConstant.h"
#include <boost/regex.hpp>
// #include <boost/algorithm/string/trim.hpp>
#include <string>
#include <iostream>
#include <fstream>
OpalInputInterpreter::OpalInputInterpreter(const std::string & fileName) {
sourceParts_m.push_back(ast::CALL);
sourceParts_m.push_back(fileName);
while (processCalls()) { }
}
OpalInputInterpreter::OpalInputInterpreter() { }
bool OpalInputInterpreter::processCalls() {
bool processedCalls = false;
for (auto it = sourceParts_m.begin(); it != sourceParts_m.end(); ++ it) {
if (getCall(it)) {
std::string fileName = boost::get<std::string>(*it);
std::ifstream ifh(fileName.c_str());
it = sourceParts_m.erase(it); // remove fileName;
processedCalls = true;
parse(ifh, it);
ifh.close();
break;
}
}
return processedCalls;
}
void OpalInputInterpreter::parse(std::istream & in,
const OpalInputInterpreter::iterator_t &position) {
std::string source("");
std::string str;
const std::string commentFormat("");
const boost::regex cppCommentExpr("//.*");
const boost::regex cCommentExpr("/\\*.*?\\*/");
while (std::getline(in, str)) {
str = boost::regex_replace(str, cppCommentExpr, commentFormat);
source += str + '\n';
if (!in.good() || in.eof())
break;
}
iterator_t it = sourceParts_m.insert(position, ast::TEXT);
sourceParts_m.insert(position, boost::regex_replace(source, cCommentExpr, commentFormat));
parseTGauss(it, position);
parseGauss(it, position);
parseCall(it, position);
}
void OpalInputInterpreter::parseTGauss(const OpalInputInterpreter::iterator_t & begin,
const OpalInputInterpreter::iterator_t & end) {
const boost::regex tgaussExpr("TGAUSS\\s*\\(\\s*([+-]?\\s*\\d*\\.?\\d*E?[+-]?\\d*)\\s*\\)", boost::regex::icase);
boost::smatch what;
boost::match_flag_type flags = boost::match_default;
for (iterator_t it = begin; it != end; ++ it) {
if (ignoreCode(it)) continue;
std::string text = boost::get<std::string>(*it);
std::string::const_iterator start = text.begin();
std::string::const_iterator end = text.end();
while (boost::regex_search(start, end, what, tgaussExpr, flags)) {
std::string part(start, what[0].first);
std::string attribute_str(what[1].first, what[1].second);
double attribute = std::stod(attribute_str);
sourceParts_m.insert(it, part);
sourceParts_m.insert(it, ast::TGAUSS);
sourceParts_m.insert(it, attribute);
sourceParts_m.insert(it, ast::TEXT);
start = what[0].second;
}
std::string rest(start, end);
*it = rest;
}
}
void OpalInputInterpreter::parseGauss(const OpalInputInterpreter::iterator_t & begin,
const OpalInputInterpreter::iterator_t & end) {
const boost::regex gaussExpr("GAUSS\\s*\\(\\s*\\)", boost::regex::icase);
boost::smatch what;
boost::match_flag_type flags = boost::match_default;
for (iterator_t it = begin; it != end; ++ it) {
if (ignoreCode(it)) continue;
std::string text = boost::get<std::string>(*it);
std::string::const_iterator start = text.begin();
std::string::const_iterator end = text.end();
while (boost::regex_search(start, end, what, gaussExpr, flags)) {
std::string part(start, what[0].first);
sourceParts_m.insert(it, part);
sourceParts_m.insert(it, ast::GAUSS);
sourceParts_m.insert(it, ast::TEXT);
start = what[0].second;
}
std::string rest(start, end);
*it = rest;
}
}
void OpalInputInterpreter::parseCall(const OpalInputInterpreter::iterator_t & begin,
const OpalInputInterpreter::iterator_t & end) {
const boost::regex callExpr("CALL\\s*,\\s*FILE\\s*=\\s*\"([a-zA-Z0-9_\\-/\\.]*)\"\\s*;", boost::regex::icase);
boost::smatch what;
boost::match_flag_type flags = boost::match_default;
for (iterator_t it = begin; it != end; ++ it) {
if (ignoreCode(it)) continue;
std::string text = boost::get<std::string>(*it);
std::string::const_iterator start = text.begin();
std::string::const_iterator end = text.end();
while (boost::regex_search(start, end, what, callExpr, flags)) {
std::string part(start, what[0].first);
std::string filename(what[1].first, what[1].second);
sourceParts_m.insert(it, part);
sourceParts_m.insert(it, ast::CALL);
sourceParts_m.insert(it, filename);
sourceParts_m.insert(it, ast::TEXT);
start = what[0].second;
}
std::string rest(start, end);
*it = rest;
}
}
bool OpalInputInterpreter::getCall(OpalInputInterpreter::iterator_t & it) {
switch (boost::get<int>(*it)) {
case ast::TEXT:
case ast::TGAUSS:
++ it;
break;
case ast::GAUSS:
break;
case ast::CALL:
it = sourceParts_m.erase(it); // remove ast::CALL
return true;
default:
throw OpalException("OpalInputInterpreter::getCall(iterator_t &)",
"ast code not working properly");
}
return false;
}
bool OpalInputInterpreter::ignoreCode(OpalInputInterpreter::iterator_t & it) const {
switch (boost::get<int>(*it)) {
case ast::TEXT:
++ it;
break;
case ast::TGAUSS:
case ast::CALL:
++ it;
return true;
case ast::GAUSS:
return true;
default:
throw OpalException("OpalInputInterpreter::ingoreCode()",
"ast code not working properly");
}
return false;
}
std::string OpalInputInterpreter::processAST() const {
std::string source("");
for (auto it = sourceParts_m.begin(); it != sourceParts_m.end(); ++ it) {
switch (boost::get<int>(*it)) {
case ast::TEXT:
++ it;
source += boost::get<std::string>(*it);
break;
case ast::TGAUSS:
++ it;
source += ("(" + std::to_string(Expressions::Tgauss(boost::get<double>(*it))) + ")");
break;
case ast::GAUSS:
source += ("(" + std::to_string(Expressions::gauss()) + ")");
break;
default:
throw OpalException("OpalInputInterpreter::processAST()",
"ast code not working properly");
}
}
return source;
}
std::string OpalInputInterpreter::processASTReference() const {
std::string source("");
for (auto it = sourceParts_m.begin(); it != sourceParts_m.end(); ++ it) {
switch (boost::get<int>(*it)) {
case ast::TEXT:
++ it;
source += boost::get<std::string>(*it);
break;
case ast::TGAUSS:
++ it;
source += "0.0";
break;
case ast::GAUSS:
source += "0.0";
break;
default:
throw OpalException("OpalInputInterpreter::processAST()",
"ast code not working properly");
}
}
return source;
}
void OpalInputInterpreter::replaceString(const std::string &search,
std::string replace) {
const boost::regex expr(search, boost::regex::icase);
boost::smatch what;
boost::match_flag_type flags = boost::match_default;
for (iterator_t it = sourceParts_m.begin(); it != sourceParts_m.end(); ++ it) {
if (ignoreCode(it)) continue;
std::string text = boost::get<std::string>(*it);
std::string::const_iterator start = text.begin();
std::string::const_iterator end = text.end();
while (boost::regex_search(start, end, what, expr, flags)) {
std::string part(start, what[0].first);
for (unsigned int i = 1; i < what.size(); ++ i) {
const std::string whatstr(what[i].first, what[i].second);
const std::string matchReplace = "$1" + whatstr + "$2";
const std::string matchString = "^(.*?)\\$\\{" + std::to_string(i) + "\\}(.*?)$";
const boost::regex matchRe(matchString);
replace = boost::regex_replace(replace, matchRe, matchReplace);
}
sourceParts_m.insert(it, part);
sourceParts_m.insert(it, ast::TEXT);
sourceParts_m.insert(it, replace);
sourceParts_m.insert(it, ast::TEXT);
start = what[0].second;
}
std::string rest(start, end);
*it = rest;
}
}
#ifndef OPAL_INPUTINTERPRETER_H
#define OPAL_INPUTINTERPRETER_H
//
// Copyright & License: See Copyright.readme in src directory
//
/*!
Class documentation
*/
// #include "Algorithms/Tracker.h"
// #include "Algorithms/ParallelTTracker.h"
#include <boost/variant.hpp>
#include <iostream>
#include <list>
namespace ast {
enum splitType { TEXT
, GAUSS
, CALL
, TGAUSS
};
typedef boost::variant<int,
double,
std::string> variant_t;
}
struct OpalInputInterpreter {
typedef std::list<ast::variant_t>::iterator iterator_t;
OpalInputInterpreter(const std::string & fileName);
OpalInputInterpreter();
void parse(std::istream & in, const iterator_t &position);
void parseTGauss(const iterator_t & begin, const iterator_t & end);
void parseGauss(const iterator_t & begin, const iterator_t & end);
void parseCall(const iterator_t & begin, const iterator_t & end);
bool processCalls();
bool getCall(iterator_t & it);
bool ignoreCode(iterator_t & it) const;
std::string processAST() const;
std::string processASTReference() const;
void replaceString(const std::string & search,
std::string replace);
std::list<ast::variant_t> sourceParts_m;
};
#endif // OPAL_STATISTICALERRORS_H
\ No newline at end of file
......@@ -29,7 +29,6 @@
#include "Algorithms/ParallelTTracker.h"
#include "Algorithms/ParallelSliceTracker.h"
#include "Algorithms/ParallelCyclotronTracker.h"
#include "Algorithms/StatisticalErrors.h"
#include "Algorithms/NilTracker.h"
#include "Attributes/Attributes.h"
......@@ -82,8 +81,6 @@ namespace {
BOUNDARYGEOMETRY, // The boundary geometry
DISTRIBUTION, // The particle distribution
MULTIPACTING, // MULTIPACTING flag
OBJECTIVES, // for which columns of an sdds file statistical errors should be considered
// THE INTEGRATION TIMESTEP IN SEC
SIZE
};
}
......@@ -128,8 +125,6 @@ TrackRun::TrackRun():
("DISTRIBUTION", "List of particle distributions to be used ");
itsAttr[MULTIPACTING] = Attributes::makeBool
("MULTIPACTING", "Multipacting flag, default: false. Set true to initialize primary particles according to BoundaryGeometry", false);
itsAttr[OBJECTIVES] = Attributes::makeStringArray
("OBJECTIVES", "List of SDDS columns that should be considered when evaluating statistical errors");
registerOwnership(AttributeHandler::SUB_COMMAND);
......@@ -203,8 +198,6 @@ void TrackRun::execute() {
setupTTracker();
} else if(method == "CYCLOTRON-T" || method == "OPAL-CYCL") {
setupCyclotronTracker();
} else if(method.substr(0,18) == "STATISTICAL-ERRORS") {
setupStatisticalErrors(method);
} else {
throw OpalException("TrackRun::execute()",
"Method name \"" + method + "\" unknown.");
......@@ -855,48 +848,6 @@ void TrackRun::setupCyclotronTracker(){
}
}
void TrackRun::setupStatisticalErrors(const std::string & method) {
std::vector<std::string> tmp;
std::string arguments = method.substr(19,method.length() - 20);
boost::algorithm::split(tmp, arguments, boost::algorithm::is_any_of(","));
for (std::string &arg: tmp) {
boost::algorithm::trim(arg);
}
if (Util::toUpper(tmp.at(0)) == "PARALLEL-T" ||
Util::toUpper(tmp.at(0)) == "CYCLOTRON-T" ||
Util::toUpper(tmp.at(0)) == "PARALLEL-SLICE" ||
Util::toUpper(tmp.at(0)) == "THIN" ||
Util::toUpper(tmp.at(0)) == "THICK") {
if (tmp.size() != 3) {
throw OpalException("TrackRun::setupStatisticalErrors()",
"number of arguments: " + std::to_string(tmp.size()) + " != 3");
}
if(!opal->hasBunchAllocated()) {
itsTracker = new StatisticalErrors(*Track::block->use->fetchLine(),
Track::block->reference,
false,
false,
tmp.at(0),
std::stoul(tmp.at(1)),
std::stoul(tmp.at(2)),
Attributes::getStringArray(itsAttr[OBJECTIVES]));
} else {
itsTracker = new NilTracker(*Track::block->use->fetchLine(),
Track::block->reference,
false,
false);
}
} else {
throw OpalException("TrackRun::setupStatisticalErrors()",
"unkonwn method '" + tmp.at(0) + "' provided");
}
}
void TrackRun::setupFieldsolver() {
fs = FieldSolver::find(Attributes::getString(itsAttr[FIELDSOLVER]));
......
......@@ -62,7 +62,6 @@ private:
void setupSliceTracker();
void setupTTracker();
void setupCyclotronTracker();
void setupStatisticalErrors(const std::string & method);
void setupThickTracker();
void setupFieldsolver();
......@@ -86,4 +85,4 @@ private:
static const std::string defaultDistribution;
};
#endif // OPAL_TrackRun_HH
#endif // OPAL_TrackRun_HH
\ No newline at end of file
set (_SRCS
Test1.cpp
)
include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
add_sources(${_SRCS})
\ No newline at end of file
#include <gtest/gtest.h>
#include <boost/filesystem.hpp>
#include "Test1.h"
#include "Algorithms/StatisticalErrors.h"
#include "Structure/OpalInputInterpreter.h"
#include "opal_test_utilities/SilenceTest.h"
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <iterator>
TEST(StatisticalErrorTests, CPPCommentTest) {
OpalTestUtilities::SilenceTest silencer;
std::istringstream in(inputCPPCommentTest);
OpalInputInterpreter interpreter;
interpreter.parse(in, interpreter.sourceParts_m.end());
ast::variant_t front = interpreter.sourceParts_m.front();
EXPECT_EQ(ast::TEXT, boost::get<int>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(outputCPPCommentTest, boost::get<std::string>(front));
}
TEST(StatisticalErrorTests, CCommentTest) {
OpalTestUtilities::SilenceTest silencer;
std::istringstream in(inputCCommentTest);
OpalInputInterpreter interpreter;
interpreter.parse(in, interpreter.sourceParts_m.end());
ast::variant_t front = interpreter.sourceParts_m.front();
EXPECT_EQ(ast::TEXT, boost::get<int>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(outputCCommentTest, boost::get<std::string>(front));
}
TEST(StatisticalErrorTests, TGaussTest) {
OpalTestUtilities::SilenceTest silencer;
std::istringstream in(inputTGaussTest);
OpalInputInterpreter interpreter;
interpreter.parse(in, interpreter.sourceParts_m.end());
ast::variant_t front = interpreter.sourceParts_m.front();
EXPECT_EQ(ast::TEXT, boost::get<int>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(outputTGaussTest1, boost::get<std::string>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(ast::TGAUSS, boost::get<int>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(-3.141e-3, boost::get<double>(front));
ast::variant_t back = interpreter.sourceParts_m.back();
EXPECT_EQ(outputTGaussTest2, boost::get<std::string>(back));
}
TEST(StatisticalErrorTests, GaussTest) {
OpalTestUtilities::SilenceTest silencer;
std::istringstream in(inputGaussTest);
OpalInputInterpreter interpreter;
interpreter.parse(in, interpreter.sourceParts_m.end());
ast::variant_t front = interpreter.sourceParts_m.front();
EXPECT_EQ(ast::TEXT, boost::get<int>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(outputGaussTest1, boost::get<std::string>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(ast::GAUSS, boost::get<int>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(ast::TEXT, boost::get<int>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(outputGaussTest2, boost::get<std::string>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(ast::TGAUSS, boost::get<int>(front));
interpreter.sourceParts_m.pop_front(); // -3.141e-3
interpreter.sourceParts_m.pop_front(); // ast::TEXT
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(outputTGaussTest2, boost::get<std::string>(front));
}
TEST(StatisticalErrorTests, CallTest) {
OpalTestUtilities::SilenceTest silencer;
std::istringstream in(inputCallTest);
OpalInputInterpreter interpreter;
interpreter.parse(in, interpreter.sourceParts_m.end());
ast::variant_t front = interpreter.sourceParts_m.front();
EXPECT_EQ(ast::TEXT, boost::get<int>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(outputCallTest1, boost::get<std::string>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ(ast::CALL, boost::get<int>(front));
interpreter.sourceParts_m.pop_front();
front = interpreter.sourceParts_m.front();
EXPECT_EQ("path/to/some/OPAL_input-file.ver3.141.txt", boost::get<std::string>(front));
}
TEST(StatisticalErrorTests, FileTest) {
OpalTestUtilities::SilenceTest silencer;
std::ofstream ofh("FileTest.in");
ofh << inputGaussTest;
ofh.close();
OpalInputInterpreter interpreter("FileTest.in");
auto it = interpreter.sourceParts_m.begin();
std::advance(it, 4);
EXPECT_EQ(outputGaussTest2, boost::get<std::string>(*it));
boost::filesystem::remove("FileTest.in");
}
TEST(StatisticalErrorTests, SubFileTest) {
OpalTestUtilities::SilenceTest silencer;
std::ofstream ofh("FileTest.in");
ofh << inputSubFileTest1;
ofh.close();
ofh.open("SubFileTest.in");
ofh << inputSubFileTest2;
ofh.close();
OpalInputInterpreter interpreter("FileTest.in");
auto it = interpreter.sourceParts_m.begin();
std::advance(it, 4);
EXPECT_EQ(ast::GAUSS, boost::get<int>(*it));
std::advance(it, 4);
EXPECT_EQ(3.1e-4, boost::get<double>(*it));
std::advance(it, 4);
EXPECT_EQ(outputSubFileTest1, boost::get<std::string>(*it));
boost::filesystem::remove("SubFileTest.in");
boost::filesystem::remove("FileTest.in");
}
TEST(StatisticalErrorTests, ASTTest) {
OpalTestUtilities::SilenceTest silencer;
std::ofstream ofh("FileTest.in");
ofh << inputSubFileTest1;
ofh.close();
ofh.open("SubFileTest.in");
ofh << inputSubFileTest2;
ofh.close();
OpalInputInterpreter interpreter("FileTest.in");
std::string output = interpreter.processASTReference();
EXPECT_EQ(outputASTTest + originalTrack, output);
boost::filesystem::remove("SubFileTest.in");
boost::filesystem::remove("FileTest.in");
}
TEST(StatisticalErrorTests, ReplaceTest) {
OpalTestUtilities::SilenceTest silencer;
std::ofstream ofh("FileTest.in");
ofh << inputSubFileTest1;
ofh.close();
ofh.open("SubFileTest.in");
ofh << inputSubFileTest2;
ofh.close();
OpalInputInterpreter interpreter("FileTest.in");
interpreter.replaceString("STATISTICAL-ERRORS\\((.*?),\\s*\\d*\\s*,\\s*\\d*\\s*\\)",
"${1}");
std::string output = interpreter.processASTReference();
EXPECT_EQ(outputASTTest + replacedTrack, output);
boost::filesystem::remove("SubFileTest.in");
boost::filesystem::remove("FileTest.in");
}
\ No newline at end of file
#ifndef TEST1_H
#define TEST1_H
std::string inputCPPCommentTest("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"//////////////////////////////\n"
"// Begin Content\n"
"//////////////////////////////\n"
"\n"
"//////////////////////////////\n"
"// GAF_1\n"
"//////////////////////////////\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0, L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0, L=0;\n"
"\n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"} ELSE {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=(44.68+90-5.9)/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"}\n");
std::string outputCPPCommentTest("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0, L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0, L=0;\n"
"\n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"} ELSE {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=(44.68+90-5.9)/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"}\n");
std::string inputCCommentTest("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"//////////////////////////////\n"
"// Begin Content\n"
"//////////////////////////////\n"
"\n"
"//////////////////////////////\n"
"// GAF_1\n"
"//////////////////////////////\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0, L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0, L=0;\n"
"\n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"/*} ELSE {*/\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" /*LAG=(44.68+90-5.9)/180*PI, */FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"}\n");
std::string outputCCommentTest("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0, L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0, L=0;\n"
"\n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"}\n");
std::string inputTGaussTest("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"//////////////////////////////\n"
"// Begin Content\n"
"//////////////////////////////\n"
"\n"
"//////////////////////////////\n"
"// GAF_1\n"
"//////////////////////////////\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0, L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0 + TGAUSS(-3.141e-3), L=0;\n"
"\n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"/*} ELSE {*/\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" /*LAG=(44.68+90-5.9)/180*PI, */FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"}\n");
std::string outputTGaussTest1("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0, L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0 + ");
std::string outputTGaussTest2(", L=0;\n"
"\n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"}\n");
std::string inputGaussTest("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"//////////////////////////////\n"
"// Begin Content\n"
"//////////////////////////////\n"
"\n"
"//////////////////////////////\n"
"// GAF_1\n"
"//////////////////////////////\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0 + GAUSS(), L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0 + TGAUSS(-3.141e-3), L=0;\n"
"\n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"/*} ELSE {*/\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" /*LAG=(44.68+90-5.9)/180*PI, */FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"}\n");
std::string outputGaussTest1("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0 + ");
std::string outputGaussTest2(", L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0 + ");
std::string inputCallTest("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"//////////////////////////////\n"
"// Begin Content\n"
"//////////////////////////////\n"
"\n"
"//////////////////////////////\n"
"// GAF_1\n"
"//////////////////////////////\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0, L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0, L=0;\n"
"\n"
" call , file= \"path/to/some/OPAL_input-file.ver3.141.txt\" ; \n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"} ELSE {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=(44.68+90-5.9)/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"}\n");
std::string outputCallTest1("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0, L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0, L=0;\n"
"\n"
" ");
std::string inputSubFileTest1("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"//////////////////////////////\n"
"// Begin Content\n"
"//////////////////////////////\n"
"\n"
"//////////////////////////////\n"
"// GAF_1\n"
"//////////////////////////////\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0, L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0, L=0;\n"
"\n"
" call , file= \"SubFileTest.in\" ; \n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"} ELSE {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384 + 1.234*TGauss(+2.1e-3), TYPE=\"STANDING\",\n"
" LAG=(44.68+90-5.9)/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"}\n"
"TRACK, LINE=BerlinPro, BEAM=beam1, MAXSTEPS=180000, DT=1.0e-13, ZSTOP=15.0;\n"
"RUN, METHOD = \"STATISTICAL-ERRORS(PARALLEL-T, 4, 1000)\", BEAM = beam1, FIELDSOLVER = Fs1, DISTRIBUTION = Dist1;\n"
"ENDTRACK;\n");
std::string inputSubFileTest2("//////////////////////////////\n"
"// BAF_1\n"
"//////////////////////////////\n"
"MARK2L1BAF_1: MARKER, ELEMEDGE=2.10471, L=0;\n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1BAF_1: RFCAVITY, ELEMEDGE=2.892001 + 3.414e-3*GAUSS(), TYPE=\"STANDING\", LAG=-90./180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=4, FREQ=1300;\n"
" CAVH2BAF_1: RFCAVITY, ELEMEDGE=3.681949 + 1e-3*TGAUSS(.31e-3), TYPE=\"STANDING\", LAG=0/180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=19, FREQ=1300;\n"
" CAVH3BAF_1: RFCAVITY, ELEMEDGE=4.471991, TYPE=\"STANDING\", LAG=0/180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=19, FREQ=1300;\n"
"\n"
"// fixed ASTRA autophase minus 180° seeks correct results\n"
"} ELSE {\n"
" CAVH1BAF_1: RFCAVITY, ELEMEDGE=2.892001, TYPE=\"STANDING\", LAG=(234.63-180)/180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=4, FREQ=1300;\n"
" CAVH2BAF_1: RFCAVITY, ELEMEDGE=3.681949, TYPE=\"STANDING\", LAG=(60.62-90)/180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=19, FREQ=1300;\n"
" CAVH3BAF_1: RFCAVITY, ELEMEDGE=4.471991, TYPE=\"STANDING\", LAG=(260.13-90)/180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=19, FREQ=1300;\n"
"}\n"
"\n"
"BAF_1: LINE = (MARK2L1BAF_1, CAVH1BAF_1, CAVH2BAF_1, CAVH3BAF_1);");
std::string outputSubFileTest1(" \n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"} ELSE {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384 + 1.234*");
std::string outputASTTest("DOAUTOPHASE = 1;\n"
"OPTION, ECHO=FALSE;\n"
"OPTION, PSDUMPFREQ=200000;\n"
"OPTION, STATDUMPFREQ=50;\n"
"IF (DOAUTOPHASE == 1)\n"
" {OPTION, AUTOPHASE=4;}\n"
"ELSE\n"
" {OPTION, AUTOPHASE=0;}\n"
"OPTION, CZERO=TRUE;\n"
"\n"
"TITLE, STRING=\"SRF-Injector77pC, BK, 2014-10-16\";\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"MARK1L1GAF_1: MARKER, ELEMEDGE=0, L=0;\n"
"CATHODEVGAF_1: RFCAVITY, ELEMEDGE=0.0, L=0;\n"
"\n"
" \n"
"\n"
"\n"
"MARK2L1BAF_1: MARKER, ELEMEDGE=2.10471, L=0;\n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1BAF_1: RFCAVITY, ELEMEDGE=2.892001 + 3.414e-3*0.0, TYPE=\"STANDING\", LAG=-90./180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=4, FREQ=1300;\n"
" CAVH2BAF_1: RFCAVITY, ELEMEDGE=3.681949 + 1e-3*0.0, TYPE=\"STANDING\", LAG=0/180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=19, FREQ=1300;\n"
" CAVH3BAF_1: RFCAVITY, ELEMEDGE=4.471991, TYPE=\"STANDING\", LAG=0/180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=19, FREQ=1300;\n"
"\n"
"\n"
"} ELSE {\n"
" CAVH1BAF_1: RFCAVITY, ELEMEDGE=2.892001, TYPE=\"STANDING\", LAG=(234.63-180)/180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=4, FREQ=1300;\n"
" CAVH2BAF_1: RFCAVITY, ELEMEDGE=3.681949, TYPE=\"STANDING\", LAG=(60.62-90)/180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=19, FREQ=1300;\n"
" CAVH3BAF_1: RFCAVITY, ELEMEDGE=4.471991, TYPE=\"STANDING\", LAG=(260.13-90)/180*PI,\n"
" FMAPFN=\"CBFp.dat\", VOLT=19, FREQ=1300;\n"
"}\n"
"\n"
"BAF_1: LINE = (MARK2L1BAF_1, CAVH1BAF_1, CAVH2BAF_1, CAVH3BAF_1);\n"
" \n"
"IF (DOAUTOPHASE == 1) {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384, TYPE=\"STANDING\",\n"
" LAG=-5.9/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"} ELSE {\n"
" CAVH1GAF_1: RFCAVITY, ELEMEDGE=0.021384 + 1.234*0.0, TYPE=\"STANDING\",\n"
" LAG=(44.68+90-5.9)/180*PI, FMAPFN=\"Ez_1_4cell_cathode1_5mm.txt\", VOLT=30, FREQ=1300;\n"
"}\n");
std::string originalTrack("TRACK, LINE=BerlinPro, BEAM=beam1, MAXSTEPS=180000, DT=1.0e-13, ZSTOP=15.0;\n"
"RUN, METHOD = \"STATISTICAL-ERRORS(PARALLEL-T, 4, 1000)\", BEAM = beam1, FIELDSOLVER = Fs1, DISTRIBUTION = Dist1;\n"
"ENDTRACK;\n");
std::string replacedTrack("TRACK, LINE=BerlinPro, BEAM=beam1, MAXSTEPS=180000, DT=1.0e-13, ZSTOP=15.0;\n"
"RUN, METHOD = \"PARALLEL-T\", BEAM = beam1, FIELDSOLVER = Fs1, DISTRIBUTION = Dist1;\n"
"ENDTRACK;\n");
#endif //TEST1_H
\ No newline at end of file
add_subdirectory (Algorithms/StatisticalErrors)
add_subdirectory (BasicActions)
add_subdirectory (Distribution)
add_subdirectory (Elements)
add_subdirectory (Sample)
add_subdirectory (Utilities)
set (TEST_SRCS_LOCAL ${TEST_SRCS_LOCAL} PARENT_SCOPE)
\ No newline at end of file
set (TEST_SRCS_LOCAL ${TEST_SRCS_LOCAL} PARENT_SCOPE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment