Skip to content

Commit

Permalink
updating scoring name ready
Browse files Browse the repository at this point in the history
  • Loading branch information
dudiiiiiiii committed Jan 1, 2025
1 parent b8a784d commit fee1e90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions converter/fluka/cards/scoring_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ def handle_usrbin_scoring(detector: _DetectorType, quantity: Quantity, output_un

output_unit_in_fluka_convention = str(output_unit * -1)

# Make sure that name is processed only once
if not quantity.name_processed:
# Make each scoring distinct by adding output_unit to the name of scoring
quantity.name += f'_{output_unit}'
quantity.name_processed = True

output.extend(parse_detector(detector, quantity, quantity_to_score, output_unit_in_fluka_convention))

counter.usrbin_counter += 1
Expand All @@ -70,8 +76,7 @@ def handle_usrbin_scoring(detector: _DetectorType, quantity: Quantity, output_un
def parse_detector(detector, quantity, quantity_to_score, output_unit_in_fluka_convention) -> list[Card]:
"""Creates USRBIN card"""
if isinstance(detector, CylinderDetector):
return _parse_cylinder_detector(detector, quantity, quantity_to_score,
output_unit_in_fluka_convention)
return _parse_cylinder_detector(detector, quantity, quantity_to_score, output_unit_in_fluka_convention)
return _parse_mesh_detector(detector, quantity, quantity_to_score, output_unit_in_fluka_convention)


Expand Down Expand Up @@ -167,7 +172,6 @@ def __str__(self) -> str:

# temporary default for no symmetry
result: list[str] = []

default_output_unit = 21
counter = ScoringCardIndexCounter()
for scoring in self.data:
Expand Down
1 change: 1 addition & 0 deletions converter/fluka/helper_parsers/scoring_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Quantity:
"""Class representing Quantity"""

name: str
name_processed = False
scoring_filter: Optional[Union[CustomFilter, ParticleFilter]]
modifiers: list[any] # unused
keyword: str = 'DOSE'
Expand Down

0 comments on commit fee1e90

Please sign in to comment.