// MCTrackMaker.cpp #include "MCTrackMaker.h" #include #include "trfbase/VTrackGenerator.h" #include "trfcyl/SurfCylinder.h" #include "trfbase/TrackVector.h" #include "trfutil/TRFMath.h" #include "trfutil/RandomRegistry.h" using std::ostream; using namespace trf; //********************************************************************** // output stream void MCTrackMaker::ostr(ostream& stream) const { assert( _pvtgen != 0 ); stream << *_pvtgen; } //********************************************************************** // constructor MCTrackMaker::MCTrackMaker() { // Define the starting surface. double ri = 1.0; SurfCylinder srfi( ri ); // Define lower track bounds. TrackVector tmin; tmin(0) = -PI; // phi tmin(1) = -30.0; // z tmin(2) = -PI2; // alpha = phi_dir - phi_pos tmin(3) = -4.0; // tan(lambda) tmin(4) = -5.0; // 1/pT (was 1/6) // Define upper track bound. TrackVector tmax; for ( int i=0; i<5; ++i ) tmax(i) = -tmin(i); // Construct the input track generator. _pvtgen = new VTrackGenerator( srfi, tmin, tmax ); } //********************************************************************** // destructor MCTrackMaker::~MCTrackMaker() { } //********************************************************************** // Register random generators. void MCTrackMaker::register_generators(RandomRegistry& reg) { reg.add_generator(*_pvtgen); } //********************************************************************** // track maker VTrack* MCTrackMaker::new_track() { return _pvtgen->new_track(); } //********************************************************************** // output stream ostream& operator<<(ostream& stream, const MCTrackMaker& maker) { maker.ostr(stream); return stream; } //**********************************************************************