View Javadoc

1   /*
2    * SiliconRawHitMC.java
3    *
4    * Created on February 21, 2006, 5:44 PM
5    *
6    * To change this template, choose Tools | Template Manager
7    * and open the template in the editor.
8    */
9   
10  package org.lcsim.recon.tracking.digitization;
11  
12  import java.util.ArrayList;
13  import java.util.List;
14  import org.lcsim.event.MCParticle;
15  import org.lcsim.event.SimTrackerHit;
16  
17  /**
18   * A SiliconRawHit with information about the Monte Carlo particles 
19   * which contributed to this hit.
20   * @author ngraf
21   */
22  public class SiliconRawHitMC extends SiliconRawHit
23  {
24      private List<MCParticle> _mcParticles = new ArrayList<MCParticle>();
25      private List<SimTrackerHit> _mcHits = new ArrayList<SimTrackerHit>();
26      
27      /** Creates a new instance of SiliconRawHitMC */
28      public SiliconRawHitMC(int cellID0, int cellID1, int timeStamp, int adcCounts, MCParticle mcParticle)
29      {
30          super(cellID0, cellID1, timeStamp, adcCounts);
31          _mcParticles.add(mcParticle);
32      }
33      
34      public List<MCParticle> mcParticles()
35      {
36          return _mcParticles;
37      }
38      
39      public void addHit(int timeStamp, int adcCounts, SimTrackerHit hit)
40      {
41          addHit(timeStamp, adcCounts);
42          _mcParticles.add(hit.getMCParticle());
43          _mcHits.add(hit);
44      }
45      
46      public void addHit(SiliconRawHitMC hit)
47      {
48          addHit( hit.getTimeStamp(), hit.getADCCounts());
49          _mcParticles.addAll(hit.mcParticles());
50          _mcHits.addAll(hit.simTrackerHits());
51      }
52  
53      public List<SimTrackerHit> simTrackerHits()
54      {
55          return _mcHits;
56      }
57  }