-
Notifications
You must be signed in to change notification settings - Fork 0
Fixed calo v2 #6
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
base: master
Are you sure you want to change the base?
Changes from all commits
5adbf5c
35a6b31
2e9ccc7
ce0d3af
6ddbed5
3394890
67423a3
014600a
2a654bd
3e94777
667a5cc
45a8c5b
1ba5701
815ceef
d0a251d
0f8adaa
49ff81c
0c648ef
9e7cf18
514cbf6
5c1fb73
3f30522
0785178
e06322f
89660ef
ab568eb
7e9afac
2f32421
3fe3cd3
774e982
34e66d1
c6b077c
f5a6ec8
af55b25
8d61916
3a535f0
16716a5
83bb8a6
5ec7de1
15b6eed
66f7822
ed4562e
7e92dc7
a573ec3
fcb6312
c3eb9c5
b4b37c2
5628bd2
c7adbfd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -776,9 +776,15 @@ int Fun4AllStreamingInputManager::FillIntt() | |||||||||||||||||
| { | ||||||||||||||||||
| h_taggedAllFee_intt->Fill(refbcobitshift); | ||||||||||||||||||
| } | ||||||||||||||||||
| while (m_InttRawHitMap.begin()->first <= select_crossings - m_intt_negative_bco) | ||||||||||||||||||
|
|
||||||||||||||||||
| for (auto& [bco, hitinfo] : m_InttRawHitMap) | ||||||||||||||||||
| { | ||||||||||||||||||
| for (auto *intthititer : m_InttRawHitMap.begin()->second.InttRawHitVector) | ||||||||||||||||||
| if (bco > select_crossings) | ||||||||||||||||||
| { | ||||||||||||||||||
| break; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| for (auto *intthititer : hitinfo.InttRawHitVector) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (Verbosity() > 1) | ||||||||||||||||||
| { | ||||||||||||||||||
|
|
@@ -788,25 +794,9 @@ int Fun4AllStreamingInputManager::FillIntt() | |||||||||||||||||
| } | ||||||||||||||||||
| inttcont->AddHit(intthititer); | ||||||||||||||||||
| } | ||||||||||||||||||
| for (auto *iter : m_InttInputVector) | ||||||||||||||||||
| { | ||||||||||||||||||
| iter->CleanupUsedPackets(m_InttRawHitMap.begin()->first); | ||||||||||||||||||
| if (m_intt_negative_bco < 2) // triggered mode | ||||||||||||||||||
| { | ||||||||||||||||||
| iter->clearPacketBClkStackMap(m_InttRawHitMap.begin()->first); | ||||||||||||||||||
| iter->clearFeeGTML1BCOMap(m_InttRawHitMap.begin()->first); | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| m_InttRawHitMap.begin()->second.InttRawHitVector.clear(); | ||||||||||||||||||
| m_InttRawHitMap.erase(m_InttRawHitMap.begin()); | ||||||||||||||||||
| if (m_InttRawHitMap.empty()) | ||||||||||||||||||
| { | ||||||||||||||||||
| break; | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| return 0; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| int Fun4AllStreamingInputManager::FillMvtx() | ||||||||||||||||||
| { | ||||||||||||||||||
| int iret = FillMvtxPool(); | ||||||||||||||||||
|
|
@@ -846,7 +836,7 @@ int Fun4AllStreamingInputManager::FillMvtx() | |||||||||||||||||
| } | ||||||||||||||||||
| select_crossings += m_RefBCO; | ||||||||||||||||||
|
|
||||||||||||||||||
| uint64_t ref_bco_minus_range = m_RefBCO < m_mvtx_bco_range ? 0 : m_RefBCO - m_mvtx_bco_range; | ||||||||||||||||||
| uint64_t ref_bco_minus_range = m_RefBCO < m_mvtx_negative_bco ? 0 : m_RefBCO - m_mvtx_negative_bco; | ||||||||||||||||||
| if (Verbosity() > 2) | ||||||||||||||||||
| { | ||||||||||||||||||
| std::cout << "select MVTX crossings" | ||||||||||||||||||
|
|
@@ -981,90 +971,42 @@ int Fun4AllStreamingInputManager::FillMvtx() | |||||||||||||||||
| } | ||||||||||||||||||
| taggedPacketsFEEs.clear(); | ||||||||||||||||||
|
|
||||||||||||||||||
| if (m_mvtx_is_triggered) | ||||||||||||||||||
| uint64_t lower_limit = m_mvtx_is_triggered ? select_crossings : select_crossings - m_mvtx_bco_range - m_mvtx_negative_bco; | ||||||||||||||||||
| uint64_t upper_limit = m_mvtx_is_triggered ? select_crossings + m_mvtx_bco_range : select_crossings; | ||||||||||||||||||
|
|
||||||||||||||||||
|
Comment on lines
+974
to
+976
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential underflow in lower_limit calculation for non-triggered mode. For non-triggered MVTX, While line 839 guards against this scenario by capping 🛡️ Add underflow protection- uint64_t lower_limit = m_mvtx_is_triggered ? select_crossings : select_crossings - m_mvtx_bco_range - m_mvtx_negative_bco;
+ uint64_t lower_limit = m_mvtx_is_triggered
+ ? select_crossings
+ : (select_crossings > m_mvtx_bco_range + m_mvtx_negative_bco
+ ? select_crossings - m_mvtx_bco_range - m_mvtx_negative_bco
+ : 0);
uint64_t upper_limit = m_mvtx_is_triggered ? select_crossings + m_mvtx_bco_range : select_crossings;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| for (auto& [bco, hitinfo] : m_MvtxRawHitMap) | ||||||||||||||||||
| { | ||||||||||||||||||
| while (select_crossings <= m_MvtxRawHitMap.begin()->first && m_MvtxRawHitMap.begin()->first <= select_crossings + m_mvtx_bco_range) // triggered | ||||||||||||||||||
| if (bco < lower_limit) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (Verbosity() > 2) | ||||||||||||||||||
| { | ||||||||||||||||||
| std::cout << "Adding 0x" << std::hex << m_MvtxRawHitMap.begin()->first | ||||||||||||||||||
| << " ref: 0x" << select_crossings << std::dec << std::endl; | ||||||||||||||||||
| } | ||||||||||||||||||
| for (auto *mvtxFeeIdInfo : m_MvtxRawHitMap.begin()->second.MvtxFeeIdInfoVector) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (Verbosity() > 1) | ||||||||||||||||||
| { | ||||||||||||||||||
| mvtxFeeIdInfo->identify(); | ||||||||||||||||||
| } | ||||||||||||||||||
| mvtxEvtHeader->AddFeeIdInfo(mvtxFeeIdInfo); | ||||||||||||||||||
| delete mvtxFeeIdInfo; | ||||||||||||||||||
| } | ||||||||||||||||||
| m_MvtxRawHitMap.begin()->second.MvtxFeeIdInfoVector.clear(); | ||||||||||||||||||
| mvtxEvtHeader->AddL1Trg(m_MvtxRawHitMap.begin()->second.MvtxL1TrgBco); | ||||||||||||||||||
| continue; | ||||||||||||||||||
| } | ||||||||||||||||||
| if (bco > upper_limit) | ||||||||||||||||||
| { | ||||||||||||||||||
| break; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| for (auto *mvtxhititer : m_MvtxRawHitMap.begin()->second.MvtxRawHitVector) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (Verbosity() > 1) | ||||||||||||||||||
| { | ||||||||||||||||||
| mvtxhititer->identify(); | ||||||||||||||||||
| } | ||||||||||||||||||
| mvtxcont->AddHit(mvtxhititer); | ||||||||||||||||||
| } | ||||||||||||||||||
| for (auto *iter : m_MvtxInputVector) | ||||||||||||||||||
| { | ||||||||||||||||||
| iter->CleanupUsedPackets(m_MvtxRawHitMap.begin()->first); | ||||||||||||||||||
| } | ||||||||||||||||||
| m_MvtxRawHitMap.begin()->second.MvtxRawHitVector.clear(); | ||||||||||||||||||
| m_MvtxRawHitMap.begin()->second.MvtxL1TrgBco.clear(); | ||||||||||||||||||
| m_MvtxRawHitMap.erase(m_MvtxRawHitMap.begin()); | ||||||||||||||||||
| // m_MvtxRawHitMap.empty() need to be checked here since we do not call FillPoolMvtx() | ||||||||||||||||||
| if (m_MvtxRawHitMap.empty()) | ||||||||||||||||||
| { | ||||||||||||||||||
| break; | ||||||||||||||||||
| } | ||||||||||||||||||
| if (Verbosity() > 2) | ||||||||||||||||||
| { | ||||||||||||||||||
| std::cout << "Adding 0x" << std::hex << bco | ||||||||||||||||||
| << " ref: 0x" << select_crossings << std::dec << std::endl; | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| else | ||||||||||||||||||
| { | ||||||||||||||||||
| while (select_crossings - m_mvtx_bco_range - m_mvtx_negative_bco <= m_MvtxRawHitMap.begin()->first && m_MvtxRawHitMap.begin()->first <= select_crossings) // streamed | ||||||||||||||||||
| for (auto *mvtxFeeIdInfo : hitinfo.MvtxFeeIdInfoVector) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (Verbosity() > 2) | ||||||||||||||||||
| { | ||||||||||||||||||
| std::cout << "Adding 0x" << std::hex << m_MvtxRawHitMap.begin()->first | ||||||||||||||||||
| << " ref: 0x" << select_crossings << std::dec << std::endl; | ||||||||||||||||||
| } | ||||||||||||||||||
| for (auto *mvtxFeeIdInfo : m_MvtxRawHitMap.begin()->second.MvtxFeeIdInfoVector) | ||||||||||||||||||
| if (Verbosity() > 1) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (Verbosity() > 1) | ||||||||||||||||||
| { | ||||||||||||||||||
| mvtxFeeIdInfo->identify(); | ||||||||||||||||||
| } | ||||||||||||||||||
| mvtxEvtHeader->AddFeeIdInfo(mvtxFeeIdInfo); | ||||||||||||||||||
| delete mvtxFeeIdInfo; | ||||||||||||||||||
| mvtxFeeIdInfo->identify(); | ||||||||||||||||||
| } | ||||||||||||||||||
| m_MvtxRawHitMap.begin()->second.MvtxFeeIdInfoVector.clear(); | ||||||||||||||||||
| mvtxEvtHeader->AddL1Trg(m_MvtxRawHitMap.begin()->second.MvtxL1TrgBco); | ||||||||||||||||||
| mvtxEvtHeader->AddFeeIdInfo(mvtxFeeIdInfo); | ||||||||||||||||||
| } | ||||||||||||||||||
| mvtxEvtHeader->AddL1Trg(hitinfo.MvtxL1TrgBco); | ||||||||||||||||||
|
|
||||||||||||||||||
| for (auto *mvtxhititer : m_MvtxRawHitMap.begin()->second.MvtxRawHitVector) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (Verbosity() > 1) | ||||||||||||||||||
| { | ||||||||||||||||||
| mvtxhititer->identify(); | ||||||||||||||||||
| } | ||||||||||||||||||
| mvtxcont->AddHit(mvtxhititer); | ||||||||||||||||||
| } | ||||||||||||||||||
| for (auto *iter : m_MvtxInputVector) | ||||||||||||||||||
| { | ||||||||||||||||||
| iter->CleanupUsedPackets(m_MvtxRawHitMap.begin()->first); | ||||||||||||||||||
| } | ||||||||||||||||||
| m_MvtxRawHitMap.begin()->second.MvtxRawHitVector.clear(); | ||||||||||||||||||
| m_MvtxRawHitMap.begin()->second.MvtxL1TrgBco.clear(); | ||||||||||||||||||
| m_MvtxRawHitMap.erase(m_MvtxRawHitMap.begin()); | ||||||||||||||||||
| // m_MvtxRawHitMap.empty() need to be checked here since we do not call FillPoolMvtx() | ||||||||||||||||||
| if (m_MvtxRawHitMap.empty()) | ||||||||||||||||||
| for (auto *mvtxhititer : hitinfo.MvtxRawHitVector) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (Verbosity() > 1) | ||||||||||||||||||
| { | ||||||||||||||||||
| break; | ||||||||||||||||||
| mvtxhititer->identify(); | ||||||||||||||||||
| } | ||||||||||||||||||
| mvtxcont->AddHit(mvtxhititer); | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -1422,7 +1364,7 @@ int Fun4AllStreamingInputManager::FillMicromegasPool() | |||||||||||||||||
|
|
||||||||||||||||||
| int Fun4AllStreamingInputManager::FillMvtxPool() | ||||||||||||||||||
| { | ||||||||||||||||||
| uint64_t ref_bco_minus_range = m_RefBCO < m_mvtx_bco_range ? m_mvtx_bco_range : m_RefBCO - m_mvtx_bco_range; | ||||||||||||||||||
| uint64_t ref_bco_minus_range = m_RefBCO < m_mvtx_negative_bco ? m_mvtx_negative_bco : m_RefBCO - m_mvtx_negative_bco; | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent underflow handling - returns wrong value. The ternary expression returns 🐛 Fix to match line 839 pattern- uint64_t ref_bco_minus_range = m_RefBCO < m_mvtx_negative_bco ? m_mvtx_negative_bco : m_RefBCO - m_mvtx_negative_bco;
+ uint64_t ref_bco_minus_range = m_RefBCO < m_mvtx_negative_bco ? 0 : m_RefBCO - m_mvtx_negative_bco;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| for (auto *iter : m_MvtxInputVector) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (Verbosity() > 3) | ||||||||||||||||||
|
|
||||||||||||||||||
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:
Repository: sPHENIX-Test/coresoftware
Length of output: 107
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 3381
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 141
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 3015
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 51
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 1579
🏁 Script executed:
# Check the parent commits to understand the branching git log --oneline --graph -10 -- offline/QA/Calorimeters/CaloValid.ccRepository: sPHENIX-Test/coresoftware
Length of output: 143
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 51
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 51
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 213
🏁 Script executed:
# Look at the file size and structure to understand better wc -l offline/QA/Calorimeters/CaloValid.ccRepository: sPHENIX-Test/coresoftware
Length of output: 110
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 473
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 2192
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 761
🏁 Script executed:
Repository: sPHENIX-Test/coresoftware
Length of output: 712
Verify intention of gating total energy by tower quality flag.
Total energy accumulation for all three calorimeters (CEMC, IHCAL, OHCAL) is now gated by the
isGoodflag. This changes the semantics oftotalcemc,totalihcal, andtotalohcalfrom accumulating all tower energies to accumulating only "good" tower energies.This affects the correlation plots at lines 629-632 and the clustering threshold check at line 666. Confirm this behavior change is intentional and verify that downstream analyses depending on these totals remain valid.
🤖 Prompt for AI Agents