Message: What is the difference between AddEmModel and SetEmModel Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question What is the difference between AddEmModel and SetEmModel 

Forum: Physics List
Date: 23 Nov, 2013
From: gdss <gdss>

It seems there are two choices to register a physical processes in physicsList:

One is to use AddEmModel(): void G4VEmProcess::AddEmModel(G4int order, G4VEmModel *p, const G4Region *region)

and another way is SetEmModel(): void G4VEmProcess::SetEmModel(G4VEmModel *p, G4int index).

If I want to register photoelectric effect, what is the difference except G4Region:

         G4PhysicsListHelper *ph = G4PhysicsListHelper::GetPhysicsListHelper();

         G4PhotoElectricEffect *thePhotoElectric = new G4PhotoElectricEffect();
         thePhotoElectric->SetEmModel(new G4LivermorePhotoElectricModel(),1);
         ph->RegisterProcess(thePhotoElectric, particle);

         -----------------------------------------------------------------------
         G4PhysicsListHelper *ph = G4PhysicsListHelper::GetPhysicsListHelper();

         G4PhotoElectricEffect *thePhotoElectric = new G4PhotoElectricEffect();
         G4LivermorePhotoElectricModel *theLivermorePhotoElectricModel
                      =new G4LivermorePhotoElectricMOdel();
         thePhotoElectric->AddEmModel(0, theLivermorePhotoElectricModel);
         ph->RegisterProcess(thePhotoElectric, particle);

******************************************************************************

Another puzzle: if I want to register two model, how should I do? For example:

  thePhotoElectric->SetEmModel(new G4LivermorePhotoElectricModel(),1);
  thePhotoElectric->SetEmModel(new G4LivermorePolarizedPhotoElectricModel(),2);

or (if AddEmModel is better than SetEmModel):

 G4LivermorePhotoElectricModel *theLivermorePhotoElectricModel
          = new G4LivermorePhotoElectricModel();
 G4LivermorePolarizedPhotoElectricModel *theLivermorePolarizedPhotoElectricModel
          = new G4LivermorePolarizedPhotoElectricModel();
 thePhotoElectric->AddEmModel(0, theLivermorePhotoElectricModel);
 thePhotoElectric->AddEmModel(0, theLivermorePolarizedPhotoElectricModel);

Are both of them are right? Any help will be appreciated!

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

1 Idea: Re: What is the difference between AddEmModel and SetEmModel   (Vladimir Ivanchenko - 26 Nov, 2013)
 Add Message Add Message
to: "What is the difference between AddEmModel and SetEmModel"

 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 ]