Newer
Older
FairShipTools / Katerina / doc / html / StrawHits_8py_source.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Python: StrawHits.py Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Python
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">StrawHits.py</div>  </div>
</div><!--header-->
<div class="contents">
<a href="StrawHits_8py.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"><a class="line" href="namespaceStrawHits.html">    1</a></span>&#160;<span class="keyword">import</span> ROOT,os,sys,getopt</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="keyword">import</span> rootUtils <span class="keyword">as</span> ut</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="keyword">import</span> shipunit <span class="keyword">as</span> u</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="keyword">from</span> pythia8_conf <span class="keyword">import</span> addHNLtoROOT</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="keyword">from</span> array <span class="keyword">import</span> array</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="keyword">import</span> RecoSettings</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">from</span> FitTrackInfo <span class="keyword">import</span> FitTrackInfo</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html">   12</a></span>&#160;<span class="keyword">class </span><a class="code" href="classStrawHits_1_1StrawHits.html">StrawHits</a>(object):</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;  <span class="stringliteral">&quot;&quot;&quot;StrawHit class&quot;&quot;&quot;</span>  </div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a48decae5ea4b5f021f560b3b2d322617">   14</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a48decae5ea4b5f021f560b3b2d322617">__init__</a>(self, tree, modules, resolution, debug=0, mhistdict=None, ship_geo=None):</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    <span class="comment">## root tree to be read.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#aaa2456d54ca6081bc8548eb2f8d59219">   16</a></span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#aaa2456d54ca6081bc8548eb2f8d59219">__tree</a>    = tree</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <span class="comment">## geometry description modules. </span></div>
<div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#aac9a9101e965e151ba490eb750e57a92">   18</a></span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#aac9a9101e965e151ba490eb750e57a92">__modules</a> = modules</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    <span class="comment">## debug level [0,3]</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">   20</a></span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>   = debug</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="comment">## hit resolition</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#ad8361407d10cf89e4233f652d5348919">   22</a></span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad8361407d10cf89e4233f652d5348919">__resolution</a> = resolution</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    <span class="comment">## {MCtrackID : [{&#39;pos&#39;:TVector3, &#39;det&#39;:detID, &#39;dw&#39;:distance to wire, &#39;smdw&#39;: smeared dw} where [TVector3] list of each hit position. Created if MCtrackID&gt;0.</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">   24</a></span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>     = {}</div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#ac2c5e012bc6b6a78f8008cfb176cde06">   25</a></span>&#160;    <span class="comment">##</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#ac2c5e012bc6b6a78f8008cfb176cde06">__oldSmearedHits</a> ={}</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <span class="comment">## {MCtrackID : {X : TVector3}} where x=&#39;entry&#39; or &#39;exit&#39;, TVector3 coordinates of last or first hit. </span></div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">   28</a></span>&#160;    <span class="comment">## Created for tracks with more than #RecoSettings .trackMinNofHits hits.</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a> = {} </div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a0aba6263d7c7d83cee880a3dbaf8931a">   30</a></span>&#160;    <span class="comment">## {MCtrackID : number of hits at Z&lt;0 (veto tracker)}.</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0aba6263d7c7d83cee880a3dbaf8931a">__vetoHits</a>      = {}</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#aeb977fd03ff90657c43db0110cffe1fb">   32</a></span>&#160;    <span class="comment">## {MCtrackID: number of crossed stations (exclude veto tracker)}.</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#aeb977fd03ff90657c43db0110cffe1fb">__nStations</a>       = {}</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a8c32e1e97ffc82135a76b564f23ffd54">   34</a></span>&#160;    <span class="comment">## root random engent for hit smearing (see #__hitSmear).</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a8c32e1e97ffc82135a76b564f23ffd54">__random</a>        = ROOT.TRandom()</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    ROOT.gRandom.SetSeed(13)</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="comment">#fitter          = ROOT.genfit.KalmanFitter()</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a1fae7caaa752bb302f3ee108c6957c50">   38</a></span>&#160;    <span class="comment">#fitter          = ROOT.genfit.KalmanFitterRefTrack()</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a1fae7caaa752bb302f3ee108c6957c50">__fitter</a>          = ROOT.genfit.DAF()</div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a62170847a3f9e5961bcdf3dda22d9e40">   40</a></span>&#160;    <span class="comment"># refitted traks</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a0f7aef7f59605a2aad9f286cf034a55a">   41</a></span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a62170847a3f9e5961bcdf3dda22d9e40">__reFitTracks</a> = <a class="code" href="classFitTrackInfo_1_1FitTrackInfo.html">FitTrackInfo</a>(tree=<span class="keywordtype">None</span>, debug = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>)</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0f7aef7f59605a2aad9f286cf034a55a">__docaEval</a>    = []</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    </div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="keywordflow">if</span> (mhistdict <span class="keywordflow">and</span> ship_geo) :</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;      fm  = ROOT.genfit.FieldManager.getInstance()</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;      <span class="comment"># copy from python/shipDet_conf.py</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;      sbf =  ROOT.ShipBellField(<span class="stringliteral">&quot;wilfried&quot;</span>, ship_geo.Bfield.max,ship_geo.Bfield.z,2,ship_geo.Yheight/2.*u.m )</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;      <span class="keywordflow">for</span> i <span class="keywordflow">in</span> range (0,300):</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    z = 1000. + i*10</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    pvec3  = ROOT.TVector3(0,0,z)</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    fx = ROOT.Double(0)</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    fy = ROOT.Double(0)</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    fz = ROOT.Double(0)</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="comment">#fvec3f = fm.getField().get(pvec3)</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    fm.getField().get(0,0,z,fx,fy,fz)</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    fvec3f = ROOT.TVector3(fx,fy,fz)</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    </div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    fvec3s = ROOT.TVector3( sbf.GetBx(pvec3.X(),pvec3.Y(),pvec3.Z()),sbf.GetBy(pvec3.X(),pvec3.Y(),pvec3.Z()),sbf.GetBz(pvec3.X(),pvec3.Y(),pvec3.Z()))</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;      </div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="comment">#print z,    &quot;  &quot;.join(&quot;{:10.4f}&quot;.format(fvec3f(ii)) for ii in range(0,3)),</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="comment">#print &quot;\t&quot;, &quot;  &quot;.join(&quot;{:10.4f}&quot;.format(fvec3s(ii)) for ii in range(0,3))</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    mhistdict[<span class="stringliteral">&#39;magZfit&#39;</span>].Fill(z,fvec3f.Mag())</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    mhistdict[<span class="stringliteral">&#39;magZsim&#39;</span>].Fill(z,fvec3s.Mag())</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    </div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;      zdict = {1:2500., 2:2800., 3:3000.}</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;      <span class="keywordflow">for</span> zi <span class="keywordflow">in</span> zdict:</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keywordflow">for</span> xi <span class="keywordflow">in</span> range (-30, 30):</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;      <span class="keywordflow">for</span> yi <span class="keywordflow">in</span> range (-30,30):</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        x = xi*10.</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        y = yi*10.</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        pvec3 = ROOT.TVector3(x, y, zdict[zi])</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        fx = ROOT.Double(0)</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        fy = ROOT.Double(0)</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        fz = ROOT.Double(0)</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <span class="comment">#fvec3f = fm.getField().get(pvec3)</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        fm.getField().get(x,y,zdict[zi],fx,fy,fz)</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        fvec3f = ROOT.TVector3(fx,fy,fz)</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        fvec3s = ROOT.TVector3( sbf.GetBx(pvec3.X(),pvec3.Y(),pvec3.Z()),sbf.GetBy(pvec3.X(),pvec3.Y(),pvec3.Z()),sbf.GetBz(pvec3.X(),pvec3.Y(),pvec3.Z()))</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <span class="comment">#print x, &quot;   &quot;, y, &quot;   &quot;, zdict[zi],</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="comment">#print &quot;\t&quot;, &quot;  &quot;.join(&quot;{:10.4f}&quot;.format(fvec3f(ii)) for ii in range(0,3)),</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="comment">#print &quot;\t&quot;, &quot;  &quot;.join(&quot;{:10.4f}&quot;.format(fvec3s(ii)) for ii in range(0,3))</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        mhistdict[<span class="stringliteral">&#39;magXY&#39;</span>+str(zi)+<span class="stringliteral">&quot;fit&quot;</span>].Fill(x, y,fvec3f.Mag())</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        mhistdict[<span class="stringliteral">&#39;magXY&#39;</span>+str(zi)+<span class="stringliteral">&quot;sim&quot;</span>].Fill(x, y,fvec3s.Mag())</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;  <span class="comment">## \brief to be called for each new event (called in #readEvent())</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <span class="comment"># cleans all dictionaries (#__trackHits, #__trackEdgeHits, #__vetoHits, #__nStations).</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a05c164606532ecb264d38d320e714020">   90</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a05c164606532ecb264d38d320e714020">__clean</a>(self):</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    self.__trackHits.clear()</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    self.__oldSmearedHits.clear()</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    self.__trackEdgeHits.clear()</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    self.__vetoHits.clear()</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    self.__nStations.clear()</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0f7aef7f59605a2aad9f286cf034a55a">__docaEval</a>    = []</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    </div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  <span class="comment">## \brief returns list of keys #__trackEdgeHits (MCtrackIDs&gt;0 with more than #RecoSettings .trackMinNofHits hits).</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  <span class="comment">#  \return list of MCtrackIDs of &quot;good&quot; tracks.</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a9bc5a6aa025d639c6fd6a8ad5e492227">  102</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a9bc5a6aa025d639c6fd6a8ad5e492227">getTrIDs</a>(self):</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    trID = []</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keywordflow">for</span> tid <span class="keywordflow">in</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>:</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;      trID.append(tid)</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordflow">return</span> trID</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  <span class="comment">## \brief returns list of keys #__trackHits (MCtrackIDs&gt;0.</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;  <span class="comment">#  \return list of MCtrackIDs of MC assigned tracks.</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a9b2f62145f4c30c69e42dfafbbd451c1">  112</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a9b2f62145f4c30c69e42dfafbbd451c1">getTrIDsALL</a>(self):</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    trID = []</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="keywordflow">for</span> tid <span class="keywordflow">in</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>:</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;      trID.append(tid)</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keywordflow">return</span> trID</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  <span class="comment">## \brief returns list of keys #__reFitTracks.</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  <span class="comment">#  \return list of MCtrackIDs of &quot;good&quot; tracks.</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#acb97ae2ff666fe817f32fa64cb79b027">  122</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#acb97ae2ff666fe817f32fa64cb79b027">getReFitTrIDs</a>(self):</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordflow">return</span> self.__reFitTracks.getTrIDs()</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  </div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;  </div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a3767e6b8b7c3d2c72d8ee5cab1780916">  127</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a3767e6b8b7c3d2c72d8ee5cab1780916">getReFitChi2Ndf</a>(self,tid):</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keywordflow">return</span> self.__reFitTracks.getChi2Ndf(tid)</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  </div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  </div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a6a3cd5817218a7bb46d771955ba7b1c2">  132</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a6a3cd5817218a7bb46d771955ba7b1c2">getReFitNdf</a>(self,tid):</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keywordflow">return</span> self.__reFitTracks.getNdf(tid)</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  </div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  </div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;  <span class="comment">## \brief returns vertex (if number of tracks!=2 will return None!).</span></div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  <span class="comment">#  \return new vertex (if number of tracks!=2 will return None!).</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a4c1e2091baa4551cc510f92400c702e4">  140</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a4c1e2091baa4551cc510f92400c702e4">getReFitVertex</a>(self):</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    <span class="keywordflow">return</span> self.__reFitTracks.getVertex()</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;  <span class="comment">## \brief returns doca&#39;s of each extrapolation steps (size is defined in #RecoSettings .VertexExtrSteps).</span></div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;  <span class="comment">#  \return new vertex (if number of tracks!=2 will return None!).</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#aefb7ae25c67992b8fa5aa2cadc0a01b1">  149</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#aefb7ae25c67992b8fa5aa2cadc0a01b1">getStepDoca</a>(self, step):</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordflow">if</span> ( step&gt;RecoSettings.VertexExtrSteps <span class="keywordflow">or</span> (<span class="keywordflow">not</span> self.__reFitTracks.Vertex) ) : <span class="keywordflow">return</span> <span class="keywordtype">None</span></div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    <span class="keywordflow">return</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0f7aef7f59605a2aad9f286cf034a55a">__docaEval</a>[step]</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;  <span class="comment">## \brief returns vertex (if number of tracks!=2 will return None!).</span></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;  <span class="comment">#  \return new vertex (if number of tracks!=2 will return None!).</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a3c32c037cb8638d136b805b62182f5e1">  157</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a3c32c037cb8638d136b805b62182f5e1">getReFitPosDirPval</a>(self, tid):</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordflow">return</span> self.__reFitTracks.getPosDirPval(tid)</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;  </div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;  </div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;  <span class="comment">## \brief returns number of hits in proper tracker stations (Z&gt;0) calculated from #__trackHits and #__vetoHits.</span></div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;  <span class="comment">#  \param tid - MCtrackID.</span></div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;  <span class="comment">#  \return number of hits in proper tracker stations (Z&gt;0).</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a93a1a8fc6260b0bd1ecad3448c1efb00">  165</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a93a1a8fc6260b0bd1ecad3448c1efb00">getNofPHits</a>(self, tid):</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keywordflow">return</span> len(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[tid]) - self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0aba6263d7c7d83cee880a3dbaf8931a">__vetoHits</a>[tid]</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;  <span class="comment">## \brief returns TVector3 of a tracker entry hit (Z&gt;0) from #__trackEdgeHits.</span></div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;  <span class="comment">#  \param tid - MCtrackID.</span></div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;  <span class="comment">#  \return position of a tracker entry hit (Z&gt;0) from #__trackEdgeHits.</span></div>
<div class="line"><a name="l00173"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a36a22796964abef83666fa091b348df9">  173</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a36a22796964abef83666fa091b348df9">getStartHit</a>(self, tid):</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    <span class="keywordflow">return</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[tid][<span class="stringliteral">&#39;entry&#39;</span>]</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    </div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;  <span class="comment">## \brief returns number of hits with Z&lt;0 of #__trackHits.</span></div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;  <span class="comment">#  \param tid - MCtrackID.</span></div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;  <span class="comment">#  \return number of hits with Z&lt;0 of #__trackHits.</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#ab67fb92dfa9fe98f6374e677d7e72223">  181</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#ab67fb92dfa9fe98f6374e677d7e72223">checkVetoHits</a>(self, tid):</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    vh = 0</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keywordflow">if</span> tid <span class="keywordflow">in</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0aba6263d7c7d83cee880a3dbaf8931a">__vetoHits</a>:</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;      vh = self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0aba6263d7c7d83cee880a3dbaf8931a">__vetoHits</a>[tid]</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    <span class="keywordflow">return</span> vh</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#ad5d90b2675b9763f1c84a7f1a519f736">  189</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#ad5d90b2675b9763f1c84a7f1a519f736">PrintNewTracks</a>(self):</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&quot;new Fits: &quot;</span>,</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    self.__reFitTracks.Print()</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;<span class="comment">########################################################################      </span></div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;</div>
<div class="line"><a name="l00195"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#aca9ae66051a12143d8b1d1bd496a8662">  195</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#aca9ae66051a12143d8b1d1bd496a8662">compareFitTracks</a>(self, tid, theFitTracks):</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    pos, direct, pval = theFitTracks.getPosDirPval(tid)</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="keywordflow">return</span> self.__reFitTracks.compareTracks(tid, pos, direct, pval)</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    </div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;<span class="comment">########################################################################      </span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;  <span class="comment">## \brief returns a dictionary {xtop, ytop, z, ybot, ybot, z, dist} for a smeared hit.</span></div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;  <span class="comment">#  \param tid - MCtrackID.</span></div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;  <span class="comment">#  \param hid - hit index of #__trackHits</span></div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;  <span class="comment">#  \param new - to generate new smearing (True) or get from SmearedHits (det.position still recalculated!)</span></div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;  <span class="comment">#  \return a dictionary {xtop, ytop, z, ybot, ybot, z, dist} for a smeared hit.</span></div>
<div class="line"><a name="l00205"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#ad5f6e4bfd1342927d9c683941d787626">  205</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#ad5f6e4bfd1342927d9c683941d787626">__hitSmear</a>(self,tid,hid, new=False):</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    top   = ROOT.TVector3()</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    bot   = ROOT.TVector3()</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    dw    = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[tid][hid][<span class="stringliteral">&#39;dw&#39;</span>]</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    detID = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[tid][hid][<span class="stringliteral">&#39;det&#39;</span>]</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    </div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#aac9a9101e965e151ba490eb750e57a92">__modules</a>[<span class="stringliteral">&quot;Strawtubes&quot;</span>].StrawEndPoints(detID,bot,top)</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    </div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    if( new ):</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;      smear = abs(self.__random.Gaus(dw, self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad8361407d10cf89e4233f652d5348919">__resolution</a>))</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <span class="keywordflow">else</span>:</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;      smear = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[tid][hid][<span class="stringliteral">&#39;smdw&#39;</span>]</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    smearedHit = {<span class="stringliteral">&#39;xtop&#39;</span>:top.x(),<span class="stringliteral">&#39;ytop&#39;</span>:top.y(),<span class="stringliteral">&#39;z&#39;</span>:top.z(),<span class="stringliteral">&#39;xbot&#39;</span>:bot.x(),<span class="stringliteral">&#39;ybot&#39;</span>:bot.y(),<span class="stringliteral">&#39;z&#39;</span>:bot.z(),<span class="stringliteral">&#39;dist&#39;</span>:smear}</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;2):</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;\tsmear :&quot;</span>, <span class="stringliteral">&quot;&quot;</span>.join(<span class="stringliteral">&quot;{:8.2f}&quot;</span>.format(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[tid][hid][<span class="stringliteral">&#39;pos&#39;</span>](ii)) <span class="keywordflow">for</span> ii <span class="keywordflow">in</span> range(0,3)),  </div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;{:6.2f}&quot;</span>.format(dw),</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;\t(xt,xb, yt, yb, z, dw) : &quot;</span>,</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;      <span class="keywordflow">for</span> x <span class="keywordflow">in</span> [<span class="stringliteral">&#39;xtop&#39;</span>,<span class="stringliteral">&#39;xbot&#39;</span>, <span class="stringliteral">&#39;ytop&#39;</span>,<span class="stringliteral">&#39;ybot&#39;</span>,<span class="stringliteral">&#39;z&#39;</span>, <span class="stringliteral">&#39;dist&#39;</span>]:</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&quot;&quot;</span>.join(<span class="stringliteral">&quot;{:8.2f}&quot;</span>.format(smearedHit[x])),  </div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;&quot;</span></div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="keywordflow">return</span> smearedHit</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;<span class="comment">########################################################################</span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;  <span class="comment">## \brief to be called per each event. Fills #__trackHits, #__trackEdgeHits, #__vetoHits, #__nStations.</span></div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;  <span class="comment">#  \return number of &quot;good&quot; tracks (size of #__trackEdgeHits)</span></div>
<div class="line"><a name="l00232"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#ad53933e2cc71c51134b86f40904e3458">  232</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#ad53933e2cc71c51134b86f40904e3458">readEvent</a>(self):</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a05c164606532ecb264d38d320e714020">__clean</a>()</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    toSort      = [] <span class="comment"># list of MCtrackID which has unsorted hits (I saw also hits from different tracks assigned to the same MCtrackID)</span></div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    stationList = {} <span class="comment"># {MCtrackID:[stations]}</span></div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    </div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    <span class="comment"># loop over all hits and fill __trackHits[MCtrackID]</span></div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    hindx = -1</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="keywordflow">for</span> ahit <span class="keywordflow">in</span> self.__tree.strawtubesPoint:</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;      detID   = ahit.GetDetectorID()</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;      trID    = ahit.GetTrackID()</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;      </div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;      <span class="comment"># get old smearing</span></div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;      hindx +=1</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;      origSmHit = self.__tree.SmearedHits.At(hindx)</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;      if( (abs(ahit.GetZ()-origSmHit[3])&gt;0.8) <span class="keywordflow">or</span> (abs(ahit.dist2Wire()-origSmHit[7])&gt;0.2) ):</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&quot;problem getting smeared his, but do not change anything&quot;</span> </div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&quot;=&gt;&quot;</span>, ahit.GetZ(), origSmHit[3], ahit.dist2Wire(), origSmHit[7]</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <span class="comment"># m = array(&#39;d&#39;,[i,sm[&#39;xtop&#39;],sm[&#39;ytop&#39;],sm[&#39;z&#39;],sm[&#39;xbot&#39;],sm[&#39;ybot&#39;],sm[&#39;z&#39;],sm[&#39;dist&#39;]])</span></div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;      </div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;      <span class="comment">#=&gt;</span></div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;      if(trID&lt;0): <span class="keywordflow">continue</span> <span class="comment"># these are hits not assigned to MC track because low E cut</span></div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;      </div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;      <span class="keywordflow">if</span> (<span class="keywordflow">not</span> self.__trackHits.has_key(trID)): </div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID] = []</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    stationList[trID]      = []</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;      hinfo = {}</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;      hinfo[<span class="stringliteral">&#39;pos&#39;</span>]  = ROOT.TVector3(ahit.GetX(), ahit.GetY(), ahit.GetZ()) </div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;      hinfo[<span class="stringliteral">&#39;det&#39;</span>]  = ahit.GetDetectorID()</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;      hinfo[<span class="stringliteral">&#39;dw&#39;</span>]   = ahit.dist2Wire()</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;      hinfo[<span class="stringliteral">&#39;smdw&#39;</span>] = origSmHit[7]</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;      self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID].append(hinfo)</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;      </div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;      lastIndx = len(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID])-1</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;      if( self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][lastIndx][<span class="stringliteral">&#39;pos&#39;</span>].Z() &lt; self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][lastIndx-1][<span class="stringliteral">&#39;pos&#39;</span>].Z() ):</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    if( <span class="keywordflow">not</span> trID <span class="keywordflow">in</span> toSort):</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;      toSort.append(trID)</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;      if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;0): <span class="keywordflow">print</span> <span class="stringliteral">&quot;StrawHitsEntry: wrong order of hits for track &quot;</span>, trID</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;      </div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;      station = int(ahit.GetDetectorID()/10000000)</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;      <span class="keywordflow">if</span> station &gt; 4 : <span class="keywordflow">continue</span></div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;      <span class="keywordflow">if</span> ( <span class="keywordflow">not</span> station <span class="keywordflow">in</span> stationList[trID]) : stationList[trID].append(station)</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;      </div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    <span class="comment"># sort</span></div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    <span class="keywordflow">for</span> trID <span class="keywordflow">in</span> toSort:</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;      if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;0): <span class="keywordflow">print</span> <span class="stringliteral">&quot;StrawHitsEntry: will sort hits for track &quot;</span>, trID</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;      if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;2):</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&quot;\t\thits to be sorted&quot;</span></div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <span class="keywordflow">for</span> hinfo <span class="keywordflow">in</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID]:</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;      vec3 = hinfo[<span class="stringliteral">&#39;pos&#39;</span>]</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;\t\t\t\t&quot;</span>, vec3.X(), <span class="stringliteral">&quot;\t&quot;</span>, vec3.Y(), <span class="stringliteral">&quot;\t&quot;</span>, vec3.Z(), hinfo[<span class="stringliteral">&#39;dw&#39;</span>]</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;      self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID].sort(key=<span class="keyword">lambda</span> x: x[<span class="stringliteral">&#39;pos&#39;</span>].Z(), reverse=<span class="keyword">False</span>)</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;      if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;2):</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&quot;\t\thits after sorting&quot;</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    <span class="keywordflow">for</span> hinfo <span class="keywordflow">in</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID]:</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;      vec3 = hinfo[<span class="stringliteral">&#39;pos&#39;</span>]</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;\t\t\t\t&quot;</span>, vec3.X(), <span class="stringliteral">&quot;\t&quot;</span>, vec3.Y(), <span class="stringliteral">&quot;\t&quot;</span>, vec3.Z(), hinfo[<span class="stringliteral">&#39;dw&#39;</span>]</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    </div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    <span class="comment"># fill self.__nStations</span></div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    <span class="keywordflow">for</span> trID <span class="keywordflow">in</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>:</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;      self.<a class="code" href="classStrawHits_1_1StrawHits.html#aeb977fd03ff90657c43db0110cffe1fb">__nStations</a>[trID] = len(stationList[trID])</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;      if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;0):</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&quot;Number of crossed stations (trID:n)&quot;</span>, trID, <span class="stringliteral">&quot; : &quot;</span>, self.<a class="code" href="classStrawHits_1_1StrawHits.html#aeb977fd03ff90657c43db0110cffe1fb">__nStations</a>[trID]</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    </div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    <span class="comment"># find entry and exit positions</span></div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    <span class="keywordflow">for</span> trID <span class="keywordflow">in</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>:</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;      if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;1):</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&quot;hits for trID &quot;</span>, trID</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;    <span class="keywordflow">for</span> hinfo <span class="keywordflow">in</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID]:</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;      vec3 = hinfo[<span class="stringliteral">&#39;pos&#39;</span>]</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;\t&quot;</span>, vec3.X(), <span class="stringliteral">&quot;\t&quot;</span>, vec3.Y(), <span class="stringliteral">&quot;\t&quot;</span>, vec3.Z(), hinfo[<span class="stringliteral">&#39;dw&#39;</span>]</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;      if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;0): <span class="keywordflow">print</span> <span class="stringliteral">&quot;start/stop position for hits of track &quot;</span>, trID     </div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;      <span class="comment">#find number of vetoTracker hits</span></div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;      firstHit = 0</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;      nHits    = len(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID])</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;      while( firstHit&lt;nHits <span class="keywordflow">and</span> (self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][firstHit][<span class="stringliteral">&#39;pos&#39;</span>].Z()&lt;0) ): </div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    firstHit+=1</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    </div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;      <span class="comment"># =&gt;</span></div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;      <span class="comment"># the EdgeHits are filled only if nHits(stations1-4)&gt;25</span></div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;      if( (firstHit&lt;nHits) <span class="keywordflow">and</span> ((nHits-firstHit)&gt;RecoSettings.trackMinNofHits) ):</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[trID] = {}   </div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[trID][<span class="stringliteral">&#39;entry&#39;</span>]    = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][firstHit][<span class="stringliteral">&#39;pos&#39;</span>]</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[trID][<span class="stringliteral">&#39;exit&#39;</span>]     = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][-1][<span class="stringliteral">&#39;pos&#39;</span>]</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0aba6263d7c7d83cee880a3dbaf8931a">__vetoHits</a>[trID]                  = firstHit</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;    if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;0):</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;      <span class="keywordflow">for</span> pos <span class="keywordflow">in</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[trID]:</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;        vec3 = self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[trID][pos]</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;        <span class="keywordflow">print</span> <span class="stringliteral">&quot;\t&quot;</span>, pos, vec3.X(), <span class="stringliteral">&quot;\t&quot;</span>, vec3.Y(), <span class="stringliteral">&quot;\t&quot;</span>, vec3.Z()</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;      elif( self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;0): <span class="keywordflow">print</span> <span class="stringliteral">&quot;not set due to small number of hits&quot;</span></div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;    <span class="keywordflow">return</span> len(self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>)</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;<span class="comment">########################################################################    </span></div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;    </div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;</div>
<div class="line"><a name="l00330"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#aca7d347a78937cf8b7384f3f7d2f9cf4">  330</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#aca7d347a78937cf8b7384f3f7d2f9cf4">__getIniDir</a>(self,trID):</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;    v1 = self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[trID][<span class="stringliteral">&#39;entry&#39;</span>]</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    i2 = self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0aba6263d7c7d83cee880a3dbaf8931a">__vetoHits</a>[trID]+1 </div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;    if( len(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID])&gt;i2 ):</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;      v2 = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][i2][<span class="stringliteral">&#39;pos&#39;</span>]</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;      dv = v2-v1</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;    <span class="keywordflow">else</span>: </div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;      dv = ROOT.TVector3(0., 0., 1.) </div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;      if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;0):</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&quot;trying to get initial direction having just one hit, will set (0,0,1)&quot;</span></div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;    <span class="keywordflow">return</span> dv*(1./dv.Mag())</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;  </div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;  </div>
<div class="line"><a name="l00343"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a76d7648ab2e960d209d7713e175d1031">  343</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a76d7648ab2e960d209d7713e175d1031">__prepareIniPosMomCov</a>(self, tid, original=True):</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;    <span class="keywordflow">if</span> ( original ) :</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;      pos = ROOT.TVector3(0, 0, 0)</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;      mom = ROOT.TVector3(0,0,3.*u.GeV)</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;      cov = ROOT.TMatrixDSym(6)</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;      resolution = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad8361407d10cf89e4233f652d5348919">__resolution</a></div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;      <span class="keywordflow">for</span>  i <span class="keywordflow">in</span> range(3):   cov[i][i] = resolution*resolution</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;      cov[0][0]=resolution*resolution*100.</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;      nM = self.<a class="code" href="classStrawHits_1_1StrawHits.html#a93a1a8fc6260b0bd1ecad3448c1efb00">getNofPHits</a>(tid)</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;      <span class="keywordflow">for</span>  i <span class="keywordflow">in</span> range(3,6): cov[i][i] = ROOT.TMath.pow(resolution / nM / ROOT.TMath.sqrt(3), 2)</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;    <span class="keywordflow">else</span>:</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;      pos = self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[tid][<span class="stringliteral">&#39;entry&#39;</span>]</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;      mom = self.<a class="code" href="classStrawHits_1_1StrawHits.html#aca7d347a78937cf8b7384f3f7d2f9cf4">__getIniDir</a>(tid)</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;      cov = ROOT.TMatrixDSym(6)</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;      resolution = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad8361407d10cf89e4233f652d5348919">__resolution</a></div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;      <span class="keywordflow">for</span>  i <span class="keywordflow">in</span> range(3):   cov[i][i] = resolution*resolution</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;      cov[0][0]=resolution*resolution*100.</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;      nM = self.<a class="code" href="classStrawHits_1_1StrawHits.html#a93a1a8fc6260b0bd1ecad3448c1efb00">getNofPHits</a>(tid)</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;      <span class="keywordflow">for</span>  i <span class="keywordflow">in</span> range(3,6): cov[i][i] = ROOT.TMath.pow(resolution / nM / ROOT.TMath.sqrt(3), 2)      </div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;    <span class="keywordflow">return</span> pos, mom, cov    </div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;<span class="comment">######################################################################## </span></div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;</div>
<div class="line"><a name="l00367"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a166e6a9121b32fa99c5a70986ad26a88">  367</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#a166e6a9121b32fa99c5a70986ad26a88">__prepareWireMeasurements</a>(self, tid, fTrack):</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;    <span class="comment">#WireMeasurement::WireMeasurement(const TVectorD&amp; rawHitCoords, </span></div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;    <span class="comment">#                                 const TMatrixDSym&amp; rawHitCov, </span></div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;    <span class="comment">#                                 int detId, </span></div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;    <span class="comment">#                                 int hitId, </span></div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;    <span class="comment">#                                 genfit::TrackPoint* trackPoint)</span></div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;    <span class="comment"># per each proper hit  TMP ??? does it make sense to do for tracks with __vetoHits&gt;0???</span></div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;    <span class="comment">#self.__measurements4fit[trID] = []</span></div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    <span class="keywordflow">for</span> hindx <span class="keywordflow">in</span> range (self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0aba6263d7c7d83cee880a3dbaf8931a">__vetoHits</a>[tid], len(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[tid])):</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;      sm          = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad5f6e4bfd1342927d9c683941d787626">__hitSmear</a>(tid,hindx)</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;      mVector     = ROOT.TVectorD(7,array(<span class="stringliteral">&#39;d&#39;</span>,[sm[<span class="stringliteral">&#39;xtop&#39;</span>],sm[<span class="stringliteral">&#39;ytop&#39;</span>],sm[<span class="stringliteral">&#39;z&#39;</span>],sm[<span class="stringliteral">&#39;xbot&#39;</span>],sm[<span class="stringliteral">&#39;ybot&#39;</span>],sm[<span class="stringliteral">&#39;z&#39;</span>],sm[<span class="stringliteral">&#39;dist&#39;</span>]]))</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;      <span class="comment">#self.__measurements4fit[trID].push_back(mVector)</span></div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;      hitCov       = ROOT.TMatrixDSym(7)</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;      hitCov[6][6] = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad8361407d10cf89e4233f652d5348919">__resolution</a>*self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad8361407d10cf89e4233f652d5348919">__resolution</a></div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;      tp = ROOT.genfit.TrackPoint(fTrack) <span class="comment"># note how the point is told which track it belongs to </span></div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;      measurement = ROOT.genfit.WireMeasurement(mVector,hitCov,1,6,tp) <span class="comment"># the measurement is told which trackpoint it belongs to</span></div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;      <span class="comment"># print measurement.getMaxDistance()</span></div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;      measurement.setMaxDistance(0.5*u.cm)</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;      <span class="comment">#measurement.setLeftRightResolution(-1)</span></div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;      tp.addRawMeasurement(measurement) <span class="comment"># package measurement in the TrackPoint                                          </span></div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;      if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;2):</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;    tp.Print()</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;      fTrack.insertPoint(tp)  <span class="comment"># add point to Track</span></div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;<span class="comment">######################################################################## </span></div>
<div class="line"><a name="l00399"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#afce2af1d22711c4291b7cd7f3ca51641">  399</a></span>&#160;  <span class="keyword">def </span><a class="code" href="classStrawHits_1_1StrawHits.html#afce2af1d22711c4291b7cd7f3ca51641">FitTracks</a>(self, old=True):</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;    </div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;    self.__reFitTracks.clean()</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;    </div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;    fitTrack = {}</div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;    <span class="comment">#self.__measurements4fit = {}</span></div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;    nTrack = -1</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;</div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;    <span class="keywordflow">for</span> trID <span class="keywordflow">in</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a> : <span class="comment"># these are already tracks with large number of hits</span></div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;      <span class="comment">#print &quot;track entry&quot;, self.__trackEdgeHits[tid][&#39;entry&#39;]. </span></div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;      <span class="comment">#print &quot;mfield: &quot;, ROOT</span></div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;      </div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;      <span class="comment"># minimal requirements on number of crossed stations</span></div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;      <span class="keywordflow">if</span> ( self.<a class="code" href="classStrawHits_1_1StrawHits.html#aeb977fd03ff90657c43db0110cffe1fb">__nStations</a>&lt;RecoSettings.trackMinNofStations): <span class="keywordflow">continue</span></div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;      </div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;      pdg = self.__tree.MCTrack[trID].GetPdgCode()</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;      </div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;      <span class="comment"># remove unknown or neutral particles </span></div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;      charge = <a class="code" href="namespaceRecoSettings.html#aa7af3e34857fc86f30ffbbaa1ce4f817">RecoSettings.chargePDG</a>(pdg)</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;      if( (<span class="keywordflow">not</span> charge) <span class="keywordflow">or</span> (charge==0) ): </div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&quot;StrawHits.FitTracks for TrID &quot;</span>, trID, <span class="stringliteral">&quot;finds charge of track of &quot;</span>, charge, <span class="stringliteral">&quot; and does nothing.&quot;</span></div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    <span class="keywordflow">continue</span></div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;</div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;      posM, momM, covM = self.<a class="code" href="classStrawHits_1_1StrawHits.html#a76d7648ab2e960d209d7713e175d1031">__prepareIniPosMomCov</a>(trID,old)</div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;      </div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;      rep          = ROOT.genfit.RKTrackRep(pdg)</div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;      stateSmeared = ROOT.genfit.MeasuredStateOnPlane(rep)</div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;      rep.setPosMomCov(stateSmeared, posM, momM, covM)</div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;</div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;      seedState = ROOT.TVectorD(6)</div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;      seedCov   = ROOT.TMatrixDSym(6)</div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;      rep.get6DStateCov(stateSmeared, seedState, seedCov)</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;      </div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;      fitTrack[trID] = ROOT.genfit.Track(rep, seedState, seedCov)</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;      ROOT.SetOwnership(fitTrack[trID], <span class="keyword">False</span>)</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;      </div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;      if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>&gt;2): <span class="keywordflow">print</span> <span class="stringliteral">&quot;preparing measurements for track ID&quot;</span>, trID</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;      self.<a class="code" href="classStrawHits_1_1StrawHits.html#a166e6a9121b32fa99c5a70986ad26a88">__prepareWireMeasurements</a>(trID, fitTrack[trID])</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;      </div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;      </div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;      <span class="keywordflow">if</span> <span class="keywordflow">not</span> fitTrack[trID].checkConsistency():</div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&#39;Problem with track before fit, not consistent&#39;</span>,self.fitTrack[atrack]</div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;    <span class="keywordflow">continue</span></div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;      <span class="keywordflow">try</span>:  self.__fitter.processTrack(fitTrack[trID]) <span class="comment"># processTrackWithRep(fitTrack[atrack],rep,True)</span></div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;      <span class="keywordflow">except</span>: </div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;genfit failed to fit track&quot;</span></div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;      <span class="keywordflow">continue</span></div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;      <span class="keywordflow">if</span> <span class="keywordflow">not</span> fitTrack[trID].checkConsistency():</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;    <span class="keywordflow">print</span> <span class="stringliteral">&#39;Problem with track after fit, not consistent&#39;</span>,self.fitTrack[atrack]</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;    <span class="keywordflow">continue</span></div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;      stat = fitTrack[trID].getFitStatus()</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;      <span class="keywordflow">if</span> <span class="keywordflow">not</span> stat.isFitConverged() : <span class="keywordflow">continue</span></div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;      f = fitTrack[trID].getFittedState()</div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;      </div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;      <span class="comment">#if(self.__debug&gt;0):</span></div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;      <span class="comment">#print &quot;for track &quot;, trID,</span></div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;      <span class="comment">#print &quot;  pos:&quot;, &quot;  &quot;.join(&quot;{:10.4f}&quot;.format(f.getPos()(ii)) for ii in range(0,3)),  </span></div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;      <span class="comment">#print &quot;  mom:&quot;, &quot;  &quot;.join(&quot;{:10.4f}&quot;.format(f.getMom()(ii)) for ii in range(0,3))</span></div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;      self.__reFitTracks.addNewTrack(trID, f.getPos(), f.getDir(), f.getMomMag(), </div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;                     stat.getNdf(), stat.getChi2())</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;      </div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;    </div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;    </div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;    </div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;    newFitTrIDs = self.__reFitTracks.getTrIDs()</div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;    twoTracks   = ( len(newFitTrIDs)==2 )</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;    theStep     = 0</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;    self.<a class="code" href="classStrawHits_1_1StrawHits.html#a0f7aef7f59605a2aad9f286cf034a55a">__docaEval</a> = []</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;    <span class="keywordflow">if</span> (twoTracks) : </div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;      self.__reFitTracks.createVertex(newFitTrIDs[0], newFitTrIDs[1], flag=0) <span class="comment"># original</span></div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;      iniDoca = self.__reFitTracks.Doca</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;      iniY    = self.__reFitTracks.Vertex.Y()</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;    <span class="keywordflow">while</span> ( theStep&lt;RecoSettings.VertexExtrSteps <span class="keywordflow">and</span>  twoTracks):</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;      flag        = 1</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;      newFitTrIDs = self.__reFitTracks.getTrIDs()</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;      <span class="comment">#if(self.__debug&gt;1):</span></div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;==&gt;vertex &quot;</span>, theStep, <span class="stringliteral">&quot;  &quot;</span>, self.__reFitTracks.Doca</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;      self.__reFitTracks.Vertex.Print()</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;      self.__docaEval.append(self.__reFitTracks.Doca)</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;      <span class="keywordflow">for</span> tid <span class="keywordflow">in</span> fitTrack :</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;    <span class="keywordflow">try</span>:</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;      state = fitTrack[tid].getFittedState()</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;    <span class="keywordflow">except</span>:</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;can&#39;t get fittedState&quot;</span></div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;      flag = -1</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;    vPosEx = ROOT.TVector3(0,0,0)</div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;    vMomEx = ROOT.TVector3(0,0,0)</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;    <span class="keywordflow">try</span> :</div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;      state.extrapolateToPoint(self.__reFitTracks.Vertex)</div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;    <span class="keywordflow">except</span> :</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;      flag = -1</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;      <span class="keywordflow">print</span> <span class="stringliteral">&quot;track exctrapolation failed!tid: &quot;</span>, tid</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;    <span class="keywordflow">if</span> (flag &gt; 0 ) : <span class="comment"># </span></div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;      status = fitTrack[tid].getFitStatus()</div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;      <span class="comment">#print &quot;extr track &quot;, tid,</span></div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;      <span class="comment">#print &quot;  pos:&quot;, &quot;  &quot;.join(&quot;{:10.4f}&quot;.format(state.getPos()(ii)) for ii in range(0,3)),  </span></div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;      <span class="comment">#print &quot;  mom:&quot;, &quot;  &quot;.join(&quot;{:10.4f}&quot;.format(state.getMom()(ii)) for ii in range(0,3))</span></div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;      self.__reFitTracks.addNewTrack(trID, state.getPos(), state.getDir(), state.getMomMag(), </div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;                    status.getNdf(), status.getChi2(), verb=<span class="keyword">False</span>)</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;      <span class="comment"># FIX temporary</span></div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;      self.__reFitTracks.createVertex(newFitTrIDs[0], newFitTrIDs[1], flag)</div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;      self.__reFitTracks.Vertex.SetY(iniY)</div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;      theStep+=1</div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;      twoTacks = ( len(self.__reFitTracks.getTrIDs())==2 )</div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;    <span class="keywordflow">return</span> len(newFitTrIDs)</div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;    </div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;</div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a76d7648ab2e960d209d7713e175d1031"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a76d7648ab2e960d209d7713e175d1031">StrawHits.StrawHits.__prepareIniPosMomCov</a></div><div class="ttdeci">def __prepareIniPosMomCov</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00343">StrawHits.py:343</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_ad53933e2cc71c51134b86f40904e3458"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#ad53933e2cc71c51134b86f40904e3458">StrawHits.StrawHits.readEvent</a></div><div class="ttdeci">def readEvent</div><div class="ttdoc">to be called per each event. </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00232">StrawHits.py:232</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a0f7aef7f59605a2aad9f286cf034a55a"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a0f7aef7f59605a2aad9f286cf034a55a">StrawHits.StrawHits.__docaEval</a></div><div class="ttdeci">__docaEval</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00041">StrawHits.py:41</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_afce2af1d22711c4291b7cd7f3ca51641"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#afce2af1d22711c4291b7cd7f3ca51641">StrawHits.StrawHits.FitTracks</a></div><div class="ttdeci">def FitTracks</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00399">StrawHits.py:399</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a93a1a8fc6260b0bd1ecad3448c1efb00"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a93a1a8fc6260b0bd1ecad3448c1efb00">StrawHits.StrawHits.getNofPHits</a></div><div class="ttdeci">def getNofPHits</div><div class="ttdoc">returns number of hits in proper tracker stations (Z&amp;gt;0) calculated from __trackHits and __vetoHits...</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00165">StrawHits.py:165</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_ac2c5e012bc6b6a78f8008cfb176cde06"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#ac2c5e012bc6b6a78f8008cfb176cde06">StrawHits.StrawHits.__oldSmearedHits</a></div><div class="ttdeci">__oldSmearedHits</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00025">StrawHits.py:25</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a3c32c037cb8638d136b805b62182f5e1"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a3c32c037cb8638d136b805b62182f5e1">StrawHits.StrawHits.getReFitPosDirPval</a></div><div class="ttdeci">def getReFitPosDirPval</div><div class="ttdoc">returns vertex (if number of tracks!=2 will return None!). </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00157">StrawHits.py:157</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_ad0ca7943fa49c8cb139c9d867bb6a63e"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">StrawHits.StrawHits.__trackHits</a></div><div class="ttdeci">__trackHits</div><div class="ttdoc">{MCtrackID : [{&amp;#39;pos&amp;#39;:TVector3, &amp;#39;det&amp;#39;:detID, &amp;#39;dw&amp;#39;:distance to wire, &amp;#39;smdw&amp;#39;: smeared dw} where [TVector...</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00024">StrawHits.py:24</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_aca9ae66051a12143d8b1d1bd496a8662"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#aca9ae66051a12143d8b1d1bd496a8662">StrawHits.StrawHits.compareFitTracks</a></div><div class="ttdeci">def compareFitTracks</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00195">StrawHits.py:195</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_acb97ae2ff666fe817f32fa64cb79b027"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#acb97ae2ff666fe817f32fa64cb79b027">StrawHits.StrawHits.getReFitTrIDs</a></div><div class="ttdeci">def getReFitTrIDs</div><div class="ttdoc">returns list of keys __reFitTracks. </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00122">StrawHits.py:122</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a9b2f62145f4c30c69e42dfafbbd451c1"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a9b2f62145f4c30c69e42dfafbbd451c1">StrawHits.StrawHits.getTrIDsALL</a></div><div class="ttdeci">def getTrIDsALL</div><div class="ttdoc">returns list of keys __trackHits (MCtrackIDs&amp;gt;0. </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00112">StrawHits.py:112</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_ad8361407d10cf89e4233f652d5348919"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#ad8361407d10cf89e4233f652d5348919">StrawHits.StrawHits.__resolution</a></div><div class="ttdeci">__resolution</div><div class="ttdoc">hit resolition </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00022">StrawHits.py:22</a></div></div>
<div class="ttc" id="namespaceRecoSettings_html_aa7af3e34857fc86f30ffbbaa1ce4f817"><div class="ttname"><a href="namespaceRecoSettings.html#aa7af3e34857fc86f30ffbbaa1ce4f817">RecoSettings.chargePDG</a></div><div class="ttdeci">def chargePDG</div><div class="ttdef"><b>Definition:</b> <a href="RecoSettings_8py_source.html#l00017">RecoSettings.py:17</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a62170847a3f9e5961bcdf3dda22d9e40"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a62170847a3f9e5961bcdf3dda22d9e40">StrawHits.StrawHits.__reFitTracks</a></div><div class="ttdeci">__reFitTracks</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00040">StrawHits.py:40</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a6a3cd5817218a7bb46d771955ba7b1c2"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a6a3cd5817218a7bb46d771955ba7b1c2">StrawHits.StrawHits.getReFitNdf</a></div><div class="ttdeci">def getReFitNdf</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00132">StrawHits.py:132</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a1fae7caaa752bb302f3ee108c6957c50"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a1fae7caaa752bb302f3ee108c6957c50">StrawHits.StrawHits.__fitter</a></div><div class="ttdeci">__fitter</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00038">StrawHits.py:38</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a3767e6b8b7c3d2c72d8ee5cab1780916"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a3767e6b8b7c3d2c72d8ee5cab1780916">StrawHits.StrawHits.getReFitChi2Ndf</a></div><div class="ttdeci">def getReFitChi2Ndf</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00127">StrawHits.py:127</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a781dcb7594b4cfcfeb8eb2ca129594fd"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">StrawHits.StrawHits.__trackEdgeHits</a></div><div class="ttdeci">__trackEdgeHits</div><div class="ttdoc">{MCtrackID : {X : TVector3}} where x=&amp;#39;entry&amp;#39; or &amp;#39;exit&amp;#39;, TVector3 coordinates of last or first hit...</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00028">StrawHits.py:28</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a36a22796964abef83666fa091b348df9"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a36a22796964abef83666fa091b348df9">StrawHits.StrawHits.getStartHit</a></div><div class="ttdeci">def getStartHit</div><div class="ttdoc">returns TVector3 of a tracker entry hit (Z&amp;gt;0) from __trackEdgeHits. </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00173">StrawHits.py:173</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a05c164606532ecb264d38d320e714020"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a05c164606532ecb264d38d320e714020">StrawHits.StrawHits.__clean</a></div><div class="ttdeci">def __clean</div><div class="ttdoc">to be called for each new event (called in readEvent()) cleans all dictionaries (__trackHits, __trackEdgeHits, __vetoHits, __nStations). </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00090">StrawHits.py:90</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html">StrawHits.StrawHits</a></div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00012">StrawHits.py:12</a></div></div>
<div class="ttc" id="classFitTrackInfo_1_1FitTrackInfo_html"><div class="ttname"><a href="classFitTrackInfo_1_1FitTrackInfo.html">FitTrackInfo.FitTrackInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="FitTrackInfo_8py_source.html#l00005">FitTrackInfo.py:5</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a48decae5ea4b5f021f560b3b2d322617"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a48decae5ea4b5f021f560b3b2d322617">StrawHits.StrawHits.__init__</a></div><div class="ttdeci">def __init__</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00014">StrawHits.py:14</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a8c32e1e97ffc82135a76b564f23ffd54"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a8c32e1e97ffc82135a76b564f23ffd54">StrawHits.StrawHits.__random</a></div><div class="ttdeci">__random</div><div class="ttdoc">root random engent for hit smearing (see __hitSmear). </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00034">StrawHits.py:34</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a9bc5a6aa025d639c6fd6a8ad5e492227"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a9bc5a6aa025d639c6fd6a8ad5e492227">StrawHits.StrawHits.getTrIDs</a></div><div class="ttdeci">def getTrIDs</div><div class="ttdoc">returns list of keys __trackEdgeHits (MCtrackIDs&amp;gt;0 with more than RecoSettings .trackMinNofHits hits)...</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00102">StrawHits.py:102</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_aefb7ae25c67992b8fa5aa2cadc0a01b1"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#aefb7ae25c67992b8fa5aa2cadc0a01b1">StrawHits.StrawHits.getStepDoca</a></div><div class="ttdeci">def getStepDoca</div><div class="ttdoc">returns doca&amp;#39;s of each extrapolation steps (size is defined in RecoSettings .VertexExtrSteps). </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00149">StrawHits.py:149</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_aac9a9101e965e151ba490eb750e57a92"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#aac9a9101e965e151ba490eb750e57a92">StrawHits.StrawHits.__modules</a></div><div class="ttdeci">__modules</div><div class="ttdoc">geometry description modules. </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00018">StrawHits.py:18</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a166e6a9121b32fa99c5a70986ad26a88"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a166e6a9121b32fa99c5a70986ad26a88">StrawHits.StrawHits.__prepareWireMeasurements</a></div><div class="ttdeci">def __prepareWireMeasurements</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00367">StrawHits.py:367</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_ad5f6e4bfd1342927d9c683941d787626"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#ad5f6e4bfd1342927d9c683941d787626">StrawHits.StrawHits.__hitSmear</a></div><div class="ttdeci">def __hitSmear</div><div class="ttdoc">returns a dictionary {xtop, ytop, z, ybot, ybot, z, dist} for a smeared hit. </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00205">StrawHits.py:205</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_ae689f206dc81ded009630c60877dda2c"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">StrawHits.StrawHits.__debug</a></div><div class="ttdeci">__debug</div><div class="ttdoc">debug level [0,3] </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00020">StrawHits.py:20</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a4c1e2091baa4551cc510f92400c702e4"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a4c1e2091baa4551cc510f92400c702e4">StrawHits.StrawHits.getReFitVertex</a></div><div class="ttdeci">def getReFitVertex</div><div class="ttdoc">returns vertex (if number of tracks!=2 will return None!). </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00140">StrawHits.py:140</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_aeb977fd03ff90657c43db0110cffe1fb"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#aeb977fd03ff90657c43db0110cffe1fb">StrawHits.StrawHits.__nStations</a></div><div class="ttdeci">__nStations</div><div class="ttdoc">{MCtrackID: number of crossed stations (exclude veto tracker)}. </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00032">StrawHits.py:32</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_a0aba6263d7c7d83cee880a3dbaf8931a"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#a0aba6263d7c7d83cee880a3dbaf8931a">StrawHits.StrawHits.__vetoHits</a></div><div class="ttdeci">__vetoHits</div><div class="ttdoc">{MCtrackID : number of hits at Z&amp;lt;0 (veto tracker)}. </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00030">StrawHits.py:30</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_aca7d347a78937cf8b7384f3f7d2f9cf4"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#aca7d347a78937cf8b7384f3f7d2f9cf4">StrawHits.StrawHits.__getIniDir</a></div><div class="ttdeci">def __getIniDir</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00330">StrawHits.py:330</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_aaa2456d54ca6081bc8548eb2f8d59219"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#aaa2456d54ca6081bc8548eb2f8d59219">StrawHits.StrawHits.__tree</a></div><div class="ttdeci">__tree</div><div class="ttdoc">root tree to be read. </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00016">StrawHits.py:16</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_ab67fb92dfa9fe98f6374e677d7e72223"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#ab67fb92dfa9fe98f6374e677d7e72223">StrawHits.StrawHits.checkVetoHits</a></div><div class="ttdeci">def checkVetoHits</div><div class="ttdoc">returns number of hits with Z&amp;lt;0 of __trackHits. </div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00181">StrawHits.py:181</a></div></div>
<div class="ttc" id="classStrawHits_1_1StrawHits_html_ad5d90b2675b9763f1c84a7f1a519f736"><div class="ttname"><a href="classStrawHits_1_1StrawHits.html#ad5d90b2675b9763f1c84a7f1a519f736">StrawHits.StrawHits.PrintNewTracks</a></div><div class="ttdeci">def PrintNewTracks</div><div class="ttdef"><b>Definition:</b> <a href="StrawHits_8py_source.html#l00189">StrawHits.py:189</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>