Belle II Software  release-05-02-19
__init__.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 import basf2
5 
6 from ROOT import gSystem
7 gSystem.Load('libframework') # for PyStoreArray
8 gSystem.Load('libcdc') # for CDCSimHit
9 gSystem.Load('libtracking') # for CDCHit and so on
10 
11 from ROOT import Belle2 # make Belle2 namespace available
12 from ROOT import std
13 
14 import os
15 import os.path
16 import math
17 
18 import subprocess
19 from datetime import datetime
20 import itertools
21 from . import svgdrawing
22 from .svgdrawing import attributemaps
23 
24 
25 class CDCSVGDisplayModule(basf2.Module):
26 
27  """
28  Personal two dimensional event display based on scalable vector graphics
29  """
30 
31  def __init__(self, output_folder="/tmp", interactive=True):
32  """
33  Constructor method
34 
35  Parameters
36  ----------
37  output_folder : str
38  Target folder for the output
39  interactive : bool, optional
40  Switch to display each event to the user and ask to continue after each event
41  Defaults to True
42  """
43 
44  super(CDCSVGDisplayModule, self).__init__()
45  # call constructor of base class, required!
46 
47 
48  self.interactive = interactive
49 
50 
51  self.output_folder = output_folder
52 
53  # List of drawing options
54 
55  # Animate the display by uncovering the drawn objects in order of their time of flight
56  # This can be seen in most standard browsers. Note however that you should switch of
57  # the wires in this case to reduce the rendering load.
58 
59  self.animate = False
60 
61 
62  self.forward_fade = False
63 
64  # The following options can be used independent of the track finder
65  # to view Monte Carlo information after the simulation is done
66 
67 
68  self.use_cpp = True
69 
70 
71  self.use_python = False
72 
73 
74  self._draw_wires = True
75  # This is wrapped by an extra property,
76  # because it should always be deactivated in case the scene is animated
77 
78 
80 
81 
83 
84 
85  self.draw_walls = False
86 
87 
88  self.draw_hits = True
89 
90 
91  self.draw_takenflag = False
92 
93 
94  self.draw_mcparticle_id = False
95 
96 
98 
99 
101 
102 
104 
105 
106  self.draw_simhits = False
107 
108 
109  self.draw_simhit_tof = False
110 
111 
112  self.draw_simhit_posflag = False
113 
114 
115  self.draw_simhit_pdgcode = False
116 
117 
119  self.draw_simhit_bkgtag = False
120 
121 
122  self.draw_simhit_isbkg = False
123 
124 
125  self.draw_nloops = False
126 
127 
130  self.draw_connect_tof = False
131 
132 
134  self.draw_rlinfo = False
135 
136 
139  self.draw_reassigned = False
140 
141 
142  self.draw_mcsegments = False
143 
144 
146 
147 
148  self.draw_mcsegmentpairs = False # <- not implemented at the moment
149 
150 
152 
153  # Those are only available if the local track finder is in the module chain
154  # and specific compile time flags enable to transportation of this data
155 
156 
157  self.draw_superclusters = False
158 
159 
160  self.draw_clusters = False
161 
162 
163  self.draw_segments = False
164 
165 
167 
168 
169  self.draw_tangentsegments = False
170 
171 
173 
174 
176  self.draw_segment_fbinfos = False
177 
178 
180 
181 
183 
184 
187 
188 
191 
192 
194 
195 
196  self.draw_segmentpairs = False
197 
198 
199  self.draw_segmenttriples = False
200 
201 
203 
204 
205  self.draw_tracks = False
206 
207 
209 
210  # Those are only available, if any track finder is in the module chain (not tested for others than the local track finder)
211 
212 
213  self.draw_recotracks = False
214 
215 
216  self.draw_mcrecotracks = False
217 
218 
220 
221 
223 
224 
226 
227 
229 
230 
232 
233 
235 
236 
237  self.cdc_hits_store_array_name = "CDCHits"
238 
239 
240  self.reco_tracks_store_array_name = "RecoTracks"
241 
242 
243  self.mc_reco_tracks_store_array_name = "MCRecoTracks"
244 
245 
246  self.cdc_wire_hit_cluster_store_obj_name = "CDCWireHitClusterVector"
247 
248 
249  self.cdc_segment_vector_store_obj_name = 'CDCSegment2DVector'
250 
251 
252  self.file_number = 0
253 
254 
255  self.filename_prefix = "CDCDisplay"
256 
257 
258  self.use_time_in_filename = False
259 
260  @property
261  def drawoptions(self):
262  """
263  Property that collects the various names of the draw options to a list
264  that are not related to the CDC cellular automaton track finder.
265  @return list of strings naming the different switches that can be activated.
266  """
267  result = [
268  'animate',
269  'forward_fade',
270  'draw_superlayer_boundaries',
271  'draw_walls',
272  'draw_interaction_point',
273  'draw_mcparticle_id',
274  'draw_mcparticle_pdgcode',
275  'draw_mcparticle_primary',
276  'draw_mcparticle_trajectories',
277  'draw_mcsegments',
278  'draw_simhits',
279  'draw_simhit_tof',
280  'draw_simhit_posflag',
281  'draw_simhit_pdgcode',
282  'draw_simhit_bkgtag',
283  'draw_simhit_isbkg',
284  'draw_nloops',
285  'draw_connect_tof',
286  'draw_rlinfo',
287  'draw_reassigned',
288  'draw_recotracks',
289  'draw_mcrecotracks',
290  'draw_recotrack_matching',
291  'draw_mcrecotrack_matching',
292  'draw_recotrack_seed_trajectories',
293  'draw_recotrack_fit_trajectories',
294  # Specialised options to be used in the CDC local tracking context
295  # obtain them from the all_drawoptions property
296  # 'draw_takenflag',
297  # 'draw_superclusters',
298  # 'draw_clusters',
299  # 'draw_tangentsegments',
300  # 'draw_segment_trajectories',
301  # 'draw_segments',
302  # 'draw_segment_mctrackids',
303  # 'draw_segment_fbinfos',
304  # 'draw_segment_firstInTrackIds',
305  # 'draw_segment_lastInTrackIds',
306  # 'draw_segment_firstNPassedSuperLayers',
307  # 'draw_segment_lastNPassedSuperLayers',
308  # 'draw_segmentpairs'
309  # 'draw_mcsegmentpairs',
310  # 'draw_axialsegmentpairs'
311  # 'draw_mcaxialsegmentpairs',
312  # 'draw_segmenttriples',
313  # 'draw_segmenttriple_trajectories',
314  # 'draw_mcsegmenttriples',
315  # 'draw_tracks',
316  # 'draw_track_trajectories',
317  ]
318  for name in result:
319  if not hasattr(self, name):
320  raise NameError('%s is not a valid draw option. Fix the misspelling.'
321  % name)
322 
323  return result
324 
325  @property
326  def all_drawoptions(self):
327  """
328  Property that collects the all names of the draw options to a list.
329  Note that some draw options only make sense after running the CDC
330  cellular automaton track finder.
331  @return list of strings naming the different switches that can be activated.
332  """
333  result = self.drawoptions
334 
335  # Add all attributes that start with draw
336  draw_options = [option for option in self.__dict__
337  if option.startswith('draw_')]
338  _draw_options = [option[1:] for option in self.__dict__
339  if option.startswith('_draw_')]
340 
341  result.extend(draw_options)
342  result.extend(_draw_options)
343 
344  return set(result)
345 
346  @property
347  def draw_wires(self):
348  """
349  Getter for the draw option that indicates if all wires shall be drawn.
350  Since this has some performance impact in animated events the wires
351  are prevented from being drawn in this case.
352  """
353 
354  return self._draw_wires and not self.animate
355 
356  @draw_wires.setter
357  def draw_wires(self, draw_wires):
358  """
359  Setter for the option to draw all wires.
360  """
361 
362  self._draw_wires = draw_wires
363 
364  def initialize(self):
365  """
366  Initialisation method of the module.
367  Creates the output folder if it is not present yet.
368  """
369 
370  output_folder = self.output_folder
371  if not os.path.exists(output_folder):
372  print("CDCSVGDisplay.__init__ : Output folder '", output_folder,
373  "' does not exist.")
374  answer = input('Create it? (y or n)')
375  if answer == 'y':
376  os.makedirs(output_folder)
377 
378  # Make sure at least one backend is available
379  if not self.use_cpp and not self.use_python:
380  self.use_cpp = True
381 
382  if self.use_cpp:
384  if self.use_python:
385  plotter = svgdrawing.CDCSVGPlotter(animate=self.animate)
386 
387  # ######### CDCWires ##########
388  # Draw wires from cdcwire objects
389  # Now prefered way of ploting the wires
390  if self.draw_wires:
391  theCDCWireTopology = \
393 
394  if self.use_cpp:
395  cppplotter.drawWires(theCDCWireTopology)
396  if self.use_python:
397  plotter.draw(theCDCWireTopology)
398 
399  if self.use_cpp:
400 
401  self.prefilled_cppplotter = cppplotter
402  if self.use_python:
403 
404  self.prefilled_plotter = plotter
405 
407  segment_relation_filter.initialize()
408 
409  def beginRun(self):
410  """
411  Begin run method of the module. Empty here.
412  """
413 
414  pass
415 
416  def event(self):
417  """
418  Event method of the module. Draws the event into a new svg file.
419  """
420 
421  # Clone the plotter that contains the wires already
422  if self.use_cpp:
423  cppplotter = self.prefilled_cppplotter.clone()
424  if self.use_python:
425  plotter = self.prefilled_plotter.clone()
426 
427  self.file_number += 1
428 
429  # if self.draw_wires:
430  # theCDCWireTopology = \
431  # Belle2.TrackFindingCDC.CDCWireTopology.getInstance()
432  # cppplotter.draw(theCDCWireTopology)
433 
434  # Plotter instance receiving drawable tracking objects.
435  # self.plotter = plotter
436 
437  # Construct additional information from basic Monte Carlo data, if it is available from the DataStore
438  # Belle2.TrackFindingCDC.CDCMCHitLookUp.getInstance().fill()
439 
440  # Skip empty events
441  if Belle2.PyStoreArray(self.cdc_hits_store_array_name).getEntries() == 0:
442  basf2.B2INFO("Skip empty event")
443  return
444 
445  # ######### CDCHits ##########
446  # Draw the raw CDCHits
447  if self.draw_hits:
448  if self.use_cpp:
449  cppplotter.drawHits(self.cdc_hits_store_array_name, 'ZeroDriftLengthColorMap', 'ZeroDriftLengthStrokeWidthMap')
450  if self.use_python:
451  styleDict = {'stroke': attributemaps.ZeroDriftLengthColorMap(),
452  'stroke-width': attributemaps.ZeroDriftLengthStrokeWidthMap()}
453  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
454 
455  # Draw the CDCHits colored by the taken flag from the CDCWireHit.
456  if self.draw_takenflag:
457  if self.use_cpp:
458  cppplotter.drawHits(self.cdc_hits_store_array_name, 'TakenFlagColorMap', '')
459  if self.use_python:
460  styleDict = {'stroke': attributemaps.TakenFlagColorMap(), }
461  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
462 
463  # Draw mcparticle id
464  if self.draw_mcparticle_id:
465  if self.use_cpp:
466  cppplotter.drawHits(self.cdc_hits_store_array_name, 'MCParticleColorMap', '')
467  if self.use_python:
468  styleDict = {'stroke': attributemaps.MCParticleColorMap()}
469  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
470 
471  # Draw monte carlo pdg codes
472  if self.draw_mcparticle_pdgcode:
473  if self.use_cpp:
474  cppplotter.drawHits(self.cdc_hits_store_array_name, 'MCPDGCodeColorMap', '')
475  if self.use_python:
476  styleDict = {'stroke': attributemaps.MCPDGCodeColorMap()}
477  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
478 
479  # Draw monte carlo pdg codes
480  if self.draw_mcparticle_primary:
481  if self.use_cpp:
482  cppplotter.drawHits(self.cdc_hits_store_array_name, 'MCPrimaryColorMap', '')
483  if self.use_python:
484  styleDict = {'stroke': attributemaps.MCPrimaryColorMap()}
485  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
486 
487  # Draw SimHits
488  if self.draw_simhits:
489  if self.use_cpp:
490  cppplotter.drawSimHits(self.cdc_hits_store_array_name, '', '.2')
491  if self.use_python:
492  hit_storearray = Belle2.PyStoreArray(self.cdc_hits_store_array_name)
493  if hit_storearray:
494  simHits_related_to_hits = [hit.getRelated('CDCSimHits')
495  for hit in hit_storearray]
496  styleDict = {'stroke-width': '0.2'}
497  plotter.draw_iterable(simHits_related_to_hits, **styleDict)
498 
499  # Draw RL MC info
500  if self.draw_simhit_posflag:
501  if self.use_cpp:
502  cppplotter.drawHits(self.cdc_hits_store_array_name, 'PosFlagColorMap', '')
503  if self.use_python:
504  styleDict = {'stroke': attributemaps.PosFlagColorMap()}
505  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
506 
507  # Draw local RL info
508  if self.draw_rlinfo:
510  if self.use_cpp:
511  cppplotter.drawHits(self.cdc_hits_store_array_name, 'RLColorMap', '')
512  if self.use_python:
513  styleDict = {'stroke': attributemaps.RLColorMap()}
514  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
515 
516  # Draw tof info
517  if self.draw_simhit_tof:
518  if self.use_cpp:
519  cppplotter.drawHits(self.cdc_hits_store_array_name, 'TOFColorMap', '')
520  if self.use_python:
521  styleDict = {'stroke': attributemaps.TOFColorMap()}
522  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
523 
524  # Draw pdg code of simhits
525  if self.draw_simhit_pdgcode:
526  if self.use_cpp:
527  cppplotter.drawHits(self.cdc_hits_store_array_name, "SimHitPDGCodeColorMap", "")
528  if self.use_python:
529  def color_map(iHit, hit):
530  simHit = hit.getRelated('CDCSimHits')
531  pdgCode = simHit.getPDGCode()
532  color = \
533  attributemaps.MCPDGCodeColorMap.color_by_pdgcode.get(pdgCode,
534  'orange')
535  return color
536 
537  styleDict = {'stroke': color_map}
538  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
539 
540  # Draw background tag of related simhits
541  if self.draw_simhit_bkgtag:
542  if self.use_cpp:
543  cppplotter.drawHits(self.cdc_hits_store_array_name, 'BackgroundTagColorMap', '')
544  if self.use_python:
545  styleDict = {'stroke': attributemaps.BackgroundTagColorMap()}
546  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
547 
548  # Draw background tag != bg_none of related simhits
549  if self.draw_simhit_isbkg:
550  if self.use_cpp:
551  cppplotter.drawHits(self.cdc_hits_store_array_name, 'SimHitIsBkgColorMap', '')
552  if self.use_python:
553  def color_map(iHit, hit):
554  simHit = hit.getRelated('CDCSimHits')
555  bkgTag = simHit.getBackgroundTag()
556  color = ('gray' if bkgTag else 'red')
557  return color
558 
559  styleDict = {'stroke': color_map}
560  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
561 
562  # Draw background tag != bg_none of related simhits
563  if self.draw_nloops:
564  if self.use_cpp:
566  cppplotter.drawHits(self.cdc_hits_store_array_name, 'NLoops', '')
567  if self.use_python:
568  print('No Python-function defined')
569 
570  if self.draw_connect_tof:
571  if self.use_cpp:
572  cppplotter.drawSimHitsConnectByToF(self.cdc_hits_store_array_name, "black", ".2")
573  if self.use_python:
574  cdchits_storearray = Belle2.PyStoreArray(self.cdc_hits_store_array_name)
575  if cdchits_storearray:
576  simhits_related_to_cdchit = [cdchit.getRelated('CDCSimHits')
577  for cdchit in cdchits_storearray]
578 
579  # group them by their mcparticle id
580  simhits_by_mcparticle = {}
581  for simhit in simhits_related_to_cdchit:
582  mcparticle = simhit.getRelated('MCParticles')
583  if not mcparticle == None: # noqa
584  mcTrackId = mcparticle.getArrayIndex()
585  simhits_by_mcparticle.setdefault(mcTrackId, [])
586  simhits_by_mcparticle[mcTrackId].append(simhit)
587 
588  for simhits_for_mcparticle in list(simhits_by_mcparticle.values()):
589  simhits_for_mcparticle.sort(key=lambda simhit:
590  simhit.getFlightTime())
591 
592  nSimHits = len(simhits_for_mcparticle)
593  for iSimHit in range(nSimHits - 1):
594  fromSimHit = simhits_for_mcparticle[iSimHit]
595  toSimHit = simhits_for_mcparticle[iSimHit + 1]
596 
597  styleDict = {'stroke-width': '0.2', "stroke": "black"}
598 
599  fromHit = fromSimHit.getRelated(self.cdc_hits_store_array_name)
600  toHit = toSimHit.getRelated(self.cdc_hits_store_array_name)
601 
602  fromWireHit = Belle2.TrackFindingCDC.CDCWireHit(fromHit)
603  toWireHit = Belle2.TrackFindingCDC.CDCWireHit(toHit)
604 
605  fromRLWireHit = Belle2.TrackFindingCDC.CDCRLWireHit(fromWireHit, 0)
606  toRLWireHit = Belle2.TrackFindingCDC.CDCRLWireHit(toWireHit, 0)
607 
608  fromDisplacement = Belle2.TrackFindingCDC.Vector3D(fromSimHit.getPosTrack() - fromSimHit.getPosWire())
609  toDisplacement = Belle2.TrackFindingCDC.Vector3D(toSimHit.getPosTrack() - toSimHit.getPosWire())
610 
611  fromRecoHit2D = Belle2.TrackFindingCDC.CDCRecoHit2D(fromRLWireHit, fromDisplacement.xy())
612  toRecoHit2D = Belle2.TrackFindingCDC.CDCRecoHit2D(toRLWireHit, toDisplacement.xy())
613 
614  tangent = Belle2.TrackFindingCDC.CDCTangent(fromRecoHit2D, toRecoHit2D)
615  plotter.draw(tangent, **styleDict)
616 
617  # Draw the reassignment information of hits
618  if self.draw_reassigned:
619  if self.use_cpp:
620  cppplotter.drawHits(self.cdc_hits_store_array_name, 'ReassignedSecondaryMap', '')
621  if self.use_python:
622  styleDict = {'stroke': attributemaps.ReassignedSecondaryMap()}
623  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
624 
625  # Draw the in track segment id
626  if self.draw_mcsegments:
628  if self.use_cpp:
629  cppplotter.drawHits(self.cdc_hits_store_array_name, 'MCSegmentIdColorMap', '')
630  if self.use_python:
631  styleDict = {'stroke': attributemaps.MCSegmentIdColorMap()}
632  plotter.draw_storearray(self.cdc_hits_store_array_name, **styleDict)
633 
634  # Draw superclusters
635  if self.draw_superclusters:
636  if self.use_cpp:
637  cppplotter.drawClusters('CDCWireHitSuperClusterVector',
638  '', '')
639  if self.use_python:
640  styleDict = {'stroke': attributemaps.listColors}
641  plotter.draw_storevector('CDCWireHitSuperClusterVector', **styleDict)
642 
643  # Draw clusters
644  if self.draw_clusters:
645  if self.use_cpp:
646  cppplotter.drawClusters(self.cdc_wire_hit_cluster_store_obj_name,
647  '', '')
648  if self.use_python:
649  styleDict = {'stroke': attributemaps.listColors}
650  plotter.draw_storevector(self.cdc_wire_hit_cluster_store_obj_name, **styleDict)
651 
652  # ######### CDCSegments2D ##########
653  # Draw Segments
654  if self.draw_segments:
655  if self.use_cpp:
656  cppplotter.drawSegments(self.cdc_segment_vector_store_obj_name,
657  "ListColors", "")
658  if self.use_python:
659  styleDict = {'stroke': attributemaps.listColors}
660  plotter.draw_storevector(self.cdc_segment_vector_store_obj_name, **styleDict)
661 
662  if self.draw_segment_mctrackids:
664  if self.use_cpp:
665  cppplotter.drawSegments(self.cdc_segment_vector_store_obj_name,
666  "SegmentMCTrackIdColorMap", "")
667  if self.use_python:
668  styleDict = {'stroke': attributemaps.SegmentMCTrackIdColorMap()}
669  plotter.draw_storevector(self.cdc_segment_vector_store_obj_name, **styleDict)
670 
671  if self.draw_segment_fbinfos:
672  if self.use_cpp:
673  cppplotter.drawSegments(self.cdc_segment_vector_store_obj_name,
674  "SegmentFBInfoColorMap", "")
675  if self.use_python:
676  styleDict = {'stroke': attributemaps.SegmentFBInfoColorMap()}
677  plotter.draw_storevector(self.cdc_segment_vector_store_obj_name, **styleDict)
678 
679  if self.draw_segment_firstInTrackIds:
680  if self.use_cpp:
681  cppplotter.drawSegments(self.cdc_segment_vector_store_obj_name,
682  "SegmentFirstInTrackIdColorMap", "")
683  if self.use_python:
684  styleDict = \
685  {'stroke': attributemaps.SegmentFirstInTrackIdColorMap()}
686  plotter.draw_storevector(self.cdc_segment_vector_store_obj_name, **styleDict)
687 
688  if self.draw_segment_lastInTrackIds:
689  if self.use_cpp:
690  cppplotter.drawSegments(self.cdc_segment_vector_store_obj_name,
691  "SegmentLastInTrackIdColorMap", "")
692  if self.use_python:
693  styleDict = \
694  {'stroke': attributemaps.SegmentLastInTrackIdColorMap()}
695  plotter.draw_storevector(self.cdc_segment_vector_store_obj_name, **styleDict)
696 
697  if self.draw_segment_firstNPassedSuperLayers:
699  if self.use_cpp:
700  cppplotter.drawSegments(self.cdc_segment_vector_store_obj_name,
701  "SegmentFirstNPassedSuperLayersColorMap", "")
702  if self.use_python:
703  styleDict = \
704  {'stroke': attributemaps.SegmentFirstNPassedSuperLayersColorMap()}
705  plotter.draw_storevector(self.cdc_segment_vector_store_obj_name, **styleDict)
706 
707  if self.draw_segment_lastNPassedSuperLayers:
709  if self.use_cpp:
710  cppplotter.drawSegments(self.cdc_segment_vector_store_obj_name,
711  "SegmentLastNPassedSuperLayersColorMap", "")
712  if self.use_python:
713  styleDict = \
714  {'stroke': attributemaps.SegmentLastNPassedSuperLayersColorMap()}
715  plotter.draw_storevector(self.cdc_segment_vector_store_obj_name, **styleDict)
716 
717  if self.draw_segmentpairs:
718  if self.use_cpp:
719  cppplotter.drawSegmentPairs('CDCSegmentPairs', 'black', '')
720  if self.use_python:
721  styleDict = {"stroke": "black"}
722  plotter.draw_storearray('CDCSegmentPairs', **styleDict)
723 
724  # Mimic axial to axial pair selection
725  if self.draw_mcaxialsegmentpairs:
726  if self.use_cpp:
727  cppplotter.drawMCAxialSegmentPairs(self.cdc_segment_vector_store_obj_name, "black", '')
728  if self.use_python:
729  segment_storevector = Belle2.PyStoreObj(self.cdc_segment_vector_store_obj_name)
730  if segment_storevector:
731  segments = segment_storevector.obj().unwrap()
732  axial_segments = [segment for segment in segments
733  if segment.getStereoType() == 0]
734 
735  mc_axial_segment_pair_segment_filter = \
737  axial_segment_pair_relations = \
738  (Belle2.TrackFindingCDC.CDCAxialSegmentPair(startSegment, endSegment)
739  for startSegment in axial_segments
740  for endSegment in axial_segments)
741 
742  def is_good_pair(pair):
743  weight = mc_axial_segment_pair_segment_filter(pair)
744  return weight == weight # not nan
745 
746  good_axial_segment_pair_relations = [pair for pair in
747  axial_segment_pair_relations if is_good_pair(pair)]
748  styleDict = {"stroke": "black"}
749  plotter.draw_iterable(good_axial_segment_pair_relations, **styleDict)
750 
751  if self.draw_mcsegmentpairs:
752  if self.use_cpp:
753  cppplotter.drawMCSegmentPairs(self.cdc_segment_vector_store_obj_name, "black", '')
754  if self.use_python:
755  print('No Python-function defined')
756 
757  if self.draw_mcsegmenttriples:
758  if self.use_cpp:
759  cppplotter.drawMCSegmentTriples(self.cdc_segment_vector_store_obj_name, '', '')
760  if self.use_python:
761  segment_storevector = Belle2.PyStoreObj(self.cdc_segment_vector_store_obj_name)
762  if segment_storevector:
763  segments = segment_storevector.obj().unwrap()
764  axial_segments = [segment for segment in segments
765  if segment.getStereoType() == 0]
766 
767  stereo_segments = [segment for segment in segments
768  if segment.getStereoType() != 0]
769 
770  # Misuse this a bit but still does what we want
771  mc_axial_segment_pair_segment_filter = \
773  mc_segment_lookup = \
775 
776  segment_triples = \
778  middleSegment, endSegment) for startSegment in
779  axial_segments for middleSegment in stereo_segments
780  for endSegment in axial_segments)
781 
782  def is_good_triple(triple):
783  start = triple.getStartSegment()
784  middle = triple.getMiddleSegment()
785  end = triple.getEndSegment()
786 
787  pairWeight = \
788  mc_axial_segment_pair_segment_filter(triple)
789 
790  if not pairWeight == pairWeight:
791  return False
792 
793  startToMiddleFBInfo = \
794  mc_segment_lookup.areAlignedInMCTrack(start, middle)
795  if abs(startToMiddleFBInfo) > 1:
796  return False
797 
798  middleToEndFBInfo = \
799  mc_segment_lookup.areAlignedInMCTrack(middle, end)
800  if abs(middleToEndFBInfo) > 1:
801  return False
802 
803  if startToMiddleFBInfo == middleToEndFBInfo:
804  return True
805  else:
806  return False
807 
808  good_segment_triples = [triple for triple in segment_triples
809  if is_good_triple(triple)]
810 
811  styleDict = {"stroke": "black"}
812  plotter.draw_iterable(good_segment_triples, **styleDict)
813 
814  # Draw Tangent segments
815  if self.draw_tangentsegments:
816  if self.use_cpp:
817  print('No CPP-function defined')
818  if self.use_python:
819  styleDict = {'stroke-width': '0.2'}
820  plotter.draw_storearray('CDCTangentSegments', **styleDict)
821 
822  # Draw axial axial segment pairs
823  if self.draw_axialsegmentpairs:
824  if self.use_cpp:
825  cppplotter.drawAxialSegmentPairs('CDCAxialSegmentPairVector', '', '')
826  if self.use_python:
827  styleDict = {'stroke': attributemaps.listColors}
828  plotter.draw_storevector('CDCAxialSegmentPairVector', **styleDict)
829 
830  # Draw segment triples
831  if self.draw_segmenttriples:
832  if self.use_cpp:
833  cppplotter.drawSegmentTriples('CDCSegmentTripleVector', '', '')
834  if self.use_python:
835  styleDict = {'stroke': attributemaps.listColors}
836  plotter.draw_storevector('CDCSegmentTriples', **styleDict)
837 
838  # Draw Tracks
839  if self.draw_tracks:
840  if self.use_cpp:
841  cppplotter.drawTracks('CDCTrackVector', '', '')
842  if self.use_python:
843  styleDict = {'stroke': attributemaps.listColors}
844  plotter.draw_storevector('CDCTrackVector', **styleDict)
845 
846  # Wrong RL Info
847  if self.draw_wrong_rl_infos_in_tracks:
848  if self.use_cpp:
850  cppplotter.drawWrongRLHitsInTracks('CDCTrackVector')
851  if self.use_python:
852  styleDict = {'stroke': attributemaps.WrongRLColorMap()}
853  pystoreobj = Belle2.PyStoreObj('CDCTrackVector')
854 
855  if pystoreobj:
856  # Wrapper around std::vector like
857  wrapped_vector = pystoreobj.obj()
858  vector = wrapped_vector.get()
859 
860  for track in vector:
861  plotter.draw_iterable(list(track.items()), **styleDict)
862 
863  if self.draw_wrong_rl_infos_in_segments:
864  if self.use_cpp:
866  cppplotter.drawWrongRLHitsInSegments(self.cdc_segment_vector_store_obj_name)
867  if self.use_python:
868  styleDict = {'stroke': attributemaps.WrongRLColorMap()}
869  pystoreobj = Belle2.PyStoreObj(self.cdc_segment_vector_store_obj_name)
870 
871  if pystoreobj:
872  # Wrapper around std::vector like
873  wrapped_vector = pystoreobj.obj()
874  vector = wrapped_vector.get()
875 
876  for track in vector:
877  plotter.draw_iterable(list(track.items()), **styleDict)
878 
879  # Draw the RecoTracks
880  if self.draw_recotracks:
881  if self.use_cpp:
882  cppplotter.drawRecoTracks(self.reco_tracks_store_array_name, 'ListColors', '')
883  if self.use_python:
884  styleDict = {'stroke': attributemaps.listColors}
885  plotter.draw_storearray(self.reco_tracks_store_array_name, **styleDict)
886 
887  # Draw the MCRecoTracks
888  if self.draw_mcrecotracks:
889  if self.use_cpp:
890  cppplotter.drawRecoTracks(self.mc_reco_tracks_store_array_name, 'ListColors', '')
891  if self.use_python:
892  styleDict = {'stroke': attributemaps.listColors}
893  plotter.draw_storearray(self.mc_reco_tracks_store_array_name, **styleDict)
894 
895  # Draw the RecoTracks matching status
896  if self.draw_recotrack_matching:
897  if self.use_cpp:
898  cppplotter.drawRecoTracks(self.reco_tracks_store_array_name, 'MatchingStatus', '')
899  if self.use_python:
900  print('No Python-function defined')
901 
902  # Draw the Monte Carlo reference RecoTracks matching status
903  if self.draw_mcrecotrack_matching:
904  if self.use_cpp:
905  cppplotter.drawRecoTracks(self.mc_reco_tracks_store_array_name, 'MCMatchingStatus', '')
906  if self.use_python:
907  print('No Python-function defined')
908 
909  # Draw interaction point
910  if self.draw_interaction_point:
911  if self.use_cpp:
912  cppplotter.drawInteractionPoint()
913  if self.use_python:
914  plotter.draw_interaction_point()
915 
916  # Draw the superlayer boundaries
917  if self.draw_superlayer_boundaries:
918  if self.use_cpp:
919  cppplotter.drawSuperLayerBoundaries()
920  if self.use_python:
921  plotter.draw_superlayer_boundaries()
922 
923  # Draw the outer and inner wall of the cdc.
924  if self.draw_walls:
925  if self.use_cpp:
926  cppplotter.drawOuterCDCWall('black')
927  cppplotter.drawInnerCDCWall('black')
928  if self.use_python:
929  styleDict = {'stroke': 'black'}
930  plotter.draw_outer_cdc_wall(**styleDict)
931  plotter.draw_inner_cdc_wall(**styleDict)
932 
933  # Draw the trajectories of the reco tracks
934  if self.draw_mcparticle_trajectories:
935  if self.use_cpp:
936  cppplotter.drawMCParticleTrajectories("MCParticles", 'black', '')
937  if self.use_python:
938  print("Python backend can not draw mc particles")
939 
940  # Draw the fits to the segments
941  if self.draw_segment_trajectories:
942  if self.use_cpp:
943  cppplotter.drawSegmentTrajectories(self.cdc_segment_vector_store_obj_name,
944  "ListColors", "")
945  if self.use_python:
946  segment_storevector = Belle2.PyStoreObj(self.cdc_segment_vector_store_obj_name)
947  if segment_storevector:
948  segments = segment_storevector.obj().unwrap()
949 
950  iterTrajectories = (segment.getTrajectory2D() for segment in segments)
951  plotter.draw_iterable(iterTrajectories)
952 
953  # Draw segment triples fits
954  if self.draw_segmenttriple_trajectories:
955  cppplotter.drawSegmentTripleTrajectories("CDCSegmentTriples",
956  "ListColors", "")
957 
958  if self.use_python:
959  segmentTriple_storearray = Belle2.PyStoreArray('CDCSegmentTriples')
960  if segmentTriple_storearray:
961  iterSegmentTriples = iter(segmentTriple_storearray)
962  iterTrajectories = (segmentTriple.getTrajectory2D()
963  for segmentTriple in iterSegmentTriples)
964  plotter.draw_iterable(iterTrajectories)
965 
966  # Draw Track Trajectories
967  if self.draw_track_trajectories:
968  if self.use_cpp:
969  cppplotter.drawTrackTrajectories("CDCTrackVector",
970  "ListColors", "")
971  if self.use_python:
972  styleDict = {'stroke': attributemaps.listColors}
973  track_storevector = Belle2.PyStoreObj('CDCTrackVector')
974  if track_storevector:
975  tracks = track_storevector.obj().unwrap()
976  iterTrajectories = (cdcTrack.getStartTrajectory3D().getTrajectory2D()
977  for cdcTrack in tracks)
978  plotter.draw_iterable(iterTrajectories, **styleDict)
979 
980  # Draw the trajectories of the reco tracks
981  if self.draw_recotrack_seed_trajectories:
982  if self.use_python:
983  recotrack_storearray = Belle2.PyStoreArray(self.reco_tracks_store_array_name)
984  if recotrack_storearray:
985  def color_map(iTrajectory, trajectory):
986  # return "black"
987  return attributemaps.listColors[iTrajectory
988  % len(attributemaps.listColors)]
989 
990  styleDict = {'stroke': color_map}
991 
992  trajectories = []
993  for recotrack in recotrack_storearray:
994  tMomentum = recotrack.getMomentumSeed()
995  charge = recotrack.getChargeSeed()
996  tPosition = recotrack.getPositionSeed()
997  time = recotrack.getTimeSeed()
998 
999  momentum = Belle2.TrackFindingCDC.Vector2D(tMomentum.X(),
1000  tMomentum.Y())
1001  position = Belle2.TrackFindingCDC.Vector2D(tPosition.X(),
1002  tPosition.Y())
1003 
1004  trajectory = \
1006  momentum, charge)
1007  trajectories.append(trajectory)
1008 
1009  plotter.draw_iterable(trajectories, **styleDict)
1010 
1011  if self.use_cpp:
1012  raise NotImplementedError
1013 
1014  if self.draw_recotrack_fit_trajectories:
1015  if self.use_cpp:
1016  cppplotter.drawRecoTrackTrajectories(self.reco_tracks_store_array_name, '', '')
1017 
1018  if self.use_python:
1019  raise NotImplementedError
1020 
1021  fileName = self.new_output_filename()
1022  cppfileName = self.new_output_filename()
1023 
1024  if self.use_cpp:
1025  cppplotter.saveFile(cppfileName)
1026  if self.use_python:
1027  plotter.saveSVGFile(fileName)
1028 
1029  if self.interactive:
1030  if self.use_python:
1031  print(" Use the 'display' command to show the svg file", fileName,
1032  'generated for the last event')
1033  if self.use_cpp:
1034  print(" Use the 'display' command to show the svg file", cppfileName,
1035  'generated for the last event with cpp')
1036 
1037  # 'display' is part of the ImageMagic package commonly installed in linux
1038  if self.use_python:
1039  procDisplay = subprocess.Popen(['eog', fileName])
1040  if self.use_cpp:
1041  procDisplay = subprocess.Popen(['eog', cppfileName])
1042  # procDisplay = subprocess.Popen(['display','-background','white',
1043  # '-flatten',fileName])
1044  # procConverter = subprocess.Popen(['rsvg', root + '.svg', root + '.png'])
1045  input('Hit enter for next event')
1046 
1047  def endRun(self):
1048  """
1049  endRun methode of the module. Empty here.
1050  """
1051 
1052  pass
1053 
1054  def terminate(self):
1055  """
1056  teminate methode of the module. Empty here.
1057  """
1058 
1059  pass
1060 
1062  """
1063  Generates a new unique name for the current event without the folder prefix
1064  """
1065 
1066  if self.use_time_in_filename:
1067  output_basename = datetime.now().isoformat() + '.svg'
1068  else:
1069  output_basename = self.filename_prefix + str(self.file_number).zfill(4) + '.svg'
1070  return output_basename
1071 
1073  """
1074  Generates a new unique name for the current event with the folder prefix
1075  """
1076 
1077  return os.path.join(self.output_folder, self.new_output_basename())
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.endRun
def endRun(self)
Definition: __init__.py:1047
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_simhit_isbkg
draw_simhit_isbkg
Switch to draw the CDCSimHits red for getBackgroundTag() != bg_none.
Definition: __init__.py:122
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.beginRun
def beginRun(self)
Definition: __init__.py:409
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_tracks
draw_tracks
Switch to draw the tracks generated by the finder.
Definition: __init__.py:205
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_mcparticle_primary
draw_mcparticle_primary
Switch to draw the MCParticle::hasStatus(c_PrimaryParticle) property.
Definition: __init__.py:100
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segments
draw_segments
Switch to draw the segments generated by the finder.
Definition: __init__.py:163
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule._draw_wires
_draw_wires
Switch to draw the wires.
Definition: __init__.py:74
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_simhit_bkgtag
draw_simhit_bkgtag
Switch to draw the CDCSimHits color coded by their getBackgroundTag() property.
Definition: __init__.py:119
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_simhit_pdgcode
draw_simhit_pdgcode
Switch to draw the CDCSimHits color coded by their getPDGCode() property.
Definition: __init__.py:115
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_wires
def draw_wires(self)
Definition: __init__.py:347
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.new_output_filename
def new_output_filename(self)
Definition: __init__.py:1072
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_recotracks
draw_recotracks
Draw the output RecoTracks.
Definition: __init__.py:213
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segment_lastInTrackIds
draw_segment_lastInTrackIds
Switch to draw the segments generated by the finder colored by the second in track hit id.
Definition: __init__.py:182
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segment_firstInTrackIds
draw_segment_firstInTrackIds
Switch to draw the segments generated by the finder colored by the frist in track hit id.
Definition: __init__.py:179
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_connect_tof
draw_connect_tof
Switch to draw the CDCSimHits connected in the order of their getFlightTime for each Monte Carlo part...
Definition: __init__.py:130
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.prefilled_plotter
prefilled_plotter
prefilled default is to use the python plotter
Definition: __init__.py:404
Belle2::TrackFindingCDC::MCAxialSegmentPairFilter
Filter for the constuction of axial to axial segment pairs based on simple criterions.
Definition: MCAxialSegmentPairFilter.h:34
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_walls
draw_walls
Switch to draw the superlayer boundaries.
Definition: __init__.py:85
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.animate
animate
Switch to make an animated event display by means of animated SVG.
Definition: __init__.py:59
Belle2::TrackFindingCDC::CDCWireTopology::getInstance
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
Definition: CDCWireTopology.cc:22
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.file_number
file_number
Current file's number (used for making output filename)
Definition: __init__.py:252
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_interaction_point
draw_interaction_point
Switch to draw the interaction point.
Definition: __init__.py:79
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_mcparticle_id
draw_mcparticle_id
Switch to draw the MCParticle::getArrayIndex property.
Definition: __init__.py:94
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.forward_fade
forward_fade
Switch to make the color of segments and tracks fade out in the forward direction.
Definition: __init__.py:62
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_mcparticle_trajectories
draw_mcparticle_trajectories
Switch to draw the ideal trajectory of the MCParticle.
Definition: __init__.py:103
Belle2::TrackFindingCDC::CDCSVGPlotter
Helper class to generated the svg image from the various tracking objects.
Definition: CDCSVGPlotter.h:33
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule
Definition: __init__.py:25
Belle2::PyStoreObj
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:69
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.initialize
def initialize(self)
Definition: __init__.py:364
Belle2::TrackFindingCDC::CDCMCSegment2DLookUp::getInstance
static const CDCMCSegment2DLookUp & getInstance()
Getter for the singletone instance.
Definition: CDCMCSegment2DLookUp.cc:23
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segment_trajectories
draw_segment_trajectories
Switch to draw the trajectories fitted to the segments generated by the finder.
Definition: __init__.py:166
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.output_folder
output_folder
Folder the images shall be saved to.
Definition: __init__.py:51
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.use_python
use_python
Flag to use python.
Definition: __init__.py:71
Belle2::TrackFindingCDC::CDCTrajectory2D
Particle trajectory as it is seen in xy projection represented as a circle.
Definition: CDCTrajectory2D.h:46
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_nloops
draw_nloops
Switch to draw the CDCHit colored by the number of loops passed.
Definition: __init__.py:125
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_reassigned
draw_reassigned
Switch to draw the CDCSimHits color coded by their reassignement information to a different MCParticl...
Definition: __init__.py:139
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.terminate
def terminate(self)
Definition: __init__.py:1054
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.reco_tracks_store_array_name
reco_tracks_store_array_name
Name of the RecoTracks store array.
Definition: __init__.py:240
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_mcaxialsegmentpairs
draw_mcaxialsegmentpairs
Switch to draw the axial to axial segment pairs from Monte Carlo truth.
Definition: __init__.py:145
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.new_output_basename
def new_output_basename(self)
Definition: __init__.py:1061
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segmenttriple_trajectories
draw_segmenttriple_trajectories
Switch to draw the trajectories fitted to the segment triples generated by the finder.
Definition: __init__.py:202
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_simhits
draw_simhits
Switch to draw the CDCSimHits with momentum information.
Definition: __init__.py:106
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segmenttriples
draw_segmenttriples
Switch to draw the segment triples generated by the finder.
Definition: __init__.py:199
Belle2::TrackFindingCDC::CDCRecoHit2D
Class representing a two dimensional reconstructed hit in the central drift chamber.
Definition: CDCRecoHit2D.h:57
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.mc_reco_tracks_store_array_name
mc_reco_tracks_store_array_name
Name of the Monte Carlo reference RecoTracks store array.
Definition: __init__.py:243
Belle2::TrackFindingCDC::CDCAxialSegmentPair
Class representing a pair of reconstructed axial segements in adjacent superlayer.
Definition: CDCAxialSegmentPair.h:41
Belle2::TrackFindingCDC::CDCRLWireHit
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:51
Belle2::TrackFindingCDC::CDCTangent
Class representating a linear track piece between two oriented wire hits.
Definition: CDCTangent.h:50
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_mcsegmenttriples
draw_mcsegmenttriples
Switch to draw the segment triples from Monte Carlo truth.
Definition: __init__.py:151
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segment_fbinfos
draw_segment_fbinfos
Switch to draw the segments generated by the finder colored by the coalignment information (forward,...
Definition: __init__.py:176
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.drawoptions
def drawoptions(self)
Definition: __init__.py:261
Belle2::TrackFindingCDC::Vector3D
A three dimensional vector.
Definition: Vector3D.h:34
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_simhit_tof
draw_simhit_tof
Switch to draw the CDCSimHits color coded by their time of flight.
Definition: __init__.py:109
Belle2::TrackFindingCDC::MVAFeasibleSegmentRelationFilter
Filter for the constuction of segment pairs based on simple criteria without the common fit.
Definition: MVAFeasibleSegmentRelationFilter.h:37
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_wrong_rl_infos_in_tracks
draw_wrong_rl_infos_in_tracks
Draw a red cdc hit of the rl info of the track reco hits is wrong, else a green one.
Definition: __init__.py:234
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_mcparticle_pdgcode
draw_mcparticle_pdgcode
Switch to draw the MCParticle::getPDGCode property.
Definition: __init__.py:97
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_wrong_rl_infos_in_segments
draw_wrong_rl_infos_in_segments
Draw a red cdc hit of the rl info of the segment reco hits is wrong, else a green one.
Definition: __init__.py:231
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.cdc_wire_hit_cluster_store_obj_name
cdc_wire_hit_cluster_store_obj_name
Name of the CDC Wire Hit Clusters.
Definition: __init__.py:246
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segment_mctrackids
draw_segment_mctrackids
Switch to draw the segments generated by the finder colored with the Monte Carlo track id.
Definition: __init__.py:172
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segment_firstNPassedSuperLayers
draw_segment_firstNPassedSuperLayers
Switch to draw the segments generated by the finder colored by the number of passed superlayers assoz...
Definition: __init__.py:186
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_recotrack_matching
draw_recotrack_matching
Draw the output RecoTracks pattern recognition matching status.
Definition: __init__.py:219
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_mcsegments
draw_mcsegments
Switch to draw the Monte Carlo segments as generated in CDCMCTrackStore.
Definition: __init__.py:142
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_axialsegmentpairs
draw_axialsegmentpairs
Switch to draw the axial stereo segment pairs generated by the finder.
Definition: __init__.py:193
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.filename_prefix
filename_prefix
Filename prefix.
Definition: __init__.py:255
Belle2::TrackFindingCDC::CDCMCHitLookUp::getInstance
static const CDCMCHitLookUp & getInstance()
Getter for the singletone instance.
Definition: CDCMCHitLookUp.cc:32
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_recotrack_seed_trajectories
draw_recotrack_seed_trajectories
Draw the output track seed trajectories.
Definition: __init__.py:225
Belle2::PyStoreArray
a (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:58
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.interactive
interactive
Switch if the module shall show the event to the user and wait to continue or just generate the image...
Definition: __init__.py:48
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.cdc_segment_vector_store_obj_name
cdc_segment_vector_store_obj_name
Name of the CDC Reco Segment Vector.
Definition: __init__.py:249
trackfindingcdc.cdcdisplay.svgdrawing.CDCSVGPlotter
Definition: __init__.py:13
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_hits
draw_hits
Switch to draw the CDCHits.
Definition: __init__.py:88
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.use_time_in_filename
use_time_in_filename
Use time instead of prefix in filename.
Definition: __init__.py:258
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_superlayer_boundaries
draw_superlayer_boundaries
Switch to draw the superlayer boundaries.
Definition: __init__.py:82
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_simhit_posflag
draw_simhit_posflag
Switch to draw the CDCSimHits color coded by their getPosFlag() property.
Definition: __init__.py:112
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_clusters
draw_clusters
Switch to draw the clusters generated by the finder.
Definition: __init__.py:160
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.__init__
def __init__(self, output_folder="/tmp", interactive=True)
Definition: __init__.py:31
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_superclusters
draw_superclusters
Switch to draw the clusters generated by the finder.
Definition: __init__.py:157
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_mcrecotracks
draw_mcrecotracks
Draw the MC reference RecoTracks.
Definition: __init__.py:216
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_rlinfo
draw_rlinfo
Switch to draw the CDCSimHits color coded by their local right left passage information.
Definition: __init__.py:134
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_track_trajectories
draw_track_trajectories
Switch to draw the trajectories of the tracks generated by the finder.
Definition: __init__.py:208
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_recotrack_fit_trajectories
draw_recotrack_fit_trajectories
Draw the output trackpoint trajectories.
Definition: __init__.py:228
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segmentpairs
draw_segmentpairs
Switch to draw the axial stereo segment pairs generated by the finder.
Definition: __init__.py:196
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.cdc_hits_store_array_name
cdc_hits_store_array_name
Name of the CDC Hits store array.
Definition: __init__.py:237
Belle2::TrackFindingCDC::CDCSegmentTriple
Class representing a triple of reconstructed segements in adjacent superlayer.
Definition: CDCSegmentTriple.h:42
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_mcsegmentpairs
draw_mcsegmentpairs
Switch to draw the axial to stereo segment pairs from Monte Carlo truth.
Definition: __init__.py:148
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_tangentsegments
draw_tangentsegments
Switch to draw the tangent segments generated by the finder.
Definition: __init__.py:169
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_segment_lastNPassedSuperLayers
draw_segment_lastNPassedSuperLayers
Switch to draw the segments generated by the finder colored by the number of passed superlayers assoz...
Definition: __init__.py:190
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.event
def event(self)
Definition: __init__.py:416
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.use_cpp
use_cpp
Flag to use cpp.
Definition: __init__.py:68
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_mcrecotrack_matching
draw_mcrecotrack_matching
Draw the MC reference RecoTracks pattern recognition matching status.
Definition: __init__.py:222
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.draw_takenflag
draw_takenflag
Switch to draw the CDCHits colored by the associated CDCWireHit taken flag.
Definition: __init__.py:91
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.prefilled_cppplotter
prefilled_cppplotter
prefilled default is to use the C++ plotter
Definition: __init__.py:401
trackfindingcdc.cdcdisplay.CDCSVGDisplayModule.all_drawoptions
def all_drawoptions(self)
Definition: __init__.py:326