Message: Re: RegisterProcess to Physics List QGSP_BERT_EMZ Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Re: RegisterProcess to Physics List QGSP_BERT_EMZ 

Forum: Physics List
Re: None RegisterProcess to Physics List QGSP_BERT_EMZ (Stefan E. Mueller)
Re: Idea Re: RegisterProcess to Physics List QGSP_BERT_EMZ (Vladimir Ivanchenko)
Re: Question Re: RegisterProcess to Physics List QGSP_BERT_EMZ (Stefan E. Mueller)
Re: Feedback Re: RegisterProcess to Physics List QGSP_BERT_EMZ (Andrea Dotti)
Date: 20 Mar, 2014
From: Stefan E. Mueller <Stefan E. Mueller>

OK,

thanks for the additional information. I was able to create the files G4MuonPhysics.cc and
G4MuonPhysics.hh, adding the three physics processes (drawing inspiration from the constructor of G4DecayPhysics).
 I also put SetPhysicsType(0) in the constructor of the class (does this set "type" to unknown?).

I register the new class doing in my main:

  G4PhysListFactory *physListFactory = new G4PhysListFactory();
  G4VModularPhysicsList* physics = physListFactory->GetReferencePhysList("QGSP_BERT_EMZ");
  physics->RegisterPhysics( new G4MuonPhysics(1));
  runManager->SetUserInitialization(physics);

and everything compiles fine. However, when I run the code, I get the following crash logs:

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : ProcMan013
      issued by : G4ProcessManager::CheckOrderingParameters 
      Invalid ordering parameters are set for  ee2hadr
      *** Fatal Exception *** core dump ***
      -------- EEEE -------- G4Exception-END --------- EEEE -------


      *** G4Exception: Aborting execution ***


or, if I comment the registration of ee2hadr,

G4ProcessManager::CheckOrderingParameters You cannot set ordering parameter [6] for AtRest DoIt  to the process AnnihiToMuPair

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : ProcMan013
      issued by : G4ProcessManager::CheckOrderingParameters 
      Invalid ordering parameters are set for  AnnihiToMuPair
      *** Fatal Exception *** core dump ***
      -------- EEEE -------- G4Exception-END --------- EEEE -------

for the second process of the e+.

The process G4GammaConversionToMuons registers without problems (there is no crash when running 
the executable if I register only this process).

Somebody can give me a hint what's going on here? Why are the processes for the "e+" causing
a crash when running the executable?

Many thanks,

Stefan

I attach the source code:
================G4MuonPhysics.cc======================

#include "G4MuonPhysics.hh"

#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessType.hh"

#include "G4BosonConstructor.hh"
#include "G4LeptonConstructor.hh"
#include "G4MesonConstructor.hh"
#include "G4BosonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4IonConstructor.hh"
#include "G4ShortLivedConstructor.hh"

//Physics Processes
#include "G4GammaConversionToMuons.hh"
#include "G4eeToHadrons.hh"
#include "G4AnnihiToMuPair.hh"


// factory
#include "G4PhysicsConstructorFactory.hh"
//
G4_DECLARE_PHYSCONSTR_FACTORY(G4MuonPhysics);

G4ThreadLocal G4bool G4MuonPhysics::wasActivated = false;

G4MuonPhysics::G4MuonPhysics(G4int ver)
  :  G4VPhysicsConstructor("Muon"), verbose(ver)
{
  SetPhysicsType(0);
}

G4MuonPhysics::G4MuonPhysics(const G4String& name, G4int ver)
  :  G4VPhysicsConstructor(name), verbose(ver)
{
  SetPhysicsType(0);
}

G4MuonPhysics::~G4MuonPhysics()
{
}
void G4MuonPhysics::ConstructParticle()
{

// G4cout << "G4MuonPhysics::ConstructParticle" << G4endl;
  G4BosonConstructor  pBosonConstructor;
  pBosonConstructor.ConstructParticle();

  G4LeptonConstructor pLeptonConstructor;
  pLeptonConstructor.ConstructParticle();

}

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

  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();

  
  G4ParticleDefinition* particle=0;
  G4String particleName;

  aParticleIterator->reset();
  while( (*aParticleIterator)() )
  {
   particle = aParticleIterator->value();
   particleName = particle->GetParticleName();

   G4cout << "Particle Name in G4MuonPhysics:" << particleName << G4endl;

   if (particleName == "gamma")
   {
     ph->RegisterProcess(new G4GammaConversionToMuons(), particle);

   } else if (particleName == "e+") {

     ph->RegisterProcess(new G4eeToHadrons(), particle);
     ph->RegisterProcess(new G4AnnihiToMuPair(), particle);

   }
  }
}

============G4MuonPhysics.hh=============================
#ifndef G4MuonPhysics_h
#define G4MuonPhysics_h 1

#include "globals.hh"
#include "G4VPhysicsConstructor.hh"

#include "G4Decay.hh"

class G4MuonPhysics : public G4VPhysicsConstructor
{
  public: 
    G4MuonPhysics(G4int ver = 1);
    G4MuonPhysics(const G4String& name, G4int ver = 1);
    virtual ~G4MuonPhysics();

  public: 
    // This method will be invoked in the Construct() method. 
    // each particle type will be instantiated
  virtual void ConstructParticle();
 
    // This method will be invoked in the Construct() method.
    // each physics process will be instantiated and
    // registered to the process manager of each particle type 
  virtual void ConstructProcess();

  //virtual G4Decay* GetDecayProcess() { return fDecayProcess; }

private:
  //static G4ThreadLocal G4Decay* fDecayProcess;
  G4int    verbose;
  static G4ThreadLocal G4bool   wasActivated;
};

#endif

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Question: Re: RegisterProcess to Physics List QGSP_BERT_EMZ   (Stefan E. Mueller - 25 Mar, 2014)
(_ Idea: Re: RegisterProcess to Physics List QGSP_BERT_EMZ   (Andrea Dotti - 25 Mar, 2014)
(_ Ok: Re: RegisterProcess to Physics List QGSP_BERT_EMZ   (Stefan E. Mueller - 26 Mar, 2014)
 Add Message Add Message
to: "Re: RegisterProcess to Physics List QGSP_BERT_EMZ"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]