Big differences in muon generation between 11.0.4 and 11.1.1

I’m investigating the creation of muon pairs from high energy brehms photons. To this end, I’ve constructed a simple setup, where I have a gun, a block of tungsten and some tracker planes. For additional information I store the creation vertices of muons and pions created inside my converter block with this code in

G4int PDG = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
if (abs(PDG)==13 || abs(PDG)==211)
       if (aStep->GetTrack()->GetCurrentStepNumber()==1)
			histoManager->FillMuonPionInfo(aStep, event, 0, proc->GetProcessType()*10000+proc->GetProcessSubType());

where the integer 0 is for my bookkeeping, the proc->GetProcessType()*10000+proc->GetProcessSubType()) value gives me the process and its subtype in one integer and the corresponding function in histoManager is

void HistoManager::FillMuonPionInfo(const G4Step* aStep, G4int event, G4int status, G4int creationProcess)
	auto fAnalysisManager = G4AnalysisManager::Instance();

	//Fill the NTuple
	fAnalysisManager->FillNtupleIColumn(0, 0, aStep->GetTrack()->GetDefinition()->GetPDGEncoding());
	fAnalysisManager->FillNtupleIColumn(0, 1, event);
	fAnalysisManager->FillNtupleIColumn(0, 2, status);
	fAnalysisManager->FillNtupleIColumn(0, 3, aStep->GetTrack()->GetCurrentStepNumber());
	fAnalysisManager->FillNtupleIColumn(0, 4, creationProcess);

	auto stepPoint = aStep->GetTrack()->GetStep()->GetPreStepPoint();
	fAnalysisManager->FillNtupleDColumn(0, 5, stepPoint->GetGlobalTime());
	fAnalysisManager->FillNtupleDColumn(0, 6, aStep->GetTrack()->GetTotalEnergy());
	fAnalysisManager->FillNtupleDColumn(0, 7, stepPoint->GetMomentumDirection().x());
	fAnalysisManager->FillNtupleDColumn(0, 8, stepPoint->GetMomentumDirection().y());
	fAnalysisManager->FillNtupleDColumn(0, 9, stepPoint->GetMomentumDirection().z());

	fAnalysisManager->FillNtupleDColumn(0, 10, stepPoint->GetPosition().x());
	fAnalysisManager->FillNtupleDColumn(0, 11, stepPoint->GetPosition().y());
	fAnalysisManager->FillNtupleDColumn(0, 12, stepPoint->GetPosition().z());

    if ((status == 0) and (abs(aStep->GetTrack()->GetDefinition()->GetPDGEncoding()) == 13))

The code uses QGSP_BERT physics list and I enable muon creation in my macro file, pre-init with /physics_lists/em/GammaToMuons true.

The problem I encountered when moving from 11.0.4 to 11.1.1 is that the results are very, very different:

The sim results above are for 1e7 events, with cross section for muon creation enhanced by a factor of 1000.
The only difference between the results is compiling my code against GEANT4 v11.1.1 and v11.0.4!!! Has anyone an idea what was changed to create such large differences? If it helps, the warning G4GammaConversionToMuons::PostStepDoIt WARNING: in dSigxPlusGen, result=3.27683 > 1 is shown a lot more often when running the v11.1.1 code.

Any help is greatly appreciated! I’m stumped and would like to know which results I can trust :slight_smile:


Hello Kris,

thank you for the detailed post. Is it possible to make a Bugzilla bug report using text and plots you have shown. The reason of the problem is clearly connected with gamma general process approach, which we make default in 11.1, and we should find out a way to fix it asap.


Hi Vladimir,
thanks for the suggestion! I’ll indeed open a bug report. In the mean time, as I understand, the v11.0.4 code produces more reliable results, right?