Commit 77566f77 authored by frey_m's avatar frey_m
Browse files

Gauss-Matched: Add option to match single sector or full machine (all sectors)

parent 7359476d
......@@ -1282,6 +1282,8 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles, doub
"didn't find any Cyclotron element in line");
}
const Cyclotron* CyclotronElement = CyclotronVisitor.front();
bool full = !Attributes::getBool(itsAttr[Attrib::Distribution::SECTOR]);
*gmsg << "* ----------------------------------------------------" << endl;
*gmsg << "* About to find closed orbit and matched distribution " << endl;
......@@ -1290,8 +1292,12 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles, doub
<< " EY= " << Attributes::getReal(itsAttr[Attrib::Distribution::EY])
<< " ET= " << Attributes::getReal(itsAttr[Attrib::Distribution::ET]) << endl
<< "* FMAPFN= " << Attributes::getString(itsAttr[Attrib::Distribution::FMAPFN]) << endl //CyclotronElement->getFieldMapFN() << endl
<< "* FMSYM= " << (int)Attributes::getReal(itsAttr[Attrib::Distribution::MAGSYM])
<< " HN= " << CyclotronElement->getCyclHarm()
<< "* FMSYM= " << (int)Attributes::getReal(itsAttr[Attrib::Distribution::MAGSYM]);
if ( full )
*gmsg << "* SECTOR: " << "match using all sectors" << endl;
else
*gmsg << "* SECTOR: " << "match using single sector" << endl;
*gmsg << " HN= " << CyclotronElement->getCyclHarm()
<< " PHIINIT= " << CyclotronElement->getPHIinit() << endl;
*gmsg << "* ----------------------------------------------------" << endl;
......@@ -1337,7 +1343,7 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles, doub
CyclotronElement->getPHIinit(),
Attributes::getReal(itsAttr[Attrib::Distribution::RGUESS]),
Attributes::getString(itsAttr[Attrib::Distribution::FMTYPE]),
false, false)) {
false, full)) {
std::array<double,3> Emit = siggen->getEmittances();
......@@ -3501,6 +3507,10 @@ void Distribution::setAttributes() {
= Attributes::makeReal("ORDERMAPS", "Order used in the field expansion ", 7);
itsAttr[Attrib::Distribution::MAGSYM]
= Attributes::makeReal("MAGSYM", "Number of sector magnets ", 0);
itsAttr[Attrib::Distribution::SECTOR]
= Attributes::makeBool("SECTOR", "Match using single sector (true)"
"(false: using all sectors) (default: true)",
true);
itsAttr[Attrib::Distribution::RGUESS]
= Attributes::makeReal("RGUESS", "Guess value of radius (m) for closed orbit finder ", -1);
......
......@@ -185,7 +185,8 @@ namespace Attrib
EX, // below is for the matched distribution
EY,
ET,
MAGSYM, // number of sector magnets
MAGSYM, // Matched-Gauss: number of sector magnets
SECTOR, // Matched-Gauss: single sector or full machine
LINE,
FMAPFN,
FMTYPE, // field map type used in matched gauss distribution
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment