|Message: Re: simultaneous B and E fields||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)|
Thank you for your suggestion. If I understand correctly I still need to have a global field defined as a G4UniformMagField and then the local field is a superposition of the global B and local E fields.
Following your code I added the following lines to my DetectorConstruction.cc.
// Global Magnetic Field G4double gbl_Bfield_x = 0.0*tesla; G4double gbl_Bfield_y = 2.0*tesla; G4double gbl_Bfield_z = 0.0*tesla; G4ThreeVector globalfieldVector = G4ThreeVector(gbl_Bfield_x,gbl_Bfield_y,gbl_Bfield_z); G4UniformMagField* fGlobalField = new G4UniformMagField(globalfieldVector); G4FieldManager* fGlobalFieldManager = G4TransportationManager::GetTransportationManager()->GetFieldManager(); fGlobalFieldManager->SetDetectorField(fGlobalField); fGlobalFieldManager->CreateChordFinder(fGlobalField); fGlobalFieldManager->GetChordFinder()->SetDeltaChord(0.01*mm);
// Local Electric Field G4double lcl_Efield_x = 0.0*volt/cm; G4double lcl_Efield_y = -5000.0*volt/cm; G4double lcl_Efield_z = 0.0*volt/cm; G4ElectroMagneticField* fLocalField = new G4ElectroMagneticField(gbl_Bfield_x,gbl_Bfield_y,gbl_Bfield_z,lcl_Efield_x,lcl_Efield_y,lcl_Efield_z); G4FieldManager* fLocalFieldManager = G4TransportationManager::GetTransportationManager()->GetFieldManager(); fLocalFieldManager->SetDetectorField(fLocalField);
My observation is that the global magnetic field is applied properly, but the local electric field causes the code to fail to compile. The error messages I receive seem to indicate that G4ElectroMagneticField is expecting an initialization with two doubles (not 6)? Do you have any suggestions for a way around this problem?
Compiling TPCDetectorConstruction.cc ... src/TPCDetectorConstruction.cc: In member function `G4VPhysicalVolume* TPCDetectorConstruction::ConstructTPC()': src/TPCDetectorConstruction.cc:385: error: cannot allocate an object of type ` G4ElectroMagneticField' src/TPCDetectorConstruction.cc:385: error: because the following virtual functions are abstract: /opt/geant4.8.2/include/G4ElectroMagneticField.hh:75: error: virtual void G4ElectroMagneticField::GetFieldValue(const G4double*, G4double*) const /opt/geant4.8.2/include/G4ElectroMagneticField.hh:79: error: virtual G4bool G4ElectroMagneticField::DoesFieldChangeEnergy() const make: *** [/projects/proj2/EOS_sim/TPC/tmp/Linux-g++-3.3/tpc/TPCDetectorConstruction.o] Error 1
|Inline Depth:||Outline Depth:||Add message:|