Python
StrawHits.py
Go to the documentation of this file.
1 import ROOT,os,sys,getopt
2 import rootUtils as ut
3 import shipunit as u
4 from pythia8_conf import addHNLtoROOT
5 from array import array
6 
7 import RecoSettings
8 from FitTrackInfo import FitTrackInfo
9 
10 
11 ########################################################################
12 class StrawHits(object):
13  """StrawHit class"""
14  def __init__(self, tree, modules, resolution, debug=0, mhistdict=None, ship_geo=None):
15  ## root tree to be read.
16  self.__tree = tree
17  ## geometry description modules.
18  self.__modules = modules
19  ## debug level [0,3]
20  self.__debug = debug
21  ## hit resolition
22  self.__resolution = resolution
23  ## {MCtrackID : [{'pos':TVector3, 'det':detID, 'dw':distance to wire, 'smdw': smeared dw} where [TVector3] list of each hit position. Created if MCtrackID>0.
24  self.__trackHits = {}
25  ##
26  self.__oldSmearedHits ={}
27  ## {MCtrackID : {X : TVector3}} where x='entry' or 'exit', TVector3 coordinates of last or first hit.
28  ## Created for tracks with more than #RecoSettings .trackMinNofHits hits.
29  self.__trackEdgeHits = {}
30  ## {MCtrackID : number of hits at Z<0 (veto tracker)}.
31  self.__vetoHits = {}
32  ## {MCtrackID: number of crossed stations (exclude veto tracker)}.
33  self.__nStations = {}
34  ## root random engent for hit smearing (see #__hitSmear).
35  self.__random = ROOT.TRandom()
36  ROOT.gRandom.SetSeed(13)
37  #fitter = ROOT.genfit.KalmanFitter()
38  #fitter = ROOT.genfit.KalmanFitterRefTrack()
39  self.__fitter = ROOT.genfit.DAF()
40  # refitted traks
41  self.__reFitTracks = FitTrackInfo(tree=None, debug = self.__debug)
42  self.__docaEval = []
43 
44  if (mhistdict and ship_geo) :
45  fm = ROOT.genfit.FieldManager.getInstance()
46  # copy from python/shipDet_conf.py
47  sbf = ROOT.ShipBellField("wilfried", ship_geo.Bfield.max,ship_geo.Bfield.z,2,ship_geo.Yheight/2.*u.m )
48  for i in range (0,300):
49  z = 1000. + i*10
50  pvec3 = ROOT.TVector3(0,0,z)
51  fx = ROOT.Double(0)
52  fy = ROOT.Double(0)
53  fz = ROOT.Double(0)
54  #fvec3f = fm.getField().get(pvec3)
55  fm.getField().get(0,0,z,fx,fy,fz)
56  fvec3f = ROOT.TVector3(fx,fy,fz)
57 
58  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()))
59 
60  #print z, " ".join("{:10.4f}".format(fvec3f(ii)) for ii in range(0,3)),
61  #print "\t", " ".join("{:10.4f}".format(fvec3s(ii)) for ii in range(0,3))
62  mhistdict['magZfit'].Fill(z,fvec3f.Mag())
63  mhistdict['magZsim'].Fill(z,fvec3s.Mag())
64 
65  zdict = {1:2500., 2:2800., 3:3000.}
66  for zi in zdict:
67  for xi in range (-30, 30):
68  for yi in range (-30,30):
69  x = xi*10.
70  y = yi*10.
71  pvec3 = ROOT.TVector3(x, y, zdict[zi])
72  fx = ROOT.Double(0)
73  fy = ROOT.Double(0)
74  fz = ROOT.Double(0)
75  #fvec3f = fm.getField().get(pvec3)
76  fm.getField().get(x,y,zdict[zi],fx,fy,fz)
77  fvec3f = ROOT.TVector3(fx,fy,fz)
78 
79  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()))
80  #print x, " ", y, " ", zdict[zi],
81  #print "\t", " ".join("{:10.4f}".format(fvec3f(ii)) for ii in range(0,3)),
82  #print "\t", " ".join("{:10.4f}".format(fvec3s(ii)) for ii in range(0,3))
83  mhistdict['magXY'+str(zi)+"fit"].Fill(x, y,fvec3f.Mag())
84  mhistdict['magXY'+str(zi)+"sim"].Fill(x, y,fvec3s.Mag())
85 ########################################################################
86 
87 
88  ## \brief to be called for each new event (called in #readEvent())
89  # cleans all dictionaries (#__trackHits, #__trackEdgeHits, #__vetoHits, #__nStations).
90  def __clean(self):
91  self.__trackHits.clear()
92  self.__oldSmearedHits.clear()
93  self.__trackEdgeHits.clear()
94  self.__vetoHits.clear()
95  self.__nStations.clear()
96  self.__docaEval = []
97 ########################################################################
98 
99 
100  ## \brief returns list of keys #__trackEdgeHits (MCtrackIDs>0 with more than #RecoSettings .trackMinNofHits hits).
101  # \return list of MCtrackIDs of "good" tracks.
102  def getTrIDs(self):
103  trID = []
104  for tid in self.__trackEdgeHits:
105  trID.append(tid)
106  return trID
107 ########################################################################
108 
109 
110  ## \brief returns list of keys #__trackHits (MCtrackIDs>0.
111  # \return list of MCtrackIDs of MC assigned tracks.
112  def getTrIDsALL(self):
113  trID = []
114  for tid in self.__trackEdgeHits:
115  trID.append(tid)
116  return trID
117 ########################################################################
118 
119 
120  ## \brief returns list of keys #__reFitTracks.
121  # \return list of MCtrackIDs of "good" tracks.
122  def getReFitTrIDs(self):
123  return self.__reFitTracks.getTrIDs()
124 ########################################################################
125 
126 
127  def getReFitChi2Ndf(self,tid):
128  return self.__reFitTracks.getChi2Ndf(tid)
129 ########################################################################
130 
131 
132  def getReFitNdf(self,tid):
133  return self.__reFitTracks.getNdf(tid)
134 
135 
136 
137 ########################################################################
138  ## \brief returns vertex (if number of tracks!=2 will return None!).
139  # \return new vertex (if number of tracks!=2 will return None!).
140  def getReFitVertex(self):
141  return self.__reFitTracks.getVertex()
142 ########################################################################
143 
144 
145 
146 ########################################################################
147  ## \brief returns doca's of each extrapolation steps (size is defined in #RecoSettings .VertexExtrSteps).
148  # \return new vertex (if number of tracks!=2 will return None!).
149  def getStepDoca(self, step):
150  if ( step>RecoSettings.VertexExtrSteps or (not self.__reFitTracks.Vertex) ) : return None
151  return self.__docaEval[step]
152 ########################################################################
153 
154 
155  ## \brief returns vertex (if number of tracks!=2 will return None!).
156  # \return new vertex (if number of tracks!=2 will return None!).
157  def getReFitPosDirPval(self, tid):
158  return self.__reFitTracks.getPosDirPval(tid)
159 ########################################################################
160 
161 
162  ## \brief returns number of hits in proper tracker stations (Z>0) calculated from #__trackHits and #__vetoHits.
163  # \param tid - MCtrackID.
164  # \return number of hits in proper tracker stations (Z>0).
165  def getNofPHits(self, tid):
166  return len(self.__trackHits[tid]) - self.__vetoHits[tid]
167 ########################################################################
168 
169 
170  ## \brief returns TVector3 of a tracker entry hit (Z>0) from #__trackEdgeHits.
171  # \param tid - MCtrackID.
172  # \return position of a tracker entry hit (Z>0) from #__trackEdgeHits.
173  def getStartHit(self, tid):
174  return self.__trackEdgeHits[tid]['entry']
175 ########################################################################
176 
177 
178  ## \brief returns number of hits with Z<0 of #__trackHits.
179  # \param tid - MCtrackID.
180  # \return number of hits with Z<0 of #__trackHits.
181  def checkVetoHits(self, tid):
182  vh = 0
183  if tid in self.__vetoHits:
184  vh = self.__vetoHits[tid]
185  return vh
186 ########################################################################
187 
188 
189  def PrintNewTracks(self):
190  print "new Fits: ",
191  self.__reFitTracks.Print()
192 ########################################################################
193 
194 
195  def compareFitTracks(self, tid, theFitTracks):
196  pos, direct, pval = theFitTracks.getPosDirPval(tid)
197  return self.__reFitTracks.compareTracks(tid, pos, direct, pval)
198 
199 ########################################################################
200  ## \brief returns a dictionary {xtop, ytop, z, ybot, ybot, z, dist} for a smeared hit.
201  # \param tid - MCtrackID.
202  # \param hid - hit index of #__trackHits
203  # \param new - to generate new smearing (True) or get from SmearedHits (det.position still recalculated!)
204  # \return a dictionary {xtop, ytop, z, ybot, ybot, z, dist} for a smeared hit.
205  def __hitSmear(self,tid,hid, new=False):
206  top = ROOT.TVector3()
207  bot = ROOT.TVector3()
208  dw = self.__trackHits[tid][hid]['dw']
209  detID = self.__trackHits[tid][hid]['det']
210 
211  self.__modules["Strawtubes"].StrawEndPoints(detID,bot,top)
212 
213  if( new ):
214  smear = abs(self.__random.Gaus(dw, self.__resolution))
215  else:
216  smear = self.__trackHits[tid][hid]['smdw']
217  smearedHit = {'xtop':top.x(),'ytop':top.y(),'z':top.z(),'xbot':bot.x(),'ybot':bot.y(),'z':bot.z(),'dist':smear}
218 
219  if(self.__debug>2):
220  print "\tsmear :", "".join("{:8.2f}".format(self.__trackHits[tid][hid]['pos'](ii)) for ii in range(0,3)),
221  print "{:6.2f}".format(dw),
222  print "\t(xt,xb, yt, yb, z, dw) : ",
223  for x in ['xtop','xbot', 'ytop','ybot','z', 'dist']:
224  print "".join("{:8.2f}".format(smearedHit[x])),
225  print ""
226  return smearedHit
227 ########################################################################
228 
229 
230  ## \brief to be called per each event. Fills #__trackHits, #__trackEdgeHits, #__vetoHits, #__nStations.
231  # \return number of "good" tracks (size of #__trackEdgeHits)
232  def readEvent(self):
233  self.__clean()
234  toSort = [] # list of MCtrackID which has unsorted hits (I saw also hits from different tracks assigned to the same MCtrackID)
235  stationList = {} # {MCtrackID:[stations]}
236 
237  # loop over all hits and fill __trackHits[MCtrackID]
238  hindx = -1
239  for ahit in self.__tree.strawtubesPoint:
240  detID = ahit.GetDetectorID()
241  trID = ahit.GetTrackID()
242 
243  # get old smearing
244  hindx +=1
245  origSmHit = self.__tree.SmearedHits.At(hindx)
246  if( (abs(ahit.GetZ()-origSmHit[3])>0.8) or (abs(ahit.dist2Wire()-origSmHit[7])>0.2) ):
247  print "problem getting smeared his, but do not change anything"
248  print "=>", ahit.GetZ(), origSmHit[3], ahit.dist2Wire(), origSmHit[7]
249  # m = array('d',[i,sm['xtop'],sm['ytop'],sm['z'],sm['xbot'],sm['ybot'],sm['z'],sm['dist']])
250 
251  #=>
252  if(trID<0): continue # these are hits not assigned to MC track because low E cut
253 
254  if (not self.__trackHits.has_key(trID)):
255  self.__trackHits[trID] = []
256  stationList[trID] = []
257 
258  hinfo = {}
259  hinfo['pos'] = ROOT.TVector3(ahit.GetX(), ahit.GetY(), ahit.GetZ())
260  hinfo['det'] = ahit.GetDetectorID()
261  hinfo['dw'] = ahit.dist2Wire()
262  hinfo['smdw'] = origSmHit[7]
263  self.__trackHits[trID].append(hinfo)
264 
265  lastIndx = len(self.__trackHits[trID])-1
266  if( self.__trackHits[trID][lastIndx]['pos'].Z() < self.__trackHits[trID][lastIndx-1]['pos'].Z() ):
267  if( not trID in toSort):
268  toSort.append(trID)
269  if(self.__debug>0): print "StrawHitsEntry: wrong order of hits for track ", trID
270 
271  station = int(ahit.GetDetectorID()/10000000)
272  if station > 4 : continue
273  if ( not station in stationList[trID]) : stationList[trID].append(station)
274 
275  # sort
276  for trID in toSort:
277  if(self.__debug>0): print "StrawHitsEntry: will sort hits for track ", trID
278  if(self.__debug>2):
279  print "\t\thits to be sorted"
280  for hinfo in self.__trackHits[trID]:
281  vec3 = hinfo['pos']
282  print "\t\t\t\t", vec3.X(), "\t", vec3.Y(), "\t", vec3.Z(), hinfo['dw']
283  self.__trackHits[trID].sort(key=lambda x: x['pos'].Z(), reverse=False)
284  if(self.__debug>2):
285  print "\t\thits after sorting"
286  for hinfo in self.__trackHits[trID]:
287  vec3 = hinfo['pos']
288  print "\t\t\t\t", vec3.X(), "\t", vec3.Y(), "\t", vec3.Z(), hinfo['dw']
289 
290  # fill self.__nStations
291  for trID in self.__trackHits:
292  self.__nStations[trID] = len(stationList[trID])
293  if(self.__debug>0):
294  print "Number of crossed stations (trID:n)", trID, " : ", self.__nStations[trID]
295 
296  # find entry and exit positions
297  for trID in self.__trackHits:
298  if(self.__debug>1):
299  print "hits for trID ", trID
300  for hinfo in self.__trackHits[trID]:
301  vec3 = hinfo['pos']
302  print "\t", vec3.X(), "\t", vec3.Y(), "\t", vec3.Z(), hinfo['dw']
303  if(self.__debug>0): print "start/stop position for hits of track ", trID
304  #find number of vetoTracker hits
305  firstHit = 0
306  nHits = len(self.__trackHits[trID])
307  while( firstHit<nHits and (self.__trackHits[trID][firstHit]['pos'].Z()<0) ):
308  firstHit+=1
309 
310  # =>
311  # the EdgeHits are filled only if nHits(stations1-4)>25
312  if( (firstHit<nHits) and ((nHits-firstHit)>RecoSettings.trackMinNofHits) ):
313  self.__trackEdgeHits[trID] = {}
314  self.__trackEdgeHits[trID]['entry'] = self.__trackHits[trID][firstHit]['pos']
315  self.__trackEdgeHits[trID]['exit'] = self.__trackHits[trID][-1]['pos']
316  self.__vetoHits[trID] = firstHit
317  if(self.__debug>0):
318  for pos in self.__trackEdgeHits[trID]:
319  vec3 = self.__trackEdgeHits[trID][pos]
320  print "\t", pos, vec3.X(), "\t", vec3.Y(), "\t", vec3.Z()
321  elif( self.__debug>0): print "not set due to small number of hits"
322 
323  return len(self.__trackEdgeHits)
324 ########################################################################
325 
326 
327 
328 
329 
330  def __getIniDir(self,trID):
331  v1 = self.__trackEdgeHits[trID]['entry']
332  i2 = self.__vetoHits[trID]+1
333  if( len(self.__trackHits[trID])>i2 ):
334  v2 = self.__trackHits[trID][i2]['pos']
335  dv = v2-v1
336  else:
337  dv = ROOT.TVector3(0., 0., 1.)
338  if(self.__debug>0):
339  print "trying to get initial direction having just one hit, will set (0,0,1)"
340  return dv*(1./dv.Mag())
341 
342 
343  def __prepareIniPosMomCov(self, tid, original=True):
344  if ( original ) :
345  pos = ROOT.TVector3(0, 0, 0)
346  mom = ROOT.TVector3(0,0,3.*u.GeV)
347  cov = ROOT.TMatrixDSym(6)
348  resolution = self.__resolution
349  for i in range(3): cov[i][i] = resolution*resolution
350  cov[0][0]=resolution*resolution*100.
351  nM = self.getNofPHits(tid)
352  for i in range(3,6): cov[i][i] = ROOT.TMath.pow(resolution / nM / ROOT.TMath.sqrt(3), 2)
353  else:
354  pos = self.__trackEdgeHits[tid]['entry']
355  mom = self.__getIniDir(tid)
356  cov = ROOT.TMatrixDSym(6)
357  resolution = self.__resolution
358  for i in range(3): cov[i][i] = resolution*resolution
359  cov[0][0]=resolution*resolution*100.
360  nM = self.getNofPHits(tid)
361  for i in range(3,6): cov[i][i] = ROOT.TMath.pow(resolution / nM / ROOT.TMath.sqrt(3), 2)
362  return pos, mom, cov
363 ########################################################################
364 
365 
366 
367  def __prepareWireMeasurements(self, tid, fTrack):
368  #WireMeasurement::WireMeasurement(const TVectorD& rawHitCoords,
369  # const TMatrixDSym& rawHitCov,
370  # int detId,
371  # int hitId,
372  # genfit::TrackPoint* trackPoint)
373  # per each proper hit TMP ??? does it make sense to do for tracks with __vetoHits>0???
374  #self.__measurements4fit[trID] = []
375  for hindx in range (self.__vetoHits[tid], len(self.__trackHits[tid])):
376  sm = self.__hitSmear(tid,hindx)
377  mVector = ROOT.TVectorD(7,array('d',[sm['xtop'],sm['ytop'],sm['z'],sm['xbot'],sm['ybot'],sm['z'],sm['dist']]))
378  #self.__measurements4fit[trID].push_back(mVector)
379 
380  hitCov = ROOT.TMatrixDSym(7)
381  hitCov[6][6] = self.__resolution*self.__resolution
382 
383  tp = ROOT.genfit.TrackPoint(fTrack) # note how the point is told which track it belongs to
384  measurement = ROOT.genfit.WireMeasurement(mVector,hitCov,1,6,tp) # the measurement is told which trackpoint it belongs to
385  # print measurement.getMaxDistance()
386  measurement.setMaxDistance(0.5*u.cm)
387  #measurement.setLeftRightResolution(-1)
388  tp.addRawMeasurement(measurement) # package measurement in the TrackPoint
389  if(self.__debug>2):
390  tp.Print()
391  fTrack.insertPoint(tp) # add point to Track
392 
393 
394 
395 
396 
397 
398 ########################################################################
399  def FitTracks(self, old=True):
400 
401  self.__reFitTracks.clean()
402 
403  fitTrack = {}
404  #self.__measurements4fit = {}
405  nTrack = -1
406 
407 
408  for trID in self.__trackEdgeHits : # these are already tracks with large number of hits
409  #print "track entry", self.__trackEdgeHits[tid]['entry'].
410  #print "mfield: ", ROOT
411 
412  # minimal requirements on number of crossed stations
413  if ( self.__nStations<RecoSettings.trackMinNofStations): continue
414 
415  pdg = self.__tree.MCTrack[trID].GetPdgCode()
416 
417  # remove unknown or neutral particles
418  charge = RecoSettings.chargePDG(pdg)
419  if( (not charge) or (charge==0) ):
420  print "StrawHits.FitTracks for TrID ", trID, "finds charge of track of ", charge, " and does nothing."
421  continue
422 
423  posM, momM, covM = self.__prepareIniPosMomCov(trID,old)
424 
425  rep = ROOT.genfit.RKTrackRep(pdg)
426  stateSmeared = ROOT.genfit.MeasuredStateOnPlane(rep)
427  rep.setPosMomCov(stateSmeared, posM, momM, covM)
428 
429  seedState = ROOT.TVectorD(6)
430  seedCov = ROOT.TMatrixDSym(6)
431  rep.get6DStateCov(stateSmeared, seedState, seedCov)
432 
433  fitTrack[trID] = ROOT.genfit.Track(rep, seedState, seedCov)
434  ROOT.SetOwnership(fitTrack[trID], False)
435 
436  if(self.__debug>2): print "preparing measurements for track ID", trID
437  self.__prepareWireMeasurements(trID, fitTrack[trID])
438 
439 
440  if not fitTrack[trID].checkConsistency():
441  print 'Problem with track before fit, not consistent',self.fitTrack[atrack]
442  continue
443  try: self.__fitter.processTrack(fitTrack[trID]) # processTrackWithRep(fitTrack[atrack],rep,True)
444  except:
445  print "genfit failed to fit track"
446  continue
447  if not fitTrack[trID].checkConsistency():
448  print 'Problem with track after fit, not consistent',self.fitTrack[atrack]
449  continue
450 
451  stat = fitTrack[trID].getFitStatus()
452  if not stat.isFitConverged() : continue
453  f = fitTrack[trID].getFittedState()
454 
455  #if(self.__debug>0):
456  #print "for track ", trID,
457  #print " pos:", " ".join("{:10.4f}".format(f.getPos()(ii)) for ii in range(0,3)),
458  #print " mom:", " ".join("{:10.4f}".format(f.getMom()(ii)) for ii in range(0,3))
459  self.__reFitTracks.addNewTrack(trID, f.getPos(), f.getDir(), f.getMomMag(),
460  stat.getNdf(), stat.getChi2())
461 
462 
463 
464 
465  newFitTrIDs = self.__reFitTracks.getTrIDs()
466  twoTracks = ( len(newFitTrIDs)==2 )
467  theStep = 0
468  self.__docaEval = []
469  if (twoTracks) :
470  self.__reFitTracks.createVertex(newFitTrIDs[0], newFitTrIDs[1], flag=0) # original
471  iniDoca = self.__reFitTracks.Doca
472  iniY = self.__reFitTracks.Vertex.Y()
473  while ( theStep<RecoSettings.VertexExtrSteps and twoTracks):
474  flag = 1
475  newFitTrIDs = self.__reFitTracks.getTrIDs()
476  #if(self.__debug>1):
477  print "==>vertex ", theStep, " ", self.__reFitTracks.Doca
478  self.__reFitTracks.Vertex.Print()
479  self.__docaEval.append(self.__reFitTracks.Doca)
480  for tid in fitTrack :
481  try:
482  state = fitTrack[tid].getFittedState()
483  except:
484  print "can't get fittedState"
485  flag = -1
486  vPosEx = ROOT.TVector3(0,0,0)
487  vMomEx = ROOT.TVector3(0,0,0)
488  try :
489  state.extrapolateToPoint(self.__reFitTracks.Vertex)
490  except :
491  flag = -1
492  print "track exctrapolation failed!tid: ", tid
493  if (flag > 0 ) : #
494  status = fitTrack[tid].getFitStatus()
495  #print "extr track ", tid,
496  #print " pos:", " ".join("{:10.4f}".format(state.getPos()(ii)) for ii in range(0,3)),
497  #print " mom:", " ".join("{:10.4f}".format(state.getMom()(ii)) for ii in range(0,3))
498  self.__reFitTracks.addNewTrack(trID, state.getPos(), state.getDir(), state.getMomMag(),
499  status.getNdf(), status.getChi2(), verb=False)
500  # FIX temporary
501  self.__reFitTracks.createVertex(newFitTrIDs[0], newFitTrIDs[1], flag)
502  self.__reFitTracks.Vertex.SetY(iniY)
503  theStep+=1
504  twoTacks = ( len(self.__reFitTracks.getTrIDs())==2 )
505  return len(newFitTrIDs)
506 
507 
def readEvent
to be called per each event.
Definition: StrawHits.py:232
def getNofPHits
returns number of hits in proper tracker stations (Z&gt;0) calculated from __trackHits and __vetoHits...
Definition: StrawHits.py:165
def getReFitPosDirPval
returns vertex (if number of tracks!=2 will return None!).
Definition: StrawHits.py:157
__trackHits
{MCtrackID : [{&#39;pos&#39;:TVector3, &#39;det&#39;:detID, &#39;dw&#39;:distance to wire, &#39;smdw&#39;: smeared dw} where [TVector...
Definition: StrawHits.py:24
def getReFitTrIDs
returns list of keys __reFitTracks.
Definition: StrawHits.py:122
def getTrIDsALL
returns list of keys __trackHits (MCtrackIDs&gt;0.
Definition: StrawHits.py:112
__resolution
hit resolition
Definition: StrawHits.py:22
__trackEdgeHits
{MCtrackID : {X : TVector3}} where x=&#39;entry&#39; or &#39;exit&#39;, TVector3 coordinates of last or first hit...
Definition: StrawHits.py:28
def getStartHit
returns TVector3 of a tracker entry hit (Z&gt;0) from __trackEdgeHits.
Definition: StrawHits.py:173
def __clean
to be called for each new event (called in readEvent()) cleans all dictionaries (__trackHits, __trackEdgeHits, __vetoHits, __nStations).
Definition: StrawHits.py:90
__random
root random engent for hit smearing (see __hitSmear).
Definition: StrawHits.py:34
def getTrIDs
returns list of keys __trackEdgeHits (MCtrackIDs&gt;0 with more than RecoSettings .trackMinNofHits hits)...
Definition: StrawHits.py:102
def getStepDoca
returns doca&#39;s of each extrapolation steps (size is defined in RecoSettings .VertexExtrSteps).
Definition: StrawHits.py:149
__modules
geometry description modules.
Definition: StrawHits.py:18
def __prepareWireMeasurements
Definition: StrawHits.py:367
def __hitSmear
returns a dictionary {xtop, ytop, z, ybot, ybot, z, dist} for a smeared hit.
Definition: StrawHits.py:205
__debug
debug level [0,3]
Definition: StrawHits.py:20
def getReFitVertex
returns vertex (if number of tracks!=2 will return None!).
Definition: StrawHits.py:140
__nStations
{MCtrackID: number of crossed stations (exclude veto tracker)}.
Definition: StrawHits.py:32
__vetoHits
{MCtrackID : number of hits at Z&lt;0 (veto tracker)}.
Definition: StrawHits.py:30
__tree
root tree to be read.
Definition: StrawHits.py:16
def checkVetoHits
returns number of hits with Z&lt;0 of __trackHits.
Definition: StrawHits.py:181