| Message: Re: simultaneous B and E fields | Not Logged In (login) |
|
Thank you for your suggestion. Following the example provided by advanced/microbeam/ I was able to create a new class that inherits from G4ElectroMagneticField and have confirmed that it does simultaneously apply an E and B field to the same geometrical volume. However, I have encountered one problem for which I have a followup question. If I apply the E&B field to the whole detector in my DetectorConstruction as follows everything works fine. I see the curvature of charged particle tracks and e- drift in the field gradient.
Field = new TPCEMField();
pEquation = new G4EqMagElectricField(Field);
pStepper = new G4ClassicalRK4 (pEquation);
pFieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager();
pIntgrDriver = new G4MagInt_Driver(0.000001*mm,pStepper,pStepper->GetNumberOfVariables() );
pChordFinder = new G4ChordFinder(pIntgrDriver);
pFieldMgr->SetChordFinder( pChordFinder );
pFieldMgr->GetChordFinder()->SetDeltaChord(1e-5*m);
pFieldMgr->SetDetectorField(Field);
But, I would rather apply it only to a localized volume. You mentioned that this should not be done with a global field manager so instead I changed the code to the following as shown in field03. However, now I find that the field is not being applied anywhere (ie no curved tracks and no e- drift). What am I doing wrong?
Field = new TPCEMField();
pEquation = new G4EqMagElectricField(Field);
pStepper = new G4ClassicalRK4 (pEquation);
pFieldMgr = new G4FieldManager();
pIntgrDriver = new G4MagInt_Driver(0.000001*mm,pStepper,pStepper->GetNumberOfVariables() );
pChordFinder = new G4ChordFinder(pIntgrDriver);
pFieldMgr->SetChordFinder( pChordFinder );
pFieldMgr->GetChordFinder()->SetDeltaChord(1e-5*m);
detector_log->SetFieldManager(pFieldMgr, true);
Thank you for your help. |
| Inline Depth: | Outline Depth: | Add message: |
|
to: |