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

Some DataReader classes not constructed in a good state #319

Open
mashephe opened this issue Mar 25, 2024 · 0 comments
Open

Some DataReader classes not constructed in a good state #319

mashephe opened this issue Mar 25, 2024 · 0 comments

Comments

@mashephe
Copy link
Contributor

The ROOTDataReaderTEM classes spool through the entire data file in the constructor. I think a byproduct of this is that when the class is constructed the object is left in a state with m_eventCounter equal to the number of events in the file. In this state, the next call to getEvent() will return a null pointer which is the standard behavior when the end of file is reached. It would be more desirable if at the end of the constructor the counter was reset and the source is ready to provide data. I think this involves a call to resetSource() at the end of the constructor.

Many AmpTools functions reset the source prior to doing fitting, etc., but this can be a surprise to someone writing some standalone code that creates a data reader and then tries to read events from the file.

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

1 participant