Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 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
68b618f
add flag to prune all seeds
osbornjd Jan 17, 2026
c12d8ae
adding more calo embedding tools
Jan 17, 2026
f4e898f
adding makefile update
Jan 17, 2026
61ecab4
extra feat in triggerskimmer
Jan 17, 2026
4da13b0
Merge pull request #4119 from cdean-github/KFParticle
osbornjd Jan 18, 2026
ad7235e
clang-tidy
osbornjd Jan 18, 2026
27c0ce0
Merge pull request #4120 from osbornjd/cluster_pruner
osbornjd Jan 18, 2026
6242823
add const ref
Jan 18, 2026
c6d1c91
Merge pull request #4121 from bseidlit/embed
bseidlit Jan 19, 2026
2601ddc
minor fix for event skipping
Jan 19, 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)
Comment on lines +22 to +58
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix initializer list syntax (standalone commas).

The empty comma-only lines create empty initializers and will not compile.

🐛 Proposed fix
   , _thePzHigh(999.9)
   , _thePzLow(-999.9)
-  ,
-
-    _doEtaHighCut(true)
+  , _doEtaHighCut(true)
   , _doEtaLowCut(true)
   , _doBothEtaCut(true)
-  ,
-
-  _doAbsEtaHighCut(false)
+  , _doAbsEtaHighCut(false)
   , _doAbsEtaLowCut(false)
   , _doBothAbsEtaCut(false)
-  ,
-
-  _doPtHighCut(false)
+  , _doPtHighCut(false)
   , _doPtLowCut(false)
   , _doBothPtCut(false)
-  ,
-    _doPHighCut(false)
+  , _doPHighCut(false)
   , _doPLowCut(false)
   , _doBothPCut(false)
-  ,
-
-  _doPzHighCut(false)
+  , _doPzHighCut(false)
   , _doPzLowCut(false)
   , _doBothPzCut(false)
📝 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
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)
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)
🤖 Prompt for AI Agents
In `@generators/Herwig/HepMCTrigger/HepMCParticleTrigger.cc` around lines 22 - 58,
The constructor HepMCParticleTrigger's initializer list contains standalone
commas that create empty initializers and break compilation; edit the
HepMCParticleTrigger(...) initializer list to remove the stray comma-only lines
so each member (threshold, goal_event_number, set_event_limit, _theEtaHigh,
_theEtaLow, _thePtHigh, _thePtLow, _thePHigh, _thePLow, _thePzHigh, _thePzLow,
_doEtaHighCut, _doEtaLowCut, _doBothEtaCut, _doAbsEtaHighCut, _doAbsEtaLowCut,
_doBothAbsEtaCut, _doPtHighCut, _doPtLowCut, _doBothPtCut, _doPHighCut,
_doPLowCut, _doBothPCut, _doPzHighCut, _doPzLowCut, _doBothPzCut) is separated
by a single comma with no empty lines; ensure no trailing commas or blank comma
lines remain in the initializer list for HepMCParticleTrigger.

{
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;
}
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;
Comment on lines +239 to +266
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

AbsEta setters overwrite signed-eta thresholds (risk of asymmetric selection).

SetAbsEta* writes into _theEtaHigh/_theEtaLow, which are also used by the always-enabled signed-eta cuts. This means SetAbsEtaLow(>0) will also set the signed-eta lower bound > 0, effectively discarding all negative-eta particles. Unless that is intended, you should separate abs-eta thresholds (or disable signed-eta cuts when abs-eta cuts are enabled).

🔧 Suggested direction (separate abs-eta thresholds)
 void HepMCParticleTrigger::SetAbsEtaHigh(double pt)
 {
-  _theEtaHigh = pt;
+  _theAbsEtaHigh = pt;
   _doAbsEtaHighCut = true;
   if (_doAbsEtaLowCut)
   {
     _doBothAbsEtaCut = true;
   }
   return;
 }

 void HepMCParticleTrigger::SetAbsEtaLow(double pt)
 {
-  _theEtaLow = pt;
+  _theAbsEtaLow = pt;
   _doAbsEtaLowCut = true;
   if (_doAbsEtaHighCut)
   {
     _doBothAbsEtaCut = true;
   }
   return;
 }

 void HepMCParticleTrigger::SetAbsEtaHighLow(double ptHigh, double ptLow)
 {
-  _theEtaHigh = ptHigh;
+  _theAbsEtaHigh = ptHigh;
   _doAbsEtaHighCut = true;
-  _theEtaLow = ptLow;
+  _theAbsEtaLow = ptLow;
   _doAbsEtaLowCut = true;
   _doBothAbsEtaCut = true;
   return;
 }

-    if ((_doAbsEtaHighCut || _doBothAbsEtaCut) && std::abs(eta) > _theEtaHigh)
+    if ((_doAbsEtaHighCut || _doBothAbsEtaCut) && std::abs(eta) > _theAbsEtaHigh)
     {
       continue;
     }
-    if ((_doAbsEtaLowCut || _doBothAbsEtaCut) && std::abs(eta) < _theEtaLow)
+    if ((_doAbsEtaLowCut || _doBothAbsEtaCut) && std::abs(eta) < _theAbsEtaLow)
     {
       continue;
     }

Note: this requires adding _theAbsEtaHigh/_theAbsEtaLow members and constructor initialization in the header/initializer list.

Also applies to: 312-318

🤖 Prompt for AI Agents
In `@generators/Herwig/HepMCTrigger/HepMCParticleTrigger.cc` around lines 239 -
266, The AbsEta setters (SetAbsEtaHigh, SetAbsEtaLow, SetAbsEtaHighLow)
currently write into the signed-eta members _theEtaHigh/_theEtaLow, causing
signed-eta cuts to be unintentionally modified; change the implementation to use
dedicated abs-eta members (e.g. add _theAbsEtaHigh and _theAbsEtaLow initialized
in the constructor) and have SetAbsEtaHigh/SetAbsEtaLow/SetAbsEtaHighLow assign
those new members and set _doAbsEtaHighCut/_doAbsEtaLowCut/_doBothAbsEtaCut, or
alternatively explicitly disable the signed-eta cuts inside those setters (clear
_doEtaHighCut/_doEtaLowCut) so the signed-eta thresholds are not used when
absolute-eta cuts are enabled; update any other occurrences (e.g. the similar
block at the other location noted) to use the new abs members or disabling
logic.

}
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;
}
}
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