| Message: Re: simultaneous B and E fields | Not Logged In (login) |
|
Sorry, I gave the wrong advise! This constructor does NOT exist:
> new G4ElectroMagneticField(gbl_Bfield_x, gbl_Bfield_y, gbl_Bfield_z,
lcl_Efield_x, lcl_Efield_y, lcl_Efield_z);
Maybe, it should, to make life easy for situations with both a constant B and E field; or a class G4UniformElectroMagneticField. Unfortunately, there is no example in /examples/extended/field that would show you how to go about this. The only example I found (but I didn't check/follow the code in detail) that might give you hints of what to do is: /examples/advanced/microbeam/ where the MicrobeamEMField inherits from G4ElectroMagneticField. You now can write a constructor for 'your field class' with the above signature to initialize both constant B and E fields. Also note, you MUST NOT get a new local field manager from:
G4FieldManager* fLocalFieldManager = G4TransportationManager::GetTransportationManager()->GetFieldManager(); and then set:
fLocalFieldManager->SetDetectorField(fLocalField); This will just assign the fLocalField to the World (GlobalFieldManager which is what the G4TransporationManager returns) and hence replace the fGlobalField. What you need to do is actually make a new FieldManager with: fLocalFieldManager = new G4FieldManager(); Note, that the examples/field/field03 has this correct only since the G4.9 release. |
| Inline Depth: | Outline Depth: | Add message: |
|
to: |