1 package org.lcsim.recon.tracking.trfbase; 2 // SimInteractorTest 3 // A file to test the abstract SimInteractor class. 4 import org.lcsim.recon.tracking.trfbase.SimInteractor; 5 import org.lcsim.recon.tracking.trfbase.TrackVector; 6 import org.lcsim.recon.tracking.trfbase.VTrack; 7 8 public class SimInteractorTest extends SimInteractor 9 { 10 11 private double _radLength; 12 private double _mult; 13 14 // constructor 15 public SimInteractorTest( double radLength, double mult ) 16 { 17 _radLength = radLength; 18 _mult = mult; 19 } 20 21 // method for changing the track: 22 public void interact( VTrack vtrk) 23 { 24 // the real test is statistical... so here, just change the 25 // track vector by a prescribed amount, and let a large data 26 // set determine whether the track modifications are in line 27 // with the covariance matrix modifications. 28 TrackVector trv = ( vtrk.vector() ); 29 trv.set(0, trv.get(0) * _mult); 30 trv.set(1, trv.get(1) * _mult); 31 vtrk.setVectorAndKeepDirection( trv ); 32 } 33 34 //return the number of radiation lengths: 35 public double get_rad_length() 36 { 37 return _radLength; 38 } 39 40 //make a clone 41 public SimInteractor newCopy() 42 { 43 return new SimInteractorTest(this._radLength, this._mult); 44 } 45 46 public String toString() 47 { 48 return "SimInteractorTest radlength= "+_radLength+" mult= "+_mult+"\n"; 49 } 50 51 } 52 53 54 55 56 57 58