Why do some photons get a negative pdg code, e.g. -22?

Hi all,

I am simulating a Cherenkov detector. The photon wavelengths I set are 750 nm to 300 nm (i.e. visible light).
I save all the particles that cross my sensitive layer in an NTupleD. In particular,

G4bool SensitiveDetector::ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist){
	G4Track* track = aStep->GetTrack();

        // Do something

	G4AnalysisManager* man = G4AnalysisManager::Instance();

        // ...

	man->FillNtupleIColumn(3, track->GetParticleDefinition()->GetPDGEncoding());

When I then read this tree out I get photons with a negative pdg code, e.g. -22
Does anyone know why this is -22 and not just 22?
If I would have to guess these are photons that are created via cherenkov radiation since they all have very low energy compared to the photons with pdgcode (+)22.
Is this so you can tell them apart more easily?

Cheers,
Cas

In Geant4, optical photons and gammas are different particles so get different codes.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.