// PropNull.cpp #include "PropNull.h" #include "objstream/ObjData.hpp" #include "objstream/ObjTable.hpp" #include "trfutil/trfstream.h" #include "PropStat.h" #include "Surface.h" #include "VTrack.h" #include "ETrack.h" using trf::PropStat; using trf::Propagator; using trf::PropNull; //********************************************************************** // Free functions. //********************************************************************** namespace { // Creator ObjPtr create(const ObjData& data) { assert( data.get_object_type() == "PropNull" ); if ( data.get_object_type() != "PropNull" ) return ObjPtr(0); return ObjPtr( new PropNull ); } } //********************************************************************** // Output stream. void PropNull::ostr(ostream& stream) const { stream << begin_object; stream << "Null propagator"; stream << end_object; } //********************************************************************** // Constructor. PropNull::PropNull() { } //********************************************************************** // Destructor. PropNull::~PropNull() { } //********************************************************************** // Return the creator. ObjCreator PropNull::get_creator() { return create; } //********************************************************************** // Write object data. ObjData PropNull::write_data() const { return ObjData("PropNull"); } //********************************************************************** // Clone, i.e. create a copy on the free store. Propagator* PropNull::new_propagator() const { return new PropNull; } //********************************************************************** // Propagate a track without error PropStat PropNull::vec_prop(VTrack& trv, const Surface& srf, TrackDerivative* pder) const { PropStat pstat; if ( trv.get_surface()->pure_equal(srf) ) pstat.set_same(); if ( pder != 0 ) { pder->fill(0.0); for (int i=0; i<5; ++i) (*pder)(i,i) = 1.0; } return pstat; } //********************************************************************** // Propagate a track without error in the specified direction PropStat PropNull::vec_dir_prop(VTrack& trv, const Surface& srf, PropDir dir, TrackDerivative* pder) const { PropStat pstat; if ( trv.get_surface()->pure_equal(srf) ) pstat.set_same(); if ( pder != 0 ) { pder->fill(0.0); for (int i=0; i<5; ++i) (*pder)(i,i) = 1.0; } return pstat; } //********************************************************************** // Propagate a track with error PropStat PropNull::err_prop(ETrack& tre, const Surface& srf, TrackDerivative* pder) const { PropStat pstat; if ( tre.get_surface()->pure_equal(srf) ) pstat.set_same(); if ( pder != 0 ) { pder->fill(0.0); for (int i=0; i<5; ++i) (*pder)(i,i) = 1.0; } return pstat; } //********************************************************************** // Propagate a track with error in the specified direction PropStat PropNull::err_dir_prop(ETrack& tre, const Surface& srf, PropDir dir, TrackDerivative* pder) const { PropStat pstat; if ( tre.get_surface()->pure_equal(srf) ) pstat.set_same(); if ( pder != 0 ) { pder->fill(0.0); for (int i=0; i<5; ++i) (*pder)(i,i) = 1.0; } return pstat; } //**********************************************************************