<!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 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 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> <span class="keyword">import</span> ROOT,os,sys,getopt</div> <div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <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> <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> <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> <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> </div> <div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="keyword">import</span> RecoSettings</div> <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <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> </div> <div class="line"><a name="l00010"></a><span class="lineno"> 10</span> </div> <div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <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> <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>  <span class="stringliteral">"""StrawHit class"""</span> </div> <div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a48decae5ea4b5f021f560b3b2d322617"> 14</a></span>  <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>  <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>  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>  <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>  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>  <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>  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>  <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>  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>  <span class="comment">## {MCtrackID : [{'pos':TVector3, 'det':detID, 'dw':distance to wire, 'smdw': smeared dw} where [TVector3] list of each hit position. Created if MCtrackID>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>  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>  <span class="comment">##</span></div> <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  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>  <span class="comment">## {MCtrackID : {X : TVector3}} where x='entry' or 'exit', 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>  <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>  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>  <span class="comment">## {MCtrackID : number of hits at Z<0 (veto tracker)}.</span></div> <div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  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>  <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>  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>  <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>  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>  ROOT.gRandom.SetSeed(13)</div> <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <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>  <span class="comment">#fitter = ROOT.genfit.KalmanFitterRefTrack()</span></div> <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  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>  <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>  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>  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>  </div> <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <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>  fm = ROOT.genfit.FieldManager.getInstance()</div> <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="comment"># copy from python/shipDet_conf.py</span></div> <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  sbf = ROOT.ShipBellField(<span class="stringliteral">"wilfried"</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>  <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>  z = 1000. + i*10</div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  pvec3 = ROOT.TVector3(0,0,z)</div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  fx = ROOT.Double(0)</div> <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  fy = ROOT.Double(0)</div> <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  fz = ROOT.Double(0)</div> <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="comment">#fvec3f = fm.getField().get(pvec3)</span></div> <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  fm.getField().get(0,0,z,fx,fy,fz)</div> <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  fvec3f = ROOT.TVector3(fx,fy,fz)</div> <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  </div> <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  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>  </div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="comment">#print z, " ".join("{:10.4f}".format(fvec3f(ii)) for ii in range(0,3)),</span></div> <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="comment">#print "\t", " ".join("{:10.4f}".format(fvec3s(ii)) for ii in range(0,3))</span></div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  mhistdict[<span class="stringliteral">'magZfit'</span>].Fill(z,fvec3f.Mag())</div> <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  mhistdict[<span class="stringliteral">'magZsim'</span>].Fill(z,fvec3s.Mag())</div> <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  </div> <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  zdict = {1:2500., 2:2800., 3:3000.}</div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <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>  <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>  <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>  x = xi*10.</div> <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  y = yi*10.</div> <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  pvec3 = ROOT.TVector3(x, y, zdict[zi])</div> <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  fx = ROOT.Double(0)</div> <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  fy = ROOT.Double(0)</div> <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  fz = ROOT.Double(0)</div> <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="comment">#fvec3f = fm.getField().get(pvec3)</span></div> <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  fm.getField().get(x,y,zdict[zi],fx,fy,fz)</div> <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  fvec3f = ROOT.TVector3(fx,fy,fz)</div> <div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div> <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  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>  <span class="comment">#print x, " ", y, " ", zdict[zi],</span></div> <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="comment">#print "\t", " ".join("{:10.4f}".format(fvec3f(ii)) for ii in range(0,3)),</span></div> <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="comment">#print "\t", " ".join("{:10.4f}".format(fvec3s(ii)) for ii in range(0,3))</span></div> <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  mhistdict[<span class="stringliteral">'magXY'</span>+str(zi)+<span class="stringliteral">"fit"</span>].Fill(x, y,fvec3f.Mag())</div> <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  mhistdict[<span class="stringliteral">'magXY'</span>+str(zi)+<span class="stringliteral">"sim"</span>].Fill(x, y,fvec3s.Mag())</div> <div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div> <div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div> <div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <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>  <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>  <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>  self.__trackHits.clear()</div> <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  self.__oldSmearedHits.clear()</div> <div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  self.__trackEdgeHits.clear()</div> <div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  self.__vetoHits.clear()</div> <div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  self.__nStations.clear()</div> <div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  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> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  </div> <div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  </div> <div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="comment">## \brief returns list of keys #__trackEdgeHits (MCtrackIDs>0 with more than #RecoSettings .trackMinNofHits hits).</span></div> <div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="comment"># \return list of MCtrackIDs of "good" 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>  <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>  trID = []</div> <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <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>  trID.append(tid)</div> <div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">return</span> trID</div> <div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div> <div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div> <div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="comment">## \brief returns list of keys #__trackHits (MCtrackIDs>0.</span></div> <div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <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>  <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>  trID = []</div> <div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <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>  trID.append(tid)</div> <div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keywordflow">return</span> trID</div> <div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div> <div class="line"><a name="l00119"></a><span class="lineno"> 119</span> </div> <div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="comment">## \brief returns list of keys #__reFitTracks.</span></div> <div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="comment"># \return list of MCtrackIDs of "good" 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>  <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>  <span class="keywordflow">return</span> self.__reFitTracks.getTrIDs()</div> <div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  </div> <div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  </div> <div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a3767e6b8b7c3d2c72d8ee5cab1780916"> 127</a></span>  <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>  <span class="keywordflow">return</span> self.__reFitTracks.getChi2Ndf(tid)</div> <div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  </div> <div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  </div> <div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a6a3cd5817218a7bb46d771955ba7b1c2"> 132</a></span>  <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>  <span class="keywordflow">return</span> self.__reFitTracks.getNdf(tid)</div> <div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  </div> <div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  </div> <div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  </div> <div class="line"><a name="l00137"></a><span class="lineno"> 137</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <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>  <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>  <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>  <span class="keywordflow">return</span> self.__reFitTracks.getVertex()</div> <div class="line"><a name="l00142"></a><span class="lineno"> 142</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00143"></a><span class="lineno"> 143</span> </div> <div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div> <div class="line"><a name="l00145"></a><span class="lineno"> 145</span> </div> <div class="line"><a name="l00146"></a><span class="lineno"> 146</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="comment">## \brief returns doca'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>  <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>  <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>  <span class="keywordflow">if</span> ( step>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>  <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> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00153"></a><span class="lineno"> 153</span> </div> <div class="line"><a name="l00154"></a><span class="lineno"> 154</span> </div> <div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <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>  <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>  <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>  <span class="keywordflow">return</span> self.__reFitTracks.getPosDirPval(tid)</div> <div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  </div> <div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  </div> <div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="comment">## \brief returns number of hits in proper tracker stations (Z>0) calculated from #__trackHits and #__vetoHits.</span></div> <div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="comment"># \param tid - MCtrackID.</span></div> <div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="comment"># \return number of hits in proper tracker stations (Z>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>  <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>  <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> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00168"></a><span class="lineno"> 168</span> </div> <div class="line"><a name="l00169"></a><span class="lineno"> 169</span> </div> <div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="comment">## \brief returns TVector3 of a tracker entry hit (Z>0) from #__trackEdgeHits.</span></div> <div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="comment"># \param tid - MCtrackID.</span></div> <div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="comment"># \return position of a tracker entry hit (Z>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>  <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>  <span class="keywordflow">return</span> self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[tid][<span class="stringliteral">'entry'</span>]</div> <div class="line"><a name="l00175"></a><span class="lineno"> 175</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00176"></a><span class="lineno"> 176</span> </div> <div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  </div> <div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="comment">## \brief returns number of hits with Z<0 of #__trackHits.</span></div> <div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="comment"># \param tid - MCtrackID.</span></div> <div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="comment"># \return number of hits with Z<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>  <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>  vh = 0</div> <div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <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>  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>  <span class="keywordflow">return</span> vh</div> <div class="line"><a name="l00186"></a><span class="lineno"> 186</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00187"></a><span class="lineno"> 187</span> </div> <div class="line"><a name="l00188"></a><span class="lineno"> 188</span> </div> <div class="line"><a name="l00189"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#ad5d90b2675b9763f1c84a7f1a519f736"> 189</a></span>  <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>  <span class="keywordflow">print</span> <span class="stringliteral">"new Fits: "</span>,</div> <div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  self.__reFitTracks.Print()</div> <div class="line"><a name="l00192"></a><span class="lineno"> 192</span> <span class="comment">######################################################################## </span></div> <div class="line"><a name="l00193"></a><span class="lineno"> 193</span> </div> <div class="line"><a name="l00194"></a><span class="lineno"> 194</span> </div> <div class="line"><a name="l00195"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#aca9ae66051a12143d8b1d1bd496a8662"> 195</a></span>  <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>  pos, direct, pval = theFitTracks.getPosDirPval(tid)</div> <div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <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>  </div> <div class="line"><a name="l00199"></a><span class="lineno"> 199</span> <span class="comment">######################################################################## </span></div> <div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <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>  <span class="comment"># \param tid - MCtrackID.</span></div> <div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="comment"># \param hid - hit index of #__trackHits</span></div> <div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <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>  <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>  <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>  top = ROOT.TVector3()</div> <div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  bot = ROOT.TVector3()</div> <div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  dw = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[tid][hid][<span class="stringliteral">'dw'</span>]</div> <div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  detID = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[tid][hid][<span class="stringliteral">'det'</span>]</div> <div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  </div> <div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  self.<a class="code" href="classStrawHits_1_1StrawHits.html#aac9a9101e965e151ba490eb750e57a92">__modules</a>[<span class="stringliteral">"Strawtubes"</span>].StrawEndPoints(detID,bot,top)</div> <div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  </div> <div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  if( new ):</div> <div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  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>  <span class="keywordflow">else</span>:</div> <div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  smear = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[tid][hid][<span class="stringliteral">'smdw'</span>]</div> <div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  smearedHit = {<span class="stringliteral">'xtop'</span>:top.x(),<span class="stringliteral">'ytop'</span>:top.y(),<span class="stringliteral">'z'</span>:top.z(),<span class="stringliteral">'xbot'</span>:bot.x(),<span class="stringliteral">'ybot'</span>:bot.y(),<span class="stringliteral">'z'</span>:bot.z(),<span class="stringliteral">'dist'</span>:smear}</div> <div class="line"><a name="l00218"></a><span class="lineno"> 218</span> </div> <div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>2):</div> <div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\tsmear :"</span>, <span class="stringliteral">""</span>.join(<span class="stringliteral">"{:8.2f}"</span>.format(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[tid][hid][<span class="stringliteral">'pos'</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>  <span class="keywordflow">print</span> <span class="stringliteral">"{:6.2f}"</span>.format(dw),</div> <div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\t(xt,xb, yt, yb, z, dw) : "</span>,</div> <div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keywordflow">for</span> x <span class="keywordflow">in</span> [<span class="stringliteral">'xtop'</span>,<span class="stringliteral">'xbot'</span>, <span class="stringliteral">'ytop'</span>,<span class="stringliteral">'ybot'</span>,<span class="stringliteral">'z'</span>, <span class="stringliteral">'dist'</span>]:</div> <div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">print</span> <span class="stringliteral">""</span>.join(<span class="stringliteral">"{:8.2f}"</span>.format(smearedHit[x])), </div> <div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">print</span> <span class="stringliteral">""</span></div> <div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">return</span> smearedHit</div> <div class="line"><a name="l00227"></a><span class="lineno"> 227</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00228"></a><span class="lineno"> 228</span> </div> <div class="line"><a name="l00229"></a><span class="lineno"> 229</span> </div> <div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <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>  <span class="comment"># \return number of "good" 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>  <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>  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>  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>  stationList = {} <span class="comment"># {MCtrackID:[stations]}</span></div> <div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  </div> <div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <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>  hindx = -1</div> <div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <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>  detID = ahit.GetDetectorID()</div> <div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  trID = ahit.GetTrackID()</div> <div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  </div> <div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <span class="comment"># get old smearing</span></div> <div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  hindx +=1</div> <div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  origSmHit = self.__tree.SmearedHits.At(hindx)</div> <div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  if( (abs(ahit.GetZ()-origSmHit[3])>0.8) <span class="keywordflow">or</span> (abs(ahit.dist2Wire()-origSmHit[7])>0.2) ):</div> <div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="keywordflow">print</span> <span class="stringliteral">"problem getting smeared his, but do not change anything"</span> </div> <div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keywordflow">print</span> <span class="stringliteral">"=>"</span>, ahit.GetZ(), origSmHit[3], ahit.dist2Wire(), origSmHit[7]</div> <div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="comment"># m = array('d',[i,sm['xtop'],sm['ytop'],sm['z'],sm['xbot'],sm['ybot'],sm['z'],sm['dist']])</span></div> <div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  </div> <div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="comment">#=></span></div> <div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  if(trID<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>  </div> <div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <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>  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>  stationList[trID] = []</div> <div class="line"><a name="l00257"></a><span class="lineno"> 257</span> </div> <div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  hinfo = {}</div> <div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  hinfo[<span class="stringliteral">'pos'</span>] = ROOT.TVector3(ahit.GetX(), ahit.GetY(), ahit.GetZ()) </div> <div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  hinfo[<span class="stringliteral">'det'</span>] = ahit.GetDetectorID()</div> <div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  hinfo[<span class="stringliteral">'dw'</span>] = ahit.dist2Wire()</div> <div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  hinfo[<span class="stringliteral">'smdw'</span>] = origSmHit[7]</div> <div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  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>  </div> <div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  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>  if( self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][lastIndx][<span class="stringliteral">'pos'</span>].Z() < self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][lastIndx-1][<span class="stringliteral">'pos'</span>].Z() ):</div> <div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  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>  toSort.append(trID)</div> <div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>0): <span class="keywordflow">print</span> <span class="stringliteral">"StrawHitsEntry: wrong order of hits for track "</span>, trID</div> <div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  </div> <div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  station = int(ahit.GetDetectorID()/10000000)</div> <div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="keywordflow">if</span> station > 4 : <span class="keywordflow">continue</span></div> <div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <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>  </div> <div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="comment"># sort</span></div> <div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <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>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>0): <span class="keywordflow">print</span> <span class="stringliteral">"StrawHitsEntry: will sort hits for track "</span>, trID</div> <div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>2):</div> <div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\t\thits to be sorted"</span></div> <div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <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>  vec3 = hinfo[<span class="stringliteral">'pos'</span>]</div> <div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\t\t\t\t"</span>, vec3.X(), <span class="stringliteral">"\t"</span>, vec3.Y(), <span class="stringliteral">"\t"</span>, vec3.Z(), hinfo[<span class="stringliteral">'dw'</span>]</div> <div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  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">'pos'</span>].Z(), reverse=<span class="keyword">False</span>)</div> <div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>2):</div> <div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\t\thits after sorting"</span></div> <div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <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>  vec3 = hinfo[<span class="stringliteral">'pos'</span>]</div> <div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\t\t\t\t"</span>, vec3.X(), <span class="stringliteral">"\t"</span>, vec3.Y(), <span class="stringliteral">"\t"</span>, vec3.Z(), hinfo[<span class="stringliteral">'dw'</span>]</div> <div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  </div> <div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="comment"># fill self.__nStations</span></div> <div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  <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>  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>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>0):</div> <div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <span class="keywordflow">print</span> <span class="stringliteral">"Number of crossed stations (trID:n)"</span>, trID, <span class="stringliteral">" : "</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>  </div> <div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <span class="comment"># find entry and exit positions</span></div> <div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  <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>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>1):</div> <div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keywordflow">print</span> <span class="stringliteral">"hits for trID "</span>, trID</div> <div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <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>  vec3 = hinfo[<span class="stringliteral">'pos'</span>]</div> <div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\t"</span>, vec3.X(), <span class="stringliteral">"\t"</span>, vec3.Y(), <span class="stringliteral">"\t"</span>, vec3.Z(), hinfo[<span class="stringliteral">'dw'</span>]</div> <div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>0): <span class="keywordflow">print</span> <span class="stringliteral">"start/stop position for hits of track "</span>, trID </div> <div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  <span class="comment">#find number of vetoTracker hits</span></div> <div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  firstHit = 0</div> <div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  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>  while( firstHit<nHits <span class="keywordflow">and</span> (self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][firstHit][<span class="stringliteral">'pos'</span>].Z()<0) ): </div> <div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  firstHit+=1</div> <div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  </div> <div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="comment"># =></span></div> <div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="comment"># the EdgeHits are filled only if nHits(stations1-4)>25</span></div> <div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  if( (firstHit<nHits) <span class="keywordflow">and</span> ((nHits-firstHit)>RecoSettings.trackMinNofHits) ):</div> <div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  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>  self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[trID][<span class="stringliteral">'entry'</span>] = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][firstHit][<span class="stringliteral">'pos'</span>]</div> <div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[trID][<span class="stringliteral">'exit'</span>] = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][-1][<span class="stringliteral">'pos'</span>]</div> <div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  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>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>0):</div> <div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  <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>  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>  <span class="keywordflow">print</span> <span class="stringliteral">"\t"</span>, pos, vec3.X(), <span class="stringliteral">"\t"</span>, vec3.Y(), <span class="stringliteral">"\t"</span>, vec3.Z()</div> <div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  elif( self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>0): <span class="keywordflow">print</span> <span class="stringliteral">"not set due to small number of hits"</span></div> <div class="line"><a name="l00322"></a><span class="lineno"> 322</span> </div> <div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <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> <span class="comment">######################################################################## </span></div> <div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  </div> <div class="line"><a name="l00326"></a><span class="lineno"> 326</span> </div> <div class="line"><a name="l00327"></a><span class="lineno"> 327</span> </div> <div class="line"><a name="l00328"></a><span class="lineno"> 328</span> </div> <div class="line"><a name="l00329"></a><span class="lineno"> 329</span> </div> <div class="line"><a name="l00330"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#aca7d347a78937cf8b7384f3f7d2f9cf4"> 330</a></span>  <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>  v1 = self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[trID][<span class="stringliteral">'entry'</span>]</div> <div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  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>  if( len(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID])>i2 ):</div> <div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  v2 = self.<a class="code" href="classStrawHits_1_1StrawHits.html#ad0ca7943fa49c8cb139c9d867bb6a63e">__trackHits</a>[trID][i2][<span class="stringliteral">'pos'</span>]</div> <div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  dv = v2-v1</div> <div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  <span class="keywordflow">else</span>: </div> <div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  dv = ROOT.TVector3(0., 0., 1.) </div> <div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>0):</div> <div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <span class="keywordflow">print</span> <span class="stringliteral">"trying to get initial direction having just one hit, will set (0,0,1)"</span></div> <div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  <span class="keywordflow">return</span> dv*(1./dv.Mag())</div> <div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  </div> <div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  </div> <div class="line"><a name="l00343"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a76d7648ab2e960d209d7713e175d1031"> 343</a></span>  <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>  <span class="keywordflow">if</span> ( original ) :</div> <div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  pos = ROOT.TVector3(0, 0, 0)</div> <div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  mom = ROOT.TVector3(0,0,3.*u.GeV)</div> <div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  cov = ROOT.TMatrixDSym(6)</div> <div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  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>  <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>  cov[0][0]=resolution*resolution*100.</div> <div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  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>  <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>  <span class="keywordflow">else</span>:</div> <div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  pos = self.<a class="code" href="classStrawHits_1_1StrawHits.html#a781dcb7594b4cfcfeb8eb2ca129594fd">__trackEdgeHits</a>[tid][<span class="stringliteral">'entry'</span>]</div> <div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  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>  cov = ROOT.TMatrixDSym(6)</div> <div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  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>  <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>  cov[0][0]=resolution*resolution*100.</div> <div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  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>  <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>  <span class="keywordflow">return</span> pos, mom, cov </div> <div class="line"><a name="l00363"></a><span class="lineno"> 363</span> <span class="comment">######################################################################## </span></div> <div class="line"><a name="l00364"></a><span class="lineno"> 364</span> </div> <div class="line"><a name="l00365"></a><span class="lineno"> 365</span> </div> <div class="line"><a name="l00366"></a><span class="lineno"> 366</span> </div> <div class="line"><a name="l00367"></a><span class="lineno"><a class="line" href="classStrawHits_1_1StrawHits.html#a166e6a9121b32fa99c5a70986ad26a88"> 367</a></span>  <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>  <span class="comment">#WireMeasurement::WireMeasurement(const TVectorD& rawHitCoords, </span></div> <div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  <span class="comment"># const TMatrixDSym& rawHitCov, </span></div> <div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  <span class="comment"># int detId, </span></div> <div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <span class="comment"># int hitId, </span></div> <div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <span class="comment"># genfit::TrackPoint* trackPoint)</span></div> <div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  <span class="comment"># per each proper hit TMP ??? does it make sense to do for tracks with __vetoHits>0???</span></div> <div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="comment">#self.__measurements4fit[trID] = []</span></div> <div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  <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>  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>  mVector = ROOT.TVectorD(7,array(<span class="stringliteral">'d'</span>,[sm[<span class="stringliteral">'xtop'</span>],sm[<span class="stringliteral">'ytop'</span>],sm[<span class="stringliteral">'z'</span>],sm[<span class="stringliteral">'xbot'</span>],sm[<span class="stringliteral">'ybot'</span>],sm[<span class="stringliteral">'z'</span>],sm[<span class="stringliteral">'dist'</span>]]))</div> <div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  <span class="comment">#self.__measurements4fit[trID].push_back(mVector)</span></div> <div class="line"><a name="l00379"></a><span class="lineno"> 379</span> </div> <div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  hitCov = ROOT.TMatrixDSym(7)</div> <div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  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> </div> <div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  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>  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>  <span class="comment"># print measurement.getMaxDistance()</span></div> <div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  measurement.setMaxDistance(0.5*u.cm)</div> <div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  <span class="comment">#measurement.setLeftRightResolution(-1)</span></div> <div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  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>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>2):</div> <div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  tp.Print()</div> <div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  fTrack.insertPoint(tp) <span class="comment"># add point to Track</span></div> <div class="line"><a name="l00392"></a><span class="lineno"> 392</span> </div> <div class="line"><a name="l00393"></a><span class="lineno"> 393</span> </div> <div class="line"><a name="l00394"></a><span class="lineno"> 394</span> </div> <div class="line"><a name="l00395"></a><span class="lineno"> 395</span> </div> <div class="line"><a name="l00396"></a><span class="lineno"> 396</span> </div> <div class="line"><a name="l00397"></a><span class="lineno"> 397</span> </div> <div class="line"><a name="l00398"></a><span class="lineno"> 398</span> <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>  <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>  </div> <div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  self.__reFitTracks.clean()</div> <div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  </div> <div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  fitTrack = {}</div> <div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  <span class="comment">#self.__measurements4fit = {}</span></div> <div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  nTrack = -1</div> <div class="line"><a name="l00406"></a><span class="lineno"> 406</span> </div> <div class="line"><a name="l00407"></a><span class="lineno"> 407</span> </div> <div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  <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>  <span class="comment">#print "track entry", self.__trackEdgeHits[tid]['entry']. </span></div> <div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  <span class="comment">#print "mfield: ", ROOT</span></div> <div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  </div> <div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  <span class="comment"># minimal requirements on number of crossed stations</span></div> <div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  <span class="keywordflow">if</span> ( self.<a class="code" href="classStrawHits_1_1StrawHits.html#aeb977fd03ff90657c43db0110cffe1fb">__nStations</a><RecoSettings.trackMinNofStations): <span class="keywordflow">continue</span></div> <div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  </div> <div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  pdg = self.__tree.MCTrack[trID].GetPdgCode()</div> <div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  </div> <div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  <span class="comment"># remove unknown or neutral particles </span></div> <div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  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>  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>  <span class="keywordflow">print</span> <span class="stringliteral">"StrawHits.FitTracks for TrID "</span>, trID, <span class="stringliteral">"finds charge of track of "</span>, charge, <span class="stringliteral">" and does nothing."</span></div> <div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  <span class="keywordflow">continue</span></div> <div class="line"><a name="l00422"></a><span class="lineno"> 422</span> </div> <div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  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>  </div> <div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  rep = ROOT.genfit.RKTrackRep(pdg)</div> <div class="line"><a name="l00426"></a><span class="lineno"> 426</span>  stateSmeared = ROOT.genfit.MeasuredStateOnPlane(rep)</div> <div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  rep.setPosMomCov(stateSmeared, posM, momM, covM)</div> <div class="line"><a name="l00428"></a><span class="lineno"> 428</span> </div> <div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  seedState = ROOT.TVectorD(6)</div> <div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  seedCov = ROOT.TMatrixDSym(6)</div> <div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  rep.get6DStateCov(stateSmeared, seedState, seedCov)</div> <div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  </div> <div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  fitTrack[trID] = ROOT.genfit.Track(rep, seedState, seedCov)</div> <div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  ROOT.SetOwnership(fitTrack[trID], <span class="keyword">False</span>)</div> <div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  </div> <div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  if(self.<a class="code" href="classStrawHits_1_1StrawHits.html#ae689f206dc81ded009630c60877dda2c">__debug</a>>2): <span class="keywordflow">print</span> <span class="stringliteral">"preparing measurements for track ID"</span>, trID</div> <div class="line"><a name="l00437"></a><span class="lineno"> 437</span>  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>  </div> <div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  </div> <div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  <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>  <span class="keywordflow">print</span> <span class="stringliteral">'Problem with track before fit, not consistent'</span>,self.fitTrack[atrack]</div> <div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  <span class="keywordflow">continue</span></div> <div class="line"><a name="l00443"></a><span class="lineno"> 443</span>  <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>  <span class="keywordflow">except</span>: </div> <div class="line"><a name="l00445"></a><span class="lineno"> 445</span>  <span class="keywordflow">print</span> <span class="stringliteral">"genfit failed to fit track"</span></div> <div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  <span class="keywordflow">continue</span></div> <div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  <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>  <span class="keywordflow">print</span> <span class="stringliteral">'Problem with track after fit, not consistent'</span>,self.fitTrack[atrack]</div> <div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  <span class="keywordflow">continue</span></div> <div class="line"><a name="l00450"></a><span class="lineno"> 450</span> </div> <div class="line"><a name="l00451"></a><span class="lineno"> 451</span>  stat = fitTrack[trID].getFitStatus()</div> <div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  <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>  f = fitTrack[trID].getFittedState()</div> <div class="line"><a name="l00454"></a><span class="lineno"> 454</span>  </div> <div class="line"><a name="l00455"></a><span class="lineno"> 455</span>  <span class="comment">#if(self.__debug>0):</span></div> <div class="line"><a name="l00456"></a><span class="lineno"> 456</span>  <span class="comment">#print "for track ", trID,</span></div> <div class="line"><a name="l00457"></a><span class="lineno"> 457</span>  <span class="comment">#print " pos:", " ".join("{:10.4f}".format(f.getPos()(ii)) for ii in range(0,3)), </span></div> <div class="line"><a name="l00458"></a><span class="lineno"> 458</span>  <span class="comment">#print " mom:", " ".join("{:10.4f}".format(f.getMom()(ii)) for ii in range(0,3))</span></div> <div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  self.__reFitTracks.addNewTrack(trID, f.getPos(), f.getDir(), f.getMomMag(), </div> <div class="line"><a name="l00460"></a><span class="lineno"> 460</span>  stat.getNdf(), stat.getChi2())</div> <div class="line"><a name="l00461"></a><span class="lineno"> 461</span>  </div> <div class="line"><a name="l00462"></a><span class="lineno"> 462</span>  </div> <div class="line"><a name="l00463"></a><span class="lineno"> 463</span>  </div> <div class="line"><a name="l00464"></a><span class="lineno"> 464</span>  </div> <div class="line"><a name="l00465"></a><span class="lineno"> 465</span>  newFitTrIDs = self.__reFitTracks.getTrIDs()</div> <div class="line"><a name="l00466"></a><span class="lineno"> 466</span>  twoTracks = ( len(newFitTrIDs)==2 )</div> <div class="line"><a name="l00467"></a><span class="lineno"> 467</span>  theStep = 0</div> <div class="line"><a name="l00468"></a><span class="lineno"> 468</span>  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>  <span class="keywordflow">if</span> (twoTracks) : </div> <div class="line"><a name="l00470"></a><span class="lineno"> 470</span>  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>  iniDoca = self.__reFitTracks.Doca</div> <div class="line"><a name="l00472"></a><span class="lineno"> 472</span>  iniY = self.__reFitTracks.Vertex.Y()</div> <div class="line"><a name="l00473"></a><span class="lineno"> 473</span>  <span class="keywordflow">while</span> ( theStep<RecoSettings.VertexExtrSteps <span class="keywordflow">and</span> twoTracks):</div> <div class="line"><a name="l00474"></a><span class="lineno"> 474</span>  flag = 1</div> <div class="line"><a name="l00475"></a><span class="lineno"> 475</span>  newFitTrIDs = self.__reFitTracks.getTrIDs()</div> <div class="line"><a name="l00476"></a><span class="lineno"> 476</span>  <span class="comment">#if(self.__debug>1):</span></div> <div class="line"><a name="l00477"></a><span class="lineno"> 477</span>  <span class="keywordflow">print</span> <span class="stringliteral">"==>vertex "</span>, theStep, <span class="stringliteral">" "</span>, self.__reFitTracks.Doca</div> <div class="line"><a name="l00478"></a><span class="lineno"> 478</span>  self.__reFitTracks.Vertex.Print()</div> <div class="line"><a name="l00479"></a><span class="lineno"> 479</span>  self.__docaEval.append(self.__reFitTracks.Doca)</div> <div class="line"><a name="l00480"></a><span class="lineno"> 480</span>  <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>  <span class="keywordflow">try</span>:</div> <div class="line"><a name="l00482"></a><span class="lineno"> 482</span>  state = fitTrack[tid].getFittedState()</div> <div class="line"><a name="l00483"></a><span class="lineno"> 483</span>  <span class="keywordflow">except</span>:</div> <div class="line"><a name="l00484"></a><span class="lineno"> 484</span>  <span class="keywordflow">print</span> <span class="stringliteral">"can't get fittedState"</span></div> <div class="line"><a name="l00485"></a><span class="lineno"> 485</span>  flag = -1</div> <div class="line"><a name="l00486"></a><span class="lineno"> 486</span>  vPosEx = ROOT.TVector3(0,0,0)</div> <div class="line"><a name="l00487"></a><span class="lineno"> 487</span>  vMomEx = ROOT.TVector3(0,0,0)</div> <div class="line"><a name="l00488"></a><span class="lineno"> 488</span>  <span class="keywordflow">try</span> :</div> <div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  state.extrapolateToPoint(self.__reFitTracks.Vertex)</div> <div class="line"><a name="l00490"></a><span class="lineno"> 490</span>  <span class="keywordflow">except</span> :</div> <div class="line"><a name="l00491"></a><span class="lineno"> 491</span>  flag = -1</div> <div class="line"><a name="l00492"></a><span class="lineno"> 492</span>  <span class="keywordflow">print</span> <span class="stringliteral">"track exctrapolation failed!tid: "</span>, tid</div> <div class="line"><a name="l00493"></a><span class="lineno"> 493</span>  <span class="keywordflow">if</span> (flag > 0 ) : <span class="comment"># </span></div> <div class="line"><a name="l00494"></a><span class="lineno"> 494</span>  status = fitTrack[tid].getFitStatus()</div> <div class="line"><a name="l00495"></a><span class="lineno"> 495</span>  <span class="comment">#print "extr track ", tid,</span></div> <div class="line"><a name="l00496"></a><span class="lineno"> 496</span>  <span class="comment">#print " pos:", " ".join("{:10.4f}".format(state.getPos()(ii)) for ii in range(0,3)), </span></div> <div class="line"><a name="l00497"></a><span class="lineno"> 497</span>  <span class="comment">#print " mom:", " ".join("{:10.4f}".format(state.getMom()(ii)) for ii in range(0,3))</span></div> <div class="line"><a name="l00498"></a><span class="lineno"> 498</span>  self.__reFitTracks.addNewTrack(trID, state.getPos(), state.getDir(), state.getMomMag(), </div> <div class="line"><a name="l00499"></a><span class="lineno"> 499</span>  status.getNdf(), status.getChi2(), verb=<span class="keyword">False</span>)</div> <div class="line"><a name="l00500"></a><span class="lineno"> 500</span>  <span class="comment"># FIX temporary</span></div> <div class="line"><a name="l00501"></a><span class="lineno"> 501</span>  self.__reFitTracks.createVertex(newFitTrIDs[0], newFitTrIDs[1], flag)</div> <div class="line"><a name="l00502"></a><span class="lineno"> 502</span>  self.__reFitTracks.Vertex.SetY(iniY)</div> <div class="line"><a name="l00503"></a><span class="lineno"> 503</span>  theStep+=1</div> <div class="line"><a name="l00504"></a><span class="lineno"> 504</span>  twoTacks = ( len(self.__reFitTracks.getTrIDs())==2 )</div> <div class="line"><a name="l00505"></a><span class="lineno"> 505</span>  <span class="keywordflow">return</span> len(newFitTrIDs)</div> <div class="line"><a name="l00506"></a><span class="lineno"> 506</span>  </div> <div class="line"><a name="l00507"></a><span class="lineno"> 507</span> </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&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 : [{&#39;pos&#39;:TVector3, &#39;det&#39;:detID, &#39;dw&#39;:distance to wire, &#39;smdw&#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&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=&#39;entry&#39; or &#39;exit&#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&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&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&#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&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&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  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.5 </small></address> </body> </html>