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

update loadParams(const int runNumber) and fix the index issue in StRoot/StBTofUtil/StBTofSimResParams.h #65

Merged
merged 7 commits into from
Jul 29, 2021

Conversation

Morning-Ye
Copy link
Contributor

changed the void loadParams(const int date = 20160913, const int time = 175725, const char* Default_time = "2016-09-13 17:57:25")
to void loadParams(const int runNumber = 20076002)
and read the BTOF cell resolution table based on the runnumber

Zaochen Ye added 2 commits July 21, 2021 12:26
@Morning-Ye
Copy link
Contributor Author

Gene mentioned that the 19.6 GeV data production will start soon, shall we approve the merger?

@genevb
Copy link
Contributor

genevb commented Jul 26, 2021

Gene mentioned that the 19.6 GeV data production will start soon, shall we approve the merger?

Are you hoping to have this included in SL21c???

@Morning-Ye
Copy link
Contributor Author

Morning-Ye commented Jul 26, 2021 via email

@genevb
Copy link
Contributor

genevb commented Jul 26, 2021 via email

@plexoos
Copy link
Member

plexoos commented Jul 26, 2021

It is so hard to see what was really changed in the code by looking at the diff. There are so many changes in the white space and additional print statements intertwined with presumably real changes... Hopefully, it will make more sense to the maintainers who will approve soon.

@veprbl
Copy link
Member

veprbl commented Jul 27, 2021

I second @plexoos . The change looks fine, but please don't reformat with tabs.

@Morning-Ye
Copy link
Contributor Author

I second @plexoos . The change looks fine, but please don't reformat with tabs.

Hi Dmitry, Thank you very much, I will never do this again!

@genevb
Copy link
Contributor

genevb commented Jul 27, 2021

