Project

General

Profile

Bug #21607

Misleading "invalid target" warnings in rwgt::NuReweight::RetrieveGHEP()

Added by Steven Gardiner over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
12/28/2018
Due date:
% Done:

100%

Estimated time:
Spent time:
Duration:

Description

While testing updates to the larsim EventWeight module to enable full compatibility with GENIE v3.0.2 (see #21568#note-10), I noticed that the GENIE warning message WARN Target : [n] <Target.cxx::ForceNucleusValidity (384)> : Invalid target -- Reseting to Z = 0, A = 0 was being issued every time an event was loaded. Further investigation of this problem revealed that the target PDG code was being loaded from the simb::GTruth object on disk correctly and stored in the genie::EventRecord object correctly, despite the warning:

Begin processing the 1st record. run: 20000001 subRun: 0 event: 1 at 28-Dec-2018 11:33:09 CST
1546018389 INFO PDG : [n] <PDGLibrary.cxx::Instance (46)> : PDGLibrary late initialization
1546018389 INFO PDG : [n] <PDGLibrary.cxx::LoadDBase (90)> : Load PDG data from: /dune/app/users/gardiner/gv3lar/v08_01_00_01/e17d/localProducts_larsoft_v08_01_00_01_e17_debug/genie/v3_00_02/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/data/evgen/catalogues/pdg/genie_pdg_table.txt
1546018389 WARN Target : [n] <Target.cxx::ForceNucleusValidity (384)> : Invalid target -- Reseting to Z = 0, A = 0
TargetPDG as Recorded: 1000180400
TargetZ as Recorded:   18
TargetA as Recorded:   40
TargetPDG as Recreated: 1000180400
TargetZ as Recreated: 18
TargetA as Recreated: 40
1546018389 NOTICE ReW : [n] <GReWeight.cxx::CalcWeight (102)> : Calculator: xsec_ccqe => wght = 1

Some quality time spent with gdb revealed that the warning message originates from a call to genie::InitialState::SetProbePdg() within rwgt::NuReweight::RetrieveGHEP(), as shown below.

//Set the GENIE final state interaction info
genie::Interaction * p_gint = new genie::Interaction;
genie::InitialState * p_ginstate = p_gint->InitStatePtr();
//int Z = gtruth.ftgtZ;
//int A = gtruth.ftgtA;
int targetNucleon = nu.HitNuc();
int struckQuark = nu.HitQuark();
int incoming = gtruth.fProbePDG;
p_ginstate->SetProbePdg(incoming);

genie::Target* target123 = p_ginstate->TgtPtr();

target123->SetId(gtruth.ftgtPDG);

The problem here is that, since the target PDG code is checked within genie::InitialState::SetProbePdg() before it has been initialized by the call to genie::Target::SetId(), GENIE spuriously warns the user that the target PDG code is invalid.

Associated revisions

Revision 1f5d5be8 (diff)
Added by Steven Gardiner over 1 year ago

Set target and probe PDG codes simultaneously in
rwgt::NuReweight::RetrieveGHEP(). This avoids a spurious warning message
issued by genie::Target::ForceNucleusValidity() that occurs when an
uninitialized target PDG code is checked while setting the probe PDG code.
This commit resolves nutools issue #21607.

Revision 06a50151 (diff)
Added by Steven Gardiner over 1 year ago

Set target and probe PDG codes simultaneously in
rwgt::NuReweight::RetrieveGHEP(). This avoids a spurious warning message
issued by genie::Target::ForceNucleusValidity() that occurs when an
uninitialized target PDG code is checked while setting the probe PDG code.
This commit resolves nutools issue #21607.

Revision b46535ee
Added by Steven Gardiner over 1 year ago

Set target and probe PDG codes simultaneously in
rwgt::NuReweight::RetrieveGHEP(). This avoids a spurious warning message
issued by genie::Target::ForceNucleusValidity() that occurs when an
uninitialized target PDG code is checked while setting the probe PDG code.
This commit resolves nutools issue #21607.

Revision 1f5d5be8 (diff)
Added by Steven Gardiner over 1 year ago

Set target and probe PDG codes simultaneously in
rwgt::NuReweight::RetrieveGHEP(). This avoids a spurious warning message
issued by genie::Target::ForceNucleusValidity() that occurs when an
uninitialized target PDG code is checked while setting the probe PDG code.
This commit resolves nutools issue #21607.

Revision 10c4627f
Added by Steven Gardiner over 1 year ago

Set target and probe PDG codes simultaneously in
rwgt::NuReweight::RetrieveGHEP(). This avoids a spurious warning message
issued by genie::Target::ForceNucleusValidity() that occurs when an
uninitialized target PDG code is checked while setting the probe PDG code.
This commit resolves nutools issue #21607.

Revision 1f5d5be8 (diff)
Added by Steven Gardiner over 1 year ago

Set target and probe PDG codes simultaneously in
rwgt::NuReweight::RetrieveGHEP(). This avoids a spurious warning message
issued by genie::Target::ForceNucleusValidity() that occurs when an
uninitialized target PDG code is checked while setting the probe PDG code.
This commit resolves nutools issue #21607.

History

#1 Updated by Steven Gardiner over 1 year ago

I've created a feature branch (feature/gardiner_rw_bugfix) with changes that resolve this issue (1f5d5be). The solution is to replace the separate calls to genie::InitialState::SetProbePdg() and genie::Target::SetId() with a single call to genie::InitialState::SetPdgs().

//Set the GENIE final state interaction info
genie::Interaction * p_gint = new genie::Interaction;
genie::InitialState * p_ginstate = p_gint->InitStatePtr();
p_ginstate->SetPdgs(gtruth.ftgtPDG, gtruth.fProbePDG);

#2 Updated by Lynn Garren over 1 year ago

  • Status changed from New to Assigned
  • Assignee changed from Steven Gardiner to Lynn Garren

Thanks Steve. The branch is approved and nutools v2_27_01 has been tagged. The build will be available Monday.

#3 Updated by Lynn Garren over 1 year ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

The build of nutools v2_27_01 is complete. nutools v2_27_01 is available on SciSoft and on /cvmfs/larsoft.opensciencegrid.org

#4 Updated by Lynn Garren about 1 year ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF