From 45bf5afaab4092fedddc22fef5a7e69a04164899 Mon Sep 17 00:00:00 2001
From: Andreas Adelmann <andreas,adelmann@psi.ch>
Date: Tue, 1 Sep 2015 20:19:49 +0200
Subject: [PATCH] Introduce Option BEAMHALOBOUNDARY, this is experimental

---
 .gitignore                            | 12 +++++++++++-
 classic/5.0/src/Utilities/Options.cpp |  2 ++
 classic/5.0/src/Utilities/Options.h   |  2 ++
 src/BasicActions/Option.cpp           | 11 ++++++++---
 4 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index f1576d1cf..e5012c27d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -143,6 +143,16 @@ src/opal_unit_tests
 *cmake_install.cmake
 tests/tools/gtest
 tests/opal_unit_tests
-
+.DS_Store
+classic/.DS_Store
+classic/5.0/.DS_Store
+classic/5.0/src/.DS_Store
+classic/5.0/src/AbsBeamline/.DS_Store
+ippl/.DS_Store
+ippl/doc/.DS_Store
+ippl/doc/tex/.DS_Store
+ippl/test/.DS_Store
+ippl/test/particle/.DS_Store
+src/.DS_Store
 
 
diff --git a/classic/5.0/src/Utilities/Options.cpp b/classic/5.0/src/Utilities/Options.cpp
index 2aff3167e..6b79e0440 100644
--- a/classic/5.0/src/Utilities/Options.cpp
+++ b/classic/5.0/src/Utilities/Options.cpp
@@ -16,4 +16,6 @@ namespace Options {
     // the particle will be deleted artifically to hold the accuracy of space charge calculation. The default setting of -1 stands for no deletion.
     int remotePartDel = -1;
 
+  double beamHaloBoundary = 0;
+
 }
diff --git a/classic/5.0/src/Utilities/Options.h b/classic/5.0/src/Utilities/Options.h
index 85cda9baa..ebf575f67 100644
--- a/classic/5.0/src/Utilities/Options.h
+++ b/classic/5.0/src/Utilities/Options.h
@@ -51,6 +51,8 @@ namespace Options {
     // If the distance of a particle to bunch mass larger than remotePartDel times of the rms size of the bunch in any dimension,
     // the particle will be deleted artifically to hold the accuracy of space charge calculation. The default setting of -1 stands for no deletion.
     extern int remotePartDel;
+
+    extern double beamHaloBoundary;
 }
 
 #endif // OPAL_Options_HH
diff --git a/src/BasicActions/Option.cpp b/src/BasicActions/Option.cpp
index ea0d7a90d..e6d5104f1 100644
--- a/src/BasicActions/Option.cpp
+++ b/src/BasicActions/Option.cpp
@@ -69,6 +69,7 @@ namespace {
         ENABLEHDF5,
         ASCIIDUMP,
         BOUNDPDESTROYFQ,
+	BEAMHALOBOUNDARY,
         SIZE
     };
 }
@@ -160,6 +161,9 @@ Option::Option():
     itsAttr[BOUNDPDESTROYFQ] = Attributes::makeReal
       ("BOUNDPDESTROYFQ", "The frequency to do boundp_destroy to delete lost particles. Default 10",10.0);
 
+    itsAttr[BEAMHALOBOUNDARY] = Attributes::makeReal
+      ("BEAMHALOBOUNDARY", "Defines in therms of sigma where the halo starts Default 0.0",0.0);
+
     FileStream::setEcho(echo);
     rangen.init55(seed);
 }
@@ -200,6 +204,7 @@ Option::Option(const std::string &name, Option *parent):
     Attributes::setBool(itsAttr[ENABLEHDF5], enableHDF5);
     Attributes::setBool(itsAttr[ASCIIDUMP], asciidump);
     Attributes::setReal(itsAttr[BOUNDPDESTROYFQ], 10);
+    Attributes::setReal(itsAttr[BEAMHALOBOUNDARY], 0);
 }
 
 
@@ -313,11 +318,11 @@ void Option::execute() {
         rngtype = std::string("RANDOM");
     }
     
-    if(itsAttr[BOUNDPDESTROYFQ]) {
-        boundpDestroyFreq = int(Attributes::getReal(itsAttr[BOUNDPDESTROYFQ]));
+    if(itsAttr[BEAMHALOBOUNDARY]) {
+      beamHaloBoundary  = Attributes::getReal(itsAttr[BEAMHALOBOUNDARY]);
     }
     else {
-      boundpDestroyFreq = 10;
+      beamHaloBoundary = 0;
     }
 
     // Set message flags.
-- 
GitLab