Message: Implementing maximum tracking step in an electric field Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Implementing maximum tracking step in an electric field 

Forum: Fields: Magnetic and Otherwise
Date: 17 May, 2015
From: Robert Nnaemeka <Robert Nnaemeka>

I was attempting to imprement a limit on maximum step of a proton propagating in a uniform electric field and I used the below code.

G4TransportationManager* tmanager = G4TransportationManager::GetTransportationManager(); tmanager->GetPropagatorInField()->SetLargestAcceptableStep(0.1*mm);

However, when I ran the simmulation I got this error:

 "invalid use of incomplete type ‘class G4PropagatorInField’
    fFieldPropagator->SetLargestAcceptableStep(0.1*mm); "
"forward declaration of ‘class G4PropagatorInField’
 class G4PropagatorInField;"

My electric field implementation code is displayed below:

    //Electric field
    G4double MaxTrackingStep = 0.001*mm;
    G4bool fieldChangesEnergy = true;
    G4double voltage = 100000*volt;
    G4double halfAbsorberThickness = fAbsorberThickness/2;
    G4double fieldStrength = voltage/(halfAbsorberThickness-1.5*lengthX);
    G4ElectricField* field = new G4UniformElectricField(G4ThreeVector(fieldStrength, 0.0, 0.0));

    //creates maximum step
    G4TransportationManager* tmanager = G4TransportationManager::GetTransportationManager();

    // Create an equation of motion for this field
    G4EqMagElectricField* equation = new G4EqMagElectricField(field); 
    G4int nvar = 8;
    G4MagIntegratorStepper* stepper = new G4ClassicalRK4( equation, nvar);      
    G4double minStep     = 0.01*mm; // minimum step of 10 microns

    G4MagInt_Driver* intgrDriver = new G4MagInt_Driver(minStep, 
                                     stepper->GetNumberOfVariables() );

    G4ChordFinder* chordFinder = new G4ChordFinder(intgrDriver);
    G4FieldManager* fieldManagerElectricField = new G4FieldManager(field,chordFinder,fieldChangesEnergy);
    fLogicAbsorber -> SetFieldManager( fieldManagerElectricField, false );

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

1 Feedback: Re: Implementing maximum tracking step in an electric field   (Gumplinger Peter - 19 May, 2015)
 Add Message Add Message
to: "Implementing maximum tracking step in an electric field"

 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 ]