Commit 5629d3ce authored by Christof Metzger-Kraus's avatar Christof Metzger-Kraus
Browse files

improve performance by 20% (for RingCyclotron-RegTest) by -

 moving startTimer/stopTimer outside loop over particles and - avoiding string
 comparison inside loops over particles
parent 8ddb4b07
This diff is collapsed.
......@@ -21,6 +21,7 @@
#include "Algorithms/Tracker.h"
#include "Structure/DataSink.h"
#include "AbsBeamline/ElementBase.h"
#include <vector>
class BMultipoleField;
......@@ -47,7 +48,7 @@ class ParallelCyclotronTracker: public Tracker {
public:
typedef std::pair<double[8], Component *> element_pair;
typedef std::pair<std::string, element_pair> type_pair;
typedef std::pair<ElementBase::ElementType, element_pair> type_pair;
typedef std::list<type_pair *> beamline_list;
/// Constructor.
// The beam line to be tracked is "bl".
......@@ -268,7 +269,7 @@ private:
#endif // GENERICTRACKER
/*
Local Variables both used by the integration methods
Local Variables both used by the integration methods
*/
Vector_t rold_m, pold_m, rnew_m, ptmp_m;
......@@ -339,7 +340,7 @@ private:
void applyExitFringe(double edge, double curve,
const BMultipoleField &field, double scale);
void buildupFieldList(double BcParameter[], std::string ElementType, Component *elptr);
void buildupFieldList(double BcParameter[], ElementBase::ElementType elementType, Component *elptr);
bool derivate(double *y, const double &t, double *yp, const size_t &Pindex);
......@@ -503,4 +504,4 @@ inline
double ParallelCyclotronTracker::calculateAngle2(double x, double y)
{ return atan2(y,x); }
#endif // OPAL_ParallelCyclotronTracker_HH
#endif // OPAL_ParallelCyclotronTracker_HH
\ No newline at end of file
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