AIDASoft / DD4hep

Detector Description Toolkit for High Energy Physics
http://dd4hep.cern.ch
GNU Lesser General Public License v3.0
50 stars 99 forks source link

Too Many Decay Processes assigned to particle types #513

Closed andresailer closed 5 years ago

andresailer commented 5 years ago

There are two places where dd4hep adds the decay process for particles, which can lead to a lifetime 2 or 3 times lower than desired.

ExtraParticles adds decays to particles, after Geant4 also does

The Geant4ExtraParticles plugin can add new particles to Geant4 to simulate certain b hadrons or charginos, or anything. In a first step the particles are added to Geant4

https://github.com/AIDASoft/DD4hep/blob/4fc82f8530a14a0cbfba107003d6715310d04c84/DDG4/plugins/Geant4ExtraParticles.cpp#L134-L136

And then later processes are added to the new "extra" particles

https://github.com/AIDASoft/DD4hep/blob/4fc82f8530a14a0cbfba107003d6715310d04c84/DDG4/plugins/Geant4ExtraParticles.cpp#L177-L179

However, the Decay process is already added to particles by Geant4 in most (I guess) regular physics lists

https://github.com/Geant4/geant4/blob/f794fcf60b75ac24b3ce8b64873b50757732a52a/source/physics_lists/constructors/decay/src/G4DecayPhysics.cc#L100-L123

void G4DecayPhysics::ConstructProcess()
{
  if(wasActivated) { return; }
  wasActivated = true;

  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();

  // Add Decay Process
  fDecayProcess = new G4Decay();
  aParticleIterator->reset();
  G4ParticleDefinition* particle=0;

  while( (*aParticleIterator)() ) {
    particle = aParticleIterator->value();
    if( fDecayProcess->IsApplicable(*particle) ) { 
      if(verbose > 1) {
        G4cout << "### Decays for " << particle->GetParticleName() << G4endl;
      }
      ph->RegisterProcess(fDecayProcess, particle);
    }}}

Which leads to the decay process being defined multiple times for one particle, which increases the width and reduced the particle lifetime, unless the particle to be simulated has a pre-assigned life-time from the generator.

I think this addition of the decay process can be removed from the Geant4ExtraParticles plugin, because Geant4 will add the decay process. (or it is done again in dd4hep see next point).

PhysicsLists adds decays:

In addition to the above case, if the "decays" option for the PhysicsList is set to True, https://github.com/AIDASoft/DD4hep/blob/4fc82f8530a14a0cbfba107003d6715310d04c84/DDG4/src/Geant4PhysicsList.cpp#L338

https://github.com/AIDASoft/DD4hep/blob/4fc82f8530a14a0cbfba107003d6715310d04c84/DDG4/src/Geant4PhysicsList.cpp#L408-L410

Decay processes are added for all "applicable" particles

https://github.com/AIDASoft/DD4hep/blob/4fc82f8530a14a0cbfba107003d6715310d04c84/DDG4/src/Geant4PhysicsList.cpp#L413-L431

Obviously decays should be set to False when using a pre-existing physics list, but maybe even more protections could be added for this?

andresailer commented 5 years ago

Untreated, one can see multiple decay processes with /particle/process/dump

Idle> /particle/select lambda
Idle> /particle/process/dump
G4ProcessManager:  particle[lambda]
[0]=== process[Transportation :Transportation] Active
  Ordering::             AtRest             AlongStep          PostStep
                    GetPIL/    DoIt    GetPIL/    DoIt    GetPIL/    DoIt
  Ordering::
  index                 -1:      -1:       0:       0:       5:       0:
  parameter             -1:      -1:       0:       0:       0:       0:
[1]=== process[Decay :Decay] Active
  Ordering::             AtRest             AlongStep          PostStep
                    GetPIL/    DoIt    GetPIL/    DoIt    GetPIL/    DoIt
  Ordering::
  index                  1:       0:      -1:      -1:       4:       1:
  parameter           1000:    1000:      -1:      -1:    1000:    1000:
[2]=== process[hadElastic :Hadronic] Active
  Ordering::             AtRest             AlongStep          PostStep
                    GetPIL/    DoIt    GetPIL/    DoIt    GetPIL/    DoIt
  Ordering::
  index                 -1:      -1:      -1:      -1:       3:       2:
  parameter             -1:      -1:      -1:      -1:    1000:    1000:
[3]=== process[lambdaInelastic :Hadronic] Active
  Ordering::             AtRest             AlongStep          PostStep
                    GetPIL/    DoIt    GetPIL/    DoIt    GetPIL/    DoIt
  Ordering::
  index                 -1:      -1:      -1:      -1:       2:       3:
  parameter             -1:      -1:      -1:      -1:    1000:    1000:
[4]=== process[UserSpecialCut :General] Active
  Ordering::             AtRest             AlongStep          PostStep
                    GetPIL/    DoIt    GetPIL/    DoIt    GetPIL/    DoIt
  Ordering::
  index                 -1:      -1:      -1:      -1:       1:       4:
  parameter             -1:      -1:      -1:      -1:    1000:    1000:
[5]=== process[Decay :Decay] Active
  Ordering::             AtRest             AlongStep          PostStep
                    GetPIL/    DoIt    GetPIL/    DoIt    GetPIL/    DoIt
  Ordering::
  index                  0:       1:      -1:      -1:       0:       5:
  parameter           1000:    1000:      -1:      -1:    1000:    1000: 
petricm commented 5 years ago

From Alberto Ribon

I have checked the Geant4 code regarding the EM physics processes of charged particles (i.e. multiple scattering and ionization) and it seems that it does NOT add automatically these processes for those particles that are unknown to Geant4. In other words, differently than for decays, you need to explicitly assign the EM processes to the extra particles, unknown to Geant4, that you create.