View Javadoc

1   /*
2    * MissFixed_Test.java
3    *
4    * Created on July 24, 2007, 11:43 AM
5    *
6    * $Id: MissFixed_Test.java,v 1.1.1.1 2010/04/08 20:38:00 jeremy Exp $
7    */
8   
9   package org.lcsim.recon.tracking.trfbase;
10  
11  import junit.framework.TestCase;
12  import org.lcsim.recon.tracking.trfutil.Assert;
13  
14  /**
15   *
16   * @author Norman Graf
17   */
18  public class MissFixed_Test extends TestCase
19  {
20      private boolean debug;
21      /** Creates a new instance of MissFixed_Test */
22      public void testMissFixed()
23      {
24           String component = "MissFixed";
25          String ok_prefix = component + " (I): ";
26          String error_prefix = component + " test (E): ";
27          
28          if(debug) System.out.println(ok_prefix
29                  + "---------- Testing component " + component
30                  + ". ----------" );
31          
32          //********************************************************************
33          
34          if(debug) System.out.println(ok_prefix + "Construct miss." );
35          Surface srf= new SurfTest(3);
36          double like = 0.123;
37          MissFixed miss = new MissFixed(srf,like);
38          Assert.assertTrue( miss.surface().equals(srf) );
39          Assert.assertTrue( miss.likelihood() == like );
40          
41          //********************************************************************
42          
43          if(debug) System.out.println(ok_prefix + "Update." );
44          Surface srf2 =  new SurfTest(2);
45          TrackVector vec = new TrackVector();
46          TrackError err = new TrackError();
47          ETrack tre = new ETrack(srf2,vec,err);
48          miss.update(tre);
49          Assert.assertTrue( miss.surface().equals(srf) );
50          Assert.assertTrue( miss.likelihood() == like );
51          
52          //********************************************************************
53          
54          if(debug) System.out.println(ok_prefix + "Clone." );
55          Miss pmiss2 = miss.newCopy();
56          Assert.assertTrue( pmiss2.surface().equals(miss.surface()) );
57          Assert.assertTrue( pmiss2.likelihood() == miss.likelihood() );
58          
59          //********************************************************************
60          
61          if(debug) System.out.println(ok_prefix
62                  + "------------- All tests passed. -------------" );
63          
64          //********************************************************************       
65      }
66      
67  }