View Javadoc

1   /*
2    * LayerSimGeneric_Test.java
3    *
4    * Created on July 24, 2007, 4:27 PM
5    *
6    * $Id: LayerSimGeneric_Test.java,v 1.1.1.1 2010/04/08 20:38:00 jeremy Exp $
7    */
8   
9   package org.lcsim.recon.tracking.trflayer;
10  
11  import junit.framework.TestCase;
12  import org.lcsim.recon.tracking.trfbase.HitGenerator;
13  import org.lcsim.recon.tracking.trfbase.HitGeneratorTest;
14  import org.lcsim.recon.tracking.trfbase.PropDirectedTest;
15  import org.lcsim.recon.tracking.trfbase.Propagator;
16  import org.lcsim.recon.tracking.trfbase.SurfTest;
17  import org.lcsim.recon.tracking.trfbase.VTrack;
18  import org.lcsim.recon.tracking.trfutil.Assert;
19  
20  /**
21   *
22   * @author Norman Graf
23   */
24  public class LayerSimGeneric_Test extends TestCase
25  {
26      private boolean debug;
27      /** Creates a new instance of LayerSimGeneric_Test */
28      public void testLayerSimGeneric()
29      {
30         String component = "LayerSimGeneric";
31          String ok_prefix = component + " (I): ";
32          String error_prefix = component + " test (E): ";
33          
34          if(debug) System.out.println( ok_prefix
35                  + "---------- Testing component " + component
36                  + ". ----------" );
37          
38          //********************************************************************
39          
40          if(debug) System.out.println( ok_prefix + "Check constructor." );
41          double spar = 5.0;
42          SurfTest srf = new SurfTest(spar);
43          HitGenerator hgen = new HitGeneratorTest(srf);
44          Layer lyr = new LayerTest(spar);
45          Propagator prop = new PropDirectedTest();
46          LayerSimGeneric lsim = new LayerSimGeneric(lyr,hgen,prop);
47          if(debug) System.out.println( lsim );
48          Layer lyr1 = lsim.layer();
49          if(debug) System.out.println( lyr );
50          Assert.assertTrue(lyr1.equals(lyr));
51          Assert.assertTrue( lsim.generators().size() == 1 );
52          VTrack trv = new VTrack( srf.newPureSurface() );
53          int mcid = 137;
54          lsim.addClusters(trv,mcid);
55          lsim.dropClusters();
56          
57          //********************************************************************
58          
59          if(debug) System.out.println( ok_prefix
60                  + "------------- All tests passed. -------------" );
61          
62          //********************************************************************        
63      }
64      
65  }