-
Notifications
You must be signed in to change notification settings - Fork 225
Streaming Lumi Counting and BCO Tagging #4269
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
Open
dillfitz
wants to merge
2
commits into
sPHENIX-Collaboration:master
Choose a base branch
from
dillfitz:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #include "StreamingBcoInfo.h" | ||
|
|
||
| #include <phool/phool.h> | ||
|
|
||
| #include <iostream> | ||
|
|
||
| void StreamingBcoInfo::Reset() | ||
| { | ||
| std::cout << PHWHERE << "ERROR Reset() not implemented by daughter class" << std::endl; | ||
| return; | ||
| } | ||
|
|
||
| void StreamingBcoInfo::identify(std::ostream& os) const | ||
| { | ||
| os << "identify yourself: virtual StreamingBcoInfo Object" << std::endl; | ||
| return; | ||
| } | ||
|
|
||
| //int BcoStreamingLumiInfo::isValid() const | ||
| //{ | ||
| // std::cout << PHWHERE << "isValid not implemented by daughter class" << std::endl; | ||
| // return 0; | ||
| //} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // Tell emacs that this is a C++ source | ||
| // -*- C++ -*-. | ||
| #ifndef BCOLLUMICOUNT_STREAMINGBCOINFO_H | ||
| #define BCOLLUMICOUNT_STREAMINGBCOINFO_H | ||
|
|
||
| #include <phool/PHObject.h> | ||
|
|
||
| #include <iostream> | ||
| #include <limits> | ||
| #include <utility> | ||
|
|
||
|
|
||
| /// | ||
| class StreamingBcoInfo : public PHObject | ||
| { | ||
| public: | ||
| /// ctor - daughter class copy ctor needs this | ||
| StreamingBcoInfo() = default; | ||
| /// dtor | ||
| ~StreamingBcoInfo() override = default; | ||
| /// Clear Sync | ||
| void Reset() override; | ||
|
|
||
| /** identify Function from PHObject | ||
| @param os Output Stream | ||
| */ | ||
| void identify(std::ostream& os = std::cout) const override; | ||
|
|
||
| /// isValid returns non zero if object contains valid data | ||
| //int isValid() const override; | ||
|
|
||
| virtual uint64_t get_bco() const { return 0; } | ||
|
|
||
| virtual void set_bco(uint64_t /*val*/) { return; } | ||
|
|
||
| virtual int get_evtno() const { return 0; } | ||
|
|
||
| virtual void set_evtno(int /*val*/) { return; } | ||
|
|
||
| virtual bool get_usable_bco_tag() const { return 0; } | ||
|
|
||
| virtual void set_usable_bco_tag(bool /*val*/) { return; } | ||
|
|
||
| virtual std::pair<uint64_t, uint64_t> get_bco_streaming_window() const { return std::make_pair(0, 0); } | ||
|
|
||
| virtual void set_bco_streaming_window(std::pair<uint64_t, uint64_t> /*val*/) { return; } | ||
|
|
||
|
|
||
| private: | ||
| ClassDefOverride(StreamingBcoInfo, 1) | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #ifdef __CINT__ | ||
|
|
||
| #pragma link C++ class StreamingBcoInfo + ; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #include "StreamingBcoInfov1.h" | ||
|
|
||
| #include <phool/phool.h> | ||
|
|
||
| #include <iostream> | ||
|
|
||
| void StreamingBcoInfov1::Reset() | ||
| { | ||
| set_bco(0); | ||
| set_usable_bco_tag(false); | ||
| set_bco_streaming_window(std::make_pair(0, 0)); | ||
| return; | ||
| } | ||
|
|
||
| void StreamingBcoInfov1::identify(std::ostream& os) const | ||
| { | ||
| os << "identify yourself: I am a StreamingBcoInfov1 Object\n"; return; | ||
| } | ||
|
|
||
| //int StreamingBcoInfov1::isValid() const | ||
| //{ | ||
| // std::cout << PHWHERE << "isValid not implemented by daughter class" << std::endl; | ||
| // return 0; | ||
| //} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // Tell emacs that this is a C++ source | ||
| // -*- C++ -*-. | ||
| #ifndef BCOLLUMICOUNT_STREAMINGBCOINFOV1_H | ||
| #define BCOLLUMICOUNT_STREAMINGBCOINFOV1_H | ||
|
|
||
| #include "StreamingBcoInfo.h" | ||
|
|
||
|
|
||
| #include <iostream> | ||
| #include <limits> | ||
| #include <utility> | ||
|
|
||
|
|
||
| /// | ||
| class StreamingBcoInfov1 : public StreamingBcoInfo | ||
| { | ||
| public: | ||
| /// ctor - daughter class copy ctor needs this | ||
| StreamingBcoInfov1() = default; | ||
| /// dtor | ||
| ~StreamingBcoInfov1() override = default; | ||
| /// Clear Sync | ||
| void Reset() override; | ||
|
|
||
| /** identify Function from PHObject | ||
| @param os Output Stream | ||
| */ | ||
| void identify(std::ostream& os = std::cout) const override; | ||
|
|
||
| /// isValid returns non zero if object contains valid data | ||
| //int isValid() const override; | ||
|
|
||
| virtual uint64_t get_bco() const override { return m_bco; } | ||
| virtual void set_bco(uint64_t val) override { m_bco = val; } | ||
|
|
||
| virtual int get_evtno() const override { return m_evtno; } | ||
| virtual void set_evtno(int val) override { m_evtno = val; } | ||
|
|
||
| virtual bool get_usable_bco_tag() const override { return m_usable_bco_tag; } | ||
| virtual void set_usable_bco_tag(bool val) override { m_usable_bco_tag = val; } | ||
|
|
||
| virtual std::pair<uint64_t, uint64_t> get_bco_streaming_window() const override { return m_bco_streaming_window; } | ||
| virtual void set_bco_streaming_window(std::pair<uint64_t, uint64_t> val) override { m_bco_streaming_window = val; } | ||
|
|
||
|
|
||
| private: | ||
| uint64_t m_bco{0}; | ||
| int m_evtno{0}; | ||
| bool m_usable_bco_tag{false}; | ||
| std::pair<uint64_t, uint64_t> m_bco_streaming_window; | ||
|
|
||
| ClassDefOverride(StreamingBcoInfov1, 1) | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #ifdef __CINT__ | ||
|
|
||
| #pragma link C++ class StreamingBcoInfov1 + ; | ||
| #pragma link C++ class std::pair<unsigned long, unsigned long> + ; | ||
|
|
||
| #endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reset leaves
evtnostale across object reuse.StreamingBcoInfov1::Reset()does not clear the event number, so previous-event metadata can persist after reset and propagate wrong DST bookkeeping.Proposed fix
void StreamingBcoInfov1::Reset() { set_bco(0); + set_evtno(0); set_usable_bco_tag(false); set_bco_streaming_window(std::make_pair(0, 0)); return; }📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a relevant comment from the rabbit, we should reset all member variables of the EDM object. I think. Or perhaps the idea is to only set the event number once and have it be incremented on each process_event call? We may consider seeing if there is a "global" event number owned by fun4all that could be set here each reset call, so that it is guaranteed that this object is always in sync with Fun4all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 54
🏁 Script executed:
Length of output: 0
🏁 Script executed:
Length of output: 12683
@osbornjd— good question. Looking atStreamingBcoLumiReco::process_event(), the answer is actually both problems at once:m_evtnois never written anywhere — there is nostreaming_bco_info->set_evtno(...)call inprocess_event(). So it is both stale on object reuse and never populated in the first place.On the Fun4All global event number question: you're already fetching the right handle. The
SyncObjectis retrieved at the top ofprocess_event()andsyncobject->EventNumber()is used in the debug printout. That is the canonical per-event counter in Fun4All and is exactly what should be written toStreamingBcoInfov1. No need to reach forFun4AllServerdirectly.The fix then has two parts:
1.
StreamingBcoInfov1::Reset()— zero all members:2.
StreamingBcoLumiReco::process_event()— populateevtnofromSyncObject:Note the null guard on
syncobject— it is currently dereferenced for debug output without a null check, which is an independent correctness issue worth fixing at the same time.🧠 Learnings used