View Javadoc

1   package org.lcsim.recon.tracking.trfbase;
2   // Dummy concrete cluster and hit classes.
3   // These are only used for testing.
4   import java.util.List;
5   import java.util.ArrayList;
6   import java.util.Iterator;
7   
8   
9   import org.lcsim.recon.tracking.trfbase.Cluster;
10  import org.lcsim.recon.tracking.trfbase.ETrack;
11  import org.lcsim.recon.tracking.trfbase.Hit;
12  import org.lcsim.recon.tracking.trfbase.McCluster;
13  import org.lcsim.recon.tracking.trfbase.Surface;
14  import org.lcsim.recon.tracking.trfbase.McHitTest;
15  
16  // Cluster.
17  public class McClusterTest extends McCluster
18  {
19      
20      // surface
21      public SurfTest _stst;
22          /*
23          // Return the type name.
24          public  String get_type_name()
25          { return "McClusterTest";
26          }
27           */
28          /*
29          // Return the type.
30          public static String get_static_type()
31          { return get_creator();
32          }
33           */
34      public String toString()
35      {
36          return  "McCluster test.";
37      }
38      public boolean equal( Cluster clus)
39      { List tmp1 = mcIds();
40        List tmp2 = ((McClusterTest) clus).mcIds();
41        if (tmp1.size() != tmp2.size()) return false;
42        Iterator it2 = tmp2.iterator();
43        for(Iterator it = tmp1.iterator() ; it.hasNext() ; )
44        {
45            if ( ((Cluster)it.next()).notEquals( ((Cluster)it2.next()) ) ) return false;
46        }
47        return true;
48      }
49      
50      public List predict( ETrack tre)
51      {
52          List hits = new ArrayList();
53          hits.add( (Hit) (new McHitTest()) );
54          return hits;
55      }
56      
57      public McClusterTest( SurfTest stst,  int mcid)
58      {
59          super(mcid);
60          _stst=new SurfTest(stst);
61      }
62      
63      public McClusterTest( SurfTest stst,  int[] mcids)
64      {
65          super(mcids);
66          _stst=new SurfTest(stst);
67      }
68      
69      public McClusterTest( SurfTest stst,  List mcids)
70      {
71          super(mcids);
72          _stst=new SurfTest(stst);
73      }
74      
75      public McClusterTest(McClusterTest mct)
76      {
77          super(mct.mcIdArray());
78          _stst=new SurfTest(mct._stst);
79      }
80      
81      public String type()
82      { return staticType();
83      }
84      
85      public Surface surface()
86      { return _stst;
87      }
88  }
89  
90