View Javadoc

1   package org.lcsim.recon.tracking.trfcyl;
2   
3   
4   import org.lcsim.recon.tracking.trfbase.Interactor;
5   import org.lcsim.recon.tracking.trfbase.ETrack;
6   import org.lcsim.recon.tracking.trfbase.PropDir;
7   import org.lcsim.recon.tracking.trfbase.TrackVector;
8   import org.lcsim.recon.tracking.trfbase.TrackError;
9   
10  /**
11   * This class modifies the covariance matrix of a track
12   *corresponding to multiple
13   *scattering in a thin cylindrical shell whose material is
14   *represented by the number of radiation lengths.
15   *
16   *
17   *@author Norman A. Graf
18   *@version 1.0
19   *
20   */
21  public class ThinCylMs extends Interactor
22  {
23      
24      private double _radLength;
25      
26      //
27      
28      /**
29       * Construct an instance from the number of radiation
30       * lengths of the cylindrical shell material.
31       * The Interactor is constructed with the
32       * appropriate number of radiation lengths.
33       *
34       * @param   radLength The thickness of the material in radiation lengths.
35       */
36      public ThinCylMs(double radLength)
37      {
38          _radLength = radLength;
39      }
40      
41      //
42      
43      /**
44       *Interact the given track in this cylindrical shell,
45       *using the thin material approximation for multiple scattering.
46       *Note that the track parameters are not modified. Only the
47       *covariance matrix is updated to reflect the uncertainty caused
48       *by traversing the thin cylindrical shell of material.
49       *
50       * @param   tre The ETrack to scatter.
51       */
52      public void interact(ETrack tre)
53      {
54          // This can only be used with cylinders... check that we have one..
55          
56          TrackError cleanError = tre.error();
57          TrackError newError = cleanError;
58          
59          // set the rms scattering appropriate to this momentum
60          
61          // Theta = (0.0136 GeV)*(z/p)*(sqrt(rad_length))*(1+0.038*log(rad_length))
62          
63          
64          
65          TrackVector theVec = tre.vector();
66          double trackMomentum = Math.abs(theVec.get(SurfCylinder.IQPT)*Math.cos(Math.atan(theVec.get(SurfCylinder.ITLM))));
67          
68          double trueLength = _radLength/Math.abs(Math.cos(theVec.get(SurfCylinder.IALF)))*Math.sqrt(1.0 +
69                  theVec.get(SurfCylinder.ITLM)*theVec.get(SurfCylinder.ITLM));
70          
71          double stdTheta = (0.0136)*trackMomentum*Math.sqrt(trueLength)*
72                  (1 + 0.038*Math.log(trueLength));
73          
74          // The MS covariance matrix can now be set.
75          
76          // **************** code for matrix ***********************//
77          
78          
79          // Insert values for upper triangle... use symmetry to set lower.
80          
81          double stdThetaSqr = stdTheta*stdTheta;
82          double tlamSqr = theVec.get(SurfCylinder.ITLM)*theVec.get(SurfCylinder.ITLM);
83          //This gets a bit messy here...
84          // alpha term...
85          double val = newError.get(SurfCylinder.IALF,SurfCylinder.IALF)+stdThetaSqr*(1 + tlamSqr);
86          newError.set(SurfCylinder.IALF,SurfCylinder.IALF,val);
87          // tan(lambda) term...
88          val = newError.get(SurfCylinder.ITLM,SurfCylinder.ITLM) + stdThetaSqr*(1 + tlamSqr)*(1 + tlamSqr);
89          newError.set(SurfCylinder.ITLM,SurfCylinder.ITLM,val);
90          // q/pt term...
91          val = newError.get(SurfCylinder.IQPT,SurfCylinder.IQPT)+stdThetaSqr*theVec.get(SurfCylinder.IQPT)*theVec.get(SurfCylinder.IQPT)*tlamSqr;
92          newError.set(SurfCylinder.IQPT,SurfCylinder.IQPT,val);
93          val =  newError.get(SurfCylinder.ITLM,SurfCylinder.IQPT) + stdThetaSqr*theVec.get(SurfCylinder.ITLM)*theVec.get(SurfCylinder.IQPT) * (1.0 + tlamSqr);
94          // covariance term between tan(lambda) and q/pt...
95          newError.set(SurfCylinder.ITLM,SurfCylinder.IQPT,val);
96          newError.set(SurfCylinder.IQPT,SurfCylinder.ITLM,val);
97          
98          // ********************************************************//
99          
100         tre.setError( newError );
101         
102     }
103     
104     
105     public void interact_dir(ETrack theTrack, PropDir direction )
106     {
107         interact(theTrack);
108     }
109     
110     //
111     
112     /**
113      *Return the number of radiation lengths.
114      *
115      * @return The thickness of the scattering material in radiation lengths.
116      */
117     public double radLength()
118     {
119         return _radLength;
120     }
121     
122     //
123     
124     /**
125      *Make a clone of this object.
126      *
127      * @return A Clone of this instance.
128      */
129     public Interactor newCopy()
130     {
131         return new ThinCylMs(_radLength);
132     }
133     
134     
135     
136     /**
137      *output stream
138      *
139      * @return A String representation of this instance.
140      */
141     public String toString()
142     {
143         return "ThinCylMs with "+_radLength+" radiation lengths.";
144     }
145     
146 }
147