|Message: Problems with a local magnetic field||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
I am having problems getting a local magnetic field assigned to a logical volume to work correctly, as per the examples given in answer to Questions 33 and 10 in this forum. No error messages are thrown up when I compile my files, and the program executes without complaint. But in the visualisation of the output the proton tracks pass straight through the 'MagAnomaly' region, blissfully unaware of any magnetic field...
All of the appropriate header files are included at the top of my DetectorConstructor.cc file:
#include "G4TransportationManager.hh" #include "G4UniformMagField.hh" #include "G4Mag_UsualEqRhs.hh" #include "G4ClassicalRK4.hh" #include "G4MagIntegratorStepper.hh" #include "G4ChordFinder.hh" #include "G4FieldManager.hh"
The Runge Kutta, ChordFinder, and field manager are then all set up further down in my DetectorConstructor.cc :
static const G4double fieldValue = 1.*tesla;
MagField = new G4UniformMagField(G4ThreeVector(0., fieldValue, 0. )); iEquation = new G4Mag_UsualEqRhs(MagField); iStepper = new G4ClassicalRK4(iEquation); iChordFinder = new G4ChordFinder(MagField, 0.01*mm, iStepper); fieldMgr = new G4FieldManager(MagField, iChordFinder);
all of these pointers are initialised in DetectorConstructor.hh
This fieldMgr is then assigned to a hemi-spherical logical volume which I then place as a physical volume within the WorldVolume:
G4Sphere* MagAnomaly = new G4Sphere("MagAnomaly", innerRadiusOfTheSphere, outerRadiusOfTheSphere, StartPhiAngle, DeltaPhiAngle, StartThetaAngle, DeltaThetaAngle); MagAnomaly_log = new G4LogicalVolume(MagAnomaly, MartianAir, "MagAnomaly_log", fieldMgr, 0, 0); MagAnomaly_phys = new G4PVPlacement(0, G4ThreeVector(MagAnomalyPos_x, MagAnomalyPos_y, MagAnomalyPos_z), MagAnomaly_log,"MagAnomaly", WorldVolume_log, false, 0);
This WorldVolume was originally given a localised magnetic field with the method used in Exercise#2 - ie. a global field restricted to co-ordinates within a hemi-sphere (x^2 + y^2 +z^2 < 1 && y>1). This worked fine, so I know that the problem lies in the attribution of a local magnetic field to the MagAnomaly volume, and not problems with particle definitions, trackers, etc.
Can anyone help me out with this please...?
|Inline Depth:||Outline Depth:||Add message:|