Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
5adbf5c
djl -- add average calo v2 as an option for flow
Dec 18, 2025
35a6b31
add return if LoadCalibrations failed
Dec 18, 2025
2e9ccc7
djl -- array to vector
Dec 18, 2025
ce0d3af
djl -- change error handling to exit and not check for nullptr
Dec 19, 2025
6ddbed5
Add matching flag to evaluation.
hupereir Apr 14, 2025
3394890
Merge pull request #4089 from hupereir/micromegas_pool_evaluation_update
osbornjd Jan 6, 2026
67423a3
clang-format
osbornjd Jan 6, 2026
014600a
adding quality flag to total energy calc and correlations
Jan 6, 2026
2a654bd
clang-tidy for PHGenFit
pinkenburg Jan 6, 2026
3e94777
appeasing the rabbit
Jan 6, 2026
667a5cc
clang-tidy for mvtx
pinkenburg Jan 6, 2026
45a8c5b
clang-tidy for tpc
pinkenburg Jan 6, 2026
1ba5701
Added sample to hit key. This will allow to use timed hits.
hupereir Dec 16, 2025
815ceef
Add sample to hit key
hupereir Dec 16, 2025
d0a251d
fixed comments
hupereir Dec 16, 2025
0f8adaa
Sort hits by strip number
hupereir Dec 16, 2025
49ff81c
default max sample is 1024 (full range)
hupereir Dec 16, 2025
0c648ef
implemented min and max sample range for selecting clusters.
hupereir Dec 16, 2025
9e7cf18
fix bad bug found by coderabbit
pinkenburg Jan 7, 2026
514cbf6
better performace according to code rabbit
pinkenburg Jan 7, 2026
5c1fb73
make coderabbit happy
pinkenburg Jan 7, 2026
3f30522
fix botched formatting
pinkenburg Jan 7, 2026
0785178
clang-tidy
osbornjd Jan 7, 2026
e06322f
Update offline/packages/micromegas/MicromegasDefs.cc
hupereir Jan 7, 2026
89660ef
Update offline/packages/micromegas/MicromegasDefs.cc
hupereir Jan 7, 2026
ab568eb
Merge pull request #4091 from bseidlit/master
bseidlit Jan 7, 2026
7e9afac
Merge pull request #4090 from osbornjd/clang-format
osbornjd Jan 7, 2026
2f32421
handle max between a double and an int correctly with rounding
pinkenburg Jan 7, 2026
3fe3cd3
CD: New version of silicon pooling
cdean-github Jan 7, 2026
774e982
Merge branch 'master' of github.com:sPHENIX-Collaboration/coresoftwar…
cdean-github Jan 7, 2026
34e66d1
Merge pull request #4092 from pinkenburg/clang-tidy-57
pinkenburg Jan 7, 2026
c6b077c
- removed static as per clang-tidy
hupereir Jan 7, 2026
f5a6ec8
clang-tidy
hupereir Jan 7, 2026
af55b25
add e22 showershape
Shuonli Jan 8, 2026
8d61916
more clang-tidy
hupereir Jan 8, 2026
3a535f0
📝 Add docstrings to `photonclass`
coderabbitai[bot] Jan 8, 2026
16716a5
Merge pull request #4095 from Shuonli/photonclass
pinkenburg Jan 8, 2026
83bb8a6
Merge pull request #4096 from sPHENIX-Collaboration/coderabbitai/docs…
pinkenburg Jan 8, 2026
5ec7de1
Merge pull request #4093 from hupereir/micromegas-decoding-update
osbornjd Jan 8, 2026
15b6eed
Merge pull request #4094 from cdean-github/KFParticle
osbornjd Jan 8, 2026
66f7822
Revert "📝 Add docstrings to `photonclass`"
pinkenburg Jan 8, 2026
ed4562e
Merge pull request #4097 from sPHENIX-Collaboration/revert-4096-coder…
pinkenburg Jan 8, 2026
7e92dc7
Fix bugs in CaloValid to select correct MB + 10 cm trigger
emclaughlin2 Jan 8, 2026
a573ec3
make setters functional
osbornjd Jan 8, 2026
fcb6312
Fix Gl1Packet ID type from string to integer
pinkenburg Jan 8, 2026
c3eb9c5
Merge pull request #4098 from emclaughlin2/master
pinkenburg Jan 8, 2026
36cd47a
adding more of the skeleton structure
silas-gross Jan 9, 2026
b4b37c2
Merge pull request #4099 from osbornjd/cluster_map_name
osbornjd Jan 9, 2026
c361551
Nearly done, just need to dust around the edges
silas-gross Jan 10, 2026
23ef520
Bare minimum working version of HepMC particle trigger. Requires inpu…
silas-gross Jan 10, 2026
498393a
Fixed to adress issues found by CodeRabbit
silas-gross Jan 10, 2026
e18445b
a few more code rabbit fixes
silas-gross Jan 10, 2026
ebbee62
Is this the last one CodeRabbit???
silas-gross Jan 10, 2026
3d0a2e4
fixed pdgid lookup issue
silas-gross Jan 10, 2026
5628bd2
code rabbit found a bug in the return value
Jan 10, 2026
c7adbfd
Merge branch 'sPHENIX-Collaboration:master' into fixed_calo_v2
danjlis Jan 10, 2026
62c7a10
add hook to run shell script before opening an input file
pinkenburg Jan 10, 2026
5d5a980
do not save cdb files if they are empty (do not exist)
pinkenburg Jan 10, 2026
fd44486
cleanup, modernize
pinkenburg Jan 10, 2026
3505cae
Merge pull request #4069 from danjlis/fixed_calo_v2
pinkenburg Jan 10, 2026
51336ae
fix clang-tidy for HepMCTrigger
pinkenburg Jan 10, 2026
b0df38c
fix typo in initialiation
pinkenburg Jan 11, 2026
ee08eb4
Merge pull request #4101 from pinkenburg/no-saving-of-empty-cdbfiles
pinkenburg Jan 11, 2026
2b02a79
Merge pull request #4100 from silas-gross/PHHerwig
pinkenburg Jan 11, 2026
11cb711
fixed crash when calopackets are empty
mchiu-bnl Jan 12, 2026
f63acd8
Merge branch 'master' into run-before-opening
pinkenburg Jan 12, 2026
47ab938
call script before opening
pinkenburg Jan 12, 2026
7eb599f
make rabbit happy
pinkenburg Jan 12, 2026
5d10d3e
fix clang-tidy for InputFileHandler
pinkenburg Jan 13, 2026
f9373cf
Fixed issues around the edges of Jet, set better default behavior of …
silas-gross Jan 13, 2026
90a2f62
Fixed issues around the edges of Jet, set better default behavior of …
silas-gross Jan 13, 2026
7b52f16
Merge branch 'sPHENIX-Collaboration:master' into PHHerwig
silas-gross Jan 13, 2026
ce2f8a3
Merge pull request #4103 from pinkenburg/run-before-opening
pinkenburg Jan 13, 2026
bcc0827
Merge pull request #4102 from mchiu-bnl/mbd
pinkenburg Jan 13, 2026
5b6afda
add type 37: hijing O+O 0-15fm
pinkenburg Jan 14, 2026
0f402d4
Merge pull request #4107 from pinkenburg/filelist-add-OO
pinkenburg Jan 14, 2026
85e50bb
clang-tidy for HepMCJetTrigger
pinkenburg Jan 14, 2026
e3fffce
Fixed bug in logic for using existing parameter sets
adfrawley Jan 14, 2026
2cbb506
Merge branch 'master' of https://github.com/sPHENIX-Collaboration/cor…
adfrawley Jan 14, 2026
d7d58e1
this change fixes the tpc drift velocity being set to zero
pinkenburg Jan 15, 2026
63e54e6
Merge pull request #4111 from pinkenburg/fix-tpc-drift-pythia8
pinkenburg Jan 15, 2026
04e747f
📝 Add docstrings to `fix-tpc-drift-pythia8`
coderabbitai[bot] Jan 15, 2026
53eb479
Merge pull request #4104 from silas-gross/PHHerwig
pinkenburg Jan 15, 2026
1fe3891
Fix missing newline at end of PHPythia8.cc
pinkenburg Jan 15, 2026
bfcf35d
Merge pull request #4112 from sPHENIX-Collaboration/coderabbitai/docs…
pinkenburg Jan 15, 2026
69de5bb
do not read flow angles if flow afterburner was not run
pinkenburg Jan 15, 2026
3d19299
return NAN if flow psi vector is empty
pinkenburg Jan 15, 2026
64138d4
Merge pull request #4113 from pinkenburg/no-flow-afterburner
pinkenburg Jan 15, 2026
2525b3b
restor cout state after every call to pythia8
pinkenburg Jan 15, 2026
bd1ae49
restore cout state after each call to subsystem code
pinkenburg Jan 15, 2026
04d5376
resotre cout before sending abortrun
pinkenburg Jan 15, 2026
7b60428
Merge pull request #4109 from adfrawley/new_tpc_transforms
osbornjd Jan 16, 2026
99b5ed4
abort events with any mbd packet empty
mchiu-bnl Jan 16, 2026
bea795c
Merge pull request #4115 from pinkenburg/preserve-cout
pinkenburg Jan 16, 2026
774ed82
Merge pull request #4116 from mchiu-bnl/mbd
pinkenburg Jan 16, 2026
d1152d0
New QA module to make cluster-state residual plots
rosstom2232 Jan 17, 2026
6c11c5d
clang-tidy
osbornjd Jan 17, 2026
7030fb8
Merge pull request #4118 from rosstom2232/TPOTQA
osbornjd Jan 17, 2026
ec8e8a6
CD: Stop KFP from aborting events
cdean-github Jan 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions generators/Herwig/HepMCTrigger/HepMCJetTrigger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ std::vector<fastjet::PseudoJet> HepMCJetTrigger::findAllJets(HepMC::GenEvent* e1
if (!(*iter)->end_vertex() && (*iter)->status() == 1)
{
auto p = (*iter)->momentum();
auto pd = std::abs((*iter)->pdg_id());
if (pd >= 12 && pd <= 18)
{
continue; // keep jet in the expected behavioro
}
fastjet::PseudoJet pj(p.px(), p.py(), p.pz(), p.e());
pj.set_user_index((*iter)->barcode());
input.push_back(pj);
Expand All @@ -122,6 +127,10 @@ int HepMCJetTrigger::jetsAboveThreshold(const std::vector<fastjet::PseudoJet>& j
for (const auto& j : jets)
{
float const pt = j.pt();
if (std::abs(j.eta()) > 1.1)
{
continue;
}
if (pt > this->threshold)
{
n_good_jets++;
Expand Down
369 changes: 369 additions & 0 deletions generators/Herwig/HepMCTrigger/HepMCParticleTrigger.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,369 @@
#include "HepMCParticleTrigger.h"

#include <fun4all/SubsysReco.h>
#include <phhepmc/PHHepMCGenEvent.h>
#include <phhepmc/PHHepMCGenEventMap.h>

#include <fun4all/Fun4AllReturnCodes.h>

#include <phool/PHCompositeNode.h>
#include <phool/getClass.h>

#include <fastjet/JetDefinition.hh>

#include <HepMC/GenEvent.h>

#include <fastjet/PseudoJet.hh>
#include <map>
#include <string>
#include <vector>
//____________________________________________________________________________..
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
HepMCParticleTrigger::HepMCParticleTrigger(float trigger_thresh, int n_incom, bool up_lim, const std::string& name)
: SubsysReco(name)
, threshold(trigger_thresh)
, goal_event_number(n_incom)
, set_event_limit(up_lim)
, _theEtaHigh(1.1)
, _theEtaLow(-1.1)
, _thePtHigh(999.9)
, _thePtLow(0)
, _thePHigh(999.9)
, _thePLow(-999.9)
, _thePzHigh(999.9)
, _thePzLow(-999.9)
,

_doEtaHighCut(true)
, _doEtaLowCut(true)
, _doBothEtaCut(true)
,

_doAbsEtaHighCut(false)
, _doAbsEtaLowCut(false)
, _doBothAbsEtaCut(false)
,

_doPtHighCut(false)
, _doPtLowCut(false)
, _doBothPtCut(false)
,
_doPHighCut(false)
, _doPLowCut(false)
, _doBothPCut(false)
,

_doPzHighCut(false)
, _doPzLowCut(false)
, _doBothPzCut(false)
{
if (threshold != 0)
{
_doPtLowCut = true;
_thePtLow = threshold;
}
}

//____________________________________________________________________________..
int HepMCParticleTrigger::process_event(PHCompositeNode* topNode)
{
// std::cout << "HepMCParticleTrigger::process_event(PHCompositeNode *topNode) Processing Event" << std::endl;
n_evts++;
if (this->set_event_limit == true)
{ // needed to keep all HepMC output at the same number of events
if (n_good >= this->goal_event_number)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
}
bool good_event{false};
PHHepMCGenEventMap* phg = findNode::getClass<PHHepMCGenEventMap>(topNode, "PHHepMCGenEventMap");
if (!phg)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
for (PHHepMCGenEventMap::ConstIter eventIter = phg->begin(); eventIter != phg->end(); ++eventIter)
{
PHHepMCGenEvent* hepev = eventIter->second;
if (!hepev)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
HepMC::GenEvent* ev = hepev->getEvent();
if (!ev)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
good_event = isGoodEvent(ev);
if (!good_event)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
}
if (good_event)
{
n_good++;
}
return Fun4AllReturnCodes::EVENT_OK;
Comment on lines +79 to +107
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Empty event map returns EVENT_OK with good_event=false.

If PHHepMCGenEventMap is non-null but empty, the for-loop never executes, good_event remains false, and the function returns EVENT_OK without incrementing n_good. This may not be the intended behavior.

🐛 Proposed fix
   PHHepMCGenEventMap* phg = findNode::getClass<PHHepMCGenEventMap>(topNode, "PHHepMCGenEventMap");
   if (!phg)
   {
     return Fun4AllReturnCodes::ABORTEVENT;
   }
+  if (phg->size() == 0)
+  {
+    return Fun4AllReturnCodes::ABORTEVENT;
+  }
   for (PHHepMCGenEventMap::ConstIter eventIter = phg->begin(); eventIter != phg->end(); ++eventIter)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
bool good_event{false};
PHHepMCGenEventMap* phg = findNode::getClass<PHHepMCGenEventMap>(topNode, "PHHepMCGenEventMap");
if (!phg)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
for (PHHepMCGenEventMap::ConstIter eventIter = phg->begin(); eventIter != phg->end(); ++eventIter)
{
PHHepMCGenEvent* hepev = eventIter->second;
if (!hepev)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
HepMC::GenEvent* ev = hepev->getEvent();
if (!ev)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
good_event = isGoodEvent(ev);
if (!good_event)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
}
if (good_event)
{
n_good++;
}
return Fun4AllReturnCodes::EVENT_OK;
bool good_event{false};
PHHepMCGenEventMap* phg = findNode::getClass<PHHepMCGenEventMap>(topNode, "PHHepMCGenEventMap");
if (!phg)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
if (phg->size() == 0)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
for (PHHepMCGenEventMap::ConstIter eventIter = phg->begin(); eventIter != phg->end(); ++eventIter)
{
PHHepMCGenEvent* hepev = eventIter->second;
if (!hepev)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
HepMC::GenEvent* ev = hepev->getEvent();
if (!ev)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
good_event = isGoodEvent(ev);
if (!good_event)
{
return Fun4AllReturnCodes::ABORTEVENT;
}
}
if (good_event)
{
n_good++;
}
return Fun4AllReturnCodes::EVENT_OK;
🤖 Prompt for AI Agents
In `@generators/Herwig/HepMCTrigger/HepMCParticleTrigger.cc` around lines 79 -
107, The function currently treats a non-null but empty PHHepMCGenEventMap (phg)
as a successful event because the loop never runs and good_event stays false,
leading to returning EVENT_OK; fix this by explicitly checking phg->empty()
after retrieving phg and returning Fun4AllReturnCodes::ABORTEVENT if it is empty
so empty maps do not count as valid events; update the logic around phg, the
for-loop over PHHepMCGenEventMap::ConstIter, and the n_good increment (leave
n_good++ only when a good_event was actually found via isGoodEvent on a real
HepMC::GenEvent).

}
void HepMCParticleTrigger::AddParticle(int particlePid)
{
_theParticles.push_back(particlePid);
return;
}
void HepMCParticleTrigger::AddParticles(const std::vector<int>& particles)
{
for (auto p : particles)
{
_theParticles.push_back(p);
}
return;
}

void HepMCParticleTrigger::SetPtHigh(double pt)
{
_thePtHigh = pt;
_doPtHighCut = true;
if (_doPtLowCut)
{
_doBothPtCut = true;
}
return;
}
void HepMCParticleTrigger::SetPtLow(double pt)
{
_thePtLow = pt;
_doPtLowCut = true;
if (_doPtHighCut)
{
_doBothPtCut = true;
}
return;
}
void HepMCParticleTrigger::SetPtHighLow(double ptHigh, double ptLow)
{
_thePtHigh = ptHigh;
_doPtHighCut = true;
_thePtLow = ptLow;
_doPtLowCut = true;
_doBothPtCut = true;
return;
}
void HepMCParticleTrigger::SetPHigh(double pt)
{
_thePHigh = pt;
_doPHighCut = true;
if (_doPLowCut)
{
_doBothPCut = true;
}
return;
}
void HepMCParticleTrigger::SetPLow(double pt)
{
_thePLow = pt;
_doPLowCut = true;
if (_doPHighCut)
{
_doBothPCut = true;
}
return;
}
void HepMCParticleTrigger::SetPHighLow(double ptHigh, double ptLow)
{
_thePHigh = ptHigh;
_doPHighCut = true;
_thePLow = ptLow;
_doPLowCut = true;
_doBothPCut = true;
return;
}
void HepMCParticleTrigger::SetPzHigh(double pt)
{
_thePzHigh = pt;
_doPzHighCut = true;
if (_doPzLowCut)
{
_doBothPzCut = true;
}
return;
}
void HepMCParticleTrigger::SetPzLow(double pt)
{
_thePzLow = pt;
_doPzLowCut = true;
if (_doPzHighCut)
{
_doBothPzCut = true;
}
return;
}
void HepMCParticleTrigger::SetPzHighLow(double ptHigh, double ptLow)
{
_thePzHigh = ptHigh;
_doPzHighCut = true;
_thePzLow = ptLow;
_doPzLowCut = true;
_doBothPzCut = true;
return;
}
void HepMCParticleTrigger::SetEtaHigh(double pt)
{
_theEtaHigh = pt;
_doEtaHighCut = true;
if (_doEtaLowCut)
{
_doBothEtaCut = true;
}
return;
}
void HepMCParticleTrigger::SetEtaLow(double pt)
{
_theEtaLow = pt;
_doEtaLowCut = true;
if (_doEtaHighCut)
{
_doBothEtaCut = true;
}
return;
}
void HepMCParticleTrigger::SetEtaHighLow(double ptHigh, double ptLow)
{
_theEtaHigh = ptHigh;
_doEtaHighCut = true;
_theEtaLow = ptLow;
_doEtaLowCut = true;
_doBothEtaCut = true;
return;
}
void HepMCParticleTrigger::SetAbsEtaHigh(double pt)
{
_theEtaHigh = pt;
_doAbsEtaHighCut = true;
if (_doAbsEtaLowCut)
{
_doBothAbsEtaCut = true;
}
return;
}
void HepMCParticleTrigger::SetAbsEtaLow(double pt)
{
_theEtaLow = pt;
_doAbsEtaLowCut = true;
if (_doAbsEtaHighCut)
{
_doBothAbsEtaCut = true;
}
return;
}
void HepMCParticleTrigger::SetAbsEtaHighLow(double ptHigh, double ptLow)
{
_theEtaHigh = ptHigh;
_doAbsEtaHighCut = true;
_theEtaLow = ptLow;
_doAbsEtaLowCut = true;
_doBothAbsEtaCut = true;
return;
}
bool HepMCParticleTrigger::isGoodEvent(HepMC::GenEvent* e1)
{
// this is really just the call to actually evaluate and return the filter
/*if (this->threshold == 0)
{
return true;
}*/
std::vector<int> n_trigger_particles = getParticles(e1);
for (auto ntp : n_trigger_particles)
{
if (ntp <= 0)
{
return false; // make sure all particles have at least 1
}
}
return true;
}

std::vector<int> HepMCParticleTrigger::getParticles(HepMC::GenEvent* e1)
{
std::vector<int> n_trigger{};
std::map<int, int> particle_types;
for (HepMC::GenEvent::particle_const_iterator iter = e1->particles_begin(); iter != e1->particles_end(); ++iter)
{
if (m_doStableParticleOnly && ((*iter)->end_vertex() || (*iter)->status() != 1))
{
continue;
}
auto p = (*iter)->momentum();
float px = p.px();
float py = p.py();
float pz = p.pz();
float p_M = std::sqrt(std::pow(px, 2) + std::pow(py, 2) + std::pow(pz, 2));
float pt = std::sqrt(std::pow(px, 2) + std::pow(py, 2));
int pid = std::abs((*iter)->pdg_id());
double eta = p.eta();
if ((_doEtaHighCut || _doBothEtaCut) && eta > _theEtaHigh)
{
continue;
}
if ((_doEtaLowCut || _doBothEtaCut) && eta < _theEtaLow)
{
continue;
}
if ((_doAbsEtaHighCut || _doBothAbsEtaCut) && std::abs(eta) > _theEtaHigh)
{
continue;
}
if ((_doAbsEtaLowCut || _doBothAbsEtaCut) && std::abs(eta) < _theEtaLow)
{
continue;
}
if ((_doPtHighCut || _doBothPtCut) && pt > _thePtHigh)
{
continue;
}
if ((_doPtLowCut || _doBothPtCut) && pt < _thePtLow)
{
continue;
}
if ((_doPHighCut || _doBothPCut) && p_M > _thePHigh)
{
continue;
}
if ((_doPLowCut || _doBothPCut) && p_M < _thePLow)
{
continue;
}
if ((_doPzHighCut || _doBothPzCut) && pz > _thePzHigh)
{
continue;
}
if ((_doPzLowCut || _doBothPzCut) && pz < _thePzLow)
{
continue;
}
if (particle_types.contains(pid))
{
particle_types[pid]++;
}
else
{
particle_types[pid] = 1;
}
Comment on lines +344 to +351
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Search for build configuration files
find . -maxdepth 3 -type f \( -name "CMakeLists.txt" -o -name "configure.ac" -o -name "Makefile.am" \) | head -20

Repository: sPHENIX-Test/coresoftware

Length of output: 852


🏁 Script executed:

# Search for C++ standard declarations across the repository
rg -i 'c\+\+20|c\+\+2a|cxx_std_20|CXX_STANDARD.*20|std=c\+\+20' --type-list | head -5
rg -i 'c\+\+20|c\+\+2a|cxx_std_20|CXX_STANDARD.*20|std=c\+\+20' -g "*.txt" -g "*.ac" -g "*.am" -g "*.cmake" 2>/dev/null | head -20

Repository: sPHENIX-Test/coresoftware

Length of output: 458


🏁 Script executed:

# Look for any C++ standard specifications
rg -i 'CXX_STANDARD|c\+\+17|c\+\+11|c\+\+14' -g "CMakeLists.txt" -g "configure.ac" -g "Makefile.am" 2>/dev/null | head -30

Repository: sPHENIX-Test/coresoftware

Length of output: 471


🏁 Script executed:

# Check the specific directory and parent directories for build files
ls -la generators/Herwig/HepMCTrigger/ 2>/dev/null | head -20
ls -la generators/Herwig/ 2>/dev/null | head -20
ls -la generators/ 2>/dev/null | grep -i cmake

Repository: sPHENIX-Test/coresoftware

Length of output: 816


🏁 Script executed:

# Check the Makefile.am in the HepMCTrigger directory
cat generators/Herwig/HepMCTrigger/Makefile.am

Repository: sPHENIX-Test/coresoftware

Length of output: 1134


🏁 Script executed:

# Check the configure.ac in the HepMCTrigger directory
cat generators/Herwig/HepMCTrigger/configure.ac

Repository: sPHENIX-Test/coresoftware

Length of output: 440


🏁 Script executed:

# Check if there's a parent configure.ac in generators/Herwig
find generators/Herwig -maxdepth 1 -name "configure.ac" -o -name "Makefile.am" 2>/dev/null

Repository: sPHENIX-Test/coresoftware

Length of output: 51


🏁 Script executed:

# Search for CXX_STANDARD or C++ flag declarations in the entire generators directory
rg -i 'CXX_STANDARD|AM_CXXFLAGS|std=' generators/Herwig/HepMCTrigger/ --type=make --type=cmake 2>/dev/null || echo "No matches found"

Repository: sPHENIX-Test/coresoftware

Length of output: 85


🏁 Script executed:

# Check if there's a root configure.ac or global C++ standard configuration
head -50 configure.ac 2>/dev/null || echo "No root configure.ac"

Repository: sPHENIX-Test/coresoftware

Length of output: 89


🏁 Script executed:

# Search for any other C++20 features in the HepMCTrigger files
rg 'contains\(|spaceship|concepts|requires|co_await' generators/Herwig/HepMCTrigger/ --type=cc --type=h

Repository: sPHENIX-Test/coresoftware

Length of output: 95


🏁 Script executed:

# Check if there's a toplevel CMakeLists.txt
ls -la CMakeLists.txt 2>/dev/null || echo "No CMakeLists.txt at root"

Repository: sPHENIX-Test/coresoftware

Length of output: 94


🏁 Script executed:

# Check the specific line in HepMCParticleTrigger.cc to confirm context
sed -n '340,355p' generators/Herwig/HepMCTrigger/HepMCParticleTrigger.cc

Repository: sPHENIX-Test/coresoftware

Length of output: 366


Replace std::map::contains() with C++17-compatible find() method.

The build configuration for this module does not explicitly require C++20. The code uses std::map::contains() (C++20) on line 344, which will fail to compile on systems defaulting to C++17 or earlier. Replace with find() for compatibility:

C++17-compatible fix
-    if (particle_types.contains(pid))
+    if (particle_types.find(pid) != particle_types.end())
     {
       particle_types[pid]++;
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (particle_types.contains(pid))
{
particle_types[pid]++;
}
else
{
particle_types[pid] = 1;
}
if (particle_types.find(pid) != particle_types.end())
{
particle_types[pid]++;
}
else
{
particle_types[pid] = 1;
}
🤖 Prompt for AI Agents
In `@generators/Herwig/HepMCTrigger/HepMCParticleTrigger.cc` around lines 344 -
351, The code uses std::map::contains (C++20) on particle_types with pid which
breaks builds on C++17; change the check to use particle_types.find(pid) !=
particle_types.end() (or capture the iterator once) and then increment the
mapped value or insert a new entry accordingly, updating the block that
references particle_types and pid in HepMCParticleTrigger.cc so it is
C++17-compatible.

}
n_trigger.reserve(_theParticles.size());
for (auto p : _theParticles)
{
n_trigger.push_back(particleAboveThreshold(particle_types, p)); // make sure we have at least one of each required particle
}
return n_trigger;
}
int HepMCParticleTrigger::particleAboveThreshold(const std::map<int, int>& n_particles, int trigger_particle)
{
// search through for the number of identified trigger particles passing cuts
auto it = n_particles.find(std::abs(trigger_particle));
if (it != n_particles.end())
{
return it->second;
}
return 0;
}
Loading