Skip to content

Commit

Permalink
Merge pull request #47 from cms-l1-globaltrigger/cscore_fix
Browse files Browse the repository at this point in the history
2.17.1
  • Loading branch information
arnobaer authored Feb 28, 2024
2 parents 51c17f2 + 00ec973 commit 93b08de
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Install using pip (>= 19.0)

```bash
pip install --upgrade pip
pip install git+https://github.com/cms-l1-globaltrigger/tm-vhdlproducer.git@2.17.0
pip install git+https://github.com/cms-l1-globaltrigger/tm-vhdlproducer.git@2.17.1
```

## Build from source
Expand Down
8 changes: 7 additions & 1 deletion changelog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.17.1] - 2024-02-28

### Fixed
- incorrect CScore value (#46).

## [2.17.0] - 2024-02-20

### Changed
Expand Down Expand Up @@ -305,7 +310,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- adjusted `--dryrun` and `--ratio` options.

[unreleased]: https://github.com/cms-l1-globaltrigger/tm-vhdlproducer/compare/2.17.0...HEAD
[unreleased]: https://github.com/cms-l1-globaltrigger/tm-vhdlproducer/compare/2.17.1...HEAD
[2.17.1]: https://github.com/cms-l1-globaltrigger/tm-vhdlproducer/compare/2.17.0...2.17.1
[2.17.0]: https://github.com/cms-l1-globaltrigger/tm-vhdlproducer/compare/2.16.0...2.17.0
[2.16.0]: https://github.com/cms-l1-globaltrigger/tm-vhdlproducer/compare/2.15.1...2.16.0
[2.15.1]: https://github.com/cms-l1-globaltrigger/tm-vhdlproducer/compare/2.15.0...2.15.1
Expand Down
2 changes: 1 addition & 1 deletion tmVhdlProducer/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.17.0"
__version__ = "2.17.1"
5 changes: 0 additions & 5 deletions tmVhdlProducer/algodist.py
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,6 @@ def __init__(self, es, tray):
# * assigning precision_pt
# * assigning precision_math
# * assigning precision_inverse_deltaR
# * assigning precision_cscore
#
def precision_key(left, right, name):
"""Returns precision key for scales map."""
Expand All @@ -1334,10 +1333,6 @@ def precision_key(left, right, name):
scales = self.eventSetup.getScaleMapPtr()

for condition in self.condition_handles.values():
for object in condition.objects:
for cut in object.cuts:
if cut.cut_type == tmEventSetup.CicadaScore:
cut.precision_cscore = scales['PRECISION-CICADA-CScore'].getNbits()
for cut in condition.cuts:
if cut.cut_type == tmEventSetup.TwoBodyPt:
left = condition.objects[0]
Expand Down
4 changes: 1 addition & 3 deletions tmVhdlProducer/handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,10 @@ def __init__(self, cut):
self.precision_pt = 0
self.precision_math = 0
self.precision_inverse_dr = 0
self.precision_cscore = 0.

def __repr__(self):
return f"{self.__class__.__name__}(name={self.name})"


class ObjectHandle(Handle):
"""Represents an object."""

Expand Down Expand Up @@ -459,7 +457,7 @@ def isMinBiasCondition(self):

def isTowerCountCondition(self):
return self.type in TowerCountConditionTypes

def isCorrelationCondition(self):
return self.type in CorrelationConditionTypes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ cond_{{ condition.vhdl_signal }}: entity work.cicada_condition
{%- elif o.is_signal_type -%}
{{ condition.vhdl_signal }} <= bx_data.{{ o.type | lower }}({{ o.bx_arr }});
{%- endif -%}

3 changes: 1 addition & 2 deletions tmVhdlProducer/vhdlhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1467,8 +1467,7 @@ def __init__(self, value=0):

def update(self, cut_handle):
"""Updates cicada score and enables cut."""
self.value = cut_handle.minimum.value
self.value = self.value * cut_handle.precision_cscore
self.value = int(cut_handle.minimum.index)
self.enabled = True

class TwoBodyPtCutHelper(ThresholdCutHelper):
Expand Down

0 comments on commit 93b08de

Please sign in to comment.