// PropCyl.h #ifndef PropCyl_H #define PropCyl_H // Propagates tracks from one cylinder to another in a constant field. // // Propagation will fail if either the origin or destination is // not a cylinder. // // Propagation more than halfway around one loop is not allowed and // will result in failure if attempted. // // ObjStream example: // // [ myprop PropCyl bfield=2.0 ] // // To use the global bfield: // // [ myprop PropCyl bfield=@bfield ] // // The optional parameter dir may be used to specify the default // direction for propagation. It must have one of the following // values: "forward", "backward" or "nearest". E.g. // [ myprop PropCyl bfield=2.0 dir="forward" ] // or // [ bmap PropCylFieldConst bfield=2.0 ] // [ myprop PropCyl bfield_map=*bmap dir="forward" ] // #include "trfbase/PropDirected.h" #include "ptr/Ptr.h" #include "PropCylField.h" #include "trfbase/ObjDoublePtr.h" namespace trf { class PropCylField; class PropCyl : public PropDirected { public: // typedefs typedef Ptr PropCylFieldPtr; public: // static methods // Return the type name. static TypeName get_type_name() { return "PropCyl"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } private: // attributes // Constant magnet field. ObjDoublePtr _bfield; // B-field map. // Null means to use constant value. PropCylFieldPtr _pmap; private: // output stream void ostr(std::ostream& stream) const; public: // constructors from magnetic field in Tesla. PropCyl(ObjDoublePtr bfield); // constructor from magnetic field mapper PropCyl(PropCylFieldPtr pmap); // destructor ~PropCyl(); // Clone. Propagator* new_propagator( ) const; // Return the type. Type get_type() const { return get_static_type(); } // Write the object data. ObjData write_data() const; // propagate a track without error in the specified direction PropStat vec_dir_prop(VTrack& trv, const Surface& srf, PropDir dir, TrackDerivative* pder =0) const; // return the magnetic field double get_bfield() const; // Return the field mapper. PropCylFieldPtr get_map() const { return _pmap; } }; } // end namespace trf #endif