Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor tools with multiple modes of operation #190

Open
mnieslony opened this issue May 21, 2021 · 1 comment
Open

Refactor tools with multiple modes of operation #190

mnieslony opened this issue May 21, 2021 · 1 comment

Comments

@mnieslony
Copy link
Contributor

This suggestion was also brought up by @marc1uk, in reference to PR #187

Some tools (like e.g. PhaseIIADCCalibrator) have slightly different modes of operation depending on the respective use case. For example, PhaseIIADCCalibrator operates on a list of events in the EventBuilding mode, while it only expects one event per Execute step in the normal operating mode.

Currently, the different modes are realized in large if/else statement blocks that make the code a little harder to read.

As a first step, the different modes of operation could be moved to separate functions. This would already clean up the code significantly. A further step might be to move the handling of the different operation modes to a second tool and provide the main tool always with the same data format.

@marc1uk
Copy link
Collaborator

marc1uk commented May 28, 2021

Evidently I think this is a good idea. As a somewhat independent but very related matter, we never really addressed the situation of analysing Monte Carlo vs Detector Data. Tools such as the TimeClustering and ClusterFinder tools also have if/else sections dedicated to handling the different data sources. The risk with such factoring is that different code is being used to analyse MC and data, which may mean bugs in e.g. data handling aren't picked up because the corresponding MC code is different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants