Commit 8141e0da authored by kraus's avatar kraus
Browse files

use a more suitable name instead of getCoordTransformationTo

parent c46e953c
...@@ -22,7 +22,7 @@ ParallelSliceTracker::ParallelSliceTracker(const Beamline &beamline, ...@@ -22,7 +22,7 @@ ParallelSliceTracker::ParallelSliceTracker(const Beamline &beamline,
Tracker(beamline, reference, revBeam, revTrack) { Tracker(beamline, reference, revBeam, revTrack) {
CoordinateSystemTrafo labToRef(beamline.getOrigin3D(), CoordinateSystemTrafo labToRef(beamline.getOrigin3D(),
beamline.getCoordTransformationTo().conjugate()); beamline.getInitialDirection());
referenceToLabCSTrafo_m = labToRef.inverted(); referenceToLabCSTrafo_m = labToRef.inverted();
} }
...@@ -46,7 +46,7 @@ ParallelSliceTracker::ParallelSliceTracker(const Beamline &beamline, ...@@ -46,7 +46,7 @@ ParallelSliceTracker::ParallelSliceTracker(const Beamline &beamline,
itsDataSink_m = &ds; itsDataSink_m = &ds;
CoordinateSystemTrafo labToRef(beamline.getOrigin3D(), CoordinateSystemTrafo labToRef(beamline.getOrigin3D(),
beamline.getCoordTransformationTo()); beamline.getInitialDirection());
referenceToLabCSTrafo_m = labToRef.inverted(); referenceToLabCSTrafo_m = labToRef.inverted();
for (std::vector<unsigned long long>::const_iterator it = maxSteps.begin(); it != maxSteps.end(); ++ it) { for (std::vector<unsigned long long>::const_iterator it = maxSteps.begin(); it != maxSteps.end(); ++ it) {
...@@ -78,7 +78,7 @@ ParallelSliceTracker::~ParallelSliceTracker() ...@@ -78,7 +78,7 @@ ParallelSliceTracker::~ParallelSliceTracker()
void ParallelSliceTracker::visitBeamline(const Beamline &bl) { // borrowed from ParallelTTracker void ParallelSliceTracker::visitBeamline(const Beamline &bl) { // borrowed from ParallelTTracker
const FlaggedBeamline* fbl = static_cast<const FlaggedBeamline*>(&bl); const FlaggedBeamline* fbl = static_cast<const FlaggedBeamline*>(&bl);
if (fbl->getRelativeFlag()) { if (fbl->getRelativeFlag()) {
OpalBeamline stash(fbl->getOrigin3D(), fbl->getCoordTransformationTo()); OpalBeamline stash(fbl->getOrigin3D(), fbl->getInitialDirection());
stash.swap(itsOpalBeamline_m); stash.swap(itsOpalBeamline_m);
fbl->iterate(*this, false); fbl->iterate(*this, false);
itsOpalBeamline_m.prepareSections(); itsOpalBeamline_m.prepareSections();
......
...@@ -60,7 +60,7 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline, ...@@ -60,7 +60,7 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline,
bool revTrack): bool revTrack):
Tracker(beamline, reference, revBeam, revTrack), Tracker(beamline, reference, revBeam, revTrack),
itsDataSink_m(NULL), itsDataSink_m(NULL),
itsOpalBeamline_m(beamline.getOrigin3D(), beamline.getCoordTransformationTo()), itsOpalBeamline_m(beamline.getOrigin3D(), beamline.getInitialDirection()),
RefPartR_m(0.0), RefPartR_m(0.0),
RefPartP_m(0.0), RefPartP_m(0.0),
globalEOL_m(false), globalEOL_m(false),
...@@ -88,7 +88,7 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline, ...@@ -88,7 +88,7 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline,
{ {
CoordinateSystemTrafo labToRef(beamline.getOrigin3D(), CoordinateSystemTrafo labToRef(beamline.getOrigin3D(),
beamline.getCoordTransformationTo().conjugate()); beamline.getInitialDirection());
referenceToLabCSTrafo_m = labToRef.inverted(); referenceToLabCSTrafo_m = labToRef.inverted();
#ifdef OPAL_DKS #ifdef OPAL_DKS
...@@ -109,7 +109,7 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline, ...@@ -109,7 +109,7 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline,
const std::vector<double> &dt): const std::vector<double> &dt):
Tracker(beamline, bunch, reference, revBeam, revTrack), Tracker(beamline, bunch, reference, revBeam, revTrack),
itsDataSink_m(&ds), itsDataSink_m(&ds),
itsOpalBeamline_m(beamline.getOrigin3D(), beamline.getCoordTransformationTo()), itsOpalBeamline_m(beamline.getOrigin3D(), beamline.getInitialDirection()),
RefPartR_m(0.0), RefPartR_m(0.0),
RefPartP_m(0.0), RefPartP_m(0.0),
globalEOL_m(false), globalEOL_m(false),
...@@ -134,7 +134,7 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline, ...@@ -134,7 +134,7 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline,
{ {
CoordinateSystemTrafo labToRef(beamline.getOrigin3D(), CoordinateSystemTrafo labToRef(beamline.getOrigin3D(),
beamline.getCoordTransformationTo()); beamline.getInitialDirection());
referenceToLabCSTrafo_m = labToRef.inverted(); referenceToLabCSTrafo_m = labToRef.inverted();
for (std::vector<unsigned long long>::const_iterator it = maxSteps.begin(); it != maxSteps.end(); ++ it) { for (std::vector<unsigned long long>::const_iterator it = maxSteps.begin(); it != maxSteps.end(); ++ it) {
...@@ -259,6 +259,7 @@ void ParallelTTracker::execute() { ...@@ -259,6 +259,7 @@ void ParallelTTracker::execute() {
restoreCavityPhases(); restoreCavityPhases();
} else { } else {
RefPartR_m = Vector_t(0.0); RefPartR_m = Vector_t(0.0);
RefPartP_m = euclidean_norm(itsBunch_m->get_pmean_Distribution()) * Vector_t(0, 0, 1); RefPartP_m = euclidean_norm(itsBunch_m->get_pmean_Distribution()) * Vector_t(0, 0, 1);
......
...@@ -43,7 +43,7 @@ ThickTracker::ThickTracker(const Beamline &beamline, ...@@ -43,7 +43,7 @@ ThickTracker::ThickTracker(const Beamline &beamline,
, RefPartR_m(0.0) , RefPartR_m(0.0)
, RefPartP_m(0.0) , RefPartP_m(0.0)
, itsDataSink_m(nullptr) , itsDataSink_m(nullptr)
, itsOpalBeamline_m(beamline.getOrigin3D(), beamline.getCoordTransformationTo()) , itsOpalBeamline_m(beamline.getOrigin3D(), beamline.getInitialDirection())
, zstart_m(0.0) , zstart_m(0.0)
, zstop_m(0.0) , zstop_m(0.0)
, threshold_m(1.0e-6) , threshold_m(1.0e-6)
...@@ -53,7 +53,7 @@ ThickTracker::ThickTracker(const Beamline &beamline, ...@@ -53,7 +53,7 @@ ThickTracker::ThickTracker(const Beamline &beamline,
, mapTracking_m( IpplTimings::getTimer("mapTracking")) , mapTracking_m( IpplTimings::getTimer("mapTracking"))
{ {
CoordinateSystemTrafo labToRef(beamline.getOrigin3D(), CoordinateSystemTrafo labToRef(beamline.getOrigin3D(),
beamline.getCoordTransformationTo()); beamline.getInitialDirection());
referenceToLabCSTrafo_m = labToRef.inverted(); referenceToLabCSTrafo_m = labToRef.inverted();
} }
...@@ -74,7 +74,7 @@ ThickTracker::ThickTracker(const Beamline &beamline, ...@@ -74,7 +74,7 @@ ThickTracker::ThickTracker(const Beamline &beamline,
, RefPartR_m(0.0) , RefPartR_m(0.0)
, RefPartP_m(0.0) , RefPartP_m(0.0)
, itsDataSink_m(&ds) , itsDataSink_m(&ds)
, itsOpalBeamline_m(beamline.getOrigin3D(), beamline.getCoordTransformationTo()) , itsOpalBeamline_m(beamline.getOrigin3D(), beamline.getInitialDirection())
, zstart_m(zstart) , zstart_m(zstart)
, zstop_m(zstop[0]) , zstop_m(zstop[0])
, threshold_m(1.0e-6) , threshold_m(1.0e-6)
...@@ -89,7 +89,7 @@ ThickTracker::ThickTracker(const Beamline &beamline, ...@@ -89,7 +89,7 @@ ThickTracker::ThickTracker(const Beamline &beamline,
CoordinateSystemTrafo labToRef(beamline.getOrigin3D(), CoordinateSystemTrafo labToRef(beamline.getOrigin3D(),
beamline.getCoordTransformationTo()); beamline.getInitialDirection());
referenceToLabCSTrafo_m = labToRef.inverted(); referenceToLabCSTrafo_m = labToRef.inverted();
} }
...@@ -104,7 +104,7 @@ void ThickTracker::visitBeamline(const Beamline &bl) { ...@@ -104,7 +104,7 @@ void ThickTracker::visitBeamline(const Beamline &bl) {
const FlaggedBeamline* fbl = static_cast<const FlaggedBeamline*>(&bl); const FlaggedBeamline* fbl = static_cast<const FlaggedBeamline*>(&bl);
if (fbl->getRelativeFlag()) { if (fbl->getRelativeFlag()) {
*gmsg << " do stuff" << endl; *gmsg << " do stuff" << endl;
OpalBeamline stash(fbl->getOrigin3D(), fbl->getCoordTransformationTo()); OpalBeamline stash(fbl->getOrigin3D(), fbl->getInitialDirection());
stash.swap(itsOpalBeamline_m); stash.swap(itsOpalBeamline_m);
fbl->iterate(*this, false); fbl->iterate(*this, false);
itsOpalBeamline_m.prepareSections(); itsOpalBeamline_m.prepareSections();
...@@ -616,4 +616,4 @@ void ThickTracker::update_m(const double& spos, ...@@ -616,4 +616,4 @@ void ThickTracker::update_m(const double& spos,
itsBunch_m->setGlobalTrackStep(step); itsBunch_m->setGlobalTrackStep(step);
itsBunch_m->calcBeamParameters(); itsBunch_m->calcBeamParameters();
itsBunch_m->calcEMean(); itsBunch_m->calcEMean();
} }
\ No newline at end of file
...@@ -50,7 +50,7 @@ Vector_t Beamline::getOrigin3D() const { ...@@ -50,7 +50,7 @@ Vector_t Beamline::getOrigin3D() const {
return Vector_t(0); return Vector_t(0);
} }
Quaternion Beamline::getCoordTransformationTo() const { Quaternion Beamline::getInitialDirection() const {
return Quaternion(1, 0, 0, 0); return Quaternion(1, 0, 0, 0);
} }
......
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
virtual void iterate(BeamlineVisitor &, bool reverse) const = 0; virtual void iterate(BeamlineVisitor &, bool reverse) const = 0;
virtual Vector_t getOrigin3D() const; virtual Vector_t getOrigin3D() const;
virtual Quaternion getCoordTransformationTo() const; virtual Quaternion getInitialDirection() const;
virtual bool getRelativeFlag() const; virtual bool getRelativeFlag() const;
private: private:
......
...@@ -19,11 +19,11 @@ OpalBeamline::OpalBeamline(): ...@@ -19,11 +19,11 @@ OpalBeamline::OpalBeamline():
} }
OpalBeamline::OpalBeamline(const Vector_t& origin, OpalBeamline::OpalBeamline(const Vector_t& origin,
const Quaternion& coordTransformationTo): const Quaternion& rotation):
elements_m(), elements_m(),
prepared_m(false), prepared_m(false),
containsSource_m(false), containsSource_m(false),
coordTransformationTo_m(origin, coordTransformationTo) coordTransformationTo_m(origin, rotation)
{ {
} }
......
...@@ -41,7 +41,7 @@ class OpalBeamline { ...@@ -41,7 +41,7 @@ class OpalBeamline {
public: public:
OpalBeamline(); OpalBeamline();
OpalBeamline(const Vector_t& origin, OpalBeamline(const Vector_t& origin,
const Quaternion& coordTrafoTo); const Quaternion& rotation);
~OpalBeamline(); ~OpalBeamline();
OpalSection &getSectionAt(const Vector_t &, long &); OpalSection &getSectionAt(const Vector_t &, long &);
......
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