(EDIT: I see from Zaochen's earlier reply to me that this is needed not just for simulation, but for production as well, reinforcing the point that this needs to be resolved now, so waiting to put these into an SL21c_embed is not an option anyhow.)

Given that embedding for BES-II will likely begin before the production completes, and that we cannot update the library (SL21c) mid-production, we have to wait for this code change to be added before we start the production (unless we create another library, SL21c_embed, though we would preferably not do that). Please understand that there is high pressure to get this production started, so please wrap up this code change (and any others?) that are needed for BES-II with urgency.

@starsdong
Copy link
Member

Frank and Daniel, would it be possible for you to take a review about this change and approve at your earliest convenience?
From my side, the change looks OK. I hope Zaochen has tested this with the Run19 data production?
One potential concern is that the initialization date is always 0101 (January 1st in each calendar year). It should be OK for the BES-II datasets (Run19, 20, 21 etc.). But for some year that starts before Jan. 1st. (e.g. the upcoming 2022 run), one will need to take care of these runs happening before Jan. 1st.

@Morning-Ye
Copy link
Contributor Author

Morning-Ye commented Jul 27, 2021 via email

@starsdong
Copy link
Member

Zaochen, Glad that you have thought about this. Indeed, that would be the best and clean solution.
One more question, do we need to worry about the backward compatibility of this commit?

@Morning-Ye
Copy link
Contributor Author

Morning-Ye commented Jul 27, 2021 via email

@genevb
Copy link
Contributor

genevb commented Jul 28, 2021 via email

@Morning-Ye
Copy link
Contributor Author

Morning-Ye commented Jul 28, 2021 via email

@starsdong
Copy link
Member

Zaochen, thanks. The new commit looks good to me. If you can do a quick test with the 19.6 GeV daq file to be sure something goes wrong with this last commit. Thanks

Copy link
Member

@starsdong starsdong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Zaochen. The new commits look OK to me.

@Morning-Ye
Copy link
Contributor Author

Morning-Ye commented Jul 28, 2021 via email

@starsdong
Copy link
Member

Dmitri, I am not sure if Frank or Daniel is immediately available. Is it OK to add another reviewer here for approval so it can get merged later?

@plexoos
Copy link
Member

plexoos commented Jul 28, 2021

Ok, we can merge with the available feedback.
Can Zaochen provide here at least some instruction how he tested the change?

StRoot/StBTofUtil/StBTofSimResParams.h Outdated Show resolved Hide resolved
StRoot/StBTofUtil/StBTofSimResParams.h Outdated Show resolved Hide resolved
StRoot/StBTofUtil/StBTofSimResParams.h Outdated Show resolved Hide resolved
@Morning-Ye
Copy link
Contributor Author

Morning-Ye commented Jul 28, 2021 via email


TDataSet *DB = GetDataBase("Calibrations/tof/tofSimResParams");
//! Loads BTOF Sim Params from database
//void loadParams(const int date = 20160913, const int time = 175725, const char* Default_time = "2016-09-13 17:57:25")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//void loadParams(const int date = 20160913, const int time = 175725, const char* Default_time = "2016-09-13 17:57:25")

mAverageTimeResTof=0;
for ( int i = 0; i < 120; i++ ){ // nTrays
for ( int j = 0; j < 192; j++ ){
size_t index = i * 120 + j;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that the main objective of this PR was to fix the problem with this index?

-size_t index = i * 120 + j;
+size_t index = i * 192 + j;

If so, can it be mentioned in the PR title? The current title is not very informative. It will become a log message when we squash and merge

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two main changes: 1) fix this index issue; 2) load the table according to the runnumber. Both of these changes are within the function loadParmas().

@Morning-Ye Morning-Ye changed the title loadParams(const int runNumber) in StRoot/StBTofUtil/StBTofSimResParams.h update loadParams(const int runNumber) and fix the index issue in StRoot/StBTofUtil/StBTofSimResParams.h Jul 28, 2021
@plexoos plexoos merged commit d131162 into star-bnl:main Jul 29, 2021
plexoos pushed a commit that referenced this pull request Jul 29, 2021
* change void loadParams(const int date = 20160913, const int time = 175725, const char* Default_time ) to loadParm(const int runnumber)

* change 120, 192 to mNTray mNCellsPerTray

* loadParams(runnumber)

* Gene suggested use Previous year Oct 1st to be safe to grep the correct table

* modify double timeres_tof() itray-1, imodule-1, icell-1

* add call writePPPAHistogram from Bassam

* remove those tem debug lines

Co-authored-by: Zaochen Ye <zye20@rcas6015.rcf.bnl.gov>
@plexoos plexoos mentioned this pull request Jul 29, 2021
akioogawa pushed a commit to akioogawa/star-sw that referenced this pull request Aug 2, 2021
…-bnl#65)

* change void loadParams(const int date = 20160913, const int time = 175725, const char* Default_time ) to loadParm(const int runnumber)

* change 120, 192 to mNTray mNCellsPerTray

* loadParams(runnumber)

* Gene suggested use Previous year Oct 1st to be safe to grep the correct table

* modify double timeres_tof() itray-1, imodule-1, icell-1

* add call writePPPAHistogram from Bassam

* remove those tem debug lines

Co-authored-by: Zaochen Ye <zye20@rcas6015.rcf.bnl.gov>
plexoos pushed a commit that referenced this pull request Oct 8, 2021
* change void loadParams(const int date = 20160913, const int time = 175725, const char* Default_time ) to loadParm(const int runnumber)

* change 120, 192 to mNTray mNCellsPerTray

* loadParams(runnumber)

* Gene suggested use Previous year Oct 1st to be safe to grep the correct table

* modify double timeres_tof() itray-1, imodule-1, icell-1

* add call writePPPAHistogram from Bassam

* remove those tem debug lines

Co-authored-by: Zaochen Ye <zye20@rcas6015.rcf.bnl.gov>
plexoos pushed a commit that referenced this pull request Oct 8, 2021
* change void loadParams(const int date = 20160913, const int time = 175725, const char* Default_time ) to loadParm(const int runnumber)

* change 120, 192 to mNTray mNCellsPerTray

* loadParams(runnumber)

* Gene suggested use Previous year Oct 1st to be safe to grep the correct table

* modify double timeres_tof() itray-1, imodule-1, icell-1

* add call writePPPAHistogram from Bassam

* remove those tem debug lines

Co-authored-by: Zaochen Ye <zye20@rcas6015.rcf.bnl.gov>
plexoos pushed a commit that referenced this pull request Oct 12, 2021
* change void loadParams(const int date = 20160913, const int time = 175725, const char* Default_time ) to loadParm(const int runnumber)

* change 120, 192 to mNTray mNCellsPerTray

* loadParams(runnumber)

* Gene suggested use Previous year Oct 1st to be safe to grep the correct table

* modify double timeres_tof() itray-1, imodule-1, icell-1

* add call writePPPAHistogram from Bassam

* remove those tem debug lines

Co-authored-by: Zaochen Ye <zye20@rcas6015.rcf.bnl.gov>
akioogawa pushed a commit to akioogawa/star-sw that referenced this pull request Nov 10, 2021
…-bnl#65)

* change void loadParams(const int date = 20160913, const int time = 175725, const char* Default_time ) to loadParm(const int runnumber)

* change 120, 192 to mNTray mNCellsPerTray

* loadParams(runnumber)

* Gene suggested use Previous year Oct 1st to be safe to grep the correct table

* modify double timeres_tof() itray-1, imodule-1, icell-1

* add call writePPPAHistogram from Bassam

* remove those tem debug lines

Co-authored-by: Zaochen Ye <zye20@rcas6015.rcf.bnl.gov>
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

Successfully merging this pull request may close these issues.

None yet

5 participants