Belle II Software development
CDCHitUniqueAssumer Class Reference
Inheritance diagram for CDCHitUniqueAssumer:

Public Member Functions

def initialize (self)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 number_of_doubled_hits
 counter for doubled CDC hits
 
 number_of_total_hits
 counter for total CDC hits
 
 number_of_hits_with_wrong_flags
 counter for CDC hits with wrong flags
 

Detailed Description

A small helper module to look for double assigned hits.
Prints a summary after execution

Definition at line 15 of file modules.py.

Member Function Documentation

◆ event()

def event (   self)
Event method of the module

Definition at line 31 of file modules.py.

31 def event(self):
32 """Event method of the module"""
33 track_store_vector = Belle2.PyStoreObj('CDCTrackVector')
34
35 if track_store_vector:
36 # Wrapper around std::vector like
37 wrapped_vector = track_store_vector.obj()
38 tracks = wrapped_vector.get()
39
40 for track in tracks:
41 # Unset all taken flags
42 for recoHit3D in track:
43 if not recoHit3D.getWireHit().getAutomatonCell().hasTakenFlag():
44 self.number_of_hits_with_wrong_flags += 1
45
46 for i, track in enumerate(tracks):
47 # Now check that we only have every wire hit once
48 for j, innerTrack in enumerate(tracks):
49 if i == j:
50 continue
51 for recoHit3D in innerTrack:
52 recoHit3D.getWireHit().getAutomatonCell().setAssignedFlag()
53
54 for recoHit3D in track:
55 self.number_of_total_hits += 1
56 if recoHit3D.getWireHit().getAutomatonCell().hasAssignedFlag():
57 self.number_of_doubled_hits += 1
58 recoHit3D.getWireHit().getAutomatonCell().setAssignedFlag()
59
60 for innerTrack in tracks:
61 for recoHit3D in innerTrack:
62 recoHit3D.getWireHit().getAutomatonCell().unsetAssignedFlag()
63
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

◆ initialize()

def initialize (   self)
Initialization signal at the start of the event processing

Definition at line 22 of file modules.py.

22 def initialize(self):
23 """Initialization signal at the start of the event processing"""
24
25 self.number_of_doubled_hits = 0
26
27 self.number_of_total_hits = 0
28
29 self.number_of_hits_with_wrong_flags = 0
30

◆ terminate()

def terminate (   self)
Termination signal at the end of the event processing

Definition at line 64 of file modules.py.

64 def terminate(self):
65 """Termination signal at the end of the event processing"""
66 print("Number of doubled hits:", self.number_of_doubled_hits)
67 print("Number of hits with wrong taken flag:", self.number_of_hits_with_wrong_flags)
68 print("Number of total hits:", self.number_of_total_hits)
69
70

Member Data Documentation

◆ number_of_doubled_hits

number_of_doubled_hits

counter for doubled CDC hits

Definition at line 25 of file modules.py.

◆ number_of_hits_with_wrong_flags

number_of_hits_with_wrong_flags

counter for CDC hits with wrong flags

Definition at line 29 of file modules.py.

◆ number_of_total_hits

number_of_total_hits

counter for total CDC hits

Definition at line 27 of file modules.py.


The documentation for this class was generated from the following file: