<!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: MCTrackInfo.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">MCTrackInfo.py</div> </div> </div><!--header--> <div class="contents"> <a href="MCTrackInfo_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="namespaceMCTrackInfo.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">import</span> RecoSettings</div> <div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">########################################################################</span></div> <div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">## For a single event stores HNL, its decay products and several other tracks (if requested) </span></div> <div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"># from ShipMCTracks collection of a MCtrack branch (see $FAIRSHIP/shipdata/ShipMCTrack.h)\n</span></div> <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">#</span></div> <div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">#</span></div> <div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html"> 10</a></span> <span class="keyword">class </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html">MCTrackInfo</a>(object):</div> <div class="line"><a name="l00011"></a><span class="lineno"> 11</span>  <span class="stringliteral">""" More description here"""</span></div> <div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#af4f51c2388ec5f40514c59afd5332277"> 12</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#af4f51c2388ec5f40514c59afd5332277">__init__</a>(self, tree, debug=0):</div> <div class="line"><a name="l00013"></a><span class="lineno"> 13</span>  <span class="comment">## root tree to be read.</span></div> <div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a3fba7f2f758aafe00388a2f38648f0bb"> 14</a></span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a3fba7f2f758aafe00388a2f38648f0bb">__tree</a> = tree</div> <div class="line"><a name="l00015"></a><span class="lineno"> 15</span>  <span class="comment">## debug level [0,3].</span></div> <div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a4893611662191cf54ed81ff4c655dc83"> 16</a></span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4893611662191cf54ed81ff4c655dc83">__debug</a> = debug</div> <div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  <span class="comment">## z of the last full acceptance plane (to be used in #checkEllipticAcc), must be set later.</span></div> <div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a002c4ce91f1ba21a096a1706a2fd586a"> 18</a></span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a002c4ce91f1ba21a096a1706a2fd586a">__zAcc</a> = 3380*u.cm</div> <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  <span class="comment">## event weight. Read in #readEvent as weight of HNL.</span></div> <div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a14da949a8b7428f55295ba15215b810a"> 20</a></span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a14da949a8b7428f55295ba15215b810a">__weight</a> = 0</div> <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  <span class="comment">## HNL decay vertex coordinates (TVector3). Assigned in #readEvent()</span></div> <div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#ae7ebe267b558ce4d231ca8b29020ffa7"> 22</a></span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ae7ebe267b558ce4d231ca8b29020ffa7">__HNLdecayCoord</a> = <span class="keywordtype">None</span></div> <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  <span class="comment">## MCTrID (index of the track in MCtrack list) for \b HNL \b daughter products. </span></div> <div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a0be7deaac48872c74697f6685508bd35"> 24</a></span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a0be7deaac48872c74697f6685508bd35">__decayProdTrID</a> = []</div> <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="comment">## Production vertices of several stored products (\b not \b only HNL daughter) as {MCTrID : TVector3}.</span></div> <div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f"> 26</a></span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f">__productVertex</a> = {}</div> <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <span class="comment">## Momentum of several stored products (\b not \b only HNL daughter) as {MCTrID : TVector3}. Correspond to $__productVertex.</span></div> <div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9"> 28</a></span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a> = {}</div> <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <span class="comment">## Charge of several stored products (\b not \b only HNL daughter) as {MCTrID : value}. Correspond to $__productVertex.</span></div> <div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a4f37010427e15ef23aebfeb468a1e237"> 30</a></span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4f37010427e15ef23aebfeb468a1e237">__productCharge</a> = {}</div> <div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="comment">## Basic information on the particle (pdg, mother pdg,... to be added - z decay!)</span></div> <div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3"> 32</a></span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">__productInfo</a> = {}</div> <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  </div> <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  </div> <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  </div> <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  </div> <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  </div> <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="comment">##\brief clears all dictionaries and lists. To be called inside #readEvent.</span></div> <div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#aaa8c7975c4de4c642725da17c89ed0db"> 40</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#aaa8c7975c4de4c642725da17c89ed0db">__clean</a>(self):</div> <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a14da949a8b7428f55295ba15215b810a">__weight</a> = 0</div> <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ae7ebe267b558ce4d231ca8b29020ffa7">__HNLdecayCoord</a> = <span class="keywordtype">None</span></div> <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a0be7deaac48872c74697f6685508bd35">__decayProdTrID</a> = []</div> <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  self.__productVertex.clear()</div> <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  self.__productMoment.clear()</div> <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  self.__productCharge.clear()</div> <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  self.__productInfo.clear()</div> <div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div> <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="comment">##\brief set z of the last full acceptance plane (to be used in #checkEllipticAcc), depends on #RecoSettings. trackMinNofStations.</span></div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="comment"># \param z - the value [cm].</span></div> <div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a6477c28c98db43fbc1add398b4c0cc58"> 52</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a6477c28c98db43fbc1add398b4c0cc58">setAccPlaneZ</a>(self, z):</div> <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a002c4ce91f1ba21a096a1706a2fd586a">__zAcc</a> = z</div> <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  </div> <div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div> <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="comment">##\brief prints HNL decay products</span></div> <div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a93831a40f5d8c3c70513bb3d1f465b65"> 58</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a93831a40f5d8c3c70513bb3d1f465b65">PrintHNL</a>(self):</div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordflow">print</span> type(self).__name__, <span class="stringliteral">" : "</span></div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\tdecay vertex: "</span>, <span class="stringliteral">" "</span>.join(<span class="stringliteral">"{:10.4f}"</span>.format(self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ae7ebe267b558ce4d231ca8b29020ffa7">__HNLdecayCoord</a>(ii)) <span class="keywordflow">for</span> ii <span class="keywordflow">in</span> range(0,3)),</div> <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\n\tdecay products (trID, pdg, charge, momentum):"</span></div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keywordflow">for</span> tid <span class="keywordflow">in</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a0be7deaac48872c74697f6685508bd35">__decayProdTrID</a> :</div> <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\t"</span>, <span class="stringliteral">"{0:6}{1:10}{2:6.0f}"</span>.format(tid, self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">__productInfo</a>[tid][<span class="stringliteral">'pdg'</span>], self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4f37010427e15ef23aebfeb468a1e237">__productCharge</a>[tid]),</div> <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\t"</span>, <span class="stringliteral">" "</span>.join(<span class="stringliteral">"{:10.4f}"</span>.format(self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[tid](ii)) <span class="keywordflow">for</span> ii <span class="keywordflow">in</span> range(0,3))</div> <div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div> <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  </div> <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="comment">## \brief returns event weight.</span></div> <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="comment"># \return value of #__weight</span></div> <div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a18df111baef6f02e2fb667931bd7974c"> 71</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a18df111baef6f02e2fb667931bd7974c">getEventWeight</a>(self):</div> <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordflow">return</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a14da949a8b7428f55295ba15215b810a">__weight</a></div> <div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div> <div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div> <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="comment">## \brief returns \b HNL \b decay \b vertex coordinates (TVector3 #__HNLdecayCoord).</span></div> <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="comment"># \return TVector3 #__HNLdecayCoord </span></div> <div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a761eb08a7b51d12f9909ce00a1886bf9"> 78</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a761eb08a7b51d12f9909ce00a1886bf9">getHNLdecayVertex</a>(self):</div> <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">return</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ae7ebe267b558ce4d231ca8b29020ffa7">__HNLdecayCoord</a></div> <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  </div> <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  </div> <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="comment">## \brief returns list of MCtrIDs (index in MCTrack collection) fot \b HNL \b decay \b products.</span></div> <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="comment"># \return list of MCtrIDs (index in MCTrack collection) fot \b HNL \b decay \b products.</span></div> <div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a77ee84d4194eec9f3b8859e7fb921994"> 85</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a77ee84d4194eec9f3b8859e7fb921994">getHNLdecayTrIDs</a>(self):</div> <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  trID = []</div> <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keywordflow">for</span> tid <span class="keywordflow">in</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a0be7deaac48872c74697f6685508bd35">__decayProdTrID</a>:</div> <div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  trID.append(tid)</div> <div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordflow">return</span> trID</div> <div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  </div> <div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  </div> <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="comment">## \brief returns list of all MCtrIDs read by #readEvent and #readTrack - \b not \b only HNL decay products.</span></div> <div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="comment"># \return list of MCtrIDs (index in MCTrack collection) fot all tracks read by #readEvent and #readTrack.</span></div> <div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a8851c544b8902ba6c461483caa1c14a2"> 95</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a8851c544b8902ba6c461483caa1c14a2">getTrIDs</a>(self):</div> <div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  trID = []</div> <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">for</span> tid <span class="keywordflow">in</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>:</div> <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  trID.append(tid)</div> <div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keywordflow">return</span> trID</div> <div class="line"><a name="l00100"></a><span class="lineno"> 100</span> </div> <div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div> <div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="comment">## \brief returns charge of a particle with the given trID (index in MCTrack collection). May return None.</span></div> <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="comment"># Tries to get charge from #__productCharge; </span></div> <div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="comment"># if it is not available, tries to add the track calling #readTrack. If fails, returns None.</span></div> <div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="comment"># \param trID - index of the MCTrack</span></div> <div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="comment"># \return charge of the track or None</span></div> <div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a7d6d8ccce59d04dbda850b3ce01fb32e"> 108</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a7d6d8ccce59d04dbda850b3ce01fb32e">getCharge</a>(self, trID):</div> <div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordflow">if</span> ( <span class="keywordflow">not</span> trID <span class="keywordflow">in</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4f37010427e15ef23aebfeb468a1e237">__productCharge</a> ): self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a9ea9a05a0453c7e2d1f1ae7484ea396d">readTrack</a>(trID)</div> <div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordflow">return</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4f37010427e15ef23aebfeb468a1e237">__productCharge</a>[trID]</div> <div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  </div> <div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  </div> <div class="line"><a name="l00113"></a><span class="lineno"> 113</span> </div> <div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="comment">## \brief returns momentum (TVector3) for a particle with the given trID (index in MCTrack collection). May return None.</span></div> <div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="comment"># Tries to get momentum from #__productMoment; </span></div> <div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="comment"># if it is not available, tries to add the track calling #readTrack. If fails, returns None.</span></div> <div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="comment"># \param trID - index of the MCTrack</span></div> <div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="comment"># \return momentum of the track (TVector3) or None</span></div> <div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a9704d39b63497e5211c41525623a285b"> 120</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a9704d39b63497e5211c41525623a285b">getMomentum</a>(self, trID):</div> <div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordflow">if</span> ( <span class="keywordflow">not</span> trID <span class="keywordflow">in</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a> ): self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a9ea9a05a0453c7e2d1f1ae7484ea396d">readTrack</a>(trID)</div> <div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keywordflow">return</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[trID]</div> <div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  </div> <div class="line"><a name="l00124"></a><span class="lineno"> 124</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"> 127</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="comment">## \brief checks if HNL decay vertex (and both HNL daughter tracks, if tight cut) are in elliptic acceptance at #__zAcc.</span></div> <div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="comment"># For tight cut each HNL daughter is propagated to #__zAcc (see #getTrackPropagation) </span></div> <div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="comment"># and checked if it in the acceptance (see #RecoSettings .checkEllipticAcc). Also checks HNL decay vertex.</span></div> <div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="comment"># \param tight - if true, not only HNL vertex but also propagated tracks are checked.</span></div> <div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="comment"># \return True if the vertex (and both tracks, if tight cut) are in the acceptance.</span></div> <div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#ae37b39fe69c4f715f7efa4af606eec47"> 133</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ae37b39fe69c4f715f7efa4af606eec47">checkEllipticAcc</a>(self, tight=True):</div> <div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  ok = <a class="code" href="namespaceRecoSettings.html#a5d559dea0f8f68b24bc28e20ac5963dc">RecoSettings.checkEllipticAcc</a>(self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ae7ebe267b558ce4d231ca8b29020ffa7">__HNLdecayCoord</a>)</div> <div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keywordflow">if</span> ( <span class="keywordflow">not</span> ok ) : <span class="keywordflow">return</span> <span class="keyword">False</span></div> <div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordflow">if</span> ( tight ) :</div> <div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">for</span> tid <span class="keywordflow">in</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a0be7deaac48872c74697f6685508bd35">__decayProdTrID</a> :</div> <div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  v3 = self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a3c7c84ace7feb38618dd6bd8e4af9d8b">getTrackPropagation</a>(tid, self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a002c4ce91f1ba21a096a1706a2fd586a">__zAcc</a>)</div> <div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  ok = ( ok <span class="keywordflow">and</span> <a class="code" href="namespaceRecoSettings.html#a5d559dea0f8f68b24bc28e20ac5963dc">RecoSettings.checkEllipticAcc</a>(v3) )</div> <div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keywordflow">if</span> ( <span class="keywordflow">not</span> ok ) : <span class="keywordflow">break</span></div> <div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">return</span> ok</div> <div class="line"><a name="l00142"></a><span class="lineno"> 142</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 for Tracker Performance studies. Returns -1, 0, 1 depending on vertex topology.</span></div> <div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="comment"># defines direction in y: 0 if both momY the same direction, -1 if (negative up, positive down).</span></div> <div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="comment"># \return 0 if both momY the same direction, -1 if (negative up, positive down).</span></div> <div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a58064c8befc831414f8cd6c7a6583d83"> 150</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a58064c8befc831414f8cd6c7a6583d83">checkVertexUpDown</a>(self):</div> <div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  theCase = 0 <span class="comment"># undefined</span></div> <div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordflow">if</span> ( (<span class="keywordflow">not</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f">__productVertex</a>) <span class="keywordflow">or</span> (len(self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a0be7deaac48872c74697f6685508bd35">__decayProdTrID</a>)<2) ): <span class="keywordflow">return</span> theCase</div> <div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  tid1 = self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a0be7deaac48872c74697f6685508bd35">__decayProdTrID</a>[0]</div> <div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  tid2 = self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a0be7deaac48872c74697f6685508bd35">__decayProdTrID</a>[1]</div> <div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keywordflow">if</span> ( self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[tid1].Y()*self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[tid2].Y() >=0 ): <span class="keywordflow">return</span> theCase</div> <div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  </div> <div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  theCase = self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4f37010427e15ef23aebfeb468a1e237">__productCharge</a>[tid1]*self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[tid1].Y()/abs(self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[tid1].Y())</div> <div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  </div> <div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keywordflow">return</span> theCase</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">########################################################################</span></div> <div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="comment">## \brief for Tracker Performance studies. Returns TVector3.</span></div> <div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="comment"># Linear propagation of a given track to a plane (0,0,z) perendicular to Z-axis.</span></div> <div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="comment"># \param trID - track index (MCtrID).</span></div> <div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="comment"># \param z - coordinate of the plane. </span></div> <div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <span class="comment"># \return coordinates of the point of track crossing the given plalne (TVector3). </span></div> <div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a3c7c84ace7feb38618dd6bd8e4af9d8b"> 168</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a3c7c84ace7feb38618dd6bd8e4af9d8b">getTrackPropagation</a>(self, trID, z):</div> <div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">if</span> ( <span class="keywordflow">not</span> trID <span class="keywordflow">in</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a> ): self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a9ea9a05a0453c7e2d1f1ae7484ea396d">readTrack</a>(trID)</div> <div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  xy=[0.,0.]</div> <div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordflow">for</span> ii <span class="keywordflow">in</span> [0,1]:</div> <div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  xy[ii] = self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f">__productVertex</a>[trID][ii]+self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[trID][ii]/self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[trID][2]*(z-self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f">__productVertex</a>[trID][2])</div> <div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  vec3 = ROOT.TVector3(xy[0],xy[1],z)</div> <div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">return</span> vec3</div> <div class="line"><a name="l00175"></a><span class="lineno"> 175</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> </div> <div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="comment">## \brief reads one additional track with trID from MCTrack collection. Returns 1 if success, 0 otherwise.</span></div> <div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="comment"># fills #__productVertex, #__productMoment, #__productCharge dictionaries.</span></div> <div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="comment"># \param trID - track index (MCtrID).</span></div> <div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="comment"># \return 1 if successful, 0 if trID is not found and the dictionaries are not modified.</span></div> <div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#a9ea9a05a0453c7e2d1f1ae7484ea396d"> 184</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a9ea9a05a0453c7e2d1f1ae7484ea396d">readTrack</a>(self, trID):</div> <div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  x = <span class="keywordtype">None</span></div> <div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keywordflow">try</span>:</div> <div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  x=self.__tree.MCTrack[trID]</div> <div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordflow">except</span>:</div> <div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keywordflow">pass</span></div> <div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="keywordflow">if</span> (<span class="keywordflow">not</span> b) : <span class="keywordflow">return</span> 0</div> <div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  </div> <div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  vec3 = ROOT.TVector3(x.GetPx(),x.GetPy(),x.GetPz())</div> <div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[trID] = vec3</div> <div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  vec3 = ROOT.TVector3(x.GetStartX(),x.GetStartY(),x.GetStartZ())</div> <div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f">__productVertex</a>[trID] = vec3</div> <div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4f37010427e15ef23aebfeb468a1e237">__productCharge</a>[trID] = <a class="code" href="namespaceRecoSettings.html#aa7af3e34857fc86f30ffbbaa1ce4f817">RecoSettings.chargePDG</a>(x.GetPdgCode())</div> <div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">__productInfo</a>[trID] ={}</div> <div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">__productInfo</a>[trID][<span class="stringliteral">'pdg'</span>] = x.GetPdgCode()</div> <div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  mid = x.GetMotherId()</div> <div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  if(mid>=0) : self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">__productInfo</a>[trID][<span class="stringliteral">'mpdg'</span>] = self.__tree.MCTrack[mid].GetPdgCode()</div> <div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordflow">else</span> : self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">__productInfo</a>[trID][<span class="stringliteral">'mpdg'</span>] = 0</div> <div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  if( self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4893611662191cf54ed81ff4c655dc83">__debug</a>>0 ):</div> <div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordflow">print</span> <span class="stringliteral">"additional MC track for trID"</span>, trID</div> <div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\tpdgid/charge/mother: "</span>, x.GetPdgCode(), self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4f37010427e15ef23aebfeb468a1e237">__productCharge</a>[trID], mid, <span class="stringliteral">"(pdf="</span>,self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">__productInfo</a>[trID][<span class="stringliteral">'mpdg'</span>], <span class="stringliteral">")"</span></div> <div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\torigin: "</span>, self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f">__productVertex</a>[trID].X(), self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f">__productVertex</a>[trID].Y(), self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f">__productVertex</a>[trID].Z()</div> <div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordflow">print</span> <span class="stringliteral">"\tmomentum: "</span>, self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[trID].X(), self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[trID].Y(), self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[trID].Z()</div> <div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">return</span> 1</div> <div class="line"><a name="l00208"></a><span class="lineno"> 208</span> </div> <div class="line"><a name="l00209"></a><span class="lineno"> 209</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> </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>  <span class="comment">########################################################################</span></div> <div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="comment">## \brief reads \b HNL \b decay \b products from MCTrack collection (\b two at the moment!). Returns number of daughters.</span></div> <div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="comment"># Fills #__HNLdecayCoord and #__productVertex, #__productMoment, #__productCharge dictionaries for \b HNL \b daughters.</span></div> <div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="comment"># \return number of daughters (loop stops at daughter==2 at the moment!).</span></div> <div class="line"><a name="l00217"></a><span class="lineno"><a class="line" href="classMCTrackInfo_1_1MCTrackInfo.html#aec0fa1a45f06134247b841faab8bc943"> 217</a></span>  <span class="keyword">def </span><a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#aec0fa1a45f06134247b841faab8bc943">readEvent</a>(self):</div> <div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#aaa8c7975c4de4c642725da17c89ed0db">__clean</a>()</div> <div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordflow">if</span> (self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4893611662191cf54ed81ff4c655dc83">__debug</a>>0 ):</div> <div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keywordflow">print</span> <span class="stringliteral">"sTree.MCTrack"</span>, self.__tree.MCTrack, <span class="stringliteral">"size:"</span>, len(self.__tree.MCTrack)</div> <div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  daughter = 0 </div> <div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  tid = 0</div> <div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="comment">#/home/kkuzn/SHIP/ShipSoft/tmp/FairShip/shipdata/ShipMCTrack.h</span></div> <div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">for</span> x <span class="keywordflow">in</span> self.__tree.MCTrack:</div> <div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">if</span> daughter>1:</div> <div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">break</span></div> <div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  mid = x.GetMotherId()</div> <div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  Z = x.GetStartZ()</div> <div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  if( Z>5000 ): Z=5000</div> <div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordflow">if</span> mid==0: <span class="comment"># #NB# here I suppose HNL is record #1 always!</span></div> <div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a14da949a8b7428f55295ba15215b810a">__weight</a> = x.GetWeight()</div> <div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordflow">if</span> self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4893611662191cf54ed81ff4c655dc83">__debug</a>>0: <span class="keywordflow">print</span> <span class="stringliteral">"HNL\t\t"</span>, tid,<span class="stringliteral">"\t"</span>, x.GetStartX(), x.GetStartY(), x.GetStartZ(), <span class="stringliteral">"\t\t"</span>, x.GetPx(), x.GetPy(), x.GetPz() </div> <div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  elif( mid==1 ): <span class="comment"># HNL decay products</span></div> <div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  self.__decayProdTrID.append(tid)</div> <div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  vec3 = ROOT.TVector3(x.GetPx(),x.GetPy(),x.GetPz())</div> <div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">__productMoment</a>[tid] = vec3</div> <div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  vec3 = ROOT.TVector3(x.GetStartX(),x.GetStartY(),x.GetStartZ())</div> <div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f">__productVertex</a>[tid] = vec3</div> <div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4f37010427e15ef23aebfeb468a1e237">__productCharge</a>[tid] = <a class="code" href="namespaceRecoSettings.html#aa7af3e34857fc86f30ffbbaa1ce4f817">RecoSettings.chargePDG</a>(x.GetPdgCode())</div> <div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">__productInfo</a>[tid] ={}</div> <div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">__productInfo</a>[tid][<span class="stringliteral">'pdg'</span>] = x.GetPdgCode()</div> <div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">__productInfo</a>[tid][<span class="stringliteral">'mpdg'</span>] = self.__tree.MCTrack[mid].GetPdgCode()</div> <div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  if( self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#a4893611662191cf54ed81ff4c655dc83">__debug</a>>0 ): <span class="keywordflow">print</span> x.GetPdgCode(), <span class="stringliteral">"\t\t"</span>, tid,<span class="stringliteral">"\t"</span>, x.GetStartX(), x.GetStartY(), x.GetStartZ(), <span class="stringliteral">"\t\t"</span>, x.GetPx(), x.GetPy(), x.GetPz() </div> <div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="keywordflow">if</span> daughter<1: </div> <div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  self.<a class="code" href="classMCTrackInfo_1_1MCTrackInfo.html#ae7ebe267b558ce4d231ca8b29020ffa7">__HNLdecayCoord</a> = ROOT.TVector3(x.GetStartX(), x.GetStartY(), x.GetStartZ())</div> <div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="keywordflow">else</span>:</div> <div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="keywordflow">if</span> self.__HNLdecayCoord.Z()!=x.GetStartZ():</div> <div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  self.__HNLdecayCoord.SetXYZ(0,0,-8899)</div> <div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  daughter+=1</div> <div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  tid+=1</div> <div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  </div> <div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="keywordflow">return</span> daughter</div> <div class="line"><a name="l00253"></a><span class="lineno"> 253</span> </div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a6477c28c98db43fbc1add398b4c0cc58"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a6477c28c98db43fbc1add398b4c0cc58">MCTrackInfo.MCTrackInfo.setAccPlaneZ</a></div><div class="ttdeci">def setAccPlaneZ</div><div class="ttdoc">set z of the last full acceptance plane (to be used in checkEllipticAcc), depends on RecoSettings...</div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00052">MCTrackInfo.py:52</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_ae7ebe267b558ce4d231ca8b29020ffa7"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#ae7ebe267b558ce4d231ca8b29020ffa7">MCTrackInfo.MCTrackInfo.__HNLdecayCoord</a></div><div class="ttdeci">__HNLdecayCoord</div><div class="ttdoc">HNL decay vertex coordinates (TVector3). </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00022">MCTrackInfo.py:22</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_aec0fa1a45f06134247b841faab8bc943"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#aec0fa1a45f06134247b841faab8bc943">MCTrackInfo.MCTrackInfo.readEvent</a></div><div class="ttdeci">def readEvent</div><div class="ttdoc">reads HNL decay products from MCTrack collection (two at the moment!). </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00217">MCTrackInfo.py:217</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a4f37010427e15ef23aebfeb468a1e237"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a4f37010427e15ef23aebfeb468a1e237">MCTrackInfo.MCTrackInfo.__productCharge</a></div><div class="ttdeci">__productCharge</div><div class="ttdoc">Charge of several stored products (not only HNL daughter) as {MCTrID : value}. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00030">MCTrackInfo.py:30</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a0be7deaac48872c74697f6685508bd35"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a0be7deaac48872c74697f6685508bd35">MCTrackInfo.MCTrackInfo.__decayProdTrID</a></div><div class="ttdeci">__decayProdTrID</div><div class="ttdoc">MCTrID (index of the track in MCtrack list) for HNL daughter products. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00024">MCTrackInfo.py:24</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="classMCTrackInfo_1_1MCTrackInfo_html_a7d6d8ccce59d04dbda850b3ce01fb32e"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a7d6d8ccce59d04dbda850b3ce01fb32e">MCTrackInfo.MCTrackInfo.getCharge</a></div><div class="ttdeci">def getCharge</div><div class="ttdoc">returns charge of a particle with the given trID (index in MCTrack collection). </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00108">MCTrackInfo.py:108</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a8851c544b8902ba6c461483caa1c14a2"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a8851c544b8902ba6c461483caa1c14a2">MCTrackInfo.MCTrackInfo.getTrIDs</a></div><div class="ttdeci">def getTrIDs</div><div class="ttdoc">returns list of all MCtrIDs read by readEvent and readTrack - not only HNL decay products. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00095">MCTrackInfo.py:95</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a002c4ce91f1ba21a096a1706a2fd586a"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a002c4ce91f1ba21a096a1706a2fd586a">MCTrackInfo.MCTrackInfo.__zAcc</a></div><div class="ttdeci">__zAcc</div><div class="ttdoc">z of the last full acceptance plane (to be used in checkEllipticAcc), must be set later...</div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00018">MCTrackInfo.py:18</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a77ee84d4194eec9f3b8859e7fb921994"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a77ee84d4194eec9f3b8859e7fb921994">MCTrackInfo.MCTrackInfo.getHNLdecayTrIDs</a></div><div class="ttdeci">def getHNLdecayTrIDs</div><div class="ttdoc">returns list of MCtrIDs (index in MCTrack collection) fot HNL decay products. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00085">MCTrackInfo.py:85</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_afe237af47e501fbd0ab8aa2714ae2cf3"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#afe237af47e501fbd0ab8aa2714ae2cf3">MCTrackInfo.MCTrackInfo.__productInfo</a></div><div class="ttdeci">__productInfo</div><div class="ttdoc">Basic information on the particle (pdg, mother pdg,... </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00032">MCTrackInfo.py:32</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a14da949a8b7428f55295ba15215b810a"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a14da949a8b7428f55295ba15215b810a">MCTrackInfo.MCTrackInfo.__weight</a></div><div class="ttdeci">__weight</div><div class="ttdoc">event weight. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00020">MCTrackInfo.py:20</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a9704d39b63497e5211c41525623a285b"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a9704d39b63497e5211c41525623a285b">MCTrackInfo.MCTrackInfo.getMomentum</a></div><div class="ttdeci">def getMomentum</div><div class="ttdoc">returns momentum (TVector3) for a particle with the given trID (index in MCTrack collection). </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00120">MCTrackInfo.py:120</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a3c7c84ace7feb38618dd6bd8e4af9d8b"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a3c7c84ace7feb38618dd6bd8e4af9d8b">MCTrackInfo.MCTrackInfo.getTrackPropagation</a></div><div class="ttdeci">def getTrackPropagation</div><div class="ttdoc">for Tracker Performance studies. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00168">MCTrackInfo.py:168</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_ae37b39fe69c4f715f7efa4af606eec47"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#ae37b39fe69c4f715f7efa4af606eec47">MCTrackInfo.MCTrackInfo.checkEllipticAcc</a></div><div class="ttdeci">def checkEllipticAcc</div><div class="ttdoc">checks if HNL decay vertex (and both HNL daughter tracks, if tight cut) are in elliptic acceptance at...</div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00133">MCTrackInfo.py:133</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_aaa8c7975c4de4c642725da17c89ed0db"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#aaa8c7975c4de4c642725da17c89ed0db">MCTrackInfo.MCTrackInfo.__clean</a></div><div class="ttdeci">def __clean</div><div class="ttdoc">clears all dictionaries and lists. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00040">MCTrackInfo.py:40</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_adb9a3b5c53dc82eadce769df95a9f9b9"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#adb9a3b5c53dc82eadce769df95a9f9b9">MCTrackInfo.MCTrackInfo.__productMoment</a></div><div class="ttdeci">__productMoment</div><div class="ttdoc">Momentum of several stored products (not only HNL daughter) as {MCTrID : TVector3}. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00028">MCTrackInfo.py:28</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a761eb08a7b51d12f9909ce00a1886bf9"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a761eb08a7b51d12f9909ce00a1886bf9">MCTrackInfo.MCTrackInfo.getHNLdecayVertex</a></div><div class="ttdeci">def getHNLdecayVertex</div><div class="ttdoc">returns HNL decay vertex coordinates (TVector3 __HNLdecayCoord). </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00078">MCTrackInfo.py:78</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a18df111baef6f02e2fb667931bd7974c"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a18df111baef6f02e2fb667931bd7974c">MCTrackInfo.MCTrackInfo.getEventWeight</a></div><div class="ttdeci">def getEventWeight</div><div class="ttdoc">returns event weight. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00071">MCTrackInfo.py:71</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a93831a40f5d8c3c70513bb3d1f465b65"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a93831a40f5d8c3c70513bb3d1f465b65">MCTrackInfo.MCTrackInfo.PrintHNL</a></div><div class="ttdeci">def PrintHNL</div><div class="ttdoc">prints HNL decay products </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00058">MCTrackInfo.py:58</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a9ea9a05a0453c7e2d1f1ae7484ea396d"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a9ea9a05a0453c7e2d1f1ae7484ea396d">MCTrackInfo.MCTrackInfo.readTrack</a></div><div class="ttdeci">def readTrack</div><div class="ttdoc">reads one additional track with trID from MCTrack collection. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00184">MCTrackInfo.py:184</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a4893611662191cf54ed81ff4c655dc83"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a4893611662191cf54ed81ff4c655dc83">MCTrackInfo.MCTrackInfo.__debug</a></div><div class="ttdeci">__debug</div><div class="ttdoc">debug level [0,3]. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00016">MCTrackInfo.py:16</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a58064c8befc831414f8cd6c7a6583d83"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a58064c8befc831414f8cd6c7a6583d83">MCTrackInfo.MCTrackInfo.checkVertexUpDown</a></div><div class="ttdeci">def checkVertexUpDown</div><div class="ttdoc">for Tracker Performance studies. </div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00150">MCTrackInfo.py:150</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_a3fba7f2f758aafe00388a2f38648f0bb"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#a3fba7f2f758aafe00388a2f38648f0bb">MCTrackInfo.MCTrackInfo.__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="MCTrackInfo_8py_source.html#l00014">MCTrackInfo.py:14</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_af4f51c2388ec5f40514c59afd5332277"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#af4f51c2388ec5f40514c59afd5332277">MCTrackInfo.MCTrackInfo.__init__</a></div><div class="ttdeci">def __init__</div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00012">MCTrackInfo.py:12</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html">MCTrackInfo.MCTrackInfo</a></div><div class="ttdoc">For a single event stores HNL, its decay products and several other tracks (if requested) from ShipMC...</div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00010">MCTrackInfo.py:10</a></div></div> <div class="ttc" id="classMCTrackInfo_1_1MCTrackInfo_html_ad0414440b9d3f27082aad4422a9b082f"><div class="ttname"><a href="classMCTrackInfo_1_1MCTrackInfo.html#ad0414440b9d3f27082aad4422a9b082f">MCTrackInfo.MCTrackInfo.__productVertex</a></div><div class="ttdeci">__productVertex</div><div class="ttdoc">Production vertices of several stored products (not only HNL daughter) as {MCTrID : TVector3}...</div><div class="ttdef"><b>Definition:</b> <a href="MCTrackInfo_8py_source.html#l00026">MCTrackInfo.py:26</a></div></div> <div class="ttc" id="namespaceRecoSettings_html_a5d559dea0f8f68b24bc28e20ac5963dc"><div class="ttname"><a href="namespaceRecoSettings.html#a5d559dea0f8f68b24bc28e20ac5963dc">RecoSettings.checkEllipticAcc</a></div><div class="ttdeci">def checkEllipticAcc</div><div class="ttdef"><b>Definition:</b> <a href="RecoSettings_8py_source.html#l00021">RecoSettings.py:21</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>