Skip to content

Commit

Permalink
Resolve Issue 18: fix offset bug (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
jminock authored Sep 26, 2023
1 parent 4a64647 commit 7cea580
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/WCSimPrimaryGeneratorAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,13 @@ void WCSimPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
if(loadNewPrimaries){ LoadNewPrimaries(); } // update TChain if a new file is loaded by messenger
//inputdata has already had tree loaded at the end of last event's GeneratePrimaries call
//localEntry will already be the value of the NEXT entry
metadata->LoadTree(inputEntry);
// metadata->LoadTree(inputEntry);

Int_t nextTreeNumber = inputdata->GetTreeNumber();
if(treeNumber!=nextTreeNumber){
G4cout<< "Reached end of Tree. Last entries' tree number was "
<< treeNumber <<", this entries' tree number is "<< nextTreeNumber <<G4endl;
metadata->LoadTree(nextTreeNumber);
dirtFileName = inputdata->GetCurrentFile()->GetName(); // new tree, new file
char* dirtFileNameAsChar = strdup(dirtFileName.c_str());
dirtFileName = basename(dirtFileNameAsChar);
Expand Down Expand Up @@ -465,7 +466,7 @@ void WCSimPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
nuPVBranch->GetEntry(localEntry);
nuvtxmatBranch->GetEntry(localEntry);
genieentryBranch->GetEntry(localEntry);
nufluxfilenameBranch->GetEntry(localEntry);
nufluxfilenameBranch->GetEntry(nextTreeNumber);

// note info about this input event for recording into output file
dirtEntryNum = localEntry;
Expand Down

0 comments on commit 7cea580

Please sign in to comment